if (document.all)    {n=0;ie=1;ns6=0;fShow="visible";fHide="hidden";}
if (document.getElementById&&!document.all)    {n=0;ie=0;ns6=1;fShow="visible";fHide="hidden";}
if (document.layers) {n=1;ie=0;ns6=0;fShow="show";fHide="hide";px=""}

function layerWrite(id,text){
  if(!layerCheck(id)) return;
  if(ns6){document.getElementById(id).innerHTML=text;}
  else {if(ie) document.all[id].innerHTML=text;}
}

function layerShow(id,vis){
  if(ns6){document.getElementById(id).style.visibility=vis?fShow:fHide;}
  else {if(ie) document.all[id].style.visibility=vis?fShow:fHide;}
}

function layerShowBlock(id,vis){
  if(ns6){document.getElementById(id).style.display=vis?"block":"none";}
  else {if(ie) document.all[id].style.display=vis?"block":"none";}
}

function layerSetUp(id){
  if(ns6){block=document.getElementById(id)}
  else {if(ie) block=document.all[id]}
  if (block){
	block.txt=block.innerHTML;
	block.plotis=block.style.width;
	block.aukstis=block.style.height;
  }
}

function layerCollapse(id,vis){
  if(ns6){block=document.getElementById(id)}
  else if(ie) block=document.all[id]
  if(vis){block.innerHTML=block.txt;}
  else{block.innerHTML="";}
  layerShow(id,vis);
}
function layerCheck(id){
  if(ns6) return(document.getElementById(id));
  else if(ie)return(document.all[id]);
}
function layerMoveTo(id,xPos,yPos){
  if(ns6){document.getElementById(id).style.left=xPos;document.getElementById(id).style.top=yPos;}
  else
    if(ie){document.all[id].style.left=xPos;document.all[id].style.top=yPos;}
}
function layerText(id){
  if(!layerCheck(id)) return;
  if(ns6){return(document.getElementById(id).innerHTML);}
  else {if(ie) return(document.all[id].innerHTML);}
}
function processing(){
	layerShow('processing',fShow);
	document.innerText="";
	XuSelai(fHide);
}
function layerSwitch(id){
	if(!layerCheck(id)) return;
	var lVis=!layerVisible(id);
	layerShowBlock(id,lVis)
}

function layerVisible(id){
  if(ns6){return(document.getElementById(id).style.display=="block")}
  else {if(ie) return(document.all[id].style.display=="block")}
}
