function openImgPopUp(imgUrl, imgName){
	MyWindow = window.open(imgUrl,"Picture","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1,width=400,height=400");
	MyWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	MyWindow.document.write('<html>');
	MyWindow.document.write('<head>');
	MyWindow.document.write('	<script type="text/javascript">');
	MyWindow.document.write('		function resizePopUp() {');
	MyWindow.document.write('			iWidth = document.documentElement.clientWidth;');
	MyWindow.document.write('			iHeight = window.innerHeight;');
	MyWindow.document.write('			if(iHeight == undefined) { iHeight = document.documentElement.clientHeight; }');
	MyWindow.document.write('			iWidth = document.images[0].width - iWidth;');
	MyWindow.document.write('			iHeight = document.images[0].height - iHeight;');
	MyWindow.document.write('			window.resizeBy(iWidth, iHeight);');
	MyWindow.document.write('		};');
	MyWindow.document.write('	</script>');
	MyWindow.document.write('	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
	MyWindow.document.write('	<title>'+imgName+'</title>');
	MyWindow.document.write('</head>');
	MyWindow.document.write('<body style="margin:0; padding:0;" onLoad="resizePopUp();">');
	MyWindow.document.write('	<img src="'+imgUrl+'" alt="'+imgName+'" />');
	MyWindow.document.write('</body>');
	MyWindow.document.write('</html>');
	MyWindow.document.close();
	return(false);
}

function open_gallery(gallery_id, pic_id){
	window.open(g_web_url+'gallery.php?gallery_id='+gallery_id+'&pic_id='+pic_id, "Gallery", "toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=640,height=545");
	return false;
}

function openPopUp(sUrl, iWidth, iHeight) {
	window.open(sUrl, 'NewWindow', 'width='+iWidth+',height='+iHeight+',resizable=1'); 
	return false; 
}

function change_img(num){
	var imgContainer = document.getElementById('img_container');
	var imgs = imgContainer.getElementsByTagName('img');
	for(var i=0; i < imgs.length; i++){
		imgs[i].style.display = 'none';
	}
	document.getElementById("img_frame"+num).style.display = 'inline';
}

// Funkcija kas salabo IE6 dropdown menu
sfHover = function() {
	var oMainNav = document.getElementById("main_nav");
	if(oMainNav == null) return;
	for(var i=0; i < oMainNav.childNodes.length; i++){
		oMainNav.childNodes[i].onmouseover = function() { this.className+=" sfhover"; }
		oMainNav.childNodes[i].onmouseout = function() { this.className=this.className.replace(' sfhover', ''); }
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// Fignja prieksh email submit
click_count = 0;
function clear_txt(){
	if(!click_count++) {
		document.getElementById('email_submit').value = "";
	}
}




