if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;



/*
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
*/

//if you are on homepage you need <script> var homepage = "yes";</script> to make codework properly

var imgdir;
var sitedir;
var securedir;
var homedir;

if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.calc_page)
{
imgdir="../images/"
sitedir="../site/"
securedir="../site/"
homedir="../"
}
else if(window.securepage)
{
imgdir="https://www.gatewaycb.com/images/"
sitedir="http://www.gatewaycb.com/site/"
securedir="https://www.gatewaycb.com/site/"
homedir="http://www.gatewaycb.com/"
}
else
{
imgdir="../images/";
sitedir="";
securedir="";
homedir="../";
}


// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW
// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW
// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW


browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (((browserName == "Netscape") && (browserVer >= 3)) || ((browserName =="Microsoft Internet Explorer") && (browserVer >= 4)))
{
version = "ok";

olblogin_on = new Image(110,19);
olblogin_on.src = imgdir + "nav-olblogin-on.gif";

olblogin_off = new Image(110,19);
olblogin_off.src = imgdir + "nav-olblogin-off.gif";

aboutus_on = new Image(262,33);
aboutus_on.src = imgdir + "nav-aboutus-on.gif";

aboutus_off = new Image(262,33);
aboutus_off.src = imgdir + "nav-aboutus-off.gif";

pcbanking_on = new Image(262,24);
pcbanking_on.src = imgdir + "nav-onlinebanking-on.gif";

pcbanking_off = new Image(262,24);
pcbanking_off.src = imgdir + "nav-onlinebanking-off.gif";


/*pcbanking_on = new Image(262,24);
pcbanking_on.src = imgdir + "nav-pcbanking-on.gif";

pcbanking_off = new Image(262,24);
pcbanking_off.src = imgdir + "nav-pcbanking-off.gif";*/


personal_on = new Image(262,24);
personal_on.src = imgdir + "nav-personal-on.gif";

personal_off = new Image(262,24);
personal_off.src = imgdir + "nav-personal-off.gif";

business_on = new Image(262,24);
business_on.src = imgdir + "nav-business-on.gif";

business_off = new Image(262,24);
business_off.src = imgdir + "nav-business-off.gif";

ss_on = new Image(262,24);
ss_on.src = imgdir + "nav-ss-on.gif";

ss_off = new Image(262,24);
ss_off.src = imgdir + "nav-ss-off.gif";

rates_on = new Image(262,24);
rates_on.src = imgdir + "nav-rates-on.gif";

rates_off = new Image(262,24);
rates_off.src = imgdir + "nav-rates-off.gif";

financialproducts_on = new Image(262,24);
financialproducts_on.src = imgdir + "nav-financialproducts-on.gif";

financialproducts_off = new Image(262,24);
financialproducts_off.src = imgdir + "nav-financialproducts-off.gif";

help_on = new Image(262,24);
help_on.src = imgdir + "nav-help-on.gif";

help_off = new Image(262,24);
help_off.src = imgdir + "nav-help-off.gif";

home_on = new Image(262,24);
home_on.src = imgdir + "nav-home-on.gif";

home_off = new Image(262,24);
home_off.src = imgdir + "nav-home-off.gif";
}
else
version = "x";

function img_act(imgName)
{
if (version == "ok")
{
imgOn = eval(imgName + "_on.src");
document [imgName].src = imgOn;
}
}

function img_inact(imgName)
{
window.status = "";
 if (version == "ok")
{
imgOff = eval(imgName + "_off.src");
document [imgName].src = imgOff;
}
}

// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE
// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE
// ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE ROLLOVER CODE ABOVE

//style sheet sniffer
document.write('<scr'+ 'ipt language="JavaScript" type="text/javascript" src="' + securedir + '_styles.js"></scr' + 'ipt>');

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.gatewaycb.com/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

function open_link(url){
	window.open(url);
}

function openIB(demo){
	if(!demo){
		window.open("https://www.gatewaycb.com/onlineserv/HB/Signon.cgi");
	}
	else{
		window.open("https://www.gatewaycb.com/onlineserv/HB/demo.html");
	}
}

function IBAlert() {
	
	alert ('Please try again later, we are upating our site');
}

function open_pdf(pdf){
	window.open(pdf,'sample','width=600,height=600,resizable,scrollbars');
}

