﻿<!--//--><![CDATA[//><!--
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

/*/ ONLINE BANKING CONFIG
function setAction() {
	var rtNum = "107006994";
	var x = document.forms.Remote;
	if (x.loginTo[0].checked) {
		x.action = 'https://www.fiservsa6.com/pbi_Pbi1961/pbi1961.asp?WCI=RemoteLogin&RT=107006994&LogonBy=connect3&PRMACCESS=Account&user=false'; 
	} else {
		x.nmUID.value = x.AccessID.value;
		x.nmRTN.value = rtNum;
		x.action = 'https://www.fiservsa4.com/ebc_ebc1961/EBC1961.ASP?WCI=Process&WCE=RemoteLogon&IRL=T&RT=107006994&MFA=2&user=false';
	}
}
function doLoginRefresh() {
	var x = document.forms.Remote;
	if (x.AccessIDVisible.value != "") {
		x.AccessID.value = x.AccessIDVisible.value;
		x.AccessIDVisible.value = "";
		setAction();
		return true;
	} else {
		alert("Please Enter a valid Access ID. Thank you!");
		x.AccessIDVisible.focus();
		return false;
	} 
}
*/
// POPUP WINDOW SCRIPT
function showpop(page, pagewidth, pageheight){
	var p = page;
	var w = pagewidth;
	var h = pageheight;
	var x = (screen.width - w) / 2;
	var y = (screen.height - h) / 2;

	window.open(''+p+'','','width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left='+x+',top='+y+'');
}

//<a href="javascript:showpop('page.html', '800', '600');">Link</a>


/*
Live Date Script - © Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 
100's more DHTML scripts, and Terms Of Use, 
visit http://www.dynamicdrive.com
*/


var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate=""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+""
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}
showTime = function() {
	goforit();
}
window.onload = showTime;





//CALCULATORS
/********************************************************/
function floor(number) {
	return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
}

function dosum() {
	var mi = document.temps.IR.value / 1200;
	var base = 1;
	var mbase = 1 + mi;
	for (i=0; i<document.temps.YR.value * 12; i++) {
		base = base * mbase
	}
	document.temps.PI.value = floor(document.temps.LA.value * mi / ( 1 - (1/base)))
	document.temps.MT.value = floor(document.temps.AT.value / 12)
	document.temps.MI.value = floor(document.temps.AI.value / 12)
	var dasum = document.temps.LA.value * mi / ( 1 - (1/base)) +
	document.temps.AT.value / 12 + 
	document.temps.AI.value / 12;
	document.temps.MP.value = floor(dasum);
}
function checkNumber(input, min, max, msg) {
	msg = msg + " field has invalid data: " + input.value;
    var str = input.value;
    for (var i = 0; i < str.length; i++) {
    	var ch = str.substring(i, i + 1)
		if ((ch < "0" || ch > "9") && ch != '.') {
			alert(msg);
			return false;
		}
	}
    var num = parseFloat(str)
    if (num < min || num > max)
        {   alert(msg + " not in the range " + min + " to " + max);
            return false;
        }
    input.value = str;
    return true;
}
function computeField(input)
    {   if (    input.value != null && input.value.length != 0    )
	          input.value = "" + eval(input.value);
        computeForm(input.form);
    }
function computeForm(form)
    {   if (   form.payments.value == null ||
                form.payments.value.length == 0 ||
                form.interest.value == null ||
                form.interest.value.length == 0 ||
                form.principal.value == null ||
                form.principal.value.length == 0  )
            return;
        if (   !checkNumber(form.principal, 100, 9999999, "Principal") ||
                !checkNumber(form.payments, 1, 480, "Number of Payments") ||
                !checkNumber(form.interest, .001, 99, "Interest")    )
            {   form.payment.value = "Invalid";    return;    }
        var i = form.interest.value;
        if (    i < 1    )
            {   i *= 100;    form.interest.value = i;    }
        i /= 1200;
        var pow = 1;
        for (var j = 0; j < form.payments.value; j++)
             pow = pow * (1 + i);
        monthly = (form.principal.value * pow * i) / (pow - 1)
        form.payment.value = Math.ceil(100 * monthly)/100
    }
function clearForm(form)
    {   form.principal.value = "";
        form.payments.value = "";
        form.interest.value = "";
    }


///loadLink function

function loadLink(linkTo, wid, hei) {
	var load = window.open(linkTo,'','scrollbars=no,menubar=no,height='+hei+',width='+wid+',resizable=no,toolbar=no,location=no,status=no');
}

//leavingSite functions
function LeavingSiteEmail(url) {
	if(confirm("Notice: We understand that e-mail is a simple and cost effective method of communication, however items such as requests and inquiries needing immediate attention should not be sent via e-mail. Also, sensitive personal and account information like Account numbers, Social Security numbers, Passwords, or PIN numbers should not be sent by e-mail. Because an e-mail message that you send may not be immediately reviewed by a bank representative, you must contact the bank by telephone or in person for items needing immediate attention. E-mail messages do not serve as a sufficient means for any requirement imposed on you to provide written notice.\n\n" +
	
		"Press OK to continue.\n" +
				"Press CANCEL to return to the web page.\n\n" +
                                "Thank You.\n" +
				"")) {
	window.open(url, "_blank");
	}
	
}
