function opacityOn(obj){
	obj.setAttribute("style", "opacity:1.0;");
	if(obj.style.setAttribute) obj.style.setAttribute("filter", "alpha(opacity=100);"); //For IE
}
function opacityOff(obj){
	obj.setAttribute("style", "opacity:0.6;");
	if(obj.style.setAttribute) obj.style.setAttribute("filter", "alpha(opacity=60);"); //For IE
}
function showGalleryPhoto(id){
	var url = document.getElementById('bigPhotoUrl').value;
	document.getElementById('bigPhoto').style.backgroundImage='url("'+url+'get.php?i.'+id+':w.428:h.237")';
	document.getElementById('bigPhotoId').value=id;
}
function openPopup(id,id2,title){
	var tmp;
	var url = document.getElementById('bigPhotoUrl').value;
	if(id) tmp=id; // pasirinktos foto id
	else tmp=id2; // default'inis foto id
	openPopup2(url+'/get.php?i.'+tmp+':w.900:h.700',title);
}
function openPopup2(imageURL, caption) {
	var windowTop = 100;
	var windowLeft = 100;
	var defaultWidth = 550;
	var defaultHeight = 400;
	var onLoseFocusExit = true;
	var undefined;
	var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ",resizable";
	var myScript = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
    "<html>\n" + 
    "<head>\n" + 
    "<title>" + caption + "\</title>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n" +
    "<meta http-equiv=\"Content-Language\" content=\"lt\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
    "function resizewindow () {\n" +
    "  var width = document.myimage.width;\n" + 
    "  var height = document.myimage.height;\n";
	if(navigator.appName.indexOf("Netscape") != -1){ 
		myScript = myScript +  "  window.innerHeight = height;\n  window.innerWidth = width;\n"
	}
	else if(navigator.appName.indexOf("Opera") != -1){
		myScript = myScript +  "  window.resizeTo (width+12, height+31);\n"
	}
	else if(navigator.appName.indexOf("Microsoft") != -1){ 
		myScript = myScript + "  window.resizeTo (width+12, height+31);\n" 
	}
	else{
		myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
	}
	myScript = myScript + "}\n" + "window.onload = resizewindow;\n" +
    "</script>\n</head>\n" + "<body ";
	if(onLoseFocusExit){
		myScript = myScript + "onblur=\"self.close()\" ";
	}
	myScript = myScript + "style=\"margin: 0px; padding: 0px;\">\n" +
    "<img src=\"" + imageURL + "\" alt=\"" + caption + "\" title=\"" + caption + "\" name=\"myimage\">\n" + 
    "</body>\n" +  "</html>\n";     
	var imageWindow = window.open("","imageWin",Options);
	imageWindow.document.write(myScript);
	imageWindow.document.close();
	if(window.focus){
		imageWindow.focus();
	}
	return false;
}