/* Test for objects */
(document.layers) ? layerobject=true : layerobject=false;

(document.all) ? allobject = true: allobject = false;

(document.getElementById) ? dom = true : dom = false;

/* Test for browser */
var isIE4, isNet4;

isIE4 = false;
isNet4 = false;

if (parseInt(navigator.appVersion) >= 4) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
      isIE4 = true;
    }

    if (navigator.appName == "Netscape") {
      isNet4 = true;
    }
}

/* Page load code */
/*
if (isIE4)
{
  document.write('<style type="text/css"> body {background-image: url(../images/ubkback.gif);} </style>');
}
*/

function windowLoad(url)
{
 window.open(url,"",'toolbar=1,menubar=1,scrollbars=1,resizable=1,width=800,location=1,height=600,left=0,top=0');
}

function onResize()
{
  if(layerobject){
    document.location.reload();
  }
}

function changeVisibility(id,action)
{
 switch (action)
 {
  case "show":
       if (layerobject)
	      document.layers[''+id+''].visibility = "show";
	   else if (allobject)
	       document.all[''+id+''].style.visibility = "visible";
	   else if (dom) 
	       document.getElementById(''+id+'').style.visibility = "visible";	
       break;
  case "hide":
     	if (layerobject)
		  document.layers[''+id+''].visibility = "hide";
         else 
	        if (allobject)
             document.all[''+id+''].style.visibility = "hidden";
         else if (dom)
             document.getElementById(''+id+'').style.visibility = "hidden";
             break;
  default:return;
 }
 return;
}

function changePosition(id,x,y)
{
  if (layerobject)
   {
    document.layers[''+id+''].left = x;
    document.layers[''+id+''].top = y;
   }
  else if (allobject)
      {
	   document.all[''+id+''].style.left=x;
	   document.all[''+id+''].style.top=y;
	  }
  else if (dom)
      {
	   document.getElementById(''+id+'').style.left=x+"px";
	   document.getElementById(''+id+'').style.top=y+"px";
	  }

  return;
}

function showMenu (id) {

  // Show menu
  changeVisibility(id, 'show');
  
  return;
}

function hideMenu (id) {

  // Hide menu
  //changeVisibility(id, 'hide');
  
  return;
}

