// reloads the window if Nav4 resized
function MM_reloadPage(init)
  {
  if (init==true) with (navigator)
    {
    if ((appName=="Netscape")&&(parseInt(appVersion)==4))
      {
      document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
      }
    }
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
  }
MM_reloadPage(true);


// browser check
function BrowserCheck()
  {
  var b = navigator.appName
  if (b=="Netscape") this.b = "ns"
  else if (b=="Microsoft Internet Explorer") this.b = "ie"
  else this.b = b
  this.version = navigator.appVersion
  this.v = parseInt(this.version)
  this.ns = (this.b=="ns" && this.v>=4)
  this.ns4 = (this.b=="ns" && this.v==4)
  this.ns5 = (this.b=="ns" && this.v==5)
  this.ie = (this.b=="ie" && this.v>=4)
  this.ie4 = (this.version.indexOf('MSIE 4')>0)
  this.ie5 = (this.version.indexOf('MSIE 5')>0)
  this.min = (this.ns||this.ie)
  }
is = new BrowserCheck()


// show layer
function showLayer(id)
  {
  if (is.ns4) document.layers[id].visibility = "show"
  else if (is.ie4||is.ie5) document.all[id].style.visibility = "visible"
  window.status="testing"
  }


// hide layer
function hideLayer(id)
  {
  if (is.ns4) document.layers[id].visibility = "hide"
  else if (is.ie4 || is.ie5) 
    document.all[id].style.visibility = "hidden"
  }

// picWindow
function picWindow(pictureURL) 
{    
	var newwindow = window.open("","myWin","toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0");  with (newwindow)   
	{
		var contents="<html><head><title> " + pictureURL + " </title></head> \  <body bgcolor='#FFFFFF' text='#FFFFFF' leftmargin=0 topmargin=0> \  <img src='" + pictureURL + "' onLoad='javascript:window.resizeTo(this.width+10,this.height+30);'> \  </body></html>";
		document.open("text/html");
		document.write(contents);
		document.close();
	} 
}   


// new window
function NewWindow(mypage, myname, w, h, scroll) 
  {
  if (!w && !h) bNewWindow = false;
  else
    {
    bNewWindow = true;
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable status=no'
    }
  // if the new window to be opened requires different sources for ie and ns
  if (mypage.indexOf('htm') == -1)
    {
    if (is.ie) mynewpage = mypage +'_ie.htm'
    else if (is.ns) mynewpage = mypage +'_ns.htm'
    }
  else  mynewpage = mypage
  if (!bNewWindow) window.location = mynewpage
  else
    {
    win = window.open(mynewpage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
    }
  }
  
// define image array
function doPreload()
  {
  var the_images = new Array('images/nav_bckgrnd.gif','images/nav_btn_off.gif','images/nav_btn_on.gif','images/nav_ensera.gif');
  preloadImages(the_images);
  }


// preload images
function preloadImages(the_images_array) 
  {
  for(loop = 0; loop < the_images_array.length; loop++)
    {
    var an_image = new Image();
    an_image.src = the_images_array[loop];
    }
  }

	
