var msgWin = window.msgWin;
/* popup pro obrazky a galerie */
function popup(alink, type) {
	var retValue = false;
	switch(type) {
		case 1: // img_from_link
			prefix = "/popup_image.php?path=";
			path = prefix + alink.href.substr(alink.href.indexOf("/img/")) + "&title=" + alink.getAttribute("TITLE");
			break;
		case 2: // gal_from_link
			prefix = "/popup_gallery.php?js=true&adr=";
			ppth = alink.href.substr(alink.href.indexOf("adr=") + 4)
			path = prefix + ppth;
			break;
	}
	
	if (msgWin != null && !msgWin.closed) { 
		msgWin.location.href = path;
		msgWin.focus();
	} else {
		msgWin = window.open(path, "_gallery","height=150,menubar=0,personalbar=0,resizable=1,scrollbars=0,toolbar=0,width=150,top=100,left=100,status=0");
		if (msgWin == null || typeof(msgWin) == "undefined") {
			retValue = true; 
			}
		else { 
			alink.target = "_gallery";
			msgWin.focus(); 
		} 
	} 
	return retValue; 
}

window.onload = function(){
	checkCartAlert();
	checkToHide();
}

function checkCartAlert() {	

	if(obj = document.getElementById("cartAlert")) {
		setTimeout("obj.style.display='none';",1000);
	}

}

th = false;
function checkToHide() {
 	if(null != (th = document.getElementById("toHide"))) {
		if(document.getElementById("same").checked == true) {
			th.style.display = "none";
		}
	}
}

function showHide() {

	if(th.style.display == "none") {
		th.style.display = "block";
	} else {
		th.style.display = "none";
	}
	
}