// JavaScript Document


//NAVIGATION SOLUTION TO IE ERROR ON DROPDOWN CSS MENU
startList = function(navRoot) {
    if(document.all) { // IE only
        var sfEls = navRoot.getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+="over ";
            }
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp("over\\b"), "");
            }
        }
    }
}

window.onload = function() {
	window.attachEvent("onload", function() { 
    	startList(document.getElementById("dropdown")); 
	});
}


//REQUIRED TO SHIFT MAGAZINE OPTION ON NAVIGATION 
function moveMagazine()
{
	document.getElementById('nav-magazine-sub').style.left = "-42px";
}


//IMAGE ROLLOVER SCRIPT
function rolloverImage(controlDiv, newImage){
	document.getElementById(controlDiv).src=newImage;		
}


//COVER ROLLOVER SLIDESHOW
var coverMonths = new Array('january','february','march','april','may','june','july','august','september','october', 'november', 'december');
var numericMonth = 0;

function slideShow(mainDiv){
	document.getElementById(mainDiv).src="images/2006_covers/"+coverMonths[numericMonth]+"_cover.jpg";
	if(numericMonth>=11){
		numericMonth=0;	
	}else{
		numericMonth++;	
	}
}
		
function rolloverSlideshow(controlDiv){
	var t = setInterval(slideShow(controlDiv),500);	
}

function rolloutSlideshow(controlDiv){
	document.getElementById(controlDiv).src="images/pages_pic.jpg";
}