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="../images/"
sitedir="http://www.alamosastatebank.com/site/"
securedir="../site/"
homedir="http://www.alamosastatebank.com/"
}
else if(window.loginpage)
{
imgdir="https://www.alamosastatebank.com/images/"
sitedir="https://www.alamosastatebank.com/site/"
securedir="https://www.alamosastatebank.com/site/"
homedir="https://www.alamosastatebank.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";
aboutus_on = new Image(122,25);
aboutus_on.src = imgdir + "nav-aboutus-on.gif";

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

contactus_on = new Image(105,25);
contactus_on.src = imgdir + "nav-contactus-on.gif";

contactus_off = new Image(105,25);
contactus_off.src = imgdir + "nav-contactus-off.gif";

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

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

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

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

login_on = new Image(78,38);
login_on.src = imgdir + "nav-login-on.gif";

login_off = new Image(78,38);
login_off.src = imgdir + "nav-login-off.gif";

demo_on = new Image(78,38);
demo_on.src = imgdir + "nav-demo-on.gif";

demo_off = new Image(78,38);
demo_off.src = imgdir + "nav-demo-off.gif";

internetbanking_on = new Image(171,25);
internetbanking_on.src = imgdir + "nav-internetbanking-on.gif";

internetbanking_off = new Image(171,25);
internetbanking_off.src = imgdir + "nav-internetbanking-off.gif";

businessbanking_on = new Image(171,25);
businessbanking_on.src = imgdir + "nav-businessbanking-on.gif";

businessbanking_off = new Image(171,25);
businessbanking_off.src = imgdir + "nav-businessbanking-off.gif";

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

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

calculators_on = new Image(171,25);
calculators_on.src = imgdir + "nav-calculators-on.gif";

calculators_off = new Image(171,25);
calculators_off.src = imgdir + "nav-calculators-off.gif";

visa_on = new Image(146,19);
visa_on.src = imgdir + "nav-visa-on.gif";

visa_off = new Image(146,19);
visa_off.src = imgdir + "nav-visa-off.gif";


checking_off = new Image(146,19);
checking_off.src = imgdir + "nav-checking-off.gif";

checking_on = new Image(146,19);
checking_on.src = imgdir + "nav-checking-on.gif";

onlinedemo_off = new Image(146,19);
onlinedemo_off.src = imgdir + "nav-onlinedemo-off.gif";

onlinedemo_on = new Image(146,19);
onlinedemo_on.src = imgdir + "nav-onlinedemo-on.gif";

apply_off = new Image(81,19);
apply_off.src = imgdir + "nav-apply-off.gif";

apply_on = new Image(81,19);
apply_on.src = imgdir + "nav-apply-on.gif";

submit_off = new Image(89,19);
submit_off.src = imgdir + "nav-submit-off.gif";

submit_on = new Image(146,19);
submit_on.src = imgdir + "nav-submit-on.gif";

clear_off = new Image(75,19);
clear_off.src = imgdir + "nav-clear-off.gif";

clear_on = new Image(75,19);
clear_on.src = imgdir + "nav-clear-on.gif";

moreinfo_off = new Image(103,19);
moreinfo_off.src = imgdir + "nav-moreinfo-off.gif";

moreinfo_on = new Image(146,19);
moreinfo_on.src = imgdir + "nav-moreinfo-on.gif";

loginbutton_off = new Image(79,19);
loginbutton_off.src = imgdir + "nav-loginbutton-off.gif";

loginbutton_on = new Image(79,19);
loginbutton_on.src = imgdir + "nav-loginbutton-on.gif";

top_off = new Image(116,19);
top_off.src = imgdir + "nav-top-off.gif";

top_on = new Image(116,19);
top_on.src = imgdir + "nav-top-on.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.open('text/html','replace');
document.write('<scr'+ 'ipt language="JavaScript" type="text/javascript" src="' + securedir + '_styles.js"></scr' + 'ipt>');
document.write('<scr'+ 'ipt language="JavaScript" type="text/javascript" src="' + securedir + '_include.js"></scr' + 'ipt>');
document.close();

function open_apps(nameofapp)
{
	self.location.href='https://www.alamosastatebank.com/Forms/OnlineForm.cgi?form=' + nameofapp
}

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

function openIB(demo){
	if(!demo){
		document.location.href = ("https://www.alamosastatebank.com/onlineserv/HB/Signon.cgi");
	}
	else{
		document.location.href = ("https://www.alamosastatebank.com/onlineserv/HB/demo.html");
	}
}

function openBB(){
	if(!demo){
		document.location.href = ("https://www.alamosastatebank.com/onlineserv/CM/");
	}
	else{
		document.location.href = ("https://www.alamosastatebank.com/onlineserv/CM/");
	}
}
/*function openIB(demo){
	if(!demo){
		window.open("https://www.alamosastatebank.com/onlineserv/HB/Signon.cgi");
	}
	else{
		window.open("https://www.alamosastatebank.com/onlineserv/HB/demo.html");
	}
}*/

 function showWarning(url){
	//content creation
	var content = new Array();
        var index = 0;
	if(url == "FDIC_TLGP") {
	content[index++] = 'Alamosa State Bank is participating in the FDIC\'s Transaction Account Guarantee Program.  Under that program, through June 30,2010, all noninterest-bearing transaction accounts are fully guaranteed by the FDIC for the entire amount in the account.  Coverage under the Transaction Account Guarantee Program is in addition to and separate from the coverage available under the FDIC\'s general deposit insurance rules.<br /><br />';
	content[index++] = 'The FDIC has provided that NOW accounts with interest rates no higher than 0.50% are considered noninterest-bearing transaction accounts.  Alamosa State Bank does offer NOW accounts paying an interest rate higher than 0.50% that do not qualify as a noninterest-bearing transaction account and are not eligible for the guarantee.  Please contact a bank customer service representative if further clarification is needed on this situation.';
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Close</a></div></div>';
	}
	else {
	content[index++] = '<span class="header">Third Party Site Disclaimer</span><br />By accessing the noted link you will be leaving your financial institution\'s website and entering a website hosted by another party. Your financial institution 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 your financial institution\'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 your financial institution\'s.';
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+url+'" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&nbsp;&nbsp;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Decline</a></div></div>';
	}
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0); //used to make sure that the end user sees the disclaimer.

}


function checkSize()
{
    var width = 800; // Default window width is 800px

    if ( typeof(window.innerWidth) == 'number' ) { width = window.innerWidth; } //Non-IE
    else if ( document.documentElement && ( document.documentElement.clientWidth ) ) { width = document.documentElement.clientWidth; } //IE 6+ in 'standards compliant mode'
    else if ( document.body && ( document.body.clientWidth ) ) { width = document.body.clientWidth; } //IE 4 compatible

    return width;
}

document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:125px; left:' + (parseInt(checkSize()/2)-175) + 'px; border: thin solid #98172f; padding: 15px; display: none; z-index: 100000; width:350px; overflow: hidden;"></div>');
