//-------------------------------------------------------------------   
//---------------------   Global Variables          ------------------
var count;
var gAmount;
var slashed = "no";
var iTimeoutID;
//-------------------------------------------------------------------   
//---------------------- Show Uvest Dynamically ---------------------
function showUvest () {
if ((myUvest=MM_findObj("uvest"))!=null) {
myUvest.style.display = "block";}
}
//-------------------------------------------------------------------   
//---------------------------Delay Layer Hiding by 2 sec-------------
// Used by dropdown menus to prevent navigational dificulties.

function timeHide(layer, something, action) {
var hutzpa="MM_showHideLayers('" + layer + "','" + something + "','" + action + "')";
iTimeoutID = window.setTimeout(hutzpa, 2000);
}
//-------------------------------------------------------------------   
//--------------------------Dynamic feature and home page -----------
function JM_breakFrame () {
(count==null)?count=1:count++;
if (count==gAmount){setTimeout("JM_breakFrame2()",200); }
} 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function JM_breakFrame2 () {  
  var j=1; while (j < 4){
  if (test=MM_findObj("if"+j)) {
  if (navigator.appName=="Netscape") { test=MM_findObj("if"+j); htmlStuff=test.contentDocument.body.innerHTML;}
  	  // use functrionality based code fork.   This is sloppy.  (will do when safari is out of beta)
	  else  {htmlStuff=document.frames('if'+j).document.body.innerHTML;}
	  if (slashed=="yes") { 
	  while (htmlStuff.indexOf('"media/') > 1 ) { 
	  var index = htmlStuff.indexOf('"media/');
	  htmlStuff = htmlStuff.substring(0, index+1) + "../" + htmlStuff.substring(index+1 , htmlStuff.length);
	  } 
	  var repeat = "yes";
	  var index2= -1;
	  while (repeat="yes") { 
	  var index2=htmlStuff.indexOf('ef=', index2+1); 
	  if (index2 == -1) {break;}	
	  	var first = index2 + 3;
		var urlStart = htmlStuff.substring(first, first+2);   var iSlicePoint=index2+3; 
		if (urlStart.indexOf('"') > -1 ) {var urlStart = htmlStuff.substring(first+1, first+3); var iSlicePoint=index2+4;}
	 	if (urlStart != ".." && urlStart != "ht" ) {
	   		htmlStuff = htmlStuff.substring(0, iSlicePoint) + "../" + htmlStuff.substring(iSlicePoint , htmlStuff.length)
	 		} 	else { repeat = "no"; }
		 }  
	  }
if ((myBox=MM_findObj("div"+j)) !=null) { myBox.innerHTML = htmlStuff; } } j++;   } fillinDate();
} 

function fillinDate () {

// Set up months array
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
// Set up days array
var days=new Array(8);
days[1]="Sunday";
days[2]="Monday";
days[3]="Tuesday";
days[4]="Wednesday";
days[5]="Thursday";
days[6]="Friday";
days[7]="Saturday";
// get the raw date
var today = new Date();
// translate to verbose Day
var vDay=days[today.getDay() + 1];
//translate to verbose Month
var vMonth=months[today.getMonth() + 1];
// get date string
var date=today.getDate();
//get year string
var year=today.getYear();
var verboseDate = vDay + " " + vMonth + " " + date + ", "+ year + ' <img src="media/images/difference/spacer.gif" width="10" height="10">';

if ((dateBox=MM_findObj("mydate")) !=null) { dateBox.innerHTML = verboseDate; }

}


function JM_rotate (){
var eexists=typeof(JM_initPage);
if (eexists == "function") { JM_initPage();} else {
var exists=typeof(JM_getVars);
if (exists == "function") { 
mainBoxSrc=JM_getVars("mainBoxSrc");
fBox1Src=JM_getVars("fBox1Src");
fBox2Src=JM_getVars("fBox2Src");
var rand1=Math.floor(Math.random()*(mainBoxSrc.length))
var rand2=Math.floor(Math.random()*(fBox1Src.length))
var rand3=Math.floor(Math.random()*(fBox2Src.length))
var content = Array(); content[0]=""; 
if (mainBoxSrc.length > 0){content[1]=mainBoxSrc[rand1];} 
if (fBox1Src.length > 0){content[2]=fBox1Src[rand2];} 
if (fBox2Src.length > 0){content[3]=fBox2Src[rand3]; }
var i = 1; while (i < 4 ){ 
if (content[i].length) {
if ((test=MM_findObj("if"+(i))) != null) { 
   (gAmount==null)?gAmount=1:gAmount++;
   if (content[i].substring(0,3) == "../") { 
    var stringEnd = content[i].length;
	test.src="../media/images/features/html/" + (content[i].substring(3,stringEnd)); 
    slashed = "yes";  } 	
	else { test.src="media/images/features/html/" + content[i]; }} }i++;  }
}}}
//-------------------------------------------------------------------   
//---------------------------Printer Firendly------------------------
function PrinterFriendlyPages(region) 

