
function stopError() {
  return true;
}
window.onerror = stopError;

/*
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.loginpage)
{
imgdir="/images/"
sitedir="http://www.stateinvestors.com/site/"
securedir="/site/"
homedir="http://www.stateinvestors.com/"
}
else if(window.calcpage)
{
imgdir="../images/"
sitedir="../site/"
securedir="../site/"
homedir="../"
}
else if(window.securepage)
{
imgdir="https://www.stateinvestors.com/images/"
sitedir="https://www.stateinvestors.com/site/"
securedir="https://www.stateinvestors.com/site/"
homedir="https://www.stateinvestors.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";
home_on = new Image(162,25);
home_on.src = imgdir + "nav-home-on.gif";

home_off = new Image(162,25);
home_off.src = imgdir + "nav-home-off.gif";

olb_on = new Image(162,25);
olb_on.src = imgdir + "nav-olb-on.gif";

olb_off = new Image(162,25);
olb_off.src = imgdir + "nav-olb-off.gif";

products_on = new Image(162,25);
products_on.src = imgdir + "nav-products-on.gif";

products_off = new Image(162,25);
products_off.src = imgdir + "nav-products-off.gif";

otherservices_on = new Image(162,25);
otherservices_on.src = imgdir + "nav-otherservices-on.gif";

otherservices_off = new Image(162,25);
otherservices_off.src = imgdir + "nav-otherservices-off.gif";

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

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

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

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

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

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

}
else
version = "x";

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

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

// 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 src="' + securedir + '_styles.js" type="text/javascript"></scr' + 'ipt>');

function showCalc(calc)
{
/*var pWidth = ( ((parseInt(screen.width) / 2)) - 275)
var pHeight = (((parseInt(screen.height) / 2)) -240)
window.open(calc,"hello","width=550,height=480,left=" + pWidth + ",top=" + pHeight + ",resizable=1,scrollbars=1");
*/
	self.location.href = sitedir + calc;
	return;
}

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.stateinvestors.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");
}

day = new Array("Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday");
month = new Array("January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , " November" , "December");
total = new Date();

function getWorksheet(){

	//page variables
	var page_bgcolor="#BDCBBD";
	var border_color="#31594A";
	var table_bgcolor="#FFFFFF";
	var time_visible=30000; //automatically closes after this time

	//content creation
	var content=""
	content+='<html>';
	content+='<head>';
	content+='<title>New Account Worksheet</title></title>';
	content+='</head>';
	content+='<body bgcolor="' + page_bgcolor + '">';
	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="1" border="0">';
	content+='			<tr>';
	content+='	    		<td><font face="Arial,Verdana,Helvetica" size="-1">To make opening your new 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 504.832.9408.';                            
	content+='<br>';
	content+='<br>';
	content+='				 <div align="center"><a href="https://www.stateinvestors.com/pdf/worksheet.pdf" target="_blank" onClick="setTimeout(\'self.close()\',3000)">Close Window</a></div>';
	content+='				</td>';
	content+='			</tr>';
	content+='		</table>';
	content+='		</td>';
	content+='	</tr>';
	content+='</table>';
	content+='</body>';
	content+='</html>';

	//actual centering popup code
	var pWidth = ((parseInt(screen.width) - 340) / 2); 
	var pHeight = ((parseInt(screen.height) - 340) / 2);
    newwin = window.open("","newwin", "width=340,height=140,left="+pWidth+",top="+pHeight+", scrollbars=0");
 	newwin.document.open("text/html","replace");
	newwin.document.write(content);
	newwin.document.close();
	return
}	

function openIB(app){
	if(app == 'reg'){
		self.location.href = "https://www.stateinvestors.com/onlineserv/HB/STDReg.cgi";
	}
	else if(app == 'demo'){
		self.location.href = "https://www.stateinvestors.com/onlineserv/HB/demo.html";
	}
	else{
		self.location.href = "https://www.stateinvestors.com/onlineserv/HB/Signon.cgi"
		
	}
	
}

function openlink(newsite){
	var newwin = window.open(newsite,'newwin');
	return;
}

//ip : 208.2.188.39
