//script to allow navigation to move down with the scroll.

$(document).ready(function () {    var top = $('#inner_nav_wrapper').offset().top - parseFloat($('#inner_nav_wrapper').css('marginTop').replace(/auto/, 0));  $(window).scroll(function (event) {    // what the y position of the scroll is    
																																									 var y = $(this).scrollTop(); 
																																									 // whether that's below the form 
																																									 if (y >= top) {      // if so, ad the fixed class 
																																									 $('#inner_nav_wrapper').addClass('fixed');    } else {    
																																									 // otherwise remove it   
																																									 $('#inner_nav_wrapper').removeClass('fixed');    }  });});



//script to allow secondary content to move down with the scroll.

//my jquery wasn't working because of this code, i think what was happening was that the secondary content isn't always available, when i checked for it's availability with this if test, it seemed to work.
var productElement = document.getElementById("inner_secondary_content_wrapper");
if (productElement != null)
{

	$(document).ready(
		function () {    
			var top = $('#inner_secondary_content_wrapper').offset().top - parseFloat($('#inner_secondary_content_wrapper').css('marginTop').replace(/auto/, 0));  $(window).scroll(function (event) {    // what the y position of the scroll is    
																																										 var y = $(this).scrollTop(); 
																																										 // whether that's below the form 
																																										 if (y >= top) {      // if so, ad the fixed class 
																																										 $('#inner_secondary_content_wrapper').addClass('fixed');    } else {    
																																										 // otherwise remove it   
																																										 $('#inner_secondary_content_wrapper').removeClass('fixed');    }  });});

}




//script to revolve news stories

window.onload = setup;

function setup() {
    if (! document.getElementsByTagName) return false;
    var elms = document.getElementsByTagName("blockquote");
    if (! elms.length) return false;
    rotate(elms, 0);
}


function rotate(elms, iElm) {
    var currElm = elms[iElm];
    var timer = setInterval( swap ,10000);

    function swap() {
        currElm.style.display = "none";
        currElm = elms[++iElm % elms.length];
        currElm.style.display = "block";
    }
}



//show & hide divs
$(document).ready(function(){
	    
$(".buttons").click(function () {
    var divname= this.name;
    $("#"+divname).toggle("slow").siblings().hide("slow");
});
});

//.siblings().hide("slow")

        
