/* Location bar functions */

function set_location(loc)
{	createCookie("locdata",loc,7);
	document.getElementById('loctag1off').style.display="block";
	document.getElementById('loctag2off').style.display="block";
	document.getElementById('loctag3off').style.display="block";
	document.getElementById('loctag4off').style.display="block";
	document.getElementById('loctag5off').style.display="block";
	loctag1on.style.display="none"; loctag2on.style.display="none"; loctag3on.style.display="none";
	loctag4on.style.display="none"; loctag5on.style.display="none";
	switch (loc)
	{	case 1: locspace1.width=12; locspace2.width=20; locspace3.width=34; locspace4.width=36; 
				loctag1off.style.display="none"; loctag1on.style.display="block"; break;
		case 2: locspace1.width=12; locspace2.width=6;  locspace3.width=34; locspace4.width=36; 
				loctag2off.style.display="none"; loctag2on.style.display="block"; break;
		case 3: locspace1.width=41; locspace2.width=6;  locspace3.width=11; locspace4.width=36; 
				loctag3off.style.display="none"; loctag3on.style.display="block"; break;
		case 4: locspace1.width=41; locspace2.width=34; locspace3.width=9;  locspace4.width=10; 
				loctag4off.style.display="none"; loctag4on.style.display="block"; break;
		case 5: locspace1.width=41; locspace2.width=34; locspace3.width=34; locspace4.width=26; 
				loctag5off.style.display="none"; loctag5on.style.display="block"; break;
	}
	
	// Check and see where we came from, we might need to change pages
	//window.location.pathname
	testpgstr = window.location.pathname.substring(1,4);
	if ((testpgstr == "atm") || (testpgstr == "cse"))
	{	newpage = "";
		if (testpgstr == "atm")
			{ newpage += "atm_locations_"; }
		else
			{ newpage += "cservice_"; }
		switch (loc)
		{	case 1: newpage += "bg"; break;
			case 2: newpage += "etown"; break;
			case 3: newpage += "glasgow"; break;
			case 4: newpage += "owens"; break;
			case 5: newpage += "tomp"; break;
		}
		window.location = newpage + ".htm";
	} else {
		window.location.reload();
	}
}

function print_location()
{	loctag = readCookie("locdata");
	tabdisp = new Array(2);
	tabdisp[0] = new Array("block", "block", "block", "block", "block");
	tabdisp[1] = new Array("none", "none", "none", "none", "none");
	if (loctag > 0)
	{	tabdisp[1][loctag-1] = "block";
		tabdisp[0][loctag-1] = "none";
	}

	tabspace = new Array(41, 34, 34, 36);
	switch (loctag)
	{	case '1': tabspace[0]=12; tabspace[1]=20; break;
		case '2': tabspace[0]=12; tabspace[1]=6;  break;
		case '3': tabspace[1]=6;  tabspace[2]=11; break;
		case '4': tabspace[2]=9;  tabspace[3]=10; break;
		case '5': tabspace[3]=26; break;
	}

	  document.write("<table border=0 width='733px' height='34px' cellpadding=0 cellspacing=0 ");
	document.writeln("style=\"background: url('images/cities/nav_bg.gif') repeat-x scroll bottom;\">");
	document.writeln("<tr><td><img src='images/cities/nav_left_space.gif'></td>");
	document.writeln("	<td><div id='loctag1off' style='display:"+tabdisp[0][0]+";'><table border=0 width='105px' cellpadding=0 cellspacing=0>");
	document.writeln("			<tr><td><img border=0 src='images/cities/nav_left.gif'></td>");
	  document.write("				<td><a href='javascript:set_location(1);'><img border=0 src='images/cities/bg_off.gif' ");
	  document.write("onmouseover=\"this.src='images/cities/bg_over.gif'\" ");
	document.writeln("onmouseout=\"this.src='images/cities/bg_off.gif'\"></a></td></tr>");
	document.writeln("			</table></div>");
	document.writeln("		<div id='loctag1on' style='display:"+tabdisp[1][0]+";'><img border=0 src='images/cities/bg_on.gif'></div></td>");
	document.writeln("	<td><img border='0' src='images/spacer.gif' id='locspace1' width='"+tabspace[0]+"px' height='1px'></td>");

	document.writeln("	<td><div id='loctag2off' style='display:"+tabdisp[0][1]+";'><a href='javascript:set_location(2);'><img ");
	  document.write("border=0 src='images/cities/etown_off.gif' onmouseover=\"this.src='images/cities/etown_over.gif'\" ");
	  document.write("onmouseout=\"this.src='images/cities/etown_off.gif'\"></a></div>");
	document.writeln("		<div id='loctag2on' style='display:"+tabdisp[1][1]+";'><img border=0 src='images/cities/etown_on.gif'></div></td>");
	document.writeln("	<td><img border=0 src='images/spacer.gif' id='locspace2' width='"+tabspace[1]+"px' height='1px'></td>");

	  document.write("	<td><div id='loctag3off' style='display:"+tabdisp[0][2]+";'><a href='javascript:set_location(3);'><img ");
	  document.write("border=0 src='images/cities/glas_off.gif' onmouseover=\"this.src='images/cities/glas_over.gif'\" ");
	document.writeln("onmouseout=\"this.src='images/cities/glas_off.gif'\"></a></div>");
	document.writeln("		<div id='loctag3on' style='display:"+tabdisp[1][2]+";'><img border=0 src='images/cities/glas_on.gif'></div></td>");
	document.writeln("	<td><img border=0 src='images/spacer.gif' id='locspace3' width='"+tabspace[2]+"px' height='1px'></td>");

	  document.write("	<td><div id='loctag4off' style='display:"+tabdisp[0][3]+";'><a href='javascript:set_location(4);'><img ");
	  document.write("border=0 src=\"images/cities/owen_off.gif\" onmouseover=\"this.src='images/cities/owen_over.gif'\" ");
	document.writeln("onmouseout=\"this.src='images/cities/owen_off.gif'\"></a></div>");
	document.writeln("		<div id='loctag4on' style='display:"+tabdisp[1][3]+";'><img border=0 src='images/cities/owen_on.gif'></div></td>");
	document.writeln("	<td><img border=0 src='images/spacer.gif' id='locspace4' width='"+tabspace[3]+"px' height='1px'></td>");

	document.writeln("	<td><div id='loctag5off' style='display:"+tabdisp[0][4]+";'><table border=0 width='127px' cellpadding=0 cellspacing=0>");
	  document.write("			<tr><td><a href='javascript:set_location(5);'><img border=0 src='images/cities/tomp_off.gif' ");
	  document.write("onmouseover=\"this.src='images/cities/tomp_over.gif'\" ");
	document.writeln("onmouseout=\"this.src='images/cities/tomp_off.gif'\"></a></div></td>");
	document.writeln("				<td><img border=0 src='images/cities/nav_right.gif'></td></tr>");
	document.writeln("			</table></div>");
	document.writeln("		<div id='loctag5on' style='display:"+tabdisp[1][4]+";'><img border=0 src='images/cities/tomp_on.gif'></div></td>");
	document.writeln("		<td><img border=0 src='images/cities/nav_right_space.gif'></td></tr>");
	document.writeln("</table>");
}



