﻿
function changeBG(id, color){
	document.all[id].style.backgroundColor = color;
}


function hide_fld(sID)
{
	if (document.all[sID+ "_id"].style.display=='none') 
		document.all[sID+ "_id"].style.display = '';
	else
		document.all[sID+ "_id"].style.display = 'none';
}

function regform () {
	var iki, param,i, amount;
	iki=document.forms["regnew"].length-2;
	param = true;
    for (i=0; i < iki; i++) {
    	amount = document.forms["regnew"].elements[i].value;
        if (amount == "" && i != 2 && i != 9)
        	param = false;
        }
        if (param==true) {
        	var rezult, s
            s = new String(document.forms["regnew"].elements["email"].value);
            rezult = s.search("@");
            if (rezult > 0)
            	document.regnew.submit();
            else
            	alert("El. paštas nurodytas neteisingai");
        }
       	else
       	alert("Pariškinti laukai negali būti tušti");
}

function open_window_detail(url,target, width,height,top,left,toolbar, status, menubar, scrollbars, resize)
{	
	var options = "toolbar=" + toolbar +  ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resize + ",top=" + top + ",left=" + left + ",width=" + width + ",height="+ height;
	var adv= window.open( url,target,options);
}

function open_window(url, winname, width,height,top,left)
{	
	var s, m;
	var d;
	var shortoptions 
	var options = "toolbar=0,status=0,menubar=0,scrollbars=1, resizable=1,"
	shortoptions="top=" + top + ",left=" + left + ",width=" + width + ",height="+ height;
	
	if (winname=='gener') {
		d = new Date();
		s = d.getSeconds();
		m = d.getMinutes();
		s="s" + s;
		m="m" + m; 
		winname="content" + s + m;
	}
	
	options=options + shortoptions;  
	var adv= window.open( url,winname,options);
}
 
function change_data(img, txt) {

	if (img!='' && img!='/images/spacer.gif')
		document.main_pic.src=img;
	
	document.all.xxx.innerText=txt;
}
