// JAVASCRIPT DOCUMENT

var firstRunDelay=100;

var timer=7000;

var storyInterval = "";

var firstRunInterval = setInterval("changeMain('')", firstRunDelay);

var prev = "";

var divList = new Array("NEWS", "RUMORS", "MUSIC", "FEATURES");

function FF_fix() {
	for (var i = 0; i < divList.length; i++) {
		document.getElementById(divList[i]).style.overflow="hidden";
	}
}

function showPane(div) {
	document.getElementById(div).className="controlOver";
	divName = "p" + div;
	document.getElementById(divName).style.visibility="visible";
	document.getElementById(divName).style.overflow="auto";

	// change the panel if the user hovers a new button
	if (prev!="" && prev!=divName) {
		document.getElementById(prev).style.visibility="hidden";
		document.getElementById(prev).style.overflow="hidden";	
		document.getElementById(prev.substring(1,prev.length)).className="controlOff";
		document.getElementById("panels").className=divName+"_color";
	}
	prev = divName;
}

var oldSSI = "";

var j = "";

var firstRun = "apple";

var numStories = imgFile.length-1;

function changeMain(SSI){
	if (SSI == '') {
		SSI = j;	
	}
	if (oldSSI!=SSI) {
	//	alert("new");
		document.getElementById("mainStory").style.backgroundImage="url('"+imgFile[SSI]+"')";	
		document.getElementById("textline").innerHTML=headlinetxt[SSI];
		document.getElementById('mainHeadlineURL').href=headlineURL[SSI];
	}
	j++;
	if (j>numStories) {
		if (firstRun == "apple") { 
		clearInterval(firstRunInterval);
		storyInterval = setInterval("changeMain('')", timer);
		firstRun = "orange";
		//alert(firstRun);
		}
		j=1;
	}
	oldSSI = SSI;
}

// creates the highlighting effect in the Top Videos/Music section
function hilightOn(){
	document.getElementById("mainHeadline").style.backgroundColor="#000000";
}

function hilightOff(){
	document.getElementById("mainHeadline").style.backgroundColor="transparent";
}