function openw(theURL,winName,features) {
	if (features == "") features = "width=500,height=500,scrollbars,resizable";
	window.open(theURL,winName,features);
}

//In case browser does nt support 'getElementById'
if(!document.getElementById && document.all){
	document.getElementById=function(id){
		return document.all[id];
	}
}

///////////////////////////////////////////
//Programmer convinience functions

//Shortcut to document.getElementById
function el(id){
	return document.getElementById(id);
}

//Toggle visibility
function toggle(o){
	obj = el(o);
	obj.style.display = obj.style.display == 'none' ? 'block' : 'none';
}
function toggleInline(o){
	obj = el(o);
	obj.style.display = obj.style.display == 'none' ? 'inline' : 'none';
}

function show(obj){
	el(obj).style.display = 'block';
}
function hide(obj){
	el(obj).style.display = 'none';
}
function showHide(obj1,obj2){
	el(obj1).style.display = 'block';
	el(obj2).style.display = 'none';
}
function inline(obj){
	el(obj).style.display = "inline";
}

//To see if given value exists in array (like in PHP)
function inArray(value, array){
	if(typeof(array) != 'object') return false;
	for(var i=0;i<array.length;i++){
		if(array[i]	== value) return true;
	}
	return false;
}


function checkEmail(str) {
	var regex = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	return regex.test(str);
}

function checkPhone(str) {
	var regex = /^[+\(\)\- 0-9]+$/i;
	return regex.test(str);
}

function checkNumber(str) {
	var regex = /^[0-9]+$/i;
	return regex.test(str);
}

///////////////////////////////////////////



<!--
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS6 = (bName == "Netscape" && bVer >= 5);
 var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 window.onerror = null;
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null 
 if (NS4 || IE4 || NS6) {
	 if (navigator.appName == "Netscape" && !document.getElementById){
	 layerStyleRef="layer.";
	 layerRef="document.layers";
	 styleSwitch="";
	 layerVis="show";
	 layerHid="hide";
	 }
	 else if (!document.all && document.getElementById) {
	 layerStyleRef="layer.style.";
	 layerRef="document.getElementById";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
	 else {
	 layerStyleRef="layer.style.";
	 layerRef="document.all";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
 }
// SHOW MENU
// aprasoma visu menu left koordinate
function shLayer(layerName){
	AviabilietaiL = 137;
	Aviabilietai2L = 0;
	ViesbuciaiL = 137;
	Viesbuciai2L = 0;
	KLL = 137;
	KL2L = 0;	
	SPL = 137;
	SP2L = 0;
	KPL = 137;
	KP2L = 0;	
	
if (NS4 || IE4 || NS6) {
 if (timeOn != null) {
 clearTimeout(timeOn)
 hideLayer(onLayer)
 }
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName
 }
}
// HIDE MENU
function hideLayer(layerName){
	if (menuActive == 0) {
		if (NS4 || IE4) eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
		if (NS6) eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
	}
}

initiated = 0;

button=new Array();
button[1]=new Array();
button[2]=new Array();

function init(){
	for (n=1; n<=19; n++) {
		button[1][n]=new Image();
		button[1][n].src="images/t_bt_"+n+"_1.gif";
		button[2][n]=new Image();
		button[2][n].src="images/t_bt_"+n+"_2.gif";
	}
	initiated = 1;
}

function chimage(name,towhich){
	if (initiated && document.images[name]){document.images[name].src=towhich.src;}
	return true;
}
//-->
