// INSTRUCTIONS FOR NAVBAR JS
// NAV1 immage name list:
// ----------------------
// nav1_personal
// nav1_business
// nav1_investor
// nav1_contactus
// ----------------------
// So that the site could rely on one main template, yet show nav bar highlights for
// many different pages for single nav ccategories, a JS was created that allows the
// site admin to specify which nav graphic shows highlighted on any given page.
// the alternative was to use FOUR templates for the site, one for each navigational category.
// Those four templates are included with this site.
//
// NAV1 uses JS to dynamically highlight a specified navbar immage to show
// page category to the user.  This was accomplished by adding an editable region
// which contained a JS that defined a variable used in the NAVBAR js.
// To make an immage HIGHLIGTED:
// Change the variable in the script above: live="";
// To the image name that you would like to see highlighted. ex: live="nav1_personal";
// If the navbar NAV1 is modified at a later date, please update the above list
// of immage names from the "ssb_main_template_JS.dwt" and apply to all pages.
// DO NOT CHANGE IMMAGE NAMES OR REPLACE THE MAIN NAVIGATION ITEMS FOR NAV1
// WITHOUT UPDATING THE JS CALLS ON THE IMAGES AS WELL TO REFLECT YORU CHANGES
// A backup copy of the nav bar is included with the site files for refference.
// See: nav1.htm


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;

}

function JM_nbGroup(event, grpName) { //vx.x modified by Joe Melberg
  var i,img,nbArr,args=JM_nbGroup.arguments,live=JM_highlight(live);
  if (event == "init" && args.length > 2) {
    if ((img = JM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
    img = document.MM_nbOver[i];
    if (live==args[1]) {img.src = args[2];}
    else {img.src = (img.MM_dn) ? img.MM_dn : img.MM_up;}
    }
  }

else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
else if (event == "check") {
  if (live==args[1]) {
  living = MM_findObj(live);
  livingsrc = living.src;
  fatsrc = new String(livingsrc);
  i=args[2].length;
  e=fatsrc.length;
  o=e-i
  fat=fatsrc.substring(o,e);
  if (fat != args[2]){
  document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
   }
  }
 }
}



function MM_showHideLayers() { //v3.0

  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; }

}

//-------------------------------------------------------------------
//-------------------------------------------------------------------
function moreinfo(region, theUrl)
// call the function with the following link:
// <a href="javascript:moreinfo('#');" class="link" >More information</a>
// in the above link, "#" represents the row number that you
// would like to preserve for display.
{
   var iOption="toolbar=no,location=no,directories=no,menubar=yes,";
       iOption+="scrollbars=yes,width=620,height=500,left=100,top=25";
   var winInfo=window.open(theUrl,region,iOption);
}
function onerow(region, winInfo)
{
 if (region){
     rowcount=winInfo.document.all.oChecking.rows.length-1;
     while (rowcount > 0) {
        if (rowcount != region)
           {winInfo.document.all.oChecking.deleteRow(rowcount);}
        rowcount--;}
     }
   dHeight = winInfo.document.all.bound.offsetHeight
   aHeight = winInfo.document.all.header.offsetHeight
   nHeight = dHeight+aHeight+25;
   if (nHeight < 500) {
       winInfo.resizeTo(620,nHeight);
       }
       else {
       winInfo.resizeTo(620,500);
       }
}

//-------------------------------------------------------------------
//-------------------------------------------------------------------

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_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_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];}
}


