window.onresize=resize;
function resize(){
self.location.href=self.location.href;
}

if(window.event + "" == "undefined") event = null;
// FOR HM_MENU BELOW
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;
//FOR HM_MENU ABOVE
//FOR COOLMENU BELOW
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();
// FOR COOLMENU ABOVE

// CALL TO CORRECT DIRECTORY BELOW - if you are on homepage you need <script> var homepage = "yes";</script> to make codework properly
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="http://www.tcbanks.com/site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.tcbankss.com/images/"
sitedir="http://www.tcbanks.com/site/"
securedir="http://www.tcbanks.com/site/"
homedir="http://www.tcbanks.com/"
}
else if(window.securepage)
{
imgdir="https://www.tcbanks.com/images/"
sitedir="http://www.tcbanks.com/site/"
securedir="https://www.tcbanks.com/site/"
homedir="http://www.tcbanks.com/"
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="nav-" + name +"-on.gif";
this.name_off="nav-" + name +"-off.gif";
this.width=width;
this.height=height;
this.newimage_on = new Image(width,height);
this.newimage_on.src = imgdir + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = imgdir + this.name_off;
}

var nav_heights=22;

var navitems = new Array();
navitems["locations"] = new makeNavImage("locations",84,nav_heights);
navitems["email"] = new makeNavImage("email",84,nav_heights);
navitems["checking"] = new makeNavImage("checking",78,nav_heights);
navitems["savings"] = new makeNavImage("savings",71,nav_heights);
navitems["loan"] = new makeNavImage("loancreditapp",133,nav_heights);
navitems["investments"] = new makeNavImage("investments",96,nav_heights);
navitems["business"] = new makeNavImage("businessproducts",116,nav_heights);
navitems["insurance"] = new makeNavImage("insurance",92,nav_heights);
navitems["otherproducts"] = new makeNavImage("otherproducts",99,22);
navitems["salem"] = new makeNavImage("salem",71,21);
navitems["rolla"] = new makeNavImage("rolla",73,21);
navitems["licking"] = new makeNavImage("licking",90,21);
navitems["bourbon"] = new makeNavImage("bourbon",85,21);
navitems["mtngrove"] = new makeNavImage("mtngrove",159,18);
navitems["stjames"] = new makeNavImage("stjames",111,18);
navitems["ava"] = new makeNavImage("ava",47,18);
navitems["pevely"] = new makeNavImage("pevely",72,18);
function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
oM.mout();
document[imgName].src = navitems[imgName].newimage_off.src;
}
// ROLLOVER CODE ABOVE

// OTHER FUNCTIONS BELOW
function openWin(url,name,width,height,options){
var n = name;
var w = width;
var h = height;
var o = options;
n = (n==null)?"_blank":n;
w = (isNaN(w) || w==null)?700:w;
h = (isNaN(h) || h==null)?600:h;
o = (o==null)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(o.indexOf(",")!=0)?","+o:o;

var posX = Math.ceil((parseInt(screen.width) - w) / 2);
var posY = Math.ceil((parseInt(screen.height) - h) / 2);
aWindow = window.open(url,n,"width=" + w + ",height=" + h + ",left=" + posX + ",top=" + posY + o);
}


