// javascript

/***********************************************
* Amazon style Drop-in content box- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* Go to http://www.dynamicdrive.com/ for full source code
***********************************************/

var dropboxleft=250 //set left position of box (in px)
var dropboxtop=100 //set top position of box (in px)
var dropspeed=15 //set speed of drop animation (larger=faster)

//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.

var displaymode="always"

///Don't edit beyond here///////////

if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
var ie=document.all
var dom=document.getElementById

function initboxv2() {
	if (!dom&&!ie)
	return
	crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover
	crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	crossbox.height=crossbox.offsetHeight
	crossboxcover.style.height=parseInt(crossbox.height)+"px"
	crossbox.style.top=crossbox.height*(-1)+"px"
	crossboxcover.style.left=dropboxleft+"px"
	crossboxcover.style.top=dropboxtop+"px"
	crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
	dropstart=setInterval("dropinv2()",50)
	}

function dropinv2() {
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	if (parseInt(crossbox.style.top)<0){
		crossboxcover.style.top=scroll_top+dropboxtop+"px"
		crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
		}
	else {
		clearInterval(dropstart)
		crossbox.style.top=0
		}
	}

function dismissboxv2(){
	if (window.dropstart) clearInterval(dropstart)
	crossboxcover.style.visibility="hidden"
	}

function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}


<!--

function disclaim(goHere){
  message  = "Oakland Deposit Bank has no control over information at any site hyperlinked\n";
  message += "from this Site. Oakland Deposit Bank makes no representation concerning\n";
  message += "and is not responsible for the quality, content, nature, or reliability\n";
  message += "of any hyperlinked site and is providing this hyperlink to you only as a\n";
  message += "convenience. The inclusion of any hyperlink does not imply any endorsement,\n";
  message += "investigation, verification or monitoring by Oakland Deposit Bank of any\n";
  message += "information in any hyperlinked site. In no event shall Oakland Deposit Bank\n";
  message += "be responsible for your use of a hyperlinked site.";
  
  if (confirm(message)){
	window.open(goHere, '_blank');
	}
}


function disclaim2(mailto_address){
  	message  = "Notice: Because there is a small risk that information transmitted\n";
  	message += "via Internet email could fall into the wrong hands, we suggest that\n";
  	message += "confidential information, such as account numbers or social security\n";
  	message += "numbers, not be transmitted via email. Instead, please contact us\n";
  	message += "directly at your nearest bank branch. Thank you.";
  
  	alert(message);
  	window.open('mailto:' + mailto_address);
	}

function disclaim3(goHere){
  message  = "The mortgage division of Oakland Deposit Bank has been purchased by and transferred to Peoples State Bank of Commerce.";
  
  if (confirm(message)){
	window.open(goHere, '_blank');
	}
}


// Function to check to see if the cookie exists
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  	var dc = document.cookie;
  	var prefix = name + "=";
  	var begin = dc.indexOf("; " + prefix);
  	if (begin == -1) {
    	begin = dc.indexOf(prefix);
    	if (begin != 0) return null;
  		} 
  	else begin += 2;
  
  	var end = document.cookie.indexOf(";", begin);
  	if (end == -1) end = dc.length;
  	return unescape(dc.substring(begin + prefix.length, end));
	}

// fixdate function
// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  	var base = new Date(0);
  	var skew = base.getTime();
  	if (skew > 0)
    date.setTime(date.getTime() - skew);
	}

// function to pop up the disclosure page.
function showdisclosurepage() {
	window.open('default_disclosure_pop.asp','Ad','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=300,height=230');
	}

// create an instance of the Date object
var now = new Date();
// fix the bug in Navigator 2.0, Macintosh
fixDate(now);
// cookie expires in one year (actually, 365 days)
// 365 days in a year
// 24 hours in a day
// 60 minutes in an hour
// 60 seconds in a minute
// 1000 milliseconds in a second
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
var visits = getCookie("DiscloseCookie");
// if the cookie wasn't found, then the user hasn't clicked the "Do not show this again" button.
if (!visits) showdisclosurepage()

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
