﻿// ImageZoom - Begin

function OpenPictureLayer(divImageZoom, ImageID, ImageTagID) {
	d = document.getElementById(divImageZoom);
	d.style.visibility = 'visible';

	var flashvars = {};
	var params = {};
	params.menu = "false";
	params.quality = "high";
	var attributes = {};
	swfobject.embedSWF("/flash/imagezoom/ProCompImageZoom.swf?ImagePath=/ImageZoom/" + ImageID + "/", "FlashImageZoomLayer", "640px", "640px", "9.0.0", false, flashvars, params, attributes);
	if (document.images[ImageTagID] == '[object]') document.images[ImageTagID].src = "/shop/thumb/" + ImageID + "_sizeby_exact_sizewidth_640_sizeheight_640.jpg";
}

function ClosePictureLayer(divImageZoom, FlashImageZoomLayer) {

	d = document.getElementById(divImageZoom);
	d.style.visibility = 'hidden';

	e = document.getElementById(FlashImageZoomLayer);
	e.style.visibility = 'hidden';
}

// ImageZoom - End

// Seal - Begin

var currentSealLayer = '';

function OpenSealLayer(name) {
	CloseSealLayer();
	d = document.getElementById(name);
	d.style.visibility = 'visible';
	d.style.left = '0px';
	d.style.top = '-100px';
	currentSealLayer = name;
}

function CloseSealLayer() {
	if (currentSealLayer != '') {
		d = document.getElementById(currentSealLayer);
		d.style.visibility = 'hidden';
		currentSealLayer = '';
	}
}

// Seal - End

// InfoLayerMaterial - Begin

var currentMaterialLayer = '';

function OpenMaterialLayer(name) {
	CloseMaterialLayer();
	d = document.getElementById(name);
	d.style.visibility = 'visible';
	d.style.left = '0px';
	d.style.top = '-100px';
	currentMaterialLayer = name;
}

function CloseMaterialLayer() {
	if (currentMaterialLayer != '') {
		d = document.getElementById(currentMaterialLayer);
		d.style.visibility = 'hidden';
		currentMaterialLayer = '';
	}
}

// InfoLayerMaterial - End

function OpenGiftboxLayer(pnlgiftbox) {

	d = document.getElementById(pnlgiftbox);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '0px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '0px'; //sH / 2 - oH / 2 + 'px';
}

function OpenGiftboxLayerOrder(pnlgiftbox) {

	d = document.getElementById(pnlgiftbox);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '250px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '0px'; //sH / 2 - oH / 2 + 'px';
}

function OpenBasket(pnlexternbasketlayer) {

	d = document.getElementById(pnlexternbasketlayer);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '0px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '0px'; //sH / 2 - oH / 2 + 'px';

}

function OpenInfoRegistration(pnlInfoRegistration) {

	d = document.getElementById(pnlInfoRegistration);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '400px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '150px'; //sH / 2 - oH / 2 + 'px';
}


function OpenInfoPayment(pnlInfoPayment) {

	d = document.getElementById(pnlInfoPayment);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '400px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '150px'; //sH / 2 - oH / 2 + 'px';
}

function OpenInfoLayer(name) {

	d = document.getElementById(name);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '0px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '-100px'; //sH / 2 - oH / 2 + 'px';
}

function OpenInfoShipping(pnlInfoShipping) {

	d = document.getElementById(pnlInfoShipping);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '-200px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '-100px'; //sH / 2 - oH / 2 + 'px';

}

function OpenInfoDataPrivacy(pnlDataPrivacy) {

	d = document.getElementById(pnlDataPrivacy);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '0x'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '0px'; //sH / 2 - oH / 2 + 'px';

}


function OpenInfoShippingBasket(pnlInfoShipping) {

	d = document.getElementById(pnlInfoShipping);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '250px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '100px'; //sH / 2 - oH / 2 + 'px';

}

function OpenAdviceArticleLayer(pnlAdviceArticle) {

	d = document.getElementById(pnlAdviceArticle);
	d.style.visibility = 'visible';
	sW = screen.width;
	sH = screen.height;
	oW = d.offsetWidth;
	oH = d.offsetHeight;

	d.style.left = '0px'; //sW / 2 - oW / 2 + 'px';
	d.style.top = '0px'; //sH / 2 - oH / 2 + 'px';

}


function CloseExternLayer(pnlLayer) {
	d = document.getElementById(pnlLayer);
	d.style.visibility = 'hidden';
}

function changeimg(bildname, dateiname) {
	//	alert(document.images[bildname]);
	document.images[bildname].src = dateiname;
}

function swapLayers(id) {
	var cur_lyr; // holds id of currently visible layer

	if (cur_lyr) hideLayer(cur_lyr);
	showLayer(id);
	cur_lyr = id;
}

function showLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById) ? document.getElementById(id) : (document.all) ? document.all[id] : (document.layers) ? document.layers[id] : null;
	if (el) el.css = (el.style) ? el.style : el;
	return el;
}