// JS dynamic printer friendly page generation::
// uses <div> tags to define printed content.
// By defualt the printable region is <div id=forprint> </div>
// 
// call the function with the following link:
// <a href="javascript:PrinterFriendlyPages('forprint');" class="link" >Printer Friendly Version</a> 
//
// The script is dynamic, so that if a page should have additional printable areas,
// or if you'd like to change the printable area, just add your own <div id=x> </div> tags
// such as: <div id=thischart> </div> then the link that calls the JS could be changed to:
// <a href="javascript:PrinterFriendlyPages('thischart');" class="link" >Print This Chart</a>
// There is no limit to how many printable regions one may use per page.
// Printable regions CAN contain other printable regions. 
// 
// NOTE:  Printer friendly pages will use the ssbprinter.css style sheet.  
//        This style sheet redefines some of our styles for printing purposes.
//        Table Heads in particular rely on the .tablehead style in both sheets.
//        is a style is added to one, please add it to the other sheet as well.
// 
// -Joe Melberg

{ 
  
   var sOption="toolbar=no,location=no,directories=no,menubar=yes,"; 
       sOption+="scrollbars=yes,width=550,height=500,left=100,top=25"; 
   var sWinHTML = document.getElementById(region).innerHTML; 
 
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><base href="http://www.adventuresinc.com/ssb2/"><title>(close this window when finished printing)</title><link rel="stylesheet" href="ssbprinter.css"></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#CC9933" onLoad="javascript:window.print();" vlink="#996600"><br><table width="500" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#CC9933"><tr><td class="bodycopy"><div align="center"><table width="500" border="0" cellspacing="0" cellpadding="10"><tr><td class="bodycopy">'); 
       winprint.document.write(sWinHTML);          
       winprint.document.write('</td></tr></table><br><span class="subhead"></span> <font color="#CC9933">© Copyright 2002,Sandy Spring Bank.</font></div></td></tr></table></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}
//-------------------------------------------------------------------   
//------------------------ Leaving SSNB.com Warning -----------------
function redirectPopUp(url) 

// JS dynamic redirect pop-up::
// Creates Pop-Up window warning about leaving ssnb domain
// 
// call the function with the following link:
// <a href="javascript:redirectPopUp('http://www.url.com');" class="link" >Go to URL.com!</a> 
// where www.url.com can be any internet address.   text: ' go to url.com!' can be changed to anything, or can be an immage.
// in dreamweaver, simply paste this into link dialogue: javascript:redirectPopUp('http://www.url.com');
// and change "URL" to the address you want to send users to.
{  
  
   var sOption="toolbar=no,location=no,directories=no,menubar=no,"; 
       sOption+="scrollbars=no,width=440,height=400,left=100,top=25"; 

 
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><base href="http://www.ssnb.com"><title>Leaving Sandy Spring Bank</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel="stylesheet" href="difference.css" type="text/css"><style type="text/css"><!--.smallegalCopy { font-family: Arial, Helvetica, sans-serif; font-size: 10px; line-height: normal; font-weight: 300; white-space: normal; ; font-style: normal}--></style></head><body bgcolor="#FFFFFF" text="#000000"><table width="390" border="0" cellspacing="0" cellpadding="0"><tr> <td width="10">&nbsp;</td><td width="380" class="bodycopy"> <p class="subhead" align="center">You are leaving the Sandy Spring Bank (SSB) Web site.</p><p class="smallegalCopy" align="left">The Web site you have selected is an external one located on another server. This Web site may contain links to third party sites. These links are provided for convenience purposes and are not under the control of SSB. Ability to link to other sites does not imply endorsement of any products, services, publications or companies. If you choose to link to such third party Web sites, SSB makes no warranties, either expressed or implied, concerning the content of such sites, including the operations, programming and conduct of transactions over such sites. SSB does not warrant that such sites or content are free from any claims of copyright or other infringement or that such sites or content are devoid of viruses. SSB disclaims all liability of any kind whatsoever arising out of your use of, or inability to use such third party Web sites, the use of your information by such third parties, and the security of information you provide to such third parties.</p><p class="smallegalCopy">This site may contain a separate Privacy/Information Security Policy, and/or a separate Terms of Use Disclosure. In any case, they are separate from those for SSB site. Efforts have been made to ensure the service provider maintains the confidentiality of your data, however, we recommend that your read their disclosures (if available) prior to submitting information.</p><p class="subhead" align="center">Do you wish to continue?<br></p><p class="subhead" align="center"><a href="javascript:window.close()"><img src="media/images/difference/button_no.gif" width="104" height="17" alt="No" border="0"></a><img src="media/images/spacer.gif" width="20" height="20"><img src="media/images/spacer.gif" width="20" height="20"><img src="media/images/spacer.gif" width="20" height="20"><a href="'); 
       winprint.document.write(url);          
       winprint.document.write('" onClick="window.close()"target="_blank"><img src="media/images/difference/button_yes.gif" width="104" height="17" border="0" alt="Yes"></a> </p></td></tr></table></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}
//-------------------------------------------------------------------   
//----------------------------Macromedia Scripts---------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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;
}

function MM_showHideLayers() { //v6.0
 if (iTimeoutID) {window.clearTimeout(iTimeoutID);}

  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
