function ShowFrame(id)
{
	var obj = document.all.fram;
	obj.width = 400; // Sets width of the frame
	obj.height = 150; // Sets height of the frame
//	obj.style.left = 300; // Sets fixed horisontal position of the frame
	obj.style.left = (document.body.clientWidth - obj.width) / 2; // Sets center horisontal position of the frame
	obj.style.top = 150; // Sets fixed vertical position of the frame
	obj.style.border="#000000";
	 
	obj.src = "bagalert.asp?amount=" + id; // URL to open in the frame
	obj.style.visibility = 'visible';	// shows the frame
}

function change_text(txt) {
	document.all.main_block.innerText=txt;
}

function change_html(html, itm) {
	document.all.item(itm).innerHTML=html;
}

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';
}
//							show, hide	
function fld_change_display(sID1, sID2)
{	
	document.all[sID1+ "_id"].style.display='';
	document.all[sID2+ "_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 winconfirm(url, lang)
{
	var  conf;
	switch (lang) {
 	case 'eng':
  		conf="Are you sure you want to delete this record?";
		break;
  	default:
		conf="Jus tikrai norite ištrinti šitą įrašą?";
  		break;
  	} 
	if (window.confirm(conf)) {
		document.location.href=url;	
 	}
}

function change_top_link() {

}

function submit_new_comment() {
if (document.forma.comment.value !="" && document.forma.nick.value!="") 	
	document.forma.submit();
else
	alert("Laukai negali būti tušti")	
}

function vote() {
	document.voting.submit();
}
function dosubmit() {
	document.reg.submit();
}
function unisubmit() {
	document.uniform.submit();
}
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 show_img(url)
{	
	var s, m;
	var d;
	var shortoptions 
	var options = "toolbar=0,status=0,menubar=0,scrollbars=1, resizable=1,"
	shortoptions="top=50,left=50,width=350,height=300";
	
	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/dummy.gif')
		document.main_pic.src=img;
	if (txt!='')
		document.all.xxx.innerText=txt;
}