function OpenImagePopup(url,width,height) {
	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	this.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=no,location=no,menubar=no,resizable,status=no,directories=no,toolbar=no");
}

function Popupas(url,width,height) { OpenImagePopup(url,width,height); }

function OpenImagePopupSc(url,width,height) {

	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	this.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=yes,location=no,menubar=no,resizable,status=no,directories=no,toolbar=no");
}

function Popup(url,width,height) { OpenImagePopupSc(url,width,height); }

function setSize(width,height) {
	if (window.outerWidth) {
		window.outerWidth = width;
		window.outerHeight = height;
	}
	else if (window.resizeTo) {
		window.resizeTo(width,height);
	}
	else {
		alert("Tavo naršyklė nesupranta.");
	}
}	
function setSizeandGoToPagrindinis(width,height,adresas) {
	if (window.outerWidth) {
		window.outerWidth = width;
		window.outerHeight = height;
	}
	else if (window.resizeTo) {
		window.resizeTo(width,height);
	}
	else {
		alert("Tavo naršyklė nesupranta.");
	}
	location.href=adresas;
}

function RodytiNerodyti(Aisjungti, Aijungti, Aid, DivID) {
	if (document.getElementById(DivID).style.display == 'none') {
		document.getElementById(Aid).innerHTML = Aisjungti;
		document.getElementById(DivID).style.display = 'block'
	} else {
		document.getElementById(Aid).innerHTML = Aijungti;
		document.getElementById(DivID).style.display = 'none'		
	}
}

function keiciamValue(key) {
	if (document.getElementById(key).value == 'on') {
		document.getElementById(key).value = 'off';
	} else if (document.getElementById(key).value = 'off') {
		document.getElementById(key).value = 'on';		
	} 
}

function GetAjax(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}
