﻿// ImageZoom - Begin

function OpenPictureLayer(divImageZoom, ImageID, ImageTagID) {
	if (document.images[ImageTagID] == '[object]' || document.images[ImageTagID] == '[object HTMLImageElement]') document.images[ImageTagID].src = "/shop/thumb/" + ImageID + "_sizeby_exact_sizewidth_640_sizeheight_640.jpg";
	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);
}

function OpenPictureLayerCMS(divImageZoom, ImageID, ImageTagID) {
	if (document.images[ImageTagID] == '[object]' || document.images[ImageTagID] == '[object HTMLImageElement]') document.images[ImageTagID].src = "/file/" + ImageID + "_sizeby_exact_sizewidth_640_sizeheight_640.jpg";
	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=/ImageZoomCMS/" + ImageID + "/", "FlashImageZoomLayer", "640px", "640px", "9.0.0", false, flashvars, params, attributes);
}


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 ShowShippingInfo() {
	__doPostBack('ctl00$ctl00$btnShowShippingInfo', '');
}

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;
}

function OpenSearchOption(pnlLayer, imageOpen, extended) {
	iopen = document.getElementById(imageOpen);
	var ImageSRC = iopen.src;
	var Index = ImageSRC.indexOf('minus');

	d = document.getElementById(pnlLayer);

	if (extended == 1 && Index < 0) {
		d.style.visibility = 'visible';
		iopen.src = '/image/icon/icon_minus.gif'
		d.style.height = '150px';
	}
	else if (extended == 1 && Index > 0) {
		d.style.visibility = 'hidden';
		iopen.src = '/image/icon/icon_plus.gif'
		d.style.height = '5px';
	}
	else {
		if (Index > 0) {
			d.style.visibility = 'hidden';
			iopen.src = '/image/icon/icon_plus.gif'
			d.style.height = '5px';
		}
		else {
			d.style.visibility = 'visible';
			iopen.src = '/image/icon/icon_minus.gif'
			d.style.height = '150px';
		}
	}

}

function MovePicture(nameImage, NewImageURL, nameLink, NewLink) {

	document.getElementById(nameImage).src = NewImageURL;
	document.getElementById(nameLink).href = NewLink;
}

function OpenColorLink(NewLink) {
	top.location.href = NewLink;
}

function swapLayers_headmenu(id) {
	var cur_lyr; // holds id of currently visible layer
	if (cur_lyr) hideLayer_headmenu(cur_lyr);
	showLayer_headmenu(id);
	cur_lyr = id;
}

function showLayer_headmenu(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer_headmenu(id) {
	var lyr = getElemRefs(id);
	if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function BottomMouseOver(divBottom, ImageMC, ImageVisa, ImagePayPal, ImageKlarna, oekotex, ImageTrustedShop, ImageSSL, ImagePhone, ImageNewsletter, ImageFB, ImageTwitter, lblPayment, lblInfoTrusted, lblInfoOrder, lblPhoneNumber, lblInfoPhone, hplNewsletter, lblInfo) {
	document.getElementById(divBottom).className = 'bottonMenu_mouseover';
	document.getElementById(ImageMC).src = '/Image/Bottom/Neu/Active/Mastercard.gif';
	document.getElementById(ImageVisa).src = '/Image/Bottom/Neu/Active/Visa.gif';
	document.getElementById(ImagePayPal).src = '/Image/Bottom/Neu/Active/paypal.gif';
	document.getElementById(ImageKlarna).src = '/Image/Bottom/Neu/Active/klarna_rechnung_small.jpg';
	document.getElementById(oekotex).src = '/Image/Bottom/Neu/Active/Oeko-Tex-Logo-aktiv.gif';
	document.getElementById(ImageTrustedShop).src = '/Image/Bottom/Neu/Active/trusted.gif';
	document.getElementById(ImageSSL).src = '/Image/Bottom/Neu/Active/SSL.gif';
	document.getElementById(ImagePhone).src = '/Image/Bottom/Neu/Active/Telephone.gif';
	document.getElementById(ImageNewsletter).src = '/Image/Bottom/Neu/Active/Distel.gif';
	document.getElementById(ImageFB).src = '/Image/Bottom/Neu/Active/Facebook.gif';
	document.getElementById(ImageTwitter).src = '/Image/Bottom/Neu/Active/Twitter.gif';
	document.getElementById(lblPayment).className = 'font_menu_headline_bottom_active';
	document.getElementById(lblInfoTrusted).className = 'font_menu_headline_bottom_active';
	document.getElementById(lblInfoOrder).className = 'font_menu_headline_bottom_active';
	document.getElementById(lblPhoneNumber).className = 'font_menu_headline_bottom_phone_active';
	document.getElementById(lblInfoPhone).className = 'font_menu_headline_bottom_active';
	document.getElementById(hplNewsletter).className = 's_link_bottonMenu_newsletter_mouseover';
	document.getElementById(lblInfo).className = 'font_menu_headline_bottom_active';

}

function BottomMouseOut(divBottom, ImageMC, ImageVisa, ImagePayPal, ImageKlarna, oekotex, ImageTrustedShop, ImageSSL, ImagePhone, ImageNewsletter, ImageFB, ImageTwitter, lblPayment, lblInfoTrusted, lblInfoOrder, lblPhoneNumber, lblInfoPhone, hplNewsletter, lblInfo) {
	document.getElementById(divBottom).className = 'bottonMenu';
	document.getElementById(ImageMC).src = '/Image/Bottom/Neu/Passiv/Mastercard.gif';
	document.getElementById(ImageVisa).src = '/Image/Bottom/Neu/Passiv/Visa.gif';
	document.getElementById(ImagePayPal).src = '/Image/Bottom/Neu/Passiv/paypal.gif';
	document.getElementById(ImageKlarna).src = '/Image/Bottom/Neu/Passiv/klarna_rechnung_small.jpg';
	document.getElementById(oekotex).src = '/Image/Bottom/Neu/Passiv/Oeko-Tex-Logo-inaktiv.gif';
	document.getElementById(ImageTrustedShop).src = '/Image/Bottom/Neu/Passiv/Trusted.gif';
	document.getElementById(ImageSSL).src = '/Image/Bottom/Neu/Passiv/ssl.gif';
	document.getElementById(ImagePhone).src = '/Image/Bottom/Neu/Passiv/Telephone.gif';
	document.getElementById(ImageNewsletter).src = '/Image/Bottom/Neu/Passiv/Distel.gif';
	document.getElementById(ImageFB).src = '/Image/Bottom/Neu/Passiv/Facebook.gif';
	document.getElementById(ImageTwitter).src = '/Image/Bottom/Neu/Passiv/Twitter.gif';
	document.getElementById(lblPayment).className = 'font_menu_headline_bottom';
	document.getElementById(lblInfoTrusted).className = 'font_menu_headline_bottom';
	document.getElementById(lblInfoOrder).className = 'font_menu_headline_bottom';
	document.getElementById(lblPhoneNumber).className = 'font_menu_headline_bottom_phone';
	document.getElementById(lblInfoPhone).className = 'font_menu_headline_bottom';
	document.getElementById(hplNewsletter).className = 's_link_bottonMenu_newsletter_mouseout';
	document.getElementById(lblInfo).className = 'font_menu_headline_bottom';

} 