/* Cookie Functions */

function createCookie(name,value,days)
{
	if (days)
	{	months = 6;
		var date = new Date();
		//date.setDate(date.getDate()+days);
		date.setMonth(date.getMonth()+months);
		//date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toUTCString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	if( name == "locdata") {
		//check for old value
		var oldValue = readCookie("SCSwitcher");
		if( oldValue != "" ) {
			var newValue = '';
			switch (oldValue)
			{					
				case "bowlinggreen": newValue = 1; break;
				case "elizabethtown": newValue = 2; break;
				case "glasgow": newValue = 3; break;
				case "owensboro": newValue = 4; break;
				case "tompkinsville": newValue = 5; break;
				default: newValue = 'none';
			}
			if( newValue != "none" ) { 
				//createCookie("locdata",newValue,7);
			}
			eraseCookie("SCSwitcher"); // and then delete it
		}	
	}
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}



/* Navigation Bars */

function top_nav(currpage)
// Print the top navigation bar
{	loctag = readCookie("locdata");
	cspage = "";
	switch (loctag)
	{	case '1': cspage = "_bg"; break;
		case '2': cspage = "_etown"; break;
		case '3': cspage = "_glasgow"; break;
		case '4': cspage = "_owens"; break;
		case '5': cspage = "_tomp"; break;
	}
		document.write("<table border=0 width='692px' cellpadding=0 cellspacing=0>");
	if (currpage == 1)
	{	document.write("<tr><td><img border='0' src='images/nav/banking_on.gif'></td>");
	} else {
		document.write("<tr><td><a href='javascript:linktest(\"online_banking.htm\")'><img border=0 ");
		document.write("		src='images/nav/banking_off.gif' onmouseover=\"this.src='images/nav/banking_over.gif'\" ");
		document.write("		onmouseout=\"this.src='images/nav/banking_off.gif'\"></a></td>");
	}
		document.write("	<td><img border=0 src='images/nav/nav_v_sep.gif'></td>");
	if (currpage == 2)
	{	document.write("	<td><img border='0' src='images/nav/service_on.gif'></td>");
	} else {
		document.write("	<td><a href='javascript:linktest(\"cservice"+cspage+".htm\")'><img border=0 ");
		document.write("		src='images/nav/service_off.gif' onmouseover=\"this.src='images/nav/service_over.gif'\" ");
		document.write("		onmouseout=\"this.src='images/nav/service_off.gif'\"></a></td>");
	}
		document.write("	<td><img border=0 src='images/nav/nav_v_sep.gif'></td>");
	if (currpage == 3)
	{	document.write("	<td><img border='0' src='images/nav/atm_on.gif'></td>");
	} else {
		document.write("	<td><a href='javascript:linktest(\"atm_locations"+cspage+".htm\")'><img border=0 ");
		document.write("		src='images/nav/atm_off.gif' onmouseover=\"this.src='images/nav/atm_over.gif'\" ");
		document.write("		onmouseout=\"this.src='images/nav/atm_off.gif'\"></a></td>");
	}
		document.write("	<td><img border=0 src='images/nav/nav_v_sep.gif'></td>");
	
	if (currpage == 4)
	{	document.write("	<td><img border='0' src='images/nav/invest_on.gif'></td>");
	} else {
		if (loctag == 1 || loctag == 2 || loctag == 3 || loctag == 5)
		{	document.write("	<td><a href='javascript:LeaveSiteConf(\"investments.htm\", 1)'><img border=0 ");
			document.write("		src='images/nav/invest_off.gif' onmouseover=\"this.src='images/nav/invest_over.gif'\" ");
			document.write("		onmouseout=\"this.src='images/nav/invest_off.gif'\"></a></td>");
		} else {
			document.write("	<td><a href='javascript:linktest(\"cservice"+cspage+".htm#atm\")'><img border=0 src='images/nav/lostcard_off.gif' ");
			document.write("		onmouseover=\"this.src='images/nav/lostcard_over.gif'\" ");
			document.write("		onmouseout=\"this.src='images/nav/lostcard_off.gif'\"></a></td>");
		}
	}
		document.write("	<td><img border=0 src='images/nav/nav_v_sep.gif'></td>");
	if (currpage == 5)
	{	document.write("	<td><img border='0' src='images/nav/about_on.gif'></td></tr>");
	} else {
		document.write("	<td><a href='javascript:linktest(\"history.htm\")'><img border=0 ");
		document.write("		src='images/nav/about_off.gif' onmouseover=\"this.src='images/nav/about_over.gif'\" ");
		document.write("		onmouseout=\"this.src='images/nav/about_off.gif'\"></a></td></tr>");
	}
		document.write("</table>");
}