function open_apps(nameofapp){
openWin("https://www.tcbanks.com/Forms/OnlineForm.cgi?form=" + nameofapp,"application",700,600,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,status=1");
}


function displayEmailAlert(mailto){
	var content = new Array();
	var index = 0;
	content[index++] = "Please do not use E-Mail to request transactions to your account. Additionally, do not include confidential information such as account numbers or social security numbers in your comments as E-Mail is not a secure channel for transmission.";
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="window.open(\''+mailto+'\');document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Continue</a>&nbsp;&nbsp;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.visibility = "visible";
	scrollTo(0, 0);
}


function displayThirdPartyAlert(lk, target){
	var description = lk.innerHTML;
	if (!target) var target= "_self";
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	//content creation
	var content = new Array();
    var index = 0;
	content[index++] = '<h1>Third Party Site Disclaimer</h1><br>*If you continue, you will be connected to a third-party website that may be of interest to you. Town & Country Bank does not own or operate the linked sites. These sites may not adhere to the same privacy policies and standards as Town & Country Bank. Please review the privacy policy at each site. Town & Country Bank is not responsible for the content on this third party site. Town & Country Bank does not warrant linked sites under any circumstance.';
	content[index++] = '<br><br><br>';
	content[index++] = '<div align="center"><a href="'+lk.href+'" target="' + target + '"  onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.visibility = "visible";
	scrollTo(0,0);
	return false;
}
document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: center; position:absolute; border: 2px solid #000000; padding: 15px; visibility: hidden; z-index: 300; width:350px;  top:30; left:150px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=B76669,offX=7,offY=8,positive=true); "></div>');

function displayThirdPartyAlert2(lk){
	var description = lk.innerHTML;
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	//content creation
	var content = new Array();
    var index = 0;
	content[index++] = '<h1>Third Party Site Disclaimer</h1><br>*If you continue, you will be connected to a third-party website that may be of interest to you. Town & Country Bank does not own or operate the linked sites. These sites may not adhere to the same privacy policies and standards as Town & Country Bank. Please review the privacy policy at each site. Town & Country Bank is not responsible for the content on this third party site. Town & Country Bank does not warrant linked sites under any circumstance.';
	content[index++] = '<br><br><br>';
	content[index++] = '<div align="center"><a href="'+lk.href+'" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'" target="_blank">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.visibility = "visible";
	scrollTo(0,0);
	return false;
}
document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: center; position:absolute; border: 2px solid #000000; padding: 15px; visibility: hidden; z-index: 300; width:350px;  top:30; left:150px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=B76669,offX=7,offY=8,positive=true); "></div>');


function showWarning(lk){
	var content = new Array();
    var index = 0;
	content[index++] = '<h1>Third Party Site Disclaimer</h1><br>*If you continue, you will be connected to a third-party website that may be of interest to you. Town & Country Bank does not own or operate the linked sites. These sites may not adhere to the same privacy policies and standards as Town & Country Bank. Please review the privacy policy at each site. Town & Country Bank is not responsible for the content on this third party site. Town & Country Bank does not warrant linked sites under any circumstance.';
	content[index++] = '<br><br><br>';
	content[index++] = '<div align=\"center\"><a href="'+lk+'" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.visibility = \'hidden\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.visibility = "visible";
	scrollTo(0,0);
}

function openIB(type){
	if(type == "demo"){
		self.location.href = "https://www.tcbanks.com/home.html?demo";
	}
	else if(type == "reg"){
		self.location.href = "https://www.tcbanks.com/onlineserv/HB/reg_disc.html";
	}
	else{
		self.location.href = "https://www.tcbanks.com/home.html";
	}

}

// OTHER FUNCTIONS ABOVE
//
//
function writeVIP() {
	var content = '';
	
	content+= '<div style="border: 1px solid #000000; background-color: #eddebc; padding: 5px 20px 20px 20px; margin-top: 20px;">';
	content+= '<h1>VIP Package - Super charge your checking account</h1>For only $5.99 per month, the VIP Package offers you the following benefits (a savings of up to $967!)</p>';
	content+= '<ul>';
	content+= '<li>Pharmacy, hearing, &amp; vision discounts</li>';
	content+= '<li>Identity theft protection</li>';
	content+= '<li>Hotel &amp; motel discounts</li>';
	content+= '<li>One free box of checks each year</li>';
	content+= '<li>A $100 credit toward closing costs on a Town &amp; Country Bank home loan</li>';
	content+= '<li>A $10 annual credit toward a safe deposit box</li>';
	content+= '<li>10,000 accidental death &amp; dismemberment (AD&amp;D) coverage &amp; $20,000 common carrier insurance*</li>';
	content+= '<li>And much more!</li><br />';
	content+= '</ul>';
	content+= '<p>*Town &amp; Country Bank is pleased to offer our customers insurance products as a part of our VIP package. The common carrier and accidental death &amp; dismemberment coverage within this package is not FDIC insured. It is not a bank guarantee and it is not a deposit.</p>';
	content+= '</div>';

	document.write(content);
}
