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

//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.absolute)
{
imgdir="http://www.uibankonline.com/images/"
sitedir="http://www.uibankonline.com/site/"
securedir="http://www.uibankonline.com/site/"
homedir="http://www.uibankonline.com/"
}
else if(window.secure)
{
imgdir="https://www.uibankonline.com/images/"
sitedir="http://www.uibankonline.com/site/"
securedir="https://www.uibankonline.com/site/"
homedir="http://www.uibankonline.com/"
}
//CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
// 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)?o:(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 showCalc(calc){
openWin(calc,"calc",550,480,"resizable=1,scrollbars=1");
}

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



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function openIB(type){
    if(type == ""){
self.location.href="https://www.uibankonline.com/onlineserv/HB/Signon.cgi";
}

    else if(type == "demo"){
self.location.href="https://www.uibankonline.com/onlineserv/HB/demo.html";
}
    else{
self.location.href="https://www.uibankonline.com/onlineserv/HB/Signon.cgi";
}
}



function openCM(type){
    if(type == ""){
self.location.href="https://www.uibankonline.com/onlineserv/CM/";
}

    else if(type == "demo"){
self.location.href="http://www.cmdemo.com/customer_demo/index.html";
}
    else{
self.location.href="https://www.uibankonline.com/onlineserv/CM/";
}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


 function showWarning(url){
	//content creation
	var content = new Array();
        var index = 0;
	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+'">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); //used to make sure that the end user sees the disclaimer.

}
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: center; position:absolute; margin:25% 25%; border: thin solid #E3E3A9; padding: 15px; visibility: hidden;z-index: 300; width:350px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=E0E0CA,offX=7,offY=8,positive=true); "></div>');


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function headerPic(sect)

{


if(sect == "about"){
document.write('<img src="../images/hed-aboutus.gif" width="200" height="27" alt="About Us" />');
}

else if(sect == "app"){
document.write('<img src="../images/hed-applications.gif" width="200" height="27" alt="Applications" />');
}

else if(sect == "calc"){
document.write('<img src="../images/hed-calculators.gif" width="200" height="27" alt="Calculators" />');
}

else if(sect == "deposit"){
document.write('<img src="../images/hed-deposit.gif" width="200" height="27" alt="Deposit Products" />');
}

else if(sect == "faqs"){
document.write('<img src="../images/hed-faqs.gif" width="200" height="27" alt="FAQs" />');
}

else if(sect == "loan"){
document.write('<img src="../images/hed-loanproducts.gif" width="200" height="27" alt="Loan Products" />');
}

else if(sect == "other"){
document.write('<img src="../images/hed-otherservices.gif" width="200" height="27" alt="Other Services" />');
}

else if(sect == "security"){
document.write('<img src="../images/hed-security.gif" width="200" height="27" alt="Security" />');
}

else if(sect == "disclosure"){
document.write('<img src="../images/hed-disclosure.gif" width="200" height="27" alt="Disclosure" />');
}

else if(sect == "privacy"){
document.write('<img src="../images/hed-privacy.gif" width="200" height="27" alt="Privacy" />');
}

else if(sect == "rates"){
document.write('<img src="../images/hed-rates.gif" width="200" height="27" alt="Rates" />');
}

else if(sect == "home"){
document.write('<img src="images/hed-welcome.gif" width="81" height="27" alt="Welcome" />');
}

else{
document.write('<img src="../images/hed-welcome.gif" width="81" height="27" alt="welcome" />');
}

}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


 function showAppDisclaimer(URL)
 
 {
	//content creation
	var content = new Array();
        var index = 0;
	content[index++] = '<div align=\"left\"><strong>Dear Customer:</strong> <br />Insurance products such as Credit Life, Credit Life and Disability and Involuntary Unemployment are not a deposit nor are they insured or guaranteed by the FDIC, Utah Independent Bank, or an Agency of the Federal Government. Utah Independent Bank may not condition your extension of credit on either: your purchase of an insurance product from us, your agreement not to obtain insurance from an unaffiliated entity , or a prohibition on your obtaining insurance from an unaffiliated entity.</div>';
	content[index++] = '<br><br><br>';
	content[index++] = '<div align="center"><a href="'+URL+'">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); //used to make sure that the end user sees the disclaimer.
	}
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: center; position:absolute; margin:25% 25%; border: thin solid #E3E3A9; padding: 15px; visibility: hidden;z-index: 300; width:350px; FILTER: progid:DXImageTransform.Microsoft.dropShadow( Color=E0E0CA,offX=7,offY=8,positive=true); "></div>');


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

