//These functions are executed when the page is loaded
function doLoadEvents()
{
	changeSearchClass('blur');
}

//This function is for the search box and changing the CSS that it uses.
function changeSearchClass(evnt)
{
	var elmnt = document.getElementById("sbID");
	if (elmnt.value == '' && evnt == 'blur') 
	{
		elmnt.className = 'search';
		elmnt.blur();
	}
	else if (evnt == 'focus')
		elmnt.className = 'searchBlank';
	else 
		elmnt.className = 'searchBlank';
}

//This function controls the tab buttons
function changeContentTabs( tab )
{
	var tab1 = document.getElementById("tab1");
	var tab2 = document.getElementById("tab2");
	var tab3 = document.getElementById("tab3");
	var tab4 = document.getElementById("tab4");
	var content = document.getElementById("contentBackground");
	
	//Set all as unselected
	tab1.src = '/images/tab1U.png';
	tab2.src = '/images/tab2U.png';
	tab3.src = '/images/tab3U.png';
	tab4.src = '/images/tab4U.png';
	
	if( tab == '1') 
	{
		makeGetRequest('','alabamaAndYou','contentSection');
		tab1.src = '/images/tab1S.png';
		content.className = 'contentGovBackgroundImage';
	}
	else if( tab == '2')
	{
		makeGetRequest('','economicResources','contentSection');
		tab2.src = '/images/tab2S.png';
		content.className = 'contentBackgroundImage';
	}
	else if( tab == '3')
	{
		makeGetRequest('','onlineServices','contentSection');
		tab3.src = '/images/tab3S.png';
		content.className = 'contentServicesBackgroundImage';
	}
	else if( tab == '4')
	{
		makeGetRequest('','lifeInAlabama','contentSection');
		tab4.src = '/images/tab4S.png';
		content.className = 'contentLifeBackgroundImage';
	}
}

var curTextSize = 0;
function changeTextSize(evnt)
{
	var elmnt = document.getElementById("content");
//	var elmnt = document.getElementByName("container");
//	elmnt.className = "container2";
	if( "0" == evnt ) {curTextSize = 0;} else if( "+" == evnt ) {curTextSize++;} else {curTextSize--;}
	if( curTextSize > 3 ) {curTextSize = 3;} else if( curTextSize < -3 ) {curTextSize = -3;}
	/*
	if( curTextSize == 3 ) {elmnt.className = "contentP3";}
	else if( curTextSize == 2 ) {elmnt.className = "contentP2";}
	else if( curTextSize == 1 ) {elmnt.className = "contentP1";}
	else if( curTextSize == 0 ) {elmnt.className = "content";}
	else if( curTextSize == -1 ) {elmnt.className = "contentM1";}
	else if( curTextSize == -2 ) {elmnt.className = "contentM2";}
	else if( curTextSize == -3 ) {elmnt.className = "contentM3";}
	*/
	if( curTextSize == 3 ) {setActiveStyleSheet("standardTextP3");}
	else if( curTextSize == 2 ) {setActiveStyleSheet("standardTextP2");}
	else if( curTextSize == 1 ) {setActiveStyleSheet("standardTextP1");}
	else if( curTextSize == 0 ) {setActiveStyleSheet("standardText");}
	else if( curTextSize == -1 ) {setActiveStyleSheet("standardTextM1");}
	else if( curTextSize == -2 ) {setActiveStyleSheet("standardTextM2");}
	else if( curTextSize == -3 ) {setActiveStyleSheet("standardTextM3");}
}
function setCurTextSize(t)
{
	if( t == "standardTextP3" ) {curTextSize = 3;}
	else if( t == "standardTextP2" ) {curTextSize = 2;}
	else if( t == "standardTextP1" ) {curTextSize = 1;}
	else if( t == "standardText" ) {curTextSize = 0;}
	else if( t == "standardTextM1" ) {curTextSize = -1;}
	else if( t == "standardTextM2" ) {curTextSize = -2;}
	else if( t == "standardTextM3" ) {curTextSize = -3;}
	else {curTextSize = 0;}
}
function normalizeText()
{
	/*
	//window.location = window.location.href;
	var elmnt = document.getElementById("content");
	elmnt.className = "content";
	*/
	curTextSize = 0;
	setActiveStyleSheet("standardText");
}
function goHome()
{
	window.location = "index.jsp";
}
