﻿	function OpenImages(strCode) {
			window.open("../engine/images.aspx?code=" + strCode, "images", "height=580, width=560, scrollbars=1, status=0");
	}

	
	function ConfirmMsg(strLanguage, strProduct, strTotalPrice, strPath) {
	    var strMsg = "";
	    
	    switch (strLanguage) {
	        case "en":
    		    strMsg = "The item: \"" + strProduct + "\" was added into the basket.\nTotal price of goods in the basket is: " + strTotalPrice + " €\n\nBy clicking on OK button you display the basket,\nto continue in the order please click on Storno button";
	            break;
	        case "sk":
		        strMsg = "Produkt: \"" + strProduct + "\" byla pridána do košíka.\nCelková cena tovaru v košíku je: " + strTotalPrice + " €\n\nKliknutím na OK zobrazíte košík,\npre pokračovaní v objednávke klikněte na Storno";
	            break;
	        default:
		        strMsg = "Položka: \"" + strProduct + "\" byla přidána do košíku.\nCelková cena zboží v košíku je: " + strTotalPrice + " Kč\n\nKliknutím na OK zobrazíte košík,\npro pokračovaní v objednávce klikněte na Storno";
		        break;    
	    }

		if (window.confirm(strMsg)) {
			window.location.href = strPath + "eshop.aspx";
		}
	}


    function ToBuy  (strNumber, strLanguage) {
			var oFrame = window.document.getElementById("idFrameToBay");
			if (!(oFrame)) {
			    oFrame = idFrameToBay;
			}
			
			if (oFrame.src) {
				oFrame.src = "../../../engine/iframe_tobay.aspx?language=" + strLanguage + "&product=" +strNumber;
			}
			else {
				oFrame.location.href = "../../../engine/iframe_tobay.aspx?language=" + strLanguage + "&product=" +strNumber;
			}
    }

    var oMenuLogoLast = null;
	function ShowLogoMenu(strIdDivLogoMenu, bShow) {
		var oMenuLogo = document.getElementById(strIdDivLogoMenu);
		if (!oMenuLogo) {
		   oMenuLogo = document.getElementById("ctl00_cltMenuLogos1_" + strIdDivLogoMenu);
		}
		if (!oMenuLogo) {
		   oMenuLogo = document.getElementById("ctl00_cltMenuLogos2_" + strIdDivLogoMenu);
		}
		if (!oMenuLogo) {
            window.status = "Menu nenalezeno id je spatne:"	+ strIdDivLogoMenu;	
            return;
		}
		if (bShow) {
		    if (oMenuLogoLast) {
    			oMenuLogoLast.style.visibility = "hidden";
		    }
			oMenuLogo.style.visibility = "visible";
		}
		else {
			oMenuLogo.style.visibility = "hidden";
		}
		oMenuLogoLast = oMenuLogo;
	}
	
	function EditImg (strCode) {
		if (window.showModalDialog("../admin/modal_edit_product.asp?product=" + strCode, window, "dialogHeight:580px; dialogWidth:980px; resizable:1;")) {
			window.location.reload(true);
		}
	}
/*	
    function SetCornerPosition (){
		var objDiv = document.getElementById("idDivLista");
		
		if (!objDiv) {
		    objDiv = window.document.all("idDivLista");
		}
        
		var intTop = document.body.scrollTop;
		intTop = document.body.clientHeight + document.scrollTop - 27;
		objDiv.style.top = intTop;
		
		//alert();
		//window.setTimeout("SetCornerPosition()", 1000);
	}
*/