function saveThisPage() {
	url = this.location.href;
	document.execCommand("saveAs", true,"sekretaria");
	this.location.href = url;
}

/* Preload und Austausch der Produkt-Bilder */
prdImages = Array();
currentProdImg = 1;

function preloadPrdImg(url) {
	var img = new Image();
	img.src = url;
	prdImages[prdImages.length] = img;
}

function showPrdImg(index) {
	var img = document.getElementById("prdbig");
	img.width = prdImages[index].width;
	img.height = prdImages[index].height;
	img.src = prdImages[index].src;
	currentProdImg = index + 1;
}

function openPopup(url, width, height) {
	var options = 'location=no,menubar=no';
	if (parseInt(width) && parseInt(height)) {
		options += ',width=' + width + ',height=' + height;
	}
	var p = '?';
	if (url.split('?').length != 1) {
		p = '&';
	}
	url += p + 'imgcol=' + currentProdImg;
	return window.open(url, "prdpopup", options);
}

function setSize() {
	var img = document.getElementById('prdimg');
	width = img.width + 50;
	height = img.height + 100;
	if (window.outerWidth) {
		window.outerWidth = width;
		window.outerHeight = height;
	}
	else 
		if (window.resizeTo) {
			window.resizeTo(width,height);
		}
}

function openPrdCompare(pcode, width, height) {
	var options = 'location=no,menubar=no';
	if (parseInt(width) && parseInt(height)) {
		options += ',width=' + width + ',height=' + height;
	}
	var url = 'ecms.php?page=prd_compare&pv[p]=' + pcode;
	return window.open(url, 'prdCompare', options);

}

function show_notice_and_disable(formname) {
	popup = document.getElementById("payment_save_notice");

	if (formname== 'OrderPayment') {
		if (popup.style.visibility != 'visible') {
			popup.style.visibility = "visible";
			popup.style.display = "block";

			document.getElementById("doSave").disabled = true;

			document.OrderPayment.submit();

		} else {
			popup.style.visibility = "hidden";
			popup.style.display = "none";

			document.getElementById("doSave").disabled = false;
		}
	}
	if (formname== 'OrderDone') {
		if (popup.style.visibility != 'visible') {
			popup.style.visibility = "visible";
			popup.style.display = "block";

			document.getElementById("doSave").disabled = true;

			document.OrderDone.submit();

		} else {
			popup.style.visibility = "hidden";
			popup.style.display = "none";

			document.getElementById("doSave").disabled = false;
		}
	}
}