var newdom = 0;
var tid;

if (document.all) {
	layerRef="document.all";
	styleSwitch=".style";
}
else if (document.layers) {
	layerRef="document.layers";
  styleSwitch="";
}
else if(document.getElementById) {
	newdom = 1;
	layerRef="document.getElementById";
	styleSwitch=".style";
}

function showLayer(layerName)
{
  if (menuLoaded) {
  if (tid) clearTimeout(tid);
  var pos;
  if( document.width )
    pos = document.width;
  else
    pos = document.body.offsetWidth;
  pos=(pos/2)-494;
  if (newdom) {
    document.getElementById(layerName).style.visibility="visible";
    document.getElementById(layerName).style.left=mn[layerName]+pos;
  }
  else {
    eval(layerRef+"['"+layerName+"']"+styleSwitch+'.visibility="visible"');
    eval(layerRef+"['"+layerName+"']"+styleSwitch+'.left=mn[layerName]+pos');
   }
   }
}
  	
function hideLayer(layerName)
{
  if (newdom)
  	document.getElementById(layerName).style.visibility="hidden";
	else
  	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}

function to()
{
  tid = setTimeout("off()" , 1000);
}

function imgOn(imgName)
{
  if (document.images)
    document[imgName].src = eval("arron.src");
}

function imgOff(imgName)
{
  if (document.images)
    document[imgName].src = eval("arroff.src");
}

// Printui popupas
function OpenPrintPopup(url,width,height) {

	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	this.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=yes,location=no,menubar=yes,resizable=yes,status=no,directories=no,toolbar=no");
}
