if(window.event + "" == "undefined") event = null;
//FOR COOLMENU BELOW
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();
// FOR COOLMENU ABOVE

var uri = document.location.href;
if (window.securepage || window.homepage) {
	newUri = false;
	/* make sure we're at https: */
	if(/^http:/.test(uri)){
		uri = uri.replace(/^http/,'https');
		newUri = true;
	}
	/* make sure the 'www' is there */
	/*if(!/^https:\/\/www\./.test(uri)){
		uri = uri.replace(/^https:\/\//,'https://www.');
		newUri = true;
	}*/
	/* redirect */
	if(newUri)document.location.replace(uri);
}
else if (uri.indexOf('staging') == -1){
	if(/^https/.test(uri)) document.location.replace(uri.replace(/^https/,'http'));
}


// 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.securepage) {
imgdir="../images/";
sitedir="../";
securedir="../";
homedir="../";
}
else if (document.location.href.indexOf('cgi') != -1) {
imgdir="../images/";
sitedir="../";
securedir="../";
homedir="../";
}
// 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_widths=210;
var nav_heights=38;

var navitems = new Array();
navitems["personal"] = new makeNavImage("personal",nav_widths,nav_heights);
navitems["business"] = new makeNavImage("business",nav_widths,nav_heights);
navitems["online"] = new makeNavImage("online",nav_widths,nav_heights);
navitems["about"] = new makeNavImage("about",nav_widths,nav_heights);
navitems["whatsnew"] = new makeNavImage("whatsnew",nav_widths,nav_heights);
navitems["contact"] = new makeNavImage("contact",nav_widths,nav_heights);
navitems["ib"] = new makeNavImage("ib",nav_widths,nav_heights);
navitems["cm"] = new makeNavImage("cm",nav_widths,nav_heights);

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
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){
	self.location.href="https://www.wilsonmuirbank.com/Forms/OnlineForm.cgi?form=" + nameofapp +"&onweb=true";
}

function openCM(page){
	openWin("https://www.wilsonmuirbank.com/onlineserv/CM/");
}

function showWarning(url){
	var content = new Array();
	var index = 0;
	content[index++]='<div style="padding:10px"><h2>Third Party Site Disclaimer</h2><br />By accessing the noted link you will be leaving your financial institution\'s website and entering a website hosted by another party. Your financial institution has not approved this as a reliable partner site. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of your financial institution\'s website. We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of your financial institution\'s.';
	content[index++]='<br /><br /><br />';
	content[index++]='<div style="text-align:center;"><a href="javascript:void(0);" onclick="openExternal(\''+url+'\')">Continue</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="'+self.location.href+'">Decline</a></div></div>';
	document.getElementById("contentText").innerHTML = content.join("");
}

function openExternal(ext){
	openWin(ext);
	setTimeout("window.location.reload()",2000);
	return;
}

function showInsecureWarning(url){
	var message= confirm("This will connect you to another site. Would you like to proceed?")
	
	if (message) {
		openWin(url);
	}
}

function showWarningAlert(url){
	var message= confirm("This will connect you to another secure site. Would you like to proceed?")
	
	if (message) {
		openWin(url);
	}
}

function MortgageCalculator(){
	var message= confirm("This will connect you to another secure site. Would you like to proceed?")
	
	if (message) {
		openWin("https://www.originatorpro.com/lu/homepageview/default.asp?page=689516&ver=154438&ns=1");
	}
}

function mortgageDisclaimer(){
	var message= confirm("This will connect you to another secure site. Would you like to proceed?")
	
	if (message) {
		openWin("http://www.mywmbhomeloan.com");
	}
}



function perLoanDisclaimer(){
	var message= confirm("This will connect you to another secure site. Would you like to proceed?")
	
	if (message) {
		openWin("https://www.loans24.net/atl/clientSelect.do?clientID=7620","",800);
	}
}

// OTHER FUNCTIONS ABOVE
