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="site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.cornerstonenb.com/images/"
sitedir="http://www.cornerstonenb.com/site/"
securedir="http://www.cornerstonenb.com/site/"
homedir="http://www.cornerstonenb.com/"
}
else if(window.securepage)
{
imgdir="https://www.cornerstonenb.com/images/"
sitedir="http://www.cornerstonenb.com/site/"
securedir="https://www.cornerstonenb.com/site/"
homedir="http://www.cornerstonenb.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 navitems = new Array();
navitems["home"] = new makeNavImage("home",40,12);
navitems["help"] = new makeNavImage("help",41,12);
navitems["privacy"] = new makeNavImage("privacy",56,12);
navitems["security"] = new makeNavImage("security",59,12);
navitems["disclosure"] = new makeNavImage("disclosure",63,12);
navitems["bank"] = new makeNavImage("bank",135,27);
navitems["personal"] = new makeNavImage("personal",135,27);
navitems["interest"] = new makeNavImage("interest",135,27);
navitems["business"] = new makeNavImage("business",135,27);
navitems["wealth"] = new makeNavImage("wealth",135,27);
navitems["resource"] = new makeNavImage("resource",135,27);
navitems["community"] = new makeNavImage("community",135,27);
navitems["financial"] = new makeNavImage("financial",135,27);
navitems["contact"] = new makeNavImage("contact",135,27);
navitems["one"] = new makeNavImage("1",10,15);
navitems["two"] = new makeNavImage("2",19,15);
navitems["three"] = new makeNavImage("3",16,15);

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 openPdf(url){
aWindow = window.open(url, "_blank");
}

function showCalc(calc){
openWin(calc,"calc",550,480,"resizable=1,scrollbars=1");
}

function open_apps(nameofapp){
openWin("https://www.cornerstoneb.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");
}

  /****
  *useage: <a href="javascript:showWarning('http://www.hotmail.com');">Test Link</a>
  *
  *author:Erron Austin
  */
  function showWarning(url){
 //content creation
 var content = new Array();
        var index = 0;
 content[index++] = '<h2>Third Party Site Disclaimer</h2><p align="left">By accessing the noted link you will be leaving  Cornerstone National Bank &amp; Trust Company\'s website and entering a website hosted by another party. Cornerstone National Bank &amp; Trust Company 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 Cornerstone National Bank &amp; Trust Company\'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 Cornerstone National Bank &amp; Trust Company\'s.</p>';
 content[index++] = '<br>';
 content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="window.open(\''+url+'\');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);
 
}
document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: arial, verdana, sans-serif; font-size: 9pt; font-weight: normal; color: #000000; text-align: center; position:absolute; margin:10% 23% 10% 23%; border: thin solid #006634; padding: 15px; visibility: hidden;z-index: 400; width:400px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=#B19000,offX=7,offY=8,positive=true); "></div>');


// OTHER FUNCTIONS ABOVE


// INCLUDES

function makeFooter() {
	var footerArray = '';

	footerArray += '<div class="footer">\n';
	footerArray += '<img src="'+imgdir+'address.gif" width="366" height="30" alt="One West Northwest Highway | Palatine, IL 60067 847-654-3000 | Fax (847)934-3886 | Bank by Phone (877) 472-9287" style="margin-left: 135px; margin-right: 25px;" />\n';
	footerArray += '<a href="javascript:showWarning(\'http://www.hud.gov\');"><img src="'+imgdir+'ehl.gif" width="43" height="39" alt="Equal Housing Lender" border="0" /></a>\n';
	footerArray += '<a href="javascript:showWarning(\'http://www.fdic.gov\');"><img src="'+imgdir+'memberfdic.gif" width="62" height="38" alt="Member FDIC" border="0" /></a>\n';
	footerArray += '<a href="javascript:showWarning(\'http://www.diginsite.com\');"><!--[if lt IE 7]><script type="text/javascript" src="https://www.cornerstonenb.com/mstinc/web/js/png.js"></script><![endif]--><img src="https://www.cornerstonenb.com/mstinc/web/images/di_91x22_1c_w.png" width="91" height="22" border="0" alt="Digital Insight, an Intuit company" /></a>\n';
	footerArray += '</div>\n';
	footerArray += '<script type="text/javascript">\n';
	footerArray += 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");\n';
	footerArray += 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\'' ;
	footerArray += 'type=\'text/javascript\'%3E%3C/script%3E"));';
	footerArray += '</script>\n';
	footerArray += '<script type="text/javascript">\n';
	footerArray += 'try {\n';
	footerArray += 'var pageTracker = _gat._getTracker("UA-6350926-1");\n';
	footerArray += 'pageTracker._trackPageview();\n';
	footerArray += '} catch(err) {}</script>\n';

	document.write(footerArray);
}