function bottom_nav()
{	loctag = readCookie("locdata");
	//FraudProUrl = "http://anon.vodium.com.edgesuite.net/anon.vodium/fdic/identitytheft/index.html";
	FraudProUrl = "http://www.fdic.gov/consumers/theft/index.html";

	document.write("<table border=0 width='600px' cellpadding=0 cellspacing=0>");
	document.write("<tr><td width='100px' align='center'><a href='javascript:LeaveSiteConf(\""+FraudProUrl+"\", 1)' ");
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Fraud Protection</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");
	document.write("	<td width='94px' align='center'><a href='javascript:linktest(\"privacy.htm\")' ");
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Privacy Policies</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");
	document.write("	<td width='59px' align='center'><a href='javascript:linktest(\"history.htm\")' ");
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>About us</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");

	switch (loctag)
	{	case '1': document.write("<td width='62px' align='center'><a href='javascript:linktest(\"cservice_bg.htm#locations\")' "); break;
		case '2': document.write("<td width='62px' align='center'><a href='javascript:linktest(\"cservice_etown.htm#locations\")' "); break;
		case '3': document.write("<td width='62px' align='center'><a href='javascript:linktest(\"cservice_glasgow.htm#locations\")' "); break;
		case '4': document.write("<td width='62px' align='center'><a href='javascript:linktest(\"cservice_owens.htm#locations\")' "); break;
		case '5': document.write("<td width='62px' align='center'><a href='javascript:linktest(\"cservice_tomp.htm#locations\")' "); break;
		default:  document.write("<td width='62px' align='center'><a href='javascript:linktest(\"#\")' "); break;
	}
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Locations</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");

	switch (loctag)
	{	case '1': document.write("<td width='107px' align='center'><a href='javascript:linktest(\"cservice_bg.htm\")' "); break;
		case '2': document.write("<td width='107px' align='center'><a href='javascript:linktest(\"cservice_etown.htm\")' "); break;
		case '3': document.write("<td width='107px' align='center'><a href='javascript:linktest(\"cservice_glasgow.htm\")' "); break;
		case '4': document.write("<td width='107px' align='center'><a href='javascript:linktest(\"cservice_owens.htm\")' "); break;
		case '5': document.write("<td width='107px' align='center'><a href='javascript:linktest(\"cservice_tomp.htm\")' "); break;
		default:  document.write("<td width='107px' align='center'><a href='javascript:linktest(\"#\")' "); break;
	}
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Customer Service</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");
	document.write("	<td width='53px' align='center'><a href='javascript:linktest(\"sitemap.htm\")' ");
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Site Map</a></td>");
	document.write("	<td bgcolor='#046330'><img src='images/spacer.gif' border='0'></td>");
	document.write("	<td width='119px' align='center'><a href='javascript:linktest(\"terms_conditions.htm\")' ");
	document.write("		style='font:10px Verdana; color:#046330; text-decoration:none;'>Terms & Conditions</a></td></tr>");
	document.write("</table>");
}



/* Other Functions */
function validLogin(passform)
{	if (passform.v1.value == "")
	{	alert ("You must enter a user name to log in");
		return false;
	} else {
		passform.AccessID.value = passform.v1.value;
		return true;
	}
}