function open_worksheet(type){
	if(type=="business"){
		var app = sitedir+"New_Business_Account_Worksheet.doc"
	}
	else{
		var app = sitedir+"New_Personal_Account_Worksheet.doc"
	}
	var index = 0;
	var instructions=new Array();
	instructions[index++]='<html><head><title>Instructions</title>';
	instructions[index++]='<scr'+'ipt language="JavaScript" src="_styles.js"></scr'+'ipt>';
	instructions[index++]='<scr'+'ipt>';
	instructions[index++]='function openDoc(){';
	instructions[index++]='	window.open("'+app+'");';
	instructions[index++]='	self.close();';
	instructions[index++]='}';
	instructions[index++]='setTimeout("openDoc()",10000);';
	instructions[index++]='</scr'+'ipt>';
	instructions[index++]='</head><body bgcolor="#FFFFFF" text="#000000" link="#0000FF" alink="#0066FF" vlink="#000099" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">';
	instructions[index++]='<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="3" align="center"><tr><td bgcolor="#e7c300"><table width="100%"><tr><td width="100%" height="100%" bgcolor="#FFFFFF" class="ficontent"><strong>To make opening your new Gateway Community Bank personal or business bank account faster and more efficient, please print this New Account Worksheet and complete it.  You can either bring it with you or fax it to us at 815-623-5243.</strong>';
	instructions[index++]='<br><br><div align="center" class="disclaimer"><a href="javascript:openDoc();" class="disclaimer">Close Window</a></div>';
	instructions[index++]='</td></tr></table></td></tr></table>';
	instructions[index++]='</body></html>';
	
	var pWidth = ( ((parseInt(screen.width) / 2))- 350/2)
	var pHeight = (((parseInt(screen.height) / 2)) - 100)
	
	var mywindow =  window.open('','work',"width=350,height=150,top=" + pHeight + ",left=" + pWidth);
	mywindow.document.open("text/html","replace");
	mywindow.document.write(instructions.join(""));
	mywindow.document.close();

	return;
	

}

// TPD begins here ------------------------------------------------------
function show_warning(URL)
{

	//page variables
	var page_bgcolor="#EFEFF7";
	var border_color="#5271AD";
	var table_bgcolor="#EFEFF7";
	var time_visible=30000; //automatically closes after this time

	//content creation
	var content=""
	content+='<html>';
	content+='<head>';
	content+='<title>3rd Party Disclaimer</title>';
	content+='</head>';
	content+='<body style="background-color: #00777C; " onload=javascript:setTimeout(\'self.close()\','  + time_visible + ')>';
	content+='<table bgcolor="' + border_color + '" align="center" width="300" cellspacing="2" cellpadding="0" border="0">';
	content+='	<tr>';
	content+='	    <td>';
	content+='		<table bgcolor="' + table_bgcolor +'" align="center" width="100%" cellspacing="1" cellpadding="6" border="0">';
	content+='			<tr>';
	content+='	    		<td><font face="Arial,Verdana,Helvetica" size="-1">You are now leaving the Gateway Community Bank website. We are not responsible for the content or the security of the site you are about to visit. By advancing to this website, you acknowledge that you have made the decision to due so and accept all responsibility for any outcome that may occur.';                            
	content+='				<br /><br />';
	//content+='				 <div align="center"><a href="'+URL+'" target="_blank" onClick="setTimeout(\'self.close()\',3000)"><img src="images/button_continue.gif" border="0" WIDTH="109" HEIGHT="28" alt="continue"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:self.close();"><img src="images/button_cancel.gif" border="0" WIDTH="109" HEIGHT="28" alt="cancel"></a></div>';
	content+='				 <div align="center"><a href="'+URL+'" target="_blank" onClick="setTimeout(\'self.close()\',3000)">I Accept</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:self.close();">I Decline</a></div>';	
	content+='				</td>';
	content+='			</tr>';
	content+='		</table>';
	content+='		</td>';
	content+='	</tr>';
	content+='</table>';
	content+='</body>';
	content+='</html>';

	//actual centering popup code
	outsideURL=URL;
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 340) / 2);
     newwin = window.open("","newwin", "width=340,height=300,left="+pWidth+",top="+pHeight+", scrollbars=0, resizable=1" );
 	newwin.document.open();
	newwin.document.write(content);
	newwin.document.close();
}	
