/* window.onresize=resize;
function resize(){
self.location.href=self.location.href;
} */

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

//201-11505 - store a different path for the sucess microsite
if(document.location.href.indexOf('sucess')>0){
	
}

// CALL TO CORRECT DIRECTORY BELOW
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.pnbdirectonline.com/images/"
sitedir="http://www.pnbdirectonline.com/site/"
securedir="http://www.pnbdirectonline.com/site/"
homedir="http://www.pnbdirectonline.com/"
}
else if(window.securepage)
{
imgdir="https://www.pnbdirectonline.com/images/"
sitedir="http://www.pnbdirectonline.com/site/"
securedir="https://www.pnbdirectonline.com/site/"
homedir="http://www.pnbdirectonline.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["aboutus"] = new makeNavImage("aboutus",75,25);
navitems["personal"] = new makeNavImage("personal",122,25);
navitems["business"] = new makeNavImage("business",123,25);
navitems["private"] = new makeNavImage("private",112,25);
navitems["otherserv"] = new makeNavImage("otherserv",108,25);
navitems["rates"] = new makeNavImage("rates",137,25);

navitems["wm"] = new makeNavImage("wm",138,13);
navitems["rm"] = new makeNavImage("rm",148,13);
navitems["cl"] = new makeNavImage("cl",131,13);
navitems["ts"] = new makeNavImage("ts",96,13);
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.pnbdirectonline.com/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

function openIB(page){
if (page=="demo") self.location.href = homedir+"index.html?demo";
else if (page == "reg") openWin('https://www.pnbdirectonline.com/onlineserv/HB/STDReg.cgi?STDRegStep1=yes&runmode=REGISTRATION', 'regWin', 800, 600, 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0');
else if (page == "resetPW") openWin('https://www.pnbdirectonline.com/onlineserv/HB/ForgottenPW.html', 'resetPWWin', 800, 600, 'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=0');
else self.location.href = homedir+"index.html";
//if (page=="demo") openWin("https://www.pnbdirectonline.com/onlineserv/HB/demo.html");
//else openWin("https://www.pnbdirectonline.com/onlineserv/HB/Signon.cgi")
}

function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>By accessing the noted link you will be leaving Patriot National Bank's website and entering a website hosted by another party. Patriot National Bank 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 Patriot National Bank'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 Patriot National Bank's.";
content[index++] = "<br /><br /><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);
}

function showEmailWarning(email){
	var content = new Array();
	var index = 0;
	content[index++] = "<h2>Email Security Warning</h2><p>E-mail messages sent over the Internet are not secure. Please do not include any account or personal information such as social security numbers in the message.</p>";
	content[index++] = "<br /><br /><br />";
	content[index++] = "<div align=\"center\"><a href=\"mailto:"+ email +"\" onclick=\"document.getElementById('ex_dis').style.visibility = 'hidden'\">Continue</a>  <a href=\"#\" 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 checkSize()
{
    var myWidth = 800;
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth ) )
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	}
	else if( document.body && ( document.body.clientWidth ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
    return myWidth;
}

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: left; position:absolute; top:125px; left:' + (parseInt(checkSize()/2)-175) + 'px; border: thin solid #1A448E; padding: 15px; visibility: hidden; z-index: 100000; width:350px;"></div>');

// ---------------------------------------------------------------------------------------

function onlineBankingInfoBox()
{
	document.write('<sel' + 'ect name="onlineBankingInfo" onchange="if (this.value != \'\') document.location.href = this.value;" style="margin-top: 12px; width: 147px;">');
	document.write('<option value="">Online Banking Info...</option>');
	document.write('<option value="javascript:alert(\'Coming Soon\');">Temp Option 1</option>');
	document.write('<option value="javascript:alert(\'Coming Soon\');">Temp Option 2</option>');
	document.write('<option value="javascript:alert(\'Coming Soon\');">Temp Option 3</option>');
	document.write('</sel' + 'ect>');
}


// added by Darnell
function wcInternalPopup(url, height, width){
	var wide = parseInt(width);
	var tall = parseInt(height);
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = (((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'internalpopup',features);
}
// added by Darnell
function openPDF(pdfpath, showWarning)
{
	wcInternalPopup(pdfpath, 580, 780);
} // openPDF()
// OTHER FUNCTIONS ABOVE


// added by Brandon
function makeFooter() {
	var footerArray = "";

	footerArray += '<table align="center" border="0" cellpadding="0" cellspacing="0" class="credits" width="740">\n';
	footerArray += '<tr class="black">\n';
	footerArray += '<td><img src="'+imgdir+'clear.gif" width="1" height="1" alt="" border="0" /></td>\n';
	footerArray += '</tr>\n';
	footerArray += '</table>\n';
	footerArray += '<table align="center" border="0" cellpadding="10" cellspacing="0" class="credits" width="740">\n';
	footerArray += '<tr style="vertical-align: top;">\n';
	//footerArray += '<td align="right"><img src="'+imgdir+'FDIC_StandardSize.gif" width="57" height="19" alt="" border="0" /></td>\n';
	footerArray += '<td align="right"><p style="font-size: 135%; font-weight: bold;line-height: 10px; margin-bottom:-9px;">MEMBER</p><p style="font-size: 250%;font-weight: bold;">FDIC</p></td>\n';
	footerArray += '<td>\n';
	footerArray += '<p align="center">\n';
	footerArray += 'Patriot National Bank | 900 Bedford Street, Stamford, CT 06901<br />\n';
	footerArray += 'Questions? Contact Our Customer Service Representatives <strong>1.800.762.7620</strong>\n';
	footerArray += '</p>\n';
	footerArray += '<p align="center">\n';
	footerArray += '<a href="./" class="creditnav">Home</a> |\n';
	footerArray += '<a href="'+sitedir+'about.html" class="creditnav">About Patriot National Bank</a> |\n';
	footerArray += '<a href="javascript:openPDF(\''+sitedir+'pdf/PatrSwitchKit.pdf\',true);" class="creditnav">Switch to Patriot Bank</a> |\n';
	footerArray += '<a href="'+sitedir+'personal.html" class="creditnav">Personal Banking</a> |\n';
	footerArray += '<a href="'+sitedir+'business.html" class="creditnav">Business Banking</a><br />\n';
	footerArray += '<a href="'+sitedir+'locations.html" class="creditnav">Locations</a> |\n';
	footerArray += '<a href="javascript:showWarning(\'http://www.snl.com/irweblinkx/BranchLocatorMap.aspx?IID=4053180\');" class="creditnav">Find the Branch Nearest You</a> |\n';
	footerArray += '<a href="'+sitedir+'calculators.html" class="creditnav">Calculators</a> |\n';
	footerArray += '<a href="'+sitedir+'careers.html" class="creditnav">Careers at Patriot</a> |\n';
	footerArray += '<a href="'+sitedir+'community.html" class="creditnav">Patriot In The Community</a> |\n';
	footerArray += '<a href="'+sitedir+'news.html" class="creditnav">Patriot In The News</a> |\n';
	footerArray += '<a href="'+sitedir+'PFSpatriotnationalbankPFS.pdf" class="creditnav">Printable Personal Financial Statement</a> |\n';
	footerArray += '<a href="javascript:showWarning(\'http://www.snl.com/irweblinkx/corporateprofile.aspx?iid=4053180\');" class="creditnav">For Investors</a> |\n';
	footerArray += '<a href="'+sitedir+'protection.html" class="creditnav">For Your Protection</a> |\n';
	footerArray += '<a href="'+sitedir+'usapatriotact.html" class="creditnav">USA Patriot Act Information</a> |\n';
	footerArray += '<a href="'+sitedir+'policy.html" class="creditnav">Privacy Policy</a> |\n';
	footerArray += '<a href="'+sitedir+'Forms/OnlineForm.cgi?form=how_are_we_doing&#38;onweb=true" class="creditnav">Tell Us How We Are Doing</a> |\n';
	footerArray += '<a href="'+sitedir+'map.html" class="creditnav">Site Map</a>\n';
	footerArray += '</p>\n';
	footerArray += '<p align="center">\n';
	footerArray += 'Copyright &copy; 2007 Patriot National Bank. All Rights Reserved<br />\n';
	footerArray += '</p></td>\n';
	footerArray += '<td><img src="'+imgdir+'equalhl.gif" width="41" height="38" alt="" border="0" /></td>\n';
	footerArray += '</tr>\n';
	footerArray += '</table>\n';

	document.write(footerArray);
}
