var imgdir="images/";
var securedir="https://www.iowastatebankonline.com/";
var homedir="";
var sitedir="../site/";

if(window.homepage) {
	imgdir="images/";
	securedir="";
	homedir="";
	sitedir="site/";
} else if (window.absolutepage){
	imgdir="http://www.iowastatebankonline.com/images/";
	securedir="http://www.iowastatebankonline.com/";
	homedir="http://www.iowastatebankonline.com/";
	sitedir="http://www.iowastatebankonline.com/site/";
} else if (window.securepage){
	imgdir="https://www.iowastatebankonline.com/images/";
	securedir="https://www.iowastatebankonline.com/";
	homedir="https://www.iowastatebankonline.com/";
	sitedir="http://www.iowastatebankonline.com/site/";
} if (window.calcpage) {
	imgdir="../images/";
	securedir="https://www.iowastatebankonline.com/";
	homedir="../";
	sitedir="../site/";
}
else {
	var imgdir=imgdir;
	var securedir=securedir;
	var homedir=homedir;
	var sitedir=sitedir;
}

var fiName ="Capital Community Bank";

/************************************************************************************************************
* This function is used in the onclick of the a tag to display the external site warning. 
* @param msg - Integer specifying the which message to display.
* @param lk - The a link object
* Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a>
**************************************************************************************************************/
function displayThirdPartyAlert(msg,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("\""));
	}
	showWarning(lk.href, description, lk.target, msg)
	return false;
}

/************************************************************************************************************
* This function is used in the href of the a tag to display the external site warning. 
* @param lk - The url of the site to be opened
* @param desc - The description of the site to be opened, i.e. the name of the site.
* @param target - Allows for the window to opened in a new window
* @param msg - Integer specifying the which message to display.
* Usage: <a href="javascript:showWarning('http://wwww.mysite.com');">My Site</a>
**************************************************************************************************************/

function showWarning(lk, desc, target, msg){
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "_blank";
	msg = (msg) ? msg : 0;
	
	var messages = new Array(6);
	// Standard 3rd Party Warning
	messages[0] = messages[1] = '<h2 style="text-align:center">Third Party Site Disclaimer</h2><p><strong>You are about to leave '+fiName+'\'s Internet site.</strong> The hyperlinks to third-party Internet sites are provided solely as a convenience to users of the '+fiName+' Internet site. The Bank has made a limited effort to determine that these links function properly. However, linked web sites are not under the control of the Bank, and the Bank is not responsible for the contents of any linked web site, or any link contained in a linked web site. Even if you access a web site by means of the link provided by the Bank, you are responsible for confirming the identity and authenticity of any web site you visit and transact business with online. The inclusion of a link does not imply or constitute an endorsement by the Bank of the third party\'s web site, its ownership or management, the products or services it offers, or any advertisers or sponsors appearing on the third party\'s web site.';
	// Standard Partner Warning
	messages[2] = '<h2 style="text-align:center">Partner Site Disclaimer</h2><p>By accessing the noted link you will be leaving our website and entering a partner site which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>';
	// Standard Affiliate Warning
	messages[3] = '<h2 style="text-align:center">Affiliate Site Disclaimer</h2><p>By accessing the noted link you will be leaving our website and entering an affiliate site located which is hosted by another party. Please be advised that you will no longer be subject to, or under the protection of, the privacy and security policies of our website. We encourage you to read and evaluate the privacy and security policies of the site which you are entering, which may be different than those of ours.</p>';
	// Customize if requested
	messages[4] = messages[0];
	// Standard mailto: Insecure Warning
	messages[5] = '<h2 style="text-align:center">Email Disclaimer</h2><p>This is <strong>NOT</strong> a secured e-mail transmission. Please <strong>do not send personal/financial information</strong> via this method.</p>';

	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<div style="margin-top:1em;text-align:center"><a href="'+lk+'"'+(target?' target="'+target+'"':'')+' onclick="document.getElementById(\'ex_dis\').style.display=\'none\';">Continue</a>&#160;&#160;<a href="#" onclick="document.getElementById(\'ex_dis\').style.display=\'none\'; return false;">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display="block";
	scrollTo(0,0);
}
	   
function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

function showWin(page){
	var pWidth = ((parseInt(screen.width) - 500) / 2)
	var pHeight = ((parseInt(screen.height) - 500) / 2)
        window.open(homedir + page,'', "width=500,height=500,left=" + pWidth + ",top=" + pHeight + ",resizable=1,scrollbars=1");
      	self.name='hello'
}

