var formvar, styleSwitch, vis, stop, time;

ns = (document.layers)? true:false;
ie = (document.all)? true:false;

if(ns){
  formvar = ".layers";
  styleSwitch = "";
  vis = "show";
}

if(ie){
  formvar = ".all";
  styleSwitch = ".style";
  vis = "visible";
}

function ShowHide(name,val){
  if(eval('document' + formvar + '["' + name + '"]' + styleSwitch + '.visibility==vis')){
    hideLayer(name,val);
  }else{
    showLayer(name,val);
  }
}

function setTimer(name){
  time = setTimeout('hideLayer("'+ name +'")',1500);
}

function showLayer(name,val){
  if(ns){
    document.layers[name].top = val;
  }
  eval('document' + formvar + '["' + name + '"]' + styleSwitch + '.visibility=vis');
}

function hideLayer(name){
  eval('document' + formvar + '["' + name + '"]' + styleSwitch + '.visibility="hidden"');
}
