<!--

ns=0;
layerRef="document.all"
styleSwitch=".style"
if (navigator.appName == "Netscape") {
	ns=1;
	layerRef="document.layers"
  	styleSwitch=""
}

function place(LayerArray)
{
	for (var i=0; i<LayerArray.length; i++)
    	padetis(LayerArray[i], 150);
}
 
function padetis(layerName, iksas) 
{
	if (ns) 
		{width = window.innerWidth;}
  	else 
  		{width = document.body.clientWidth;}
  		
  	if (ns) 
  		iksas = iksas + 10;
  		
  	puseEkrano = Math.round(width/2)
  	
	if (width > 800) 
		{setx(layerName, (puseEkrano + (Math.round(puseEkrano-iksas)/2)) );}
  	else 
  		{setx(layerName, (400 + (Math.round(400-iksas)/2)) );}
                     
}

function sety(layerName,y) {
 	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top='+y);}

function setx(layerName,x) {
	//alert( layerRef+'["'+layerName+'"]'+styleSwitch+'.left='+x );
 	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left='+x);
 }
 	

function showLayer(layerName) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}

function hideLayer(layerName) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}




kvadratux1 = new Image();
kvadratux2 = new Image();
kvadratux1.src='img/meniu_off.jpg';
kvadratux2.src='img/meniu_on.jpg';

function img_act(imgName)
{
        document [imgName].src = kvadratux2.src;
}

function img_inact(imgName)
{
       document [imgName].src = kvadratux1.src;
       //info2.innerHTML='';
}


box1 = new Image(); 
box2 = new Image(); 
box1.src='/img/m_off.gif'; 
box2.src='/img/m_on.gif'; 
       
function box_act(imgName)
{
        document [imgName].src = box2.src;
}

function box_inact(imgName)
{ 
       document [imgName].src = box1.src;
}


function keypress(textarea,maxlen)
{
	if(textarea.value.length > maxlen)
		textarea.value = textarea.value.substring(0,maxlen);
}

function fixProc(proc)
	{
  		if (((proc > 100) || (proc < 1)) && (proc != ''))
  				alert ('Procentų reikšmė negali būti didesnė už 100 ar mažesnė už 1');
	}
	
	
function popupas(url, h, scroll)
{
	scr_width = screen.width;
   	scr_height = screen.Height;
	w = 450;
	scrollfeature = "";
	if (scroll > 0) scrollfeature = ", scrollBars=1";
	
   	sx = Math.round((scr_width - w) / 2);
   	sy = Math.round((scr_height - h) / 2) - 50; // Taip dizaineriai liepe
   	features = "width=" + w + ", height=" + h + ", screenx=" + sx + ", screeny=" + sy + 
   	           ", left=" + sx + ", top= " + sy + scrollfeature; 

	langas = window.open(url, "pop", features);

	return langas;
}



function langelis( URLas, width, height, skrolas) 
 {
    features = "width=" + width + "," +
                "height=" + height + ","+ 
                "location=0,menubar=0,resizable=0,"+
                "scrollbars=" + skrolas + "," +
                "status=0,titlebar=0,toolbar=0,hotkeys=0,screenx=100,screeny=50,left=100,top=50";
    window.open( 'http://www.nisc.lt/'+URLas, 'poplangaz', features );
}



//-->