function right_side(showLogin, test)
{	loctag = readCookie("locdata");
	city = "";
	switch (loctag)
	{	case '1': city = "Bowling Green"; break;
		case '2': city = "Elizabethtown"; break;
		case '3': city = "Glasgow"; break;
		case '4': city = "Owensboro"; break;
		case '5': city = "Tompkinsville"; break;
	}
	
	document.writeln("<table border=0 width='220px' cellpadding=0 cellspacing=0>");
//not looking for "+city+"?
	if (city != "")
	{	  document.write("<tr><td valign='top'><table style=\"background: url('images/ne_corner.gif') no-repeat scroll right;\" border=0 ");
		document.writeln("width='220px' cellpadding=0 cellspacing=0>");
		document.write("				<tr><td style='font:900 14px Verdana; color:#ffffff; padding-left:10px;' ");
			document.writeln("height='35px' valign='bottom'>Welcome to</td></tr>");
		document.write("				<tr><td style='font:900 21px Verdana; color:#ffffff; padding-left:10px;' ");
			document.write("height='30px' valign='bottom'>"+city+"!</td></tr>");
		document.write("				<tr><td style='font:12px Verdana; color:#ffffff; padding-left:10px;' height='35px' ");
			document.writeln("valign='top'><a style='color:white;' href='javascript:clearcookie();' >Choose another city.</a></td></tr>");
		document.writeln("		</table></td></tr>");
	} else {
		  document.write("<tr><td height='100px' style=\"background: url('images/ne_corner.gif') no-repeat scroll right; ");
		  document.write("	font:900 13px Verdana; color:#ffffff; padding-left:10px;\" valign='bottom'>");
		document.writeln("	Please Select a City<br>from the tabs at left or<br>use the drop down below:</td></tr>");
		  document.write("<tr><td><table border='0' width='220px' cellpadding=0 cellspacing=0 ");
		document.writeln("	style=\"background: url('images/right_green.gif') repeat-y scroll left;\">");
		document.writeln("			<tr><td><img src='images/pgtop/arrow.gif' border=0></td></tr>");
		  document.write("			<tr><td style='padding-left:25px;'><select style='font:12px Verdana; border:0px; width:170px;' ");
		document.writeln("onchange='set_location(this.options[this.selectedIndex].value)'>");
		document.writeln("						<option value=''>-Select a City-</option>");
		document.writeln("						<option value='1'>Bowling Green</option>");
		document.writeln("						<option value='1'>Franklin</option>");
		document.writeln("						<option value='2'>Elizabethtown</option>");
		document.writeln("						<option value='3'>Glasgow</option>");
		document.writeln("						<option value='3'>Edmonton</option>");
		document.writeln("						<option value='3'>Cave City</option>");
		document.writeln("						<option value='3'>Park City</option>");
		document.writeln("						<option value='4'>Owensboro</option>");
		document.writeln("						<option value='5'>Tompkinsville</option>");
		document.writeln("						<option value='5'>Gamaliel</option>");
		document.writeln("						<option value='5'>Fountain Run</option>");
		document.writeln("						<option value='5'>Scottsville</option>");
		document.writeln("					</select></td></tr>");
		document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
		document.writeln("		</table></td></tr>");
	}


	document.write("<tr><td><table style=\"background: url('images/right_green.gif') repeat-y scroll left;\" border='0' ");
		document.writeln("width='220px' cellpadding=0 cellspacing=0>");
	document.writeln("<tr><td><img border=0 src='images/spacer.gif' height='20px'></td></tr>");

	// Login Portion
	if (showLogin == 1)
	{	if ((loctag > 0) && (loctag < 6))
		{	document.writeln("<tr><td style='font:900 15px Tahoma; color:#ffffff; padding-left:10px;'>Online Banking</td></tr>");
			document.write("<tr><td><form action='");

			switch (loctag)
			{
				case '1': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083902002&LogonBy=Connect3&PRMAccess=account"); break;
				case '2': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083974373&LogonBy=Connect3&PRMAccess=account"); break;
				case '3': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083905012&LogonBy=Connect3&PRMAccess=Account"); break;
				case '4': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083902442&LogonBy=Connect3&PRMAccess=account"); break;
				case '5': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083903645&LogonBy=Connect3&PRMAccess=account"); break;
				default:  document.write("#"); break;
			}
			document.writeln("' method='post' style='margin:0px;' onsubmit='return validLogin(this)'>");

			switch (loctag)
			{	case '1': document.write("<input type='hidden' name='nmRTN' value='083902002'>"); break;
				case '2': document.write("<input type='hidden' name='nmRTN' value='083974373'>"); break;
				case '3': document.write("<input type='hidden' name='nmRTN' value='083905012'>"); break;
				case '4': document.write("<input type='hidden' name='nmRTN' value='083902442'>"); break;
				case '5': document.write("<input type='hidden' name='nmRTN' value='083903645'>"); break;
			}
			document.writeln("<input type='hidden' name='nmUID'>");
			document.writeln("<input type='hidden' name='AccessID'>");

			document.writeln("	<table border=0 width='220px' height='113px' cellpadding=0 cellspacing=0>");
			document.write("	<tr><td style='font:900 15px Tahoma; color:#ffffff; padding-left:10px;'>Login ");
				document.writeln("to Personal Banking</td></tr>");
			document.write("	<tr><td align='right' style='font:12px Tahoma; color:#ffffff; padding-right:20px;'>");
				document.writeln("Select your bank city prior to login.</td></tr>");
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='10px'></td></tr>");
			document.write("	<tr><td style='font:12px Tahoma; color:#ffffff; padding-left:10px;'>");
			document.writeln("<b>Notice Online Customers:</b><br>Your Username is your Access ID.</td></tr>");
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='10px'></td></tr>");
			document.writeln("	<tr><td style='font:12px Tahoma; color:#ffffff; padding-left:10px;'>Access ID:</td></tr>");

			// Here's the login box
			document.writeln("	<tr><td><table border=0 width='220px' cellpadding='0' cellspacing='0'>");
			document.write("				<tr><td width='145px' valign='top' style='padding-left:10px;'><input type='text' ");
			document.writeln("name='v1' maxlength='40' style='font:13px Verdana; border:0px; width:130px;'></td>");
			if ((loctag > 0) && (loctag < 6))
			{	document.write("					<td width='75px'><input type='image' src='images/go_green_off.gif' ");
				document.write("onmouseover=\"this.src='images/go_green_on.gif'\" onmouseout=\"this.src='images/go_green_off.gif'\" ");
				document.writeln("onclick=\"this.src='images/go_green_over.gif'\"></td></tr>");
			} else {
				document.write("					<td width='75px'><a href=\"javascript:linktest('#')\"><img ");
				document.writeln("src='images/go_green_off.gif' border='0'></td></tr>");
			}
			document.writeln("			</table></td></tr>");
			
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
			
			document.write("	<tr><td style='padding-left:10px;'>");
			switch (loctag)
			{
				case '1': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902002&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '2': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083974373&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '3': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083905012&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '4': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902442&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '5': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083903645&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
			}
			document.writeln("</td></tr>");
			document.writeln("</table></form></td></tr>");
		}
	}

	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
	document.write("			<tr><td><a href='javascript:linktest(\"business_banking.htm\")' style='font:12px Tahoma; ");
	document.writeln("color:#ffffff; padding-left:10px;'>Business Banking Log In</td></tr>");
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='18px'></td></tr>");
	document.writeln("			<tr><td><img src='images/h_sep.gif' border=0></td></tr>");
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px' width='220px'></td></tr>");
	
	if ((location.pathname == "/index.htm") || (location.pathname == "/"))
	{	if (displink == 1)
			{ document.writeln("<tr><td><a href='careers.cgi'><img border=0 src='images/nowhiring.gif'></a></td></tr>"); }
	}
	
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='20px' width='220px'></td></tr>");
	document.writeln("		</table></td></tr>");
	
	// Facebook button
	var fblink = "";
	switch (loctag)
	{	case '1': fblink = "http://www.facebook.com/pages/Bowling-Green-KY/South-Central-Bank-of-Bowling-Green-Inc/374031075853"; break;
		case '2': fblink = "http://www.facebook.com/pages/Elizabethtown-KY/South-Central-Bank-of-Hardin-County-Inc/371530541949"; break;
		case '3': fblink = "http://www.facebook.com/pages/Glasgow-KY/South-Central-Bank-Inc/368824094659"; break;
		case '4': fblink = "http://www.facebook.com/pages/Owensboro-KY/South-Central-Bank-of-Daviess-County-Inc/368470099927"; break;
		case '5': fblink = "http://www.facebook.com/pages/Tompkinsville-KY/South-Central-Bank-of-Monroe-County-Inc/366551208859"; break;
	}
	if (fblink != "")
		{ document.writeln("<tr><td><a href='" +fblink+ "' target='_blank'><img src='images/facebook.gif' border='0' /></a></td></tr>"); }

	if ((location.pathname == "/index.htm") || (location.pathname == "/"))
		{ randomNum = Math.floor((Math.random() * 2)) + 7; }
	else
		{ randomNum = Math.floor((Math.random() * 7)); }
//		randomNum = 6; // Set the RandomNum so we can test ads
	document.write("<tr><td>");
	switch (randomNum)
	{
		case 0: document.write("<a href='javascript:linktest(\"telephone_banking.htm\", 1)'><img border=0 src='images/pgtop/ad_telep_bank.gif'></a>"); break;
		case 1: document.write("<a href='javascript:linktest(\"remote_deposit.htm\", 1)'><img src='images/pgtop/ad_remote_dep.gif' border=0></a>"); break;
		case 2: document.write("<a href='javascript:linktest(\"online_banking.htm\", 1)'><img src='images/pgtop/ad_online_bank.gif' border=0></a>"); break;
		case 3: document.write("<a href='javascript:linktest(\"saving_accounts.htm#hsa\", 1)'><img border=0 src='images/pgtop/ad_unexpected.gif'></a>"); break;
		case 4: document.write("<a href='javascript:linktest(\"personal_loans.htm\", 1)'><img src='images/pgtop/ad_college.gif' border=0></a>"); break;
		case 5: document.write("<a href='javascript:linktest(\"online_banking.htm\", 1)'><img src='images/pgtop/ad_pay_bill.gif' border=0></a>"); break;
		case 6: switch (loctag)
				{
					case '1': document.write("<a href='javascript:linktest(\"cservice_bg.htm#atm\", 1)'>"); break;
					case '2': document.write("<a href='javascript:linktest(\"cservice_etown.htm#atm\", 1)'>"); break;
					case '3': document.write("<a href='javascript:linktest(\"cservice_glasgow.htm#atm\", 1)'>"); break;
					case '4': document.write("<a href='javascript:linktest(\"cservice_owens.htm#atm\", 1)'>"); break;
					case '5': document.write("<a href='javascript:linktest(\"cservice_tomp.htm#atm\", 1)'>"); break;
					default:  document.write("<a href='#'>"); break;
				}
				document.write("<img src='images/pgtop/ad_lost_card.gif' border=0></a>");
				break;
		case 7: document.write("<a href='javascript:LeaveSiteConf(\"http://www.freddiemac.com/avoidforeclosure/\", 1)'><img src='images/pgtop/ad_foreclosure.gif' border=0></a>"); break;
		case 8: document.write("<a href='fdic.htm'><img src='images/pgtop/ad_fdic.gif' border=0></a>"); break;
		
	}
	document.writeln("</td></tr>");
	document.writeln("</table>");
}

