// JavaScript Document

function change(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}

function CSURLPopupShow(formName, popupName, target) {
	var form  = document.forms[formName];
	var popup = form.elements[popupName];
	window.open(popup.options[popup.selectedIndex].value, target);
	popup.selectedIndex = 0;
}

function display(toDisplay,toHide) {

	var formDisplay = toDisplay + '-form';
	var formHide = toHide + '-form';
	
	if( document.getElementById(formDisplay) && document.getElementById(formHide) )
	{
		var imgChange = document.getElementById(toDisplay);
		var imgChangeBack = document.getElementById(toHide);
		var objDisplay = document.getElementById(formDisplay);
		var objHide    = document.getElementById(formHide);
		imgChange.style.background = "url(/images/bg_login_tab_02.gif) top left no-repeat";
		imgChangeBack.style.background = "url(/images/bg_login_tab.gif) top left no-repeat";
		objDisplay.style.display = "block";
		objHide.style.display = "none";
	}
		
	//if( document.getElementById(toDisplay) && document.getElementById(toHide) )
	//{
	//	var btnDisplay = document.getElementById(toDisplay);
	//	var btnHide = document.getElementById(toHide);
	//	btnDisplay.style.backgroundColor = "#CCC";
	//	btnHide.style.backgroundColor = "#FFF";
	//}
	
}

function changeLoginBackground(thisDiv) {

		var imgChange = document.getElementById(thisDiv);
		imgChange.style.background = "url(/images/bg_login_tab_02.gif) top left no-repeat";	
}

function returnLoginBackground(thisDiv) {

		var imgChangeBack = document.getElementById(thisDiv);
		imgChangeBack.style.background = "url(/images/bg_login_tab.gif) top left no-repeat";	
}

function leave_site(dest) { 
	var where_to= confirm("You are now leaving Ameris Bank's website.  This bank has no control over the content or quality of the website you are visiting.  The site may not have the same privacy and/or security practices as Ameris.  We encourage you to read the privacy/security policy for the site you are visiting."); 
	if (where_to== true)
	{ 
		window.location=dest;
	} 
}

function privWin(winName,file,w,h,t,l) {
// t is used only for showing scrollbars "yes" or "no"
	var iTall = screen.availHeight;	
	var iWide = screen.availWidth;	
	var iTHalf = (iTall / 2) - (h / 2);
	var iWHalf = (iWide / 2) - (w / 2);
	var sSB
	if (t == 'no')
		sSB = 'no';	
	else
		sSB = 'yes';	
	
	winName = window.open(file,winName,'width='+w+',height='+h+',top='+iTHalf+',left='+iWHalf+', resizable=no,status=0,toolbar=0,scrollbars='+sSB);
}