window.onload = function() {
	ClearLogin();
	ClearEnews();
};



function EnewsClearBG()
{
	document.getElementById('enewsInput').style.background = '#ffffff' ;	
}

function UserClearBG()
{
	document.getElementById('loginUsername').style.background = '#ffffff' ;	
}

function PasswordClearBG()
{
	document.getElementById('loginPass').style.background = '#ffffff' ;	
}

function ClearLogin()
{
	document.getElementById('loginUsername').value = '' ;	
	document.getElementById('loginPass').value = '' ;	
}

function ClearEnews()
{
	document.getElementById('enewsInput').value = '' ;	
}

/* ---------------------------------------------------------------------------------------- 
   Rotator Start
---------------------------------------------------------------------------------------- */
	var num_rotate = 4;		//total stories to rotate
	var current_story = 1;	//should be set to one at start of rotation
	var rotate_status = 1; 	//1 is active 0 is inactive
	var rotate_num = 1000 * 5;

	function ActivateStory(storyNum)
	{
		current_story = storyNum;
		//change main story
		for(i=1; i<=num_rotate; i++)
		{
			if(i == storyNum)
			{
				document.getElementById('MainStoryImageContainer_' + i).style.display = 'block';
				document.getElementById('MainStoryTextContainer_' + i).style.display = 'block';
				document.getElementById('SubStoryImageContainer_' + i).style.display = 'none';
			}
			else
			{
				document.getElementById('MainStoryImageContainer_' + i).style.display = 'none';	
				document.getElementById('MainStoryTextContainer_' + i).style.display = 'none';	
				document.getElementById('SubStoryImageContainer_' + i).style.display = 'block';	
			}
		}
	}
	
	function RotateUp(storyNum)
	{
		rotate_status = 0; //stop rotation
		if(current_story < num_rotate)
			ActivateStory(current_story + 1);	
		else
			ActivateStory(1);	
	}
	
	function RotateDown(storyNum)
	{
		rotate_status = 0; //stop rotation
		if(current_story == 1)
			ActivateStory(num_rotate);	
		else
			ActivateStory(current_story - 1);	
	}
	
	function PauseRotation()
	{
		rotate_status = 0; //stop rotation
	}
	
	function RotateStory()
	{
		if(rotate_status == 1)
		{
			RotateAuto(current_story);
			var t=setTimeout("RotateStory()",rotate_num);
		}
		else {/*do nothing*/}
	}
	
	function RotateAuto(storyNum)
	{
		if(current_story == 1)
			ActivateStory(num_rotate);	
		else
			ActivateStory(current_story - 1);	
	}
	
	var t=setTimeout("RotateStory()",rotate_num);
	
/* ---------------------------------------------------------------------------------------- 
   Rotator END
---------------------------------------------------------------------------------------- */