function clearcookie()
{	createCookie("locdata",0,7);
	window.location.reload();
}

function login_section()
{	if (1 == 2)
	{	document.write("<table border=0 width='220px' height='77px' cellpadding=0 cellspacing=0>");
		document.write("	<tr><td style='font:11px Tahoma; color:#ffffff; padding-left:10px;'>Welcome</td></tr>");
		document.write("	<tr><td style='font:900 14px Tahoma; color:#ffffff;' height='100%' ");
		document.write("				align='center' valign='top'>Matthew Ruley</td></tr>");
		document.write("	<tr><td align='right' style='padding-right:15px;'><a href='#' style='font:10px Tahoma; ");
		document.write("				color:#ffffff;'>Click Here to Log out</a></td></tr>");
		document.write("	<tr><td><img border=0 src='images/spacer.gif' height='16px'></td></tr>");
		document.write("</table>");
	} else {
		document.write("<table border=0 width='220px' height='77px' cellpadding=0 cellspacing=0>");
		document.write("	<tr><td align='right' style='font:12px Tahoma; color:#ffffff; padding-right:20px;'>To login ");
		document.write("			please first select your<br>city from the tabs at left</td></tr>");
		document.write("	<tr><td style='font:12px Tahoma; color:#ffffff; padding-left:10px;'>Username:</td></tr>");
		document.write("	<tr><td style='padding-left:10px;'><input type='text' ");
		document.write("			style='font:13px Verdana; border:0px; width:175px;'></td></tr>");
		document.write("	<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
		document.write("	<tr><td><table border=0 width='220px' cellpadding='0' cellspacing='0'>");
		document.write("				<tr><td width='145px' style='padding-left:10px;'><a href='https://www.ebankhost.net/B09/ftu.htm' ");
		document.write("						style='font:12px Tahoma; color:#ffffff;'>> First Time User</a></td>");
		document.write("					<td width='75px' rowspan=2><img src='images/go_green_off.gif' ");
		document.write("						onmouseover=\"this.src='images/go_green_on.gif'\" ");
		document.write("						onmouseout=\"this.src='images/go_green_off.gif'\" ");
		document.write("						onclick=\"this.src='images/go_green_over.gif'\"></td></tr>");
		document.write("				<tr><td width='145px' style='padding-left:10px;'><a href='#' ");
		document.write("						style='font:12px Tahoma; color:#ffffff;'>> Forgot your login?</a></td></tr>");		
		document.write("			</table></td></tr>");
		document.write("</table>");
	}
}



function linktest(url)
{	loctag = readCookie("locdata");
	if ((loctag > 0) && (loctag < 6))
	{	sectest = window.location.href;
		if (sectest.charAt(4) == "s")
			{ window.location = "http://www.southcentralbank.com/"+url; }
		else
			{ window.location = url; }
	} else {
		alert('Please choose a location.');
	}
}

function page_jump(form)
{	loctag = readCookie("locdata");
	if ((loctag > 0) && (loctag < 6))
	{	newpage = form.nav.options[form.nav.selectedIndex].value;
		if (newpage != "")
		{	if (window.location.href.charAt(4) == "s")
				{ window.location = "http://www.southcentralbank.com/"+newpage; }
			else
				{ window.location = newpage; }
		}
	} else {
		alert('Please choose a location.');
	}
}

function LeaveSiteConf(url, newwin)
{
	if (confirm("You are leaving the South Central Bank Web site.\n\nThe Web site you have selected is an external "+
				"one located on another server. South Central Bank has no responsibility for any external Web site. "+
				"It neither endorses the information, content, presentation, or accuracy nor makes any warranty, express "+
				"or implied, regarding any external site.\n\nThank you for visiting South Central Banks Web site."))
		{	if (newwin == 0)
				{ window.location = url; }
			else
				{ window.open(url, "extlinkwin"); }
		}
}

function nav_menu()
{	loctag = readCookie("locdata");
	document.write("<select name='nav' style='width:350px;' onchange='page_jump(navdrop);'>");
	document.write("<option value='#'>- Please choose an option -</option>");
	document.write("<option value='index.htm'>Home Page</option>");
	document.write("<optgroup label='About Us'>");
	document.write("	<option value='history.htm'>History</option>");

	switch (loctag)
	{	case '1': document.write("	<option value='cservice_bg.htm#locations'>Locations</option>"); break;
		case '2': document.write("	<option value='cservice_etown.htm#locations'>Locations</option>"); break;
		case '3': document.write("	<option value='cservice_glasgow.htm#locations'>Locations</option>"); break;
		case '4': document.write("	<option value='cservice_owens.htm#locations'>Locations</option>"); break;
		case '5': document.write("	<option value='cservice_tomp.htm#locations'>Locations</option>"); break;
		default:  document.write("	<option value='cservice_bg.htm#locations'>Locations</option>"); break;
	}

	document.write("	<option value='careers.cgi'>Careers</option>");
	document.write("</optgroup>");
//	document.write("<optgroup label='Locations'>");
//	document.write("	<option value='cservice_bg.htm'>Bowling Green</option>");
//	document.write("	<option value='cservice_etown.htm'>Elizabethtown</option>");
//	document.write("	<option value='cservice_glasgow.htm'>Glasgow</option>");
//	document.write("	<option value='cservice_owens.htm'>Owensboro</option>");
//	document.write("	<option value='cservice_tomp.htm'>Tompkinsville</option>");
//	document.write("</optgroup>");
	document.write("<optgroup label='ATM Locations'>");
	document.write("	<option value='atm_locations.htm#locations'>All Locations</option>");
	document.write("	<option value='atm_locations_bg.htm#locations'>Bowling Green</option>");
	document.write("	<option value='atm_locations_etown.htm#locations'>Elizabethtown</option>");
	document.write("	<option value='atm_locations_glasgow.htm#locations'>Glasgow</option>");
	document.write("	<option value='atm_locations_owens.htm#locations'>Owensboro</option>");
	document.write("	<option value='atm_locations_tomp.htm#locations'>Tompkinsville</option>");
	document.write("</optgroup>");
	document.write("<optgroup label='Personal Banking'>");
	document.write("	<option value='personal_banking.htm'>Personal Banking</option>");
	document.write("	<option value='checking.htm'>Checking Accounts</option>");
	document.write("	<option value='saving_accounts.htm#hsa'>Health Savings Account</option>");
	document.write("	<option value='saving_accounts.htm'>Savings Accounts</option>");
	document.write("	<option value='telephone_banking.htm'>Telephone Banking</option>");
	document.write("	<option value='online_banking.htm'>Online Banking</option>");
	document.write("	<option value='personal_loans.htm'>Personal Loans</option>");
	document.write("</optgroup>");
	document.write("<optgroup label='Business Banking'>");
	document.write("	<option value='business_banking.htm'>Business Banking</option>");
	document.write("	<option value='business_checking.htm'>Business Checking</option>");
	document.write("	<option value='business_savings.htm'>Business Savings</option>");
	document.write("	<option value='online_banking.htm'>Online Banking</option>");
	document.write("	<option value='business_loans.htm'>Loans</option>");
	document.write("</optgroup>");
	document.write("<optgroup label='Mortgage Options'>");
	document.write("	<option value='mortgages.htm'>Mortgages</option>");
	document.write("	<option value='home_equity.htm'>Home Equity</option>");
	document.write("	<option value='mortgage_options.htm'>Mortgage Options</option>");
	document.write("</optgroup>");
	document.write("<optgroup label='Customer Service'>");

	switch (loctag)
	{	case '1':	document.write("	<option value='cservice_bg.htm'>Customer Service</option>");
					document.write("	<option value='cservice_bg.htm#atm'>Lost ATM Debit Cards</option>"); break;
		case '2':	document.write("	<option value='cservice_etown.htm'>Customer Service</option>");
					document.write("	<option value='cservice_etown.htm#atm'>Lost ATM Debit Cards</option>"); break;
		case '3':	document.write("	<option value='cservice_glasgow.htm'>Customer Service</option>");
					document.write("	<option value='cservice_glasgow.htm#atm'>Lost ATM Debit Cards</option>"); break;
		case '4':	document.write("	<option value='cservice_owens.htm'>Customer Service</option>");
					document.write("	<option value='cservice_owens.htm#atm'>Lost ATM Debit Cards</option>"); break;
		case '5':	document.write("	<option value='cservice_tomp.htm'>Customer Service</option>");
					document.write("	<option value='cservice_tomp.htm#atm'>Lost ATM Debit Cards</option>"); break;
		default:	document.write("	<option value='cservice_bg.htm'>Customer Service</option>");
					document.write("	<option value='cservice_bg.htm#atm'>Lost ATM Debit Cards</option>"); break;
	}

	document.write("</optgroup>");

	if ((loctag == 1) || (loctag == 3))
		{ document.write("<option value='javascript:LeaveSiteConf(\"investments.htm\", 1)'>Investments</option>"); }

	//	FraudProUrl = "http://anon.vodium.com.edgesuite.net/anon.vodium/fdic/identitytheft/index.html";
		FraudProUrl = "http://www.fdic.gov/consumers/theft/index.html";
	document.write("<option value='javascript:LeaveSiteConf(\""+FraudProUrl+"\", 1)'>Fraud Protection</option>");
	document.write("<optgroup label='Privacy Policies'>");
	document.write("	<option value='privacy.htm'>Privacy Policies</option>");
	document.write("	<option value='privacy1.htm'>Privacy Statement</option>");
	document.write("	<option value='privacy2.htm'>Security Statement</option>");
	document.write("	<option value='privacy3.htm'>Privacy Notice</option>");
	document.write("</optgroup>");
	document.write("<option value='terms_conditions.htm'>Terms & Conditions</option>");
	document.write("<option value='sitemap.htm'>Site Map</option>");
	document.write("</select>");
}

function mortgageLogin(){
	var loctag = readCookie("locdata");
	var city = "";
	
	switch (loctag)
	{	case '1': city = "Bowling Green"; break;
		case '2': city = "Elizabethtown"; break;
		case '3': city = "Glasgow"; break;
		case '4': city = "Owensboro"; break;
		case '5': city = "Tompkinsville"; break;
	}
	if (1 == 1)
	{	if ((loctag > 0) && (loctag < 6))
		{	
			document.write("<span style='font:14px Tahoma; color:#000000;'>Enter Your Mortgage Account Access ID:</span><br>");
			document.write("<form action='");

			switch (loctag)
			{
				default: document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083905012&LogonBy=Connect3&PRMAccess=Account"); break;
			}
			document.writeln("' method='post' style='margin:0px;' onsubmit='return validLogin(this)'>");

			switch (loctag)
			{	case '1': document.write("<input type='hidden' name='nmRTN' value='083902002'>"); break;
				case '2': document.write("<input type='hidden' name='nmRTN' value='083974373'>"); break;
				case '3': document.write("<input type='hidden' name='nmRTN' value='083905012'>"); break;
				case '4': document.write("<input type='hidden' name='nmRTN' value='083902442'>"); break;
				case '5': document.write("<input type='hidden' name='nmRTN' value='083903645'>"); break;
			}
			document.write("<input type='hidden' name='nmUID'>");
			document.write("<input type='hidden' name='AccessID'>");
			
			document.write("<input type='text' ");
			document.write("name='v1' maxlength='40' style='font:13px Verdana; border:1px; width:190px;'>");
			
			if ((loctag > 0) && (loctag < 6))
			{	document.write("	<input style='position: relative; top: 8px; left: 10px;' type='image' src='images/go_grey_bg.jpg' ");
				document.write("onmouseover=\"this.src='images/go_grey_bg_over.jpg'\" onmouseout=\"this.src='images/go_grey_bg.jpg'\" ");
				document.write("onclick=\"this.src='images/go_grey_bg_over.jpg'\">");
			} else {
				document.write("<a href=\"javascript:linktest('#')\"><img ");
				document.write("src='images/go_green_off.gif' border='0'>");
			}
			document.write("<br>");
			switch (loctag)
			{
				case '1': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902002&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#046330;'>First Time User – Click to Enroll</a>"); break;
				case '2': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083974373&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#046330;'>First Time User – Click to Enroll</a>"); break;
				case '3': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083905012&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#046330;'>First Time User – Click to Enroll</a>"); break;
				case '4': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902442&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#046330;'>First Time User – Click to Enroll</a>"); break;
				case '5': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083903645&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#046330;'>First Time User – Click to Enroll</a>"); break;
			}

		}
	}
}

function right_side_2(showLogin, test)
{	loctag = readCookie("locdata");
	city = "";
	switch (loctag)
	{	case '1': city = "Bowling Green"; break;
		case '2': city = "Elizabethtown"; break;
		case '3': city = "Glasgow"; break;
		case '4': city = "Owensboro"; break;
		case '5': city = "Tompkinsville"; break;
	}
	
	document.writeln("<table border=0 width='220px' cellpadding=0 cellspacing=0>");
//not looking for "+city+"?
	if (city != "")
	{	  document.write("<tr><td valign='top'><table style=\"background: url('images/ne_corner.gif') no-repeat scroll right;\" border=0 ");
		document.writeln("width='220px' cellpadding=0 cellspacing=0>");
		document.write("				<tr><td style='font:900 14px Verdana; color:#ffffff; padding-left:10px;' ");
			document.writeln("height='35px' valign='bottom'><div style='position: relative;'><div id='apply_button'><a class='applyhere' href='http://myscbhomeloan.com/default.aspx'>Online Mortgages <br/><span>Apply Now</span></a></div></div></td></tr>");
		if(loctag != 3){
			document.write("				<tr><td style='font:900 21px Verdana; color:#ffffff; padding-left:10px;' ");
			document.write("height='30px' valign='bottom'><div style='position: relative;'><a href='/mortgages_account.htm' style='position: absolute; top: 8px; left: -2px;'><img border='0' src='images/view_your_account_green.jpg' alt='View your account' /></a></div></td></tr>");
		}else{
			document.write("				<tr><td style='font:900 21px Verdana; color:#ffffff; padding-left:10px;' ");
			document.write("height='30px' valign='bottom'></td></tr>");
		}
		document.write("				<tr><td style='font:12px Verdana; color:#ffffff; padding-left:10px;' height='35px' ");
			document.writeln("valign='top'></td></tr>");
		document.writeln("		</table></td></tr>");
	} else {
		  document.write("<tr><td height='100px' style=\"background: url('images/ne_corner.gif') no-repeat scroll right; ");
		  document.write("	font:900 13px Verdana; color:#ffffff; padding-left:10px;\" valign='bottom'>");
		document.writeln("	Please Select a City<br>from the tabs at left or<br>use the drop down below:</td></tr>");
		  document.write("<tr><td><table border='0' width='220px' cellpadding=0 cellspacing=0 ");
		document.writeln("	style=\"background: url('images/right_green.gif') repeat-y scroll left;\">");
		document.writeln("			<tr><td><img src='images/pgtop/arrow.gif' border=0></td></tr>");
		  document.write("			<tr><td style='padding-left:25px;'><select style='font:12px Verdana; border:0px; width:170px;' ");
		document.writeln("onchange='set_location(this.options[this.selectedIndex].value)'>");
		document.writeln("						<option value=''>-Select a City-</option>");
		document.writeln("						<option value='1'>Bowling Green</option>");
		document.writeln("						<option value='1'>Franklin</option>");
		document.writeln("						<option value='2'>Elizabethtown</option>");
		document.writeln("						<option value='3'>Glasgow</option>");
		document.writeln("						<option value='3'>Edmonton</option>");
		document.writeln("						<option value='3'>Cave City</option>");
		document.writeln("						<option value='3'>Park City</option>");
		document.writeln("						<option value='4'>Owensboro</option>");
		document.writeln("						<option value='5'>Tompkinsville</option>");
		document.writeln("						<option value='5'>Gamaliel</option>");
		document.writeln("						<option value='5'>Fountain Run</option>");
		document.writeln("						<option value='5'>Scottsville</option>");
		document.writeln("					</select></td></tr>");
		document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
		document.writeln("		</table></td></tr>");
	}


	document.write("<tr><td><table style=\"background: url('images/right_green.gif') repeat-y scroll left;\" border='0' ");
		document.writeln("width='220px' cellpadding=0 cellspacing=0>");
	document.writeln("<tr><td><img border=0 src='images/spacer.gif' height='20px'></td></tr>");

	// Login Portion
	if (showLogin == 1)
	{	if ((loctag > 0) && (loctag < 6))
		{	document.writeln("<tr><td style='font:900 15px Tahoma; color:#ffffff; padding-left:10px;'>Online Banking</td></tr>");
			document.write("<tr><td><form action='");

			switch (loctag)
			{
				case '1': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083902002&LogonBy=Connect3&PRMAccess=account"); break;
				case '2': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083974373&LogonBy=Connect3&PRMAccess=account"); break;
				case '3': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083905012&LogonBy=Connect3&PRMAccess=Account"); break;
				case '4': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083902442&LogonBy=Connect3&PRMAccess=account"); break;
				case '5': document.write("https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?WCI=RemoteLogin&Rt=083903645&LogonBy=Connect3&PRMAccess=account"); break;
				default:  document.write("#"); break;
			}
			document.writeln("' method='post' style='margin:0px;' onsubmit='return validLogin(this)'>");

			switch (loctag)
			{	case '1': document.write("<input type='hidden' name='nmRTN' value='083902002'>"); break;
				case '2': document.write("<input type='hidden' name='nmRTN' value='083974373'>"); break;
				case '3': document.write("<input type='hidden' name='nmRTN' value='083905012'>"); break;
				case '4': document.write("<input type='hidden' name='nmRTN' value='083902442'>"); break;
				case '5': document.write("<input type='hidden' name='nmRTN' value='083903645'>"); break;
			}
			document.writeln("<input type='hidden' name='nmUID'>");
			document.writeln("<input type='hidden' name='AccessID'>");

			document.writeln("	<table border=0 width='220px' height='113px' cellpadding=0 cellspacing=0>");
			document.write("	<tr><td style='font:900 15px Tahoma; color:#ffffff; padding-left:10px;'>Login ");
				document.writeln("to Personal Banking</td></tr>");
			document.write("	<tr><td align='right' style='font:12px Tahoma; color:#ffffff; padding-right:20px;'>");
				document.writeln("Select your bank city prior to login.</td></tr>");
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='10px'></td></tr>");
			document.write("	<tr><td style='font:12px Tahoma; color:#ffffff; padding-left:10px;'>");
			document.writeln("<b>Notice Online Customers:</b><br>Your Username is your Access ID.</td></tr>");
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='10px'></td></tr>");
			document.writeln("	<tr><td style='font:12px Tahoma; color:#ffffff; padding-left:10px;'>Access ID:</td></tr>");

			// Here's the login box
			document.writeln("	<tr><td><table border=0 width='220px' cellpadding='0' cellspacing='0'>");
			document.write("				<tr><td width='145px' valign='top' style='padding-left:10px;'><input type='text' ");
			document.writeln("name='v1' maxlength='40' style='font:13px Verdana; border:0px; width:130px;'></td>");
			if ((loctag > 0) && (loctag < 6))
			{	document.write("					<td width='75px'><input type='image' src='images/go_green_off.gif' ");
				document.write("onmouseover=\"this.src='images/go_green_on.gif'\" onmouseout=\"this.src='images/go_green_off.gif'\" ");
				document.writeln("onclick=\"this.src='images/go_green_over.gif'\"></td></tr>");
			} else {
				document.write("					<td width='75px'><a href=\"javascript:linktest('#')\"><img ");
				document.writeln("src='images/go_green_off.gif' border='0'></td></tr>");
			}
			document.writeln("			</table></td></tr>");
			
			document.writeln("	<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
			
			document.write("	<tr><td style='padding-left:10px;'>");
			switch (loctag)
			{
				case '1': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902002&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '2': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083974373&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '3': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083905012&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '4': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083902442&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
				case '5': document.write("<a href='https://ns.bankbyweb.net/PBI_PBI1961/pbi1961.asp?Rt=083903645&LogonBy=Connect3&PRMAccess=Account&Enroll=True' ");
						  document.write("style='font:12px Tahoma; color:#ffffff;'>First Time User – Click to Enroll</a>"); break;
			}
			document.writeln("</td></tr>");
			document.writeln("</table></form></td></tr>");
		}
	}

	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
	document.write("			<tr><td><a href='javascript:linktest(\"business_banking.htm\")' style='font:12px Tahoma; ");
	document.writeln("color:#ffffff; padding-left:10px;'>Business Banking Log In</td></tr>");
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px'></td></tr>");
	document.writeln("			<tr><td><a  style='font:12px Tahoma; color:#ffffff; padding-left:10px;' href='javascript:clearcookie();' >Choose another city.</a></td></tr>");
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='18px'></td></tr>");
	document.writeln("			<tr><td><img src='images/h_sep.gif' border=0></td></tr>");
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='5px' width='220px'></td></tr>");
	
	if ((location.pathname == "/index.htm") || (location.pathname == "/") || (location.pathname == "/index_new.htm"))
	{	if (displink == 1)
			{ document.writeln("<tr><td><a href='careers.cgi'><img border=0 src='images/nowhiring.gif'></a></td></tr>"); }
	}
	
	document.writeln("			<tr><td><img border=0 src='images/spacer.gif' height='20px' width='220px'></td></tr>");
	document.writeln("		</table></td></tr>");
	
	// Facebook button
	var fblink = "";
	switch (loctag)
	{	case '1': fblink = "http://www.facebook.com/pages/Bowling-Green-KY/South-Central-Bank-of-Bowling-Green-Inc/374031075853"; break;
		case '2': fblink = "http://www.facebook.com/pages/Elizabethtown-KY/South-Central-Bank-of-Hardin-County-Inc/371530541949"; break;
		case '3': fblink = "http://www.facebook.com/pages/Glasgow-KY/South-Central-Bank-Inc/368824094659"; break;
		case '4': fblink = "http://www.facebook.com/pages/Owensboro-KY/South-Central-Bank-of-Daviess-County-Inc/368470099927"; break;
		case '5': fblink = "http://www.facebook.com/pages/Tompkinsville-KY/South-Central-Bank-of-Monroe-County-Inc/366551208859"; break;
	}
	if (fblink != "")
		{ document.writeln("<tr><td><a href='" +fblink+ "' target='_blank'><img src='images/facebook.gif' border='0' /></a></td></tr>"); }

	if ((location.pathname == "/index.htm") || (location.pathname == "/") || (location.pathname == "/index_new.htm"))
		{ randomNum = Math.floor((Math.random() * 2)) + 7; }
	else
		{ randomNum = Math.floor((Math.random() * 7)); }
//		randomNum = 6; // Set the RandomNum so we can test ads
	document.write("<tr><td>");
	switch (randomNum)
	{
		case 0: document.write("<a href='javascript:linktest(\"telephone_banking.htm\", 1)'><img border=0 src='images/pgtop/ad_telep_bank.gif'></a>"); break;
		case 1: document.write("<a href='javascript:linktest(\"remote_deposit.htm\", 1)'><img src='images/pgtop/ad_remote_dep.gif' border=0></a>"); break;
		case 2: document.write("<a href='javascript:linktest(\"online_banking.htm\", 1)'><img src='images/pgtop/ad_online_bank.gif' border=0></a>"); break;
		case 3: document.write("<a href='javascript:linktest(\"saving_accounts.htm#hsa\", 1)'><img border=0 src='images/pgtop/ad_unexpected.gif'></a>"); break;
		case 4: document.write("<a href='javascript:linktest(\"personal_loans.htm\", 1)'><img src='images/pgtop/ad_college.gif' border=0></a>"); break;
		case 5: document.write("<a href='javascript:linktest(\"online_banking.htm\", 1)'><img src='images/pgtop/ad_pay_bill.gif' border=0></a>"); break;
		case 6: switch (loctag)
				{
					case '1': document.write("<a href='javascript:linktest(\"cservice_bg.htm#atm\", 1)'>"); break;
					case '2': document.write("<a href='javascript:linktest(\"cservice_etown.htm#atm\", 1)'>"); break;
					case '3': document.write("<a href='javascript:linktest(\"cservice_glasgow.htm#atm\", 1)'>"); break;
					case '4': document.write("<a href='javascript:linktest(\"cservice_owens.htm#atm\", 1)'>"); break;
					case '5': document.write("<a href='javascript:linktest(\"cservice_tomp.htm#atm\", 1)'>"); break;
					default:  document.write("<a href='#'>"); break;
				}
				document.write("<img src='images/pgtop/ad_lost_card.gif' border=0></a>");
				break;
		case 7: document.write("<a href='javascript:LeaveSiteConf(\"http://www.freddiemac.com/avoidforeclosure/\", 1)'><img src='images/pgtop/ad_foreclosure.gif' border=0></a>"); break;
		case 8: document.write("<a href='fdic.htm'><img src='images/pgtop/ad_fdic.gif' border=0></a>"); break;
		
	}
	document.writeln("</td></tr>");
	document.writeln("</table>");
	document.write("<style>#apply_button{position: absolute; top: -10px; left: -5px;} #apply_button a{ text-decoration: none; color: #fff; font: 12px Arial, Helvetica, sans-serif bold; }#apply_button .applyhere{display: block;	width: 185px;	height: 49px; padding: 5px 0;	text-align: center; background: url('images/animate_button.png') no-repeat;} #apply_button span{cursor: pointer; position: relative; top: -2px; font-size: 1.5em; font-weight: bold; }</style>");
}