function ClearLoginBackground(id) {
	document.getElementById(id).style.background = '#ffffff';	
}

function clearBG(id) {
	document.getElementById(id).style.background = '#ffffff';	
}


function ActivateStory(storyNum) {
	skippedFlag = 0;
	if (storyNum < 0) {//then the button was clicked to skip to an article
		storyNum = storyNum * -1;
		skippedFlag = 1;
	}
	for(i=1;i<=num_rotate;i++) 
		document.getElementById("MainStoryImageContainer_"+i).style.display = "none";
	/*
	var thedivs = getElementsByClassName(document,'div','rotator-num active');
	for(i = 0; i < thedivs.length; i++)
		thedivs[i].className= 'rotator-num';
	*/
	jQuery('div.rotator-num').removeClass("active");
	document.getElementById("MainStoryImageContainer_"+storyNum).style.display = "block";
	document.getElementById("SelectStory_"+storyNum).className = "rotator-num active";
	if (skippedFlag == 0) {
		r_timer = setTimeout("rotateTabs()",5000);
		//alert('started: '+r_timer);
	}
}

function rotateTabs() 
{
	if(r_current>r_total)
		r_current=1;
	ActivateStory(r_current);
	r_current++;
}


function stopRotate()
{
	clearTimeout(r_timer);	
	//alert('cleared: '+r_timer);
}

function getElementsByClassName(oElm, strTagName, strClassName)
{
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++)
	{
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className))
		{
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}

function HomeTabsChange(id)
{
	/*
	var thedivs = getElementsByClassName(document,'div','HomeTabs');
	for(i = 0; i < thedivs.length; i++)
		thedivs[i].style.display = 'none';
	*/
	jQuery('div.HomeTabs').css("display","none");
	/*
	var thedivs = getElementsByClassName(document,'div','HomeTabsButton');
	for(i = 0; i < thedivs.length; i++)
		thedivs[i].style.display = 'none';	
	*/
	jQuery('div.HomeTabsButton').css("display","none");
	document.getElementById(id).style.display = 'block';
	document.getElementById(id+'_button').style.display = 'block';
}