//otevre detail pro fotografii
function getPhotoDetail(detailId,winW,winH){
	var windowURL = "detail.aspx?id="+detailId;
	var windowName = "photo"+detailId;
	var w = parseInt(winW);
	var h = parseInt(winH);
	var posX = (screen.width/2)-(w/2);
	var posY = (screen.height/2)-(h/2);	
	//vlastnosti okna
	var windowFeatures = "toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no";
	var windowSize = "width="+w+",height="+h;	
	var windowPosition = "top="+posY+",left="+posX;
	var winOptions = windowSize+","+windowPosition+","+windowFeatures;
	//open window
	var photoWindows = window.open(windowURL,windowName,winOptions);
	photoWindows.focus();

}

//lightbox renaming
function renameLightBox(stat,obj1,obj2){
	var o1 = document.getElementById(obj1);
	var o2 = document.getElementById(obj2);
	if (stat == 0){
		o1.style.display = "none";
		o2.style.display = "block";
	} else {
		o1.style.display = "block";
		o2.style.display = "none";
	}
}

//old popup
function openWin(urlP,w,h){
	wX = (screen.width/2)-(w/2);
	wY = (screen.height/2)-(h/2);
	window.open(urlP,"popup","width="+w+",height="+h+",top="+wY+",left="+wX+",toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=no");
}

function openerHref(url){
	window.opener.location.href = url;
	window.opener.focus();
}

function switchLightBox()
{
	var selectBox = document.forms[1].selectLightbox;
	destination = selectBox.options[selectBox.selectedIndex].value;
	if (destination) location.href = destination;
}

function switchSearchBox(fotoId)
{
	var selectBox = document.forms[1].selectManualId;
	searchOption = selectBox.options[selectBox.selectedIndex].value;
	if(searchOption == fotoId)
	{
		renameLightBox(0,"blank","advanceSearch");
	} else {
		renameLightBox(1,"blank","advanceSearch")
	}
}

