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

if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

// CALL TO CORRECT DIRECTORY BELOW
var imgdir = "../images/";
var sitedir = "";
var securedir = "";
var homedir = "../";
if(window.homepage)
{
imgdir="images/";
sitedir="http://www.bsnb.com/site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.bsnb.com/images/"
sitedir="http://www.bsnb.com/site/"
securedir="http://www.bsnb.com/site/"
homedir="http://www.bsnb.com/"
}
else if(window.securepage)
{
imgdir="https://www.bsnb.com/images/"
sitedir="http://www.bsnb.com/site/"
securedir="https://www.bsnb.com/site/"
homedir="http://www.bsnb.com/"
}
// CALL TO CORRECT DIRECTORY ABOVE

// ROLLOVER CODE BELOW
function makeNavImage(name,width,height){
this.name_on="nav-" + name +"-on.gif";
this.name_off="nav-" + name +"-off.gif";
this.width=width;
this.height=height;
this.newimage_on = new Image(width,height);
this.newimage_on.src = imgdir + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = imgdir + this.name_off;
}

var nav_widths=190;
var nav_heights=22;

var navitems = new Array();
navitems["locations"] = new makeNavImage("locations",64,21);
navitems["contact"] = new makeNavImage("contact",70,21);
navitems["about"] = new makeNavImage("about",77,21);
navitems["online_forms"] = new makeNavImage("online_forms",46,21);
navitems["siteindex"] = new makeNavImage("siteindex",67,21);
navitems["home"] = new makeNavImage("home",nav_widths,nav_heights);
navitems["convenience"] = new makeNavImage("convenience",nav_widths,nav_heights);
navitems["personal"] = new makeNavImage("personal",nav_widths,nav_heights);
navitems["business"] = new makeNavImage("business",nav_widths,nav_heights);
navitems["trust"] = new makeNavImage("trust",nav_widths,nav_heights);
navitems["investments"] = new makeNavImage("investments",nav_widths,nav_heights);
navitems["rates"] = new makeNavImage("rates",nav_widths,nav_heights);

function img_act(imgName){
document[imgName].src = navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
document[imgName].src = navitems[imgName].newimage_off.src;
}
// 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)?"toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1":(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 open_apps(nameofapp){
self.location.href = "https://www.bsnb.com/Forms/OnlineForm.cgi?onweb=true&form=" + nameofapp;
}

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

    else if(type == "demo"){
self.location.href="../index.html?demo";
}
    
  else if(type == "security"){
window.open("https://www.bsnb.com/onlineserv/HB/security_site/","_blank","width=650,height=600,scrollbars=1,resizable=1,status=1");
        return;
}

  else if(type == "register"){
self.location.href="https://www.bsnb.com/site/online_banking_agreement.html";
}


    else{
self.location.href="https://www.bsnb.com/onlineserv/HB/Signon.cgi";
}
}


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

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


    else{
self.location.href="https://www.bsnb.com/onlineserv/CM/";
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function showWarning(url){
var content = new Array();
var index = 0;
content[index++] = "<h2>Third Party Site Disclaimer</h2>You are leaving BSNB.com and entering an unaffiliated third party web site.  BSNB is providing this link for your convenience and does not assume responsibility for the content, links or policies (privacy, security or otherwise)  of this web site.";
content[index++] = "<br /><br /><br />";
content[index++] = "<div align=\"center\"><a href=\"javascript:void('0');\" onclick=\"window.open('"+url+"');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);
}

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: left; position:absolute; top:125px; left:300px; border: thin solid #1A448E; padding: 15px; display: none; z-index: 3000; width:350px;"></div>');
// OTHER FUNCTIONS ABOVE 


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




//////////////////////////////////        ::        Rotating Banner Images    ::          //////////////////////////////////

var Random_business = new Array() 

Random_business[0] = '../images/promo-business1.jpg'
Random_business[1] = '../images/promo-business2.jpg'
Random_business[2] = '../images/promo-business3.jpg'
Random_business[3] = '../images/promo-business4.jpg'

var j_business = 0
var p_business = Random_business.length;
var preBuffer = new Array()
for (i = 0; i < p_business; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = Random_business[i]
}
var whichImage_business = Math.round(Math.random()*(p_business-1));

function show_business(){
document.write('<img src="'+Random_business[whichImage_business]+'" width="327" height="126" alt="" />');
}

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

var Random_personal = new Array() 

Random_personal[0] = '../images/promo-personal1.jpg'
Random_personal[1] = '../images/promo-personal2.jpg'
Random_personal[2] = '../images/promo-personal3.jpg'
Random_personal[3] = '../images/promo-personal4.jpg'
Random_personal[4] = '../images/promo-personal-borrow1.jpg'
Random_personal[5] = '../images/promo-personal-borrow2.jpg'
Random_personal[6] = '../images/promo-personal-borrow3.jpg'


var j_personal = 0
var p_personal = Random_personal.length;
var preBuffer = new Array()
for (i = 0; i < p_personal; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = Random_personal[i]
}
var whichImage_personal = Math.round(Math.random()*(p_personal-1));

function show_personal(){
document.write('<img src="'+Random_personal[whichImage_personal]+'" width="327" height="126" alt="" />');
}

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

var Random_other = new Array() 

Random_other[0] = '../images/promo-other1.jpg'
Random_other[1] = '../images/promo-other2.jpg'
Random_other[2] = '../images/promo-other3.jpg'

var j_other = 0
var p_other = Random_other.length;
var preBuffer = new Array()
for (i = 0; i < p_other; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = Random_other[i]
}
var whichImage_other = Math.round(Math.random()*(p_other-1));

function show_other(){
document.write('<img src="'+Random_other[whichImage_other]+'" width="327" height="126" alt="" />');
}


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

var Random_trust = new Array() 

Random_trust[0] = '../images/promo-trust1.jpg'
Random_trust[1] = '../images/promo-trust2.jpg'
Random_trust[2] = '../images/promo-trust3.jpg'
Random_trust[3] = '../images/promo-trust4.jpg'

var j_trust = 0
var p_trust = Random_trust.length;
var preBuffer = new Array()
for (i = 0; i < p_trust; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = Random_trust[i]
}
var whichImage_trust = Math.round(Math.random()*(p_trust-1));

function show_trust(){
document.write('<img src="'+Random_trust[whichImage_trust]+'" width="327" height="126" alt="" />');

}

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

function getClockTime()
				{
   					var now    = new Date();
   					var hour   = now.getHours();
   					var minute = now.getMinutes();
   					var second = now.getSeconds();
   					var ap = "am";
   					if (hour   > 11) { ap = "pm";             }
 					  if (hour   > 12) { hour = hour - 12;      }
  		   		if (hour   == 0) { hour = 12;             }
 					  if (hour   < 10) { hour   = "0" + hour;   }
            if (minute < 10) { minute = "0" + minute; }
  				  if (second < 10) { second = "0" + second; }
    			  var timeString = hour + 
                    ':' + 
                    minute 
										+ 
                    " " + 
                    ap;
  				 return timeString;
					} 
				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");
				var total = new Date;
				var clockTime = getClockTime();
				
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
				

