function remote1(){
win3=window.open('portlets/e-vicemerui.htm','','width=420,height=400,scrollbars')
win3.creator=self
}
function remote2(){
win4=window.open('http://www.vilnius.lt/gbook/gbook.php?action=add&include=on','','width=460,height=270,scrollbars')
win4.creator=self
}

function checkform_pav1(){
	if ((document.regform1.vardas.value.length <= 2) && (document.regform1.pavarde.value.length <= 3)){
		alert('Įrašykite vardą arba/ir pavardę')
		return false
	}
	return true
}

function checkform_pareig(){
	if (document.regform2.pareigos.value.length <= 3){
		alert('Įrašykite pareigas')
		return false
	}
	return true
	
}

function checkform_tel(){
	if (document.regform4.tel.value.length <= 2) {
		alert('Įrašykite tel. ar fakso numerį')
		return false
	}
	return true
	
}

function checkform_kab(){
	if (document.regform5.kab.value.length <= 0) {
		alert('Įrašykite kabinetą')
		return false
	}
	return true
	
}

function checkform_dal(){
	if (document.regform7.padal.value.length <= 3) {
		alert('Įrašykite dalinį')
		return false
	}
	return true
	
}

function msgFocus(elID, message, act){
	x = document.getElementById(elID);
if (act == '1') {
	if (x.value == message) {x.value = '';}
}
if (act == '2') {
	if (x.value == '') {x.value = message;}
}
}

function ShowHideObject(ID_ON, ID_OFF, status) {
	x = document.getElementById(ID_ON);
	y = document.getElementById(ID_OFF);
	if (status == 1) {
		x.style.display="block"
		y.style.display="none"
	}
	if (status == 0) {
		x.style.display="none"
		y.style.display="block"
	}
}

function radioValue(radioButton)
{
    for (x = 0; x <= radioButton.length; x++)
    {
        if (radioButton[x].checked == true) return radioButton[x].value; 
    } 
         // if it didnt find anything, return the .value  (behaviour of single radio btn)
        return radioButton.value;
}

function radioValue1(radioButton){
var intValue = -1;

    try{
        //determine radio value
        for (x = 0; x <= radioButton.length; x++){
            if (radioButton[x].checked == true) {
                intValue = radioButton[x].value; 
                break;
            }
        } 
    }
    catch(e){
        //there has been an error (most likely because no selection was made)
        // return not found value (-1 in this case)
        intValue = -1;
    }
    // if it didn't find anything, return the .value  (behaviour of single radio btn)
    return intValue;
}

function submitSearchForm() {
x = document.paieskosforma.word.value;
y = radioValue(document.paieskosforma.tipas);
z = document.paieskosforma.word.value;
if (y == 1) vilniusltsubmit(z);
if (y == 2) dokumentaisubmit(z);
if (y == 3) paslaugossubmit(z);
if (y == 4) telefonaisubmit(z);
}
function dokumentaisubmit(z) {
document.ff.pavadinimas.value = z;
document.ff.submit();
}

function vilniusltsubmit(z) {
document.searchForm.find.value = z;
document.searchForm.submit();
}

function paslaugossubmit(z) {
document.paslaugosForm.txtID.value = z;
document.paslaugosForm.submit();
}

function telefonaisubmit(z) {
document.phoneForm.pavarde.value = z;
document.phoneForm.submit();
}

function _setclass(e, c) { 
	if(document.getElementById) document.getElementById(e).className = c; 
	else if(document.layers) document.layers[e].className = c; 
	else document.all[e].className = c; 
	}
function _toggledss(id) {
	f = document.getElementById('_dsqf');
	if(id == 1) 	 { 	document._dsqf.c.value = "web"; 
						_setclass("www", "hi"); 
						_setclass("dok", "lo"); 
						_setclass("pas", "lo"); 
						_setclass("tel", "lo");
					 } 
	else if(id == 2) { 	document._dsqf.c.value = "etp"; 
						_setclass("www", "lo"); 
						_setclass("dok", "hi"); 
						_setclass("pas", "lo");
						_setclass("tel", "lo");
					 } 
	else if(id == 3) { 	document._dsqf.c.value = "dns"; 
						_setclass("www", "lo"); 
						_setclass("dok", "lo"); 
						_setclass("pas", "hi");
						_setclass("tel", "lo");
					 } 
	else if(id == 4) { 	document._dsqf.c.value = "dns"; 
						_setclass("www", "lo"); 
						_setclass("dok", "lo"); 
						_setclass("pas", "lo");
						_setclass("tel", "hi");
					 }
	return false;
}

function _setclass(e, c) {
	if(document.getElementById) document.getElementById(e).className = c;
	else if(document.layers) document.layers[e].className = c;
	else document.all[e].className = c;
	}
function _toggledss(id) {
	f = document.getElementById('_dsqf');
	if(id == 1) 	 { 	document.paieskosforma.tipas.value = "1";
						_setclass("www", "hi");
						_setclass("dok", "lo");
						_setclass("pas", "lo");
						_setclass("tel", "lo");
					 }
	else if(id == 2) { 	document.paieskosforma.tipas.value = "2";
						_setclass("www", "lo");
						_setclass("dok", "hi");
						_setclass("pas", "lo");
						_setclass("tel", "lo");
					 }
	else if(id == 3) { 	document.paieskosforma.tipas.value = "3";
						_setclass("www", "lo");
						_setclass("dok", "lo");
						_setclass("pas", "hi");
						_setclass("tel", "lo");
					 }
	else if(id == 4) { 	document.paieskosforma.tipas.value = "4";
						_setclass("www", "lo");
						_setclass("dok", "lo");
						_setclass("pas", "lo");
						_setclass("tel", "hi");
					 }
	return false;
}
function Checkform_userform() {
	if (document.userform.EMAIL.value != '') {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(userform.EMAIL.value)){
	} else {
		alert("Neteisingai įvestas elektroninio pašto adresas");
		document.userform.EMAIL.focus();
		return false;
	}
	}
}

function topGoToHome() {
top.location.href='http://www.vilnius.lt';
}

function errorHandler() {
self.setTimeout("topGoToHome()", 5000);
}

function edienynasHandler() {
document.bookForm.submit();
document.bookForm.personal_code.value = "";
document.bookForm.password.value = "";
return false;
}


function load() {
     if (GBrowserIsCompatible()) {
       var map = new GMap2(document.getElementById("map"));
       map.setCenter(new GLatLng(54.689600, 25.279900), 12, G_NORMAL_MAP);
 
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
var point = new GLatLng(54.6896,25.2799);
map.addOverlay(marker);
 
     }
   }
