function getSize() {
	if (document.all) { //IE & OPERA
		myWidth  = (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
		myHeight = (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		myScroll = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		if (window.opera)
			myScroll -= 500;
	} else {		   // Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		myScroll = window.pageYOffset;
	}
	
    if (window.innerHeight && window.scrollMaxY) {	
        myScrollWidth = document.body.scrollWidth;
		myScrollHeight = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
		myScrollWidth = document.body.scrollWidth;
		myScrollHeight = document.body.scrollHeight;
	} else {
		myScrollWidth = document.body.offsetWidth;
		myScrollHeight = document.body.offsetHeight;
	}
}

function getCookie(name) {
	if (document.cookie.length > 0) { 
		begin = document.cookie.indexOf(name+"="); 
		if (begin != -1) { 
			begin += name.length+1; 
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end)); 
		} 
	} else return null; 
}

function GetXmlHttpObject() {
  var xmlHttp=null;
  try {
	xmlHttp=new XMLHttpRequest();
  }
  catch (e) {
	 try {
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	 }
	 catch (e) {
		 try {
			 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		 }
		 catch (e) {
			 alert("Atnaujinkite nar�ykle");
			 return false;
		 }
	 }
  }
  return xmlHttp;
}

function stateChanged() { 
	if (xmlHttp.readyState == 4) { 
		//if (xmlHttp.responseText != 'ok')
	}
}

function echeck(str, alertmsg) {
	var at="@", dot=".", lat=str.indexOf(at), lstr=str.length, ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1) {
		alert(alertmsg)
		return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert(alertmsg)
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert(alertmsg)
		return false
	}
	if (str.indexOf(at,(lat+1))!=-1){
		alert(alertmsg)
		return false
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert(alertmsg)
		return false
	}
	if (str.indexOf(dot,(lat+2))==-1){
		alert(alertmsg)
		return false
	}
	 if (str.indexOf(" ")!=-1){
		alert(alertmsg)
		return false
	 }
	 return true					
}

function naujinkLaika(){
	d=laikas.getTime();
	d=d+1000;
	laikas.setTime(d);
	//document.getElementById('date').innerHTML= (laikas.getFullYear()) + '-' + f(laikas.getMonth()+1) + '-' + f(laikas.getDate()) + ' ' + f(laikas.getHours()) + ':' + f(laikas.getMinutes()) + ':' + f(laikas.getSeconds());
	//	t = setTimeout('laikas = naujinkLaika()', 1000);
	return laikas;
}
function f(t){ 
	if (t < 10)
		return '0'+t;
	else 
		return t;
}
//var t = setTimeout('laikas=naujinkLaika()',1000);