/*

!!!!!!!!!!!Wichtige Hinweise!!!!!!!!!!!!

Diese Datei ist in alle Länder gleich.

Bitte zukünftig alle Texte und länderspezifische Angaben (z.B. /de/) zur Functions_Config.js auslagern!

*/
// ##### Vars #####
var blnNoCrossStyle = blnChangeSize = outfitObj = clickSize = blnHtmlJSOk = false;
var blnOutFitStyle = 'falsch';
var paramArray = document.location.search.replace('?', '').split('&');
var DivisionArr, CategoryArr, WeltArr, intProductId, menuWelt;
var SizeChartObj;
// ##### Checking the Division ID or EspritKlasse #####
var CheckStyle = new Object();

var intProductId = getParameter('id', paramArray);
var FileHtmlJs = '../../HtmlJS/'+strLng+'/'+intProductId+'.html';
if(intProductId) loadJavascriptFile(FileHtmlJs);

// ##### Loading HtmlJS ##### 
function InitPage(intCalls, intMaxCalls) {
	
	var FileErr = '<center><p><b>'+Texte['unavailable'].replace('{ID}', intProductId).replace('{strLng}', strLng) +'</b></p></center>';
	
	new Ajax.Request(FileHtmlJs+'?ts='+(new Date()).getTime(), {
		method: 'get',
	  onSuccess: function() {
	  	//Manipulation
	  	if(ProductTemplate == '_SchuheV2') 				CheckStyle['schuhe'] = true;
	  	if(ProductTemplate == '_Tapete') 					CheckStyle['tapete'] = true;
	  	if(ProductTemplate == '_BettwaescheV2') 	CheckStyle['bettwaesche'] = true;
	  	if(ProductTemplate == '_SonnenbrillenV2') CheckStyle['sonnenbrillen'] = true;
	  	if(ProductTemplate != '_OutfitV2' && ProductTemplate != '_Outfit') { ProductTemplate = '_StandardV2'; }
	  	if(ProductTemplate == '_Outfit') { ProductTemplate = '_OutfitV2'; }			  	
	  	//Start
	  	InitStart();
	  },
	  onFailure: function() {
	  	document.body.innerHTML = FileErr;
	  }
	});		
}

// ##### Initializing #####
function InitStart() {
//Schliessen Button im SPVLayer nach rechts setzen
	if(SPVAsLayer) {
		$$('body')[0].insert({ top: $('backToOverview') });
		$('backToOverview').style.left = '745px';
		$('backToOverview').style.top = '5px';
	}	
//Standard-Size
	$$('body')[0].setStyle('font-size: 10px');
//CrossStyles zuletzt gesehen	
	if(this.getParameter('MasterID')){
		$('backToOverview').src = '../../Img/Product/'+strLng+'/StandartV2/zuletzt_de.gif';
	}	
//Q3 Pixel Functions_PixelQ3.js
	var webtrekkcontentId = strLng+'.';
	if(PixelVersion == 3) {
		if(typeof top.FrameStart == 'undefined') {
			webtrekkcontentId = "de.noframeset";
		}
		if(webtrekkcontentId.indexOf('de.noframeset') == -1) {
			try {
				if(typeof top.FrameStart.FrameMainNavi.menuwelt != 'undefined') {
					webtrekkcontentId += top.FrameStart.FrameMainNavi.menuwelt;
					if(typeof top.FrameStart.FrameMainNavi.menudownwelt != 'undefined') {
						webtrekkcontentId +='.' + top.FrameStart.FrameMainNavi.menudownwelt;
						if(typeof top.FrameStart.FrameMainNavi.page != 'undefined') {
							webtrekkcontentId += '.' + top.FrameStart.FrameMainNavi.page;
							if(typeof top.FrameStart.FrameMainNavi.subcat != 'undefined') {
								webtrekkcontentId += '.' + top.FrameStart.FrameMainNavi.subcat;
							}					
						}				
					}
				}
			} catch(e) {
				webtrekkcontentId += Welt;			
				webtrekkcontentId +='.' + DownWelt;
				webtrekkcontentId +='.' + Division;
				webtrekkcontentId +='.' + Category;
			}
			setContentId(webtrekkcontentId + '.detail',true);
			getContentGrp();
		}
	}
	SizeChartObj = SizeChart.SizeChartIdSplit();	
//FrameCheck	
	if(window.location.toString().indexOf('_iFrame') != -1)
		CheckStyle['iframe'] = true;
		
//Wenn alle Templates außer OutfitV2 auf StandardV2 umgestellt sind, kann diese Url-Abfrage auf ProductTemplate umgestellt werden:
	if(window.location.toString().indexOf('_iFrame') == -1 && window.location.toString().indexOf('_OutfitV2') != -1) {
		CheckStyle['outfitV2'] = true; ProductTemplate = '_OutfitV2';
	}				
//menuwelt
	try { menuWelt = top.FrameStart.FrameMainNavi.menuwelt; } catch(e) { menuWelt = Welt; }
							
	formElement = $('ProductView');
//color active
	getActiveStyleColor();
//Outfit-Picture Check (XML)
	CSOutfitCheck();	
//Reiter für CrossStyles
	if(NewSale != "sale" && CrossReiter == true && !CheckStyle['iframe'] && !CheckStyle['outfitV2']) {
		CrossStylesReiter();
		initCrossStyles(StyleNumber, aktiveColorNo, ProductTemplate);
	} else {
		if(CheckStyle['outfitV2']) {
			initCrossStyles(StyleNumber, aktiveColorNo, ProductTemplate);
		}
	}
//picture
	setAlternativeAnsichten();	
//DescStyleFitTip
	if($('passformBT')) passformDisplay();
//vars
	WeltArr	 	= (typeof OldWelt != 'undefined') ? OldWelt.split(',') : Welt.split(',');
	DivisionArr	 	= (typeof OldDivision != 'undefined') ? OldDivision.split(',') : Division.split(',');
	CategoryArr 	= (typeof OldCategory != 'undefined') ? OldCategory.split(',') : Category.split(',');	
//Thumbs Scroller
	ThumbScroller();
//SizeChart Check
	if(SizeChart.length != 5) if ($('groesseninfoBT')){$('groesseninfoBT').hide();}
	//Detail Image
	if($('detailImg')) {
		if(CheckStyle['sonnenbrillen'] && menuWelt != 'women' && DownTop1 != 'women') {
			$('detailImg').src 		= picServerBase+ 'PicProductFrontView/' + StyleNumber + '_' + aktiveColorNo  + '.jpg';			
			$('detailImg').setStyle('position: relative; margin-top: -130px;');
			$('detailBild').style.overflow = 'hidden';
		} else {
			$('detailImg').src 		= picServerBase+ 'PicDetail/' + StyleNumber + '_' + aktiveColorNo  + '.jpg';			
		}		
		$('detailImg').alt 		= Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
		$('detailImg').title	= Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
		//zoom and material
		if(!CheckStyle['tapete']) {
			$('detailImg').onclick = detailImageClicked;
			var zoomButton = new Element('img', { 'src':'../../Img/Product/'+strLng+'/zoom_button.gif' });
			zoomButton.observe('click', function() { detailImageClicked(true) });
			if(CheckStyle['schuhe'] == true && Material != '') {
				//material text and zoom
				var MaterialText = new Element('div');
				MaterialText.setStyle('text-align:right; position:absolute; top: -23px; right: 6px;');
				MaterialText.innerHTML = '<span style="background-color:#FFFFFF; color:#666666; font-family:Arial,Verdana; font-size:11px;padding: 2px">'+Material+'</span>';
				var ZoomDiv = new Element('div');
				ZoomDiv.setStyle('cursor: pointer; position: absolute; top: -25px; right: 0;');
				ZoomDiv.appendChild(zoomButton);
				MaterialText.insert({top: ZoomDiv });			
				$('farbenGroessenContainer').insert({ top: MaterialText });
				if(MaterialText.getHeight() > 14) {
					var MaterialAddPos = MaterialText.getHeight() - 14;
					MaterialText.style.top = Number(MaterialText.style.top.replace('px', '')) - MaterialAddPos;
				}
			} else {
				//ZoomButton
				zoomButton.setStyle('position:absolute; top: -26px; right: 6px; cursor: pointer;');
				$('farbenGroessenContainer').insert({top: zoomButton });		
			}
		} else {
			$('detailImg').style.cursor = 'default';
		}
	}
//Sizes and Text
	if($('Basket_Cont')) {
		writeSizeTable();
		//Size-Text
		var suche = /\d\d\/\d\d/;
		var suche2 = /\d\/\d\d/;
		var tmpSize = isNaN(Size);
		if((SizeChart.indexOf('009') == 2 || SizeChart.indexOf('008') == 2) && (suche.test(Size) == false || suche2.test(Size) == false) && tmpSize == false) {
			$('groessenTitle').innerHTML 	= Texte['size1']+'<br /><span style="text-transform:capitalize">'+Texte['size2']+'</span>';
		} else {
			$('groessenTitle').innerHTML 	= Texte['size3'];
		}
		if (writeFarbTable()) {
			$('farbenTitle').innerHTML = Texte['color'].toUpperCase()+' - '+ColorName.toUpperCase();
			$('farben').style.display = 'block';
		} else {
			$('farbenTitle').hide();
			$('farbenListe').hide();
		}
	} else {
		writeFarbTable();
	}
	//Style Picture		
	//Outfit
	if(CheckStyle['outfitV2'] != true) {
		if(blnOutFitStyle == 'wahr') {
			$('product_bild').src 	= picServerBase + 'PicProductCSOutfit/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';		
		} else {
			$('product_bild').src 	= picServerBase + 'PicProductFrontView/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
		}	
	} else {
		if(blnOutFitStyle == 'falsch') {
			$('product_bild').src 	= picServerBase + 'PicDestStyleProductOutfit/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
		} else {
			$('product_bild').src 	= picServerBase + 'PicProductCSOutfit/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
		}
	}
	// AH
	$('product_bild').alt 	= Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
	$('product_bild').title = Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
	$('product_bild').onclick = moreInfos;
	$('vergroessern').onclick = moreInfos;
	//XXL oder Zoom
	$('product_bild').onload = function() {
		//Graphit-Info
		if(this.src.indexOf('PicProductNoColor') == -1) {
			if($('noColorInfoLayer')) $('noColorInfoLayer').remove();
		} else {
			NoColorMeldung();
		}
		if(this.src.indexOf('PicProductAlternativ') != -1 || this.src.indexOf('PicProductAlternative1') != -1 || this.src.indexOf('PicProductHaptik') != -1) {
			$('product_bild').className = 'mouselupe';
			$('product_bild').alt = '';
			$('product_bild').title = '';	
			if($('product_bild_fade')) {
				$('product_bild_fade').className = 'mouselupe';			
				$('product_bild_fade').alt = '';
				$('product_bild_fade').title = '';
			}
		} else {
			$('product_bild').className = 'product_bild';
			$('product_bild').alt = Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
			$('product_bild').title = Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
			if($('product_bild_fade')) {
				$('product_bild_fade').className = 'product_bild';			
				$('product_bild_fade').alt = Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
				$('product_bild_fade').title = Texte['color'].toUpperCase()+': '+ColorName.toUpperCase();
			}
		}
		if(this.src.indexOf('PicProductCSOutfit') != -1) { blnOutFitStyle = 'wahr'; }
	};
	//Bettwäsche oder Tapete
	if(CheckStyle['bettwaesche'] || CheckStyle['tapete']) {
		$('product_bild').src 	= picServerBase + 'PicProductFlatView/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';		
	}
	//remove this graphit Message
	$('product_bild').observe('load', function() {
		if($('noColorInfoLayer')) {
			if(this.src.indexOf('PicProductNoColor') == -1) {
				$('noColorInfoLayer').remove();
			}
		}
	});
	$('product_bild').onerror = function() { if(this.src.indexOf('PicProductCSOutfit') != -1) { blnOutFitStyle = 'falsch'; } this.src = picServerBase + 'PicProductFrontView/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg'; }
	//Passform-Button
	if($('passformBT')) { $('passformBT').observe('click', passformClicked); }
	//Back-Button
  if(this.getParameter('returnto', arrParentURL) == 'catalog')
	{
		$('backToOverview').observe('click', function() {
			backToOverview('catalog');
			wtClickPixel('.back_to_catalog');
		});
	} else {
		$('backToOverview').observe('click', function() {
			backToOverview();
			wtClickPixel('.back_to_overview');
		});
	}				
	if(CheckStyle['outfitV2'] != true) {
		//SizeTip Info
		SizeTipText();
		if(strLng != 'de' && strLng != 'at') SizeTip = '0';
		//Brand
		if(PicDestBrand == '') { PicDestBrand = 'none.gif'; }
		$('PicDestBrand').src =  '../../PicDestBrand/New/' + PicDestBrand;
		//Short Description
		var maxLength = 60;
		if(DescStyleShort.length > maxLength) {
			var DescStyleShort_anzeige = DescStyleShort.substring(0,maxLength);
			DescStyleShort_anzeige = DescStyleShort_anzeige.substring(0, DescStyleShort_anzeige.lastIndexOf(' ')) + '...';
		} else if(DescStyleShort.length > 0) {
			var DescStyleShort_anzeige = DescStyleShort + '...';
		} else {
			var DescStyleShort_anzeige = DescStyleShort;
		}	
		
		var DescStyleFitTip3Element = new Element('span', {'id': 'DescStyleFitTip3'});
		if((DescStyleShort_anzeige.indexOf(DescStyleFitTip3)  != -1 && DescStyleFitTip3.length > 0) || DescStyleFitTip3.length > 0 || StyleName.toLowerCase().indexOf('edc16') >= 0) 
		{		
			$('DescStyleShort').innerHTML = DescStyleShort_anzeige;		
			$('DescStyleShort').innerHTML = DescStyleShort_anzeige.replace(DescStyleFitTip3, '');
			
			if(DescStyleFitTip3 == "" && StyleName.toLowerCase().indexOf('edc16') >= 0) {
				DescStyleFitTip3Element.innerHTML = 'EDC16<br />';
				DescStyleFitTip3Element.observe('click', showedc16layer);
		  } else {
		  	if(typeof(window.checkFitException) == "function" && checkFitException(SizeChart,DescStyleFitTip3)){	// checkFitException steht in FitGuide.js
					DescStyleFitTip3Element.innerHTML = FitText.toUpperCase()+': <span class="blackText pointer" style="text-decoration: none; cursor:default">'+DescStyleFitTip3+'</span>';					
				}else{
					DescStyleFitTip3Element.innerHTML = FitText.toUpperCase()+': <span class="blackText pointer">'+DescStyleFitTip3+'</span>';
					DescStyleFitTip3Element.observe('click', passformClicked);
				}
			}
		} else {
			DescStyleFitTip3Element.innerHTML = '<span class="blacktext" style="text-decoration: none; text-transform:none;">'+StyleName+'</span>';
			$('DescStyleShort').innerHTML = DescStyleShort_anzeige;
		}
		$('textbox').insert({top: DescStyleFitTip3Element});
		
		//More Info Link
		$('wkMehrLink').innerHTML +=  '<span class="red"> + </span><span style="text-decoration:underline;">'+Texte['more']+'</span>';
		$('wkMehrLink').observe('click', function() {
				SlideStop();
				openXXLDetail();
				wtClickPixel('.mehr');			
		});
		var mehrLinkElement = $('wkMehrLinkMaster');
		$('DescStyleShort').appendChild(mehrLinkElement);	
		//Price Display
		if(PriceNew != PriceBasic && pricereduction == true) {
			var priceBasicSpan = new Element('span', {'class': 'basic'});
			priceBasicSpan.innerHTML = waehrung+ ' ' + RoundValue(PriceBasic);
			$('PreisSpan').appendChild(priceBasicSpan);			
			var priceNewSpan = new Element('span', {'class': 'new'});	
			priceNewSpan.innerHTML = Texte['now']+' '+waehrung+' ' + RoundValue(PriceNew);
			$('PreisSpan').appendChild(priceNewSpan);
		} else {
			if(pricereduction) {
				$('PreisSpan').innerHTML = 	waehrung+' ' + RoundValue(PriceBasic);
			} else {
				$('PreisSpan').innerHTML = 	waehrung+' ' + RoundValue(PriceNew);
			}
		}				
		//StyleNumber
		$('stylenumber').innerHTML 	= StyleNumber;
		//Material-Text
		if($('materialText')) $('materialText').innerHTML = Material;			
		//Basket Button					
		$('warenkorbBT').observe('click', function(){ 
			if(clickSize == true || (SizeArr.length <= 1 && Size == 'one size')) {
				AddItem(); genHinweislayerCrossStyles();
			} else {
				var suche = /\d\d\/\d\d/;
				var suche2 = /\d\/\d\d/;
				//Spezielle Größe für UK
				if(strLng == 'uk') {
					var SizeUK = suche2.test(SizeArr[0][0]);
				} else {
					var SizeUK = false;
				}
				if((SizeChart == '01008' || SizeChart == '02008' || SizeChart == '01009' || SizeChart == '02009' || SizeChart == '01024') && (suche.test(SizeArr[0][0]) == true || SizeUK)) {
					showDenimSizeLayer();
				} else {
					showSizeLayer();
				}
				wtClickPixel('.hinweis_groessenwahl.add_basket');
			}
		});						
		//one size - off
		if((SizeArr.length <= 1 && Size == 'one size')) {
			SizeNoShow();
			clickSize = true;
		}
		//zur FunctionsV2 auslagern
		if(DescStyleFitTip4 == 'schiebevorhang') {
			var VorhangDiv = new Element('div');
			VorhangDiv.setStyle('position: absolute; right: 5px; margin-top: 5px;');
			var VorhangImg = new Element('img');
			VorhangImg.src = '../../Img/Product/'+strLng+'/curtain-instruction.jpg';
			VorhangDiv.appendChild(VorhangImg);
			$('detailBild').insert({ top: VorhangDiv });
		}			
		//Style Pics Save
		StylePicsSave();
		//Matrix Data Change
		MatrixChange();		
		//Different Price by Color Info - HF
		if($('diffColorPrice') && FarbReduziert == '-1' && Welt == 'women' && Division == 'dessous'){
			$('diffColorPrice').style.position = 'absolute';
			$('diffColorPrice').style.bottom = (document.all)? '131px' : '127px';
			$('diffColorPrice').innerHTML = '<img src="../../Img/Product/'+strLng+'/diff_Color_Price_V2.gif" border="0" alt=""/>';
			$('farbenGroessenContainer').style.bottom = (document.all)? '167px' :'162px';
		}				
		//SizeChart
		if($('groesseninfoBT')) {
			$('groesseninfoBT').observe('click', function(){ 
				WinOutSizeChart(); 
			});
		}	
		//Pfeile
		if(!CheckStyle['bettwaesche'] && !CheckStyle['tapete']) {
			PfeilStart();
		}		
	} else {
		//Style Pics Save
		StylePicsSave();
	}
	//Outfit-Farben
	if(CheckStyle['outfitV2'] && this.getParameter('spectmpl') != 'true') {
		showColorThumbs();		
	}
	//Correcting the navigation
	NaviLoad();
	//Rollierer
	if(!CheckStyle['bettwaesche'] && !CheckStyle['tapete'] && !CheckStyle['outfitV2'] && (SizeChartObj.chartType == '008' || SizeChartObj.chartType == '009') && (SizeChartObj.weltId == '01' || SizeChartObj.weltId == '02') ) {
		var FadeDiv = new Element('div');
		FadeDiv.style.cursor = 'pointer';
		FadeDiv.id = 'fade_image';		
		if($('mittelBild')) {
			$('mittelBild').insert({ top: FadeDiv });
			slideCreatePics();
			$('AnimationBT_Play').onclick = function() {
				StartSlideShow();
				wtClickPixel('.Animation.play');
			}
			$('AnimationBT_Pause').onclick = function() {
				SlideStop();
				wtClickPixel('.Animation.pause');
			}
			$('fade_image').onclick = openXXLDetail;
		}
	} else {
		if($('AnimationDiv')) $('AnimationDiv').hide();		
	}
	//keine Ansichten
	if(CheckStyle['bettwaesche']) {
		$('alternativeAnsichten').hide();
	}
	//Pixel V2/Premium
	try {
		if(PixelVersion == 3) {
			// wt_sendinfo(); 
			sendProductView('view');//initialisierung des Pixels mit Produktinformation
			setTimeout(sendSPVPixel, 300);//versenden des SPV Page Pixels
		}
		if(PixelVersion == 2) {
			if(typeof(wtClickPixel) != "undefined")
			{
				wt_c[3]= 0;		
		// Pixel bei Aufruf von Detail-CS
				if(this.getParameter('CSType') == 1)
				{
					wtClickPixel('.out.cs.klick.product-detail' ,'click');
				}			
		// Pixel bei Aufruf von Basketlayer-CS
				if(this.getParameter('CSType') == 2)
				{
					wtClickPixel('.out.cs.klick.add_basket' ,'click');
				}			
		// Pixel bei Aufruf von Übersicht
				if(!this.getParameter('CSType'))
				{
					wtClickPixel();
				} 
		// Pixel für eingeblendete CS-Styles - Timeout, da sonst der andere Pixel überschrieben/nicht gesendet wird			
				window.setTimeout('\
					if(blnNoCrossStyle) {\
						wt_c[3]= 1;\
						var tmpl_wt_be = wt_be;\
						wt_be = ".out.cs.einblendung.product-detail";\
						wtClickPixel();\
						wt_be = tmpl_wt_be;\
					}', 300);
			}			
		}
	} catch(e) {}
		
	//Schliessen Button Frame;
	if(window.name == 'CrossStyleIFrame') {
		var CloseFrame = new Element('img');
		CloseFrame.src = '../../Img/Product/'+strLng+'/ansichtenlayer/schliessen.gif';
		CloseFrame.setStyle('position: absolute; top: 10px; right: 10px; cursor: pointer;');
		CloseFrame.onclick = function() {
			parent.$('SchatteniFrame').remove();
			parent.$('CrossiFrame').remove();
		}
		$$('body')[0].appendChild(CloseFrame);
		$$('body')[0].style.marginTop = '5px';
		$('backToOverview').hide();
	}
	
	if(typeof arrInitFunctions != 'undefined') {		
		for(var i=0; i < arrInitFunctions.length; ++i) {
			if(eval(arrInitFunctions[i].enable)) {
				if(typeof eval(arrInitFunctions[i].functionName) == 'function') {
					if(typeof arrInitFunctions[i].functionTimeout != 'undefined') {
						setTimeout(eval(arrInitFunctions[i].functionName), arrInitFunctions[i].functionTimeout);
					} else {
						eval(arrInitFunctions[i].functionName +'();');
					}
				}
			}
		}
	}	
	//Outfit Bestand Check
	if(CheckStyle['outfitV2']) try { OutfitV2Check(); } catch(e) {}
}

function moreInfos() {
	if(CheckStyle['outfitV2'] != true && CheckStyle['tapete'] != true) {
		if($('product_bild').src.indexOf('Alternativ') == -1) {
			openXXLDetail();
		} else {
			detailImageClicked();
		}
	}
	if(CheckStyle['outfitV2'] == true) {
		CrossStyleAnzeigen('id='+ID+'&color='+ColorNumber+'&alternativeId='+clickForIframe+'&ThumbListClick=true', '_Outfit_iFrame');
	}
	if(CheckStyle['tapete'] == true) {
		openXXLDetail();
	}	
}

function OutfitV2Check() {
	var CSCheck = $('crossBilder').childElements()[0].childElements();
	for(var i=0; i < CSCheck.length; ++i) {
		var CSId = CSCheck[i].id.split('_')[1];
		var CrossJs = '../../HtmlJS/'+strLng+'/'+CSId+'.html';

	}	
}

function CrossStylesReiter() {	
	//ReiterElemente
	var ReiterDiv = new Element('div', { id:'CrossStyleReiter' });
	ReiterDiv.hide();
	ReiterDiv.setStyle('width: 275px;');
	var ReiterDetail = new Element('div', { id:'ReiterDetail' });
	ReiterDetail.innerHTML = '<div style="margin-top: 6px;">'+CrossReiterDetail.toUpperCase()+'</div>';
	ReiterDetail.setStyle('margin-left: 3px; float: left; color: #9f9f9f; font-size: 10px; font-family: Arial; text-align: center; font-weight: 900; width: 136px; height: 22px; background-image:url(../../Img/Product/'+strLng+'/StandartV2/tab_on.gif)');
	ReiterDetail.style.cursor = 'pointer';
	ReiterDetail.onclick = CrossSlideUp;
	var ReiterStyles = new Element('div', { id: 'ReiterStyles' });
	ReiterStyles.innerHTML = '<div style="margin-top: 6px;">'+CrossReiterStyles.toUpperCase()+'</div>';
	ReiterStyles.setStyle('float: left; color: #3e3e3e; font-family: Arial; font-size: 10px; text-align: center; font-weight: 900; width: 136px; height: 22px; background-image:url(../../Img/Product/'+strLng+'/StandartV2/tab_off.gif)');
	ReiterStyles.style.cursor = 'pointer';
	ReiterStyles.onclick = CrossSlideDown;
	ReiterDiv.appendChild(ReiterStyles);
	ReiterDiv.appendChild(ReiterDetail);
	$('rightSide').insert({ top: ReiterDiv });
	//NextStyle nach oben setzen
	$('rightSide').insert({ top: $('LastNextBox') });
	var CSSlideDiv = new Element('div');
	CSSlideDiv.id = 'CrossSlideDiv';
	CSSlideDiv.setStyle('z-index: 6; display: none; overflow: hidden; position: absolute; opacity: 1; background-color: #fff; top: 42px; width: '+ (document.all ? '275' : '273')+'px; left: 0px; height: 0px; border-left: 1px solid lightgrey; border-right: 1px solid lightgrey;');
	ReiterDiv.insert({ top: CSSlideDiv });
	var CrossStyleSlide = new Element('div');
	CrossStyleSlide.id = 'CrossStyleSlide';
	CrossStyleSlide.setStyle('width: 450px; position: absolute; left: 0px; cursor: pointer; border-bottom: 1px solid lightgrey;');
	CSSlideDiv.insert({ top: CrossStyleSlide });
	//Pfeile
	var ReiterPfeile = new Element('img', { id: 'ReiterPfeilL', src:'../../Img/Product/'+strLng+'/StandartV2/SlideCrossLeftOff.gif' });	
	ReiterPfeile.setStyle('position: absolute; top: 40px; left: 5px; cursor: pointer;');
	ReiterPfeile.hide();
	ReiterPfeile.onclick = function() {
		new Effect.Morph($('CrossStyleSlide'), {
		  style: 'left:0px;',
		  duration: 0.4
		});	
		wtClickPixel('.csreiterleft');
	}
	ReiterPfeile.onmouseover = function() { this.src = this.src.replace('Off.gif', 'On.gif'); }
	ReiterPfeile.onmouseout = function() { this.src = this.src.replace('On.gif', 'Off.gif'); }
	CSSlideDiv.appendChild(ReiterPfeile);
	var ReiterPfeile = new Element('img', { id: 'ReiterPfeilR', src:'../../Img/Product/'+strLng+'/StandartV2/SlideCrossRightOff.gif' });		
	ReiterPfeile.setStyle('position: absolute; top: 40px; left: 255px; cursor: pointer;');
	ReiterPfeile.hide();
	ReiterPfeile.onclick = function() {
		new Effect.Morph($('CrossStyleSlide'), {
		  style: 'left:-140px;',
		  duration: 0.4
		});
		wtClickPixel('.csreiterright');
	}	
	ReiterPfeile.onmouseover = function() { this.src = this.src.replace('Off.gif', 'On.gif'); }
	ReiterPfeile.onmouseout = function() { this.src = this.src.replace('On.gif', 'Off.gif'); }	
	CSSlideDiv.appendChild(ReiterPfeile);	
	//Wo immer aktiv?
	if(DivisionID == '71' || DivisionID == '72' || DivisionID == '76' || DivisionID == '77') {	
		setTimeout("CrossSlideDown(false)", 1000);
	}
}

function CrossSlideDown(clicked) {
	$('CrossStyleSlide').style.left = 0;
	$('ReiterStyles').style.backgroundImage = $('ReiterStyles').style.backgroundImage.replace('_off', '_on');	
	$('ReiterDetail').style.backgroundImage = $('ReiterDetail').style.backgroundImage.replace('_on', '_off');
	$('ReiterStyles').style.color = '#9f9f9f';
	$('ReiterDetail').style.color = '#3e3e3e';
	$('CrossSlideDiv').show();
	$('CrossSlideDiv').setStyle('opacity: 1; height: 0px;');
	new Effect.Morph($('CrossSlideDiv'), {
	  style: 'height:130px;',
	  duration: 0.4
	});
	if(clicked != false) wtClickPixel('.csreiterstyle');
}

function CrossSlideUp() {
	$('ReiterStyles').style.backgroundImage = $('ReiterStyles').style.backgroundImage.replace('_on', '_off');	
	$('ReiterDetail').style.backgroundImage = $('ReiterDetail').style.backgroundImage.replace('_off', '_on');
	$('ReiterStyles').style.color = '#3e3e3e';
	$('ReiterDetail').style.color = '#9f9f9f';	
	new Effect.Morph($('CrossSlideDiv'), {
	  style: 'height: 0;',
	  duration: 0.3
	});
	wtClickPixel('.csreiterdetail');
}

// -- Info -> no select the size --
function showSizeLayer() {
	var groesseHinweis = new Element('div', {'id': 'sizeLayerWahlen'}).setStyle('background-color:#FF0000;position:absolute;right:285px;bottom:70px;white-space: nowrap');
	$('groessen').appendChild(groesseHinweis)
	var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin: 9px 7px 9px 7px;')
	groessenText.innerHTML = '<span style="font-size: 14px;">1.</span> '+Texte['noselected1'];
	groesseHinweis.appendChild(groessenText);
	
	var Pfeil = groesseHinweis.appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/size_selection_arrow.jpg' }));
	Pfeil.setStyle('position: absolute;bottom:4px;right:-4px;');

	var groesseHinweis = new Element('div', {'id': 'sizeLayerDannWK'}).setStyle('background-color:#FF0000;bottom:5px;position:absolute;right:285px;white-space: nowrap');
	$('groessen').appendChild(groesseHinweis)
	var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin: 9px 7px 9px 7px;;text-align:center;')
	groessenText.innerHTML = '<span style="font-size: 14px;">2.</span> "'+Texte['noselected2'];
	groesseHinweis.appendChild(groessenText);	
	
	var Pfeil = groesseHinweis.appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/size_selection_arrow.jpg' }));
	Pfeil.setStyle('position: absolute;bottom:4px;right:-4px;');
}
//  ##### no selected the size #####
function showDenimSizeLayer() {
	if(SizeSelLaenge == false) {
		var groesseHinweis = new Element('div', {'id': 'sizeLayerWeite'}).setStyle('background-color:#FF0000;position:absolute;right:285px;top:-17px;white-space: nowrap');
		$('groesseListe').insert({ top: groesseHinweis });
		var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin: 7px')
		groessenText.innerHTML = Texte['noselected3'];
		groesseHinweis.appendChild(groessenText);
		
		var Pfeil = groesseHinweis.appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/size_selection_arrow.jpg' }));
		Pfeil.setStyle('position: absolute;bottom:4px;right:-4px;');
	}
	if(SizeSelWeite == false) {
		var groesseHinweis = new Element('div', {'id': 'sizeLayerLaenge'}).setStyle('background-color:#FF0000;position:absolute;top: 30px;right:285px;white-space: nowrap');
		$('groesseListe').insert({ bottom: groesseHinweis });
		var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin: 7px')
		groessenText.innerHTML = Texte['noselected4'];
		groesseHinweis.appendChild(groessenText);
		
		var Pfeil = groesseHinweis.appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/size_selection_arrow.jpg' }));
		Pfeil.setStyle('position: absolute;bottom:4px;right:-4px;');		
	}
}



// ##### EDC 16 Layer in Übersicht  DS 24.10. #####
function showedc16layer(wb){
	
var actpos = (document.all) ? document.body.scrollTop + 10 : document.body.scrollTop;			
	//---------- cookie steuerung
	var Zeit = new Date();
  var Jetzt = Zeit.getTime();
  var anzahl = parent.parent.GetCookie("edc16-Info")
  var evMousedown = 'document.body.style.overflow = \'auto\';$(\'edc16layer\').parentNode.removeChild($(\'edc16layer\'));';
  if(anzahl==""){anzahl = 0;}
  if(anzahl < 3){anzahl++;}
  Zeit.setTime(Jetzt + 24 * 60 * 60 * 1000);//5 Tage
	//---------- cookie steuerung ende   
		if($('edc16layer')){$('edc16layer').parentNode.removeChild($('edc16layer'));}
		var obj_edc16  = new Element ('span', {'id': 'edc16layer', 'onclick' : 'document.body.style.overflow=\'auto\';$(\'edc16layer\').parentNode.removeChild($(\'edc16layer\'));'});		
		(document.all) ? document.body.insertAdjacentHTML("AfterBegin",obj_edc16.outerHTML) : document.body.appendChild(obj_edc16);
			
		if(wb == 'warenkorbBT'){
			if(anzahl < 3){
				$('edc16layer').innerHTML = '<div style="position:absolute; top: '+ ((document.all) ? document.body.scrollTop + 20 : document.body.scrollTop + 20) +'px; left: 105px; width: '+ ((document.all) ? '555' : '551') +'px;z-index:50;cursor:pointer;border-width: 2px; border-style: outset; border-color: whitesmoke;"><img onclick="'+evMousedown+'" src="../../Img/Product/'+strLng+'/fit_layer_edc16_warenkorb_top.gif"/><img onclick="'+evMousedown+'" src="../../Img/Product/'+strLng+'/fit_layer_edc16_warenkorb_middle.gif"/><img src="../../Img/Product/'+strLng+'/fit_layer_edc16_warenkorb_bottomleft.gif" border="0" /><img onclick="AddItem();genHinweislayerCrossStyles();" src="../../Img/Product/'+strLng+'/fit_layer_edc16_warenkorb_bottomright.gif" border="0"/></div><div id="fader" style="position:absolute; top: 0px; width: 885px; height: '+(actpos + document.body.clientHeight)+'px; background-color: rgb(0, 0, 0);opacity: 0.25;filter:Alpha(opacity=25); -moz-opacity:0.50;cursor:pointer;z-index:10;"></div>';	
			}else{
				AddItem(); genHinweislayerCrossStyles();
			}
		}else{
		$('edc16layer').innerHTML = '<div style="position:absolute; top: '+ ((document.all) ? document.body.scrollTop + 20 : document.body.scrollTop + 20) +'px; left: 105px; width: '+ ((document.all) ? '604' : '600') +'px;z-index:50;cursor:pointer;border-width: 2px; border-style: outset; border-color: whitesmoke;"><img src="../../Img/Main/'+strLng+'/edc16_layer_image.jpg"><img src="../../Img/Main/'+strLng+'/edc16_layer_text.gif"></div><div id="fader" style="position:absolute; top: 0px; width: 885px; height: '+(actpos + document.body.clientHeight)+'px; background-color: rgb(0, 0, 0);opacity: 0.25;filter:Alpha(opacity=25); -moz-opacity:0.50;cursor:pointer;z-index:10;"></div>';
		}
		document.body.style.overflow = "hidden";
		(!document.all) ? parent.parent.FrameStart.FrameMainMain.scrollTo(0, actpos) : "";		
		parent.parent.SetCookie("edc16-Info", anzahl, Zeit);
}

// ##### Tapete #####

function tapete_show() {
		$('Basket_Cont').style.paddingTop = 0;
		var MengeDiv = new Element('div');
		MengeDiv.setStyle('float: left');
		var MengeText = new Element('div');
		MengeText.innerHTML = Texte['menge']+':';
		MengeText.setStyle('font-size:10px; margin:2px 5px 0 8px;');
		MengeDiv.appendChild(MengeText);
		var MengeInput = new Element('input');
		MengeInput.setStyle('border:1px solid #A5ACB2; font-size:10px; margin-left:8px; width:40px;');
		MengeInput.id = 'tapeteQty';
		MengeInput.name = 'Qty';
		MengeInput.value = 1;
		MengeDiv.appendChild(MengeInput);
		var TapeteButton = new Element('div', { 'style':'float: left; width: 210px; text-align: right;' });
		var TapeteBedarf	= new Element('img', { 'style':'cursor: pointer' });
		TapeteBedarf.onclick = tapete_bedarf;
		TapeteBedarf.src = '../../Img/Product/'+strLng+'/tapete/Rollenbedarf.gif';
		var TapeteAnleit	= new Element('img', { 'style':'cursor: pointer' });
		TapeteAnleit.src = '../../Img/Product/'+strLng+'/tapete/Verarbeitungsanleitung.gif';	
		TapeteAnleit.onclick = tapete_anleit;
		TapeteButton.appendChild(TapeteBedarf);
		TapeteButton.appendChild(TapeteAnleit);
		$('Basket_Cont').insert({ top: TapeteButton });
		$('Basket_Cont').insert({ top: MengeDiv });
		if(strLng == 'de' || strLng == 'at') {
			var TapeteAnfrag	= new Element('img', { 'style':'cursor: pointer; position: absolute; bottom: 0; z-index: 100;' });
			TapeteAnfrag.src = '../../Img/Product/'+strLng+'/tapete/A4_Muster_bestellen.gif';
			TapeteAnfrag.onclick = tapete_anfrage;
			$('mittelBild').appendChild(TapeteAnfrag);
		}
}

//Bedarfermittlung
function tapete_bedarf() {
	if(!$('tapete_calc')) {
		
		initMasterLayer();
		$('closeLayer').style.display  = 'none';
		
		var tap_layer 	 = new Element('div', { 'id':'tapete_calc' });
		
		tap_layer.appendChild(new Element('div', { 'class':'tapete_close' })).appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/ansichtenlayer/schliessen.gif' })).observe('click', function() { $('tapete_calc').remove(); closeLayer(); $('tapete_schatten').remove(); });
		tap_layer.appendChild(new Element('div', { 'class':'tapete_calctitel' })).innerHTML = Texte['tapetebedarf']+' <span class="tapete_grey">'+Texte['berechnen']+'*</span>';		
		tap_layer.appendChild(new Element('div', { 'class':'tapete_line' })).appendChild(new Element('img', { 'src':'../../Img/transparent.gif', 'width':'1', 'height':'1' }));
		tap_layer.appendChild(new Element('div', { 'class':'tapete_info' })).innerHTML = Texte['tapetetext'];		
		
		var tap_input = tap_layer.appendChild(new Element('div', { 'class':'tapete_input' }));		
		tap_input.appendChild(new Element('div', { 'class':'tapete_calctitle' })).innerHTML = Texte['tapeteinput'];		
		tap_input.appendChild(new Element('div', { 'class':'tapete_dataumfang' })).innerHTML = '<div style="margin-right: 2px; float: left" id="tapete_1">'+Texte['tapetebreite']+':</div> <input id="raumumfang" class="tapete_inputdata" />';		
		tap_input.appendChild(new Element('div', { 'class':'tapete_datahoehe' })).innerHTML = '<div style="margin-right: 2px; float: left" id="tapete_2">'+Texte['tapetelaenge']+':</div> <input id="raumhoehe" class="tapete_inputdata" />';
		
		tap_input.appendChild(new Element('div', { 'style':'float: left' })).appendChild(new Element('input', { 'type':'submit', 'value':Texte['tapetecalc'], 'id':'tapete_submit' })).observe('click', tapete_calc);		
		tap_input.appendChild(new Element('div', { 'class':'tapete_bedarf' })).innerHTML = '<span class="tapete_grey">'+Texte['tapeteneed']+':</span> <span id="rollenergebnis">&nbsp;</span>';			
		
		tap_layer.appendChild(new Element('div', { 'class':'tapete_databutt' }));
		tap_layer.appendChild(new Element('div', { 'class':'tapete_angabe' })).innerHTML = '*'+Texte['tapetegewaehr'];
		tap_layer.appendChild(new Element('div')).appendChild(new Element('input', { 'type':'submit', 'value':Texte['tapeteok'], 'id':'tapete_uebern' })).observe('click', function() {
			$('tapeteQty').value = tapete_rolle;
			$('tapete_calc').remove();
			$('tapete_schatten').remove();
			closeLayer();
		});

		var tap_schatten = new Element('div', { 'id':'tapete_schatten' });
		document.body.appendChild(tap_schatten);
		document.body.appendChild(tap_layer);	
		
		$('tapete_2').style.width = $('tapete_1').getWidth() + 'px';

		$('shadowLayer').observe('click', function() {
			if($('tapete_calc') != null) {
				$('tapete_calc').remove();
				$('tapete_schatten').remove();
			}
		});
		$('raumumfang').focus();
	}
}

//A4 Muster Formular (für DE/AT)
function tapete_anfrage() {
	if(!$('tapete_calc')) {
		
		initMasterLayer();
		$('closeLayer').style.display  = 'none';
		
		var tap_layer 	 = new Element('div', { 'id':'tapete_calc' });
		
		tap_layer.appendChild(new Element('div', { 'class':'tapete_close' })).appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/ansichtenlayer/schliessen.gif' })).observe('click', function() { $('tapete_calc').remove(); closeLayer(); $('tapete_schatten').remove(); });
		tap_layer.appendChild(new Element('div', { 'class':'tapete_calctitel' })).innerHTML = 'A4 MUSTER <span class="tapete_grey">BESTELLEN</span>';		
		tap_layer.appendChild(new Element('div', { 'class':'tapete_line' })).appendChild(new Element('img', { 'src':'../../Img/transparent.gif', 'width':'1', 'height':'1' }));
		tap_layer.appendChild(new Element('div', { 'class':'tapete_info' })).innerHTML = 'Gerne senden wir Ihnen ein A4-Muster dieser Tapete zu, damit Sie sich vorab von der Qualit&auml;t und dem Design überzeugen k&ouml;nnen.';		
		
		var tap_input = tap_layer.appendChild(new Element('div', { 'class':'tapete_input' })).innerHTML = '<form name="Muster" id="Muster">' + $('probeform').innerHTML + '</form>';

		tap_layer.appendChild(new Element('div', { 'class':'tapete_stylenr' })).innerHTML = 'ARTIKELNUMMER: <span style="color: #000000">'+StyleNumber+'</span>';
		tap_layer.appendChild(new Element('div')).appendChild(new Element('input', { 'type':'submit', 'value':'BESTELLUNG ABSENDEN', 'id':'tapete_uebern' })).observe('click', function() {			
			var felder = $('Muster').getInputs('text');
			var checkform = '';
			for(var i=0; i < felder.length; i++) {
				if(felder[i].value.length < 1) {
					if(typeof checkform != "number") { checkform = i; }
					felder[i].style.border = '1px solid red';
				} else {
					felder[i].style.border = '';
				}
			}
			$('Muster').plz.value = $('Muster').plz.value.replace(/\s/g, '');
			if(strLng == 'de') {
				Plz_Anzahl = 5;
			} else if(strLng == 'at') {
				Plz_Anzahl = 4;
			} else {
				Plz_Anzahl = 4;
			}
			if(typeof checkform == "number") {
				alert('Bitte füllen Sie alle Felder aus.');
				felder[checkform].focus();
			} else if($('Muster').plz.value.length != Plz_Anzahl || isNaN($('Muster').plz.value) == true) {
				alert('Bitte geben Sie eine gültige PLZ ein.');
				$('Muster').plz.style.border = '1px solid red';
				$('Muster').plz.focus();
			} else if(validEmail($('Muster').mail.value) != true) {
				alert('Bitte überprüfen Sie Ihre E-Mail Adresse.');
				$('Muster').mail.style.border = '1px solid red';
				$('Muster').mail.focus();
			} else {
				tapete_musterbestellung();
			}
		});

		var tap_schatten = new Element('div', { 'id':'tapete_schatten' });
		document.body.appendChild(tap_schatten);
		document.body.appendChild(tap_layer);

		$('shadowLayer').observe('click', function() {
			if($('tapete_calc') != null) {
				$('tapete_calc').remove();
				$('tapete_schatten').remove();
			}
		});
	}
}

//A4 Muster Senden (für DE/AT)
function tapete_musterbestellung(){
		var formular = document.forms.Muster;		
		new Ajax.Request(Texte['pfad']+'/cgi-bin/'+TapeteProbePfad, {
		  asynchronous:  	false,
		  method:  	'post',
		  parameters:  	$('Muster').serialize(),
		  onSuccess: function(transport) {
		  	if(transport.responseText.indexOf('OK') >= 0)
		  		tapete_danke()
		  },
		  onFailure: function() {} 	
		});
}

//A4 Muster Danke Msg (für DE/AT)
function tapete_danke() {
	if($('tapete_calc')) {
		$('tapete_calc').innerHTML = '';
		$('tapete_calc').appendChild(new Element('div', { 'class':'tapete_close' })).appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/ansichtenlayer/schliessen.gif' })).observe('click', function() { $('tapete_calc').remove(); closeLayer();$('tapete_schatten').remove(); });
		var tapete_danke = $('tapete_calc').appendChild(new Element('div', { 'class':'tapete_danke' }));		
		var tap_msg = 'VIELEN DANK F&Uuml;R IHRE<br />A4-MUSTER BESTELLUNG!<br /><span class="tapete_grey">Sie erhalten das Muster in K&uuml;rze.</span>';
		tapete_danke.appendChild(new Element('div', { 'class': 'tapete_dankemsg' })).innerHTML = tap_msg;
	}
}

//Rollen Rechner
var tapete_rolle = '1';
function tapete_calc() {
	var hoehe  = $('raumhoehe').value;
	var umfang = $('raumumfang').value;
	
	hoehe = parseFloat(hoehe.replace(',','.'));
	umfang = parseFloat(umfang.replace(',','.'));
	
	var rollen = Math.ceil((hoehe*umfang/5) * 1.2);

	if(!isNaN(rollen) && $('raumhoehe').value != '' && $('raumumfang').value != '') {
		$('rollenergebnis').innerHTML = rollen + ' ' + Texte['tapeterolle'];
		tapete_rolle = rollen;
	} else if($('raumhoehe').value == '' || $('raumumfang').value == '') {
		alert(Texte['tapetehinweis']);
		$('raumumfang').focus();
	} else {
		alert(Texte['tapeteerror']);
		$('raumumfang').focus();
	}
}

//Anleitung
function tapete_anleit() {
	initMasterLayer();
	$('closeLayer').style.display  = 'none';
	var div_layer = new Element('div', { 'id':'tapete_anleit' });
	div_layer.appendChild(new Element('div', { 'id':'tapete_anleit_left' })).appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/tapete/wallpaper-guide_left.gif' }));
	div_layer.appendChild(new Element('div', { 'id':'tapete_anleit_right' })).setStyle('position: absolute; bottom: 0px; right: 0px').appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/tapete/wallpaper-guide_right.gif' }));
	div_layer.appendChild(new Element('div', { 'id':'tapete_anleit_close' })).setStyle('position: absolute; top: 0px; right: 0px; cursor: pointer').appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/tapete/wallpaper-guide_close.gif' })).observe('click', function() { $('tapete_anleit').remove(); closeLayer(); });
	div_layer.appendChild(new Element('div', { 'id':'tapete_anleit_print' })).setStyle('position: absolute; top: 0px; right: 129px; cursor: pointer').appendChild(new Element('img', { 'src':'../../Img/Product/'+strLng+'/tapete/wallpaper-guide_print.gif' })).observe('click', function() { window.open('../../Img/Product/'+strLng+'/tapete/print.pdf') });
	document.body.appendChild(div_layer);
	$('tapete_anleit').observe('click', function() {
		if($('tapete_anleit') != null) {
			$('tapete_anleit').remove(); closeLayer(); 
		}	
	});
	$('shadowLayer').observe('click', function() {
		if($('tapete_anleit') != null) {
			$('tapete_anleit').remove(); closeLayer(); 
		}	
	});	
}

//Wert ändern
function tapeteAdd() {
	$('tapetemenge').appendChild(new Element('div', {'class':'tapetetext'})).innerHTML = Texte['menge']+':';
	$('tapetemenge').appendChild(new Element('div')).appendChild(new Element('input', { 'value':'1', 'name':'Qty', 'id':'tapeteQty' }));
}

function ShowFitToolTip(event, myText) {

		// Alt Title entfernen
		try{
			$('product_bild').alt = '';
			$('product_bild').title = '';
		}catch(E){}

		//Mouse-Position
		var MouseY = Event.pointerY(event);
		var MouseX = Event.pointerX(event);
		//Infobox erstellen
		if(!$('LastInfoBox')) {
			var LastInfoBox = new Element('div');
			LastInfoBox.id = 'LastInfoBox';
			$$('body')[0].appendChild(LastInfoBox);
		} else {
			$('LastInfoBox').show();
		}
		//StyleName und Preis
		$('LastInfoBox').innerHTML = '<div>'+myText+'</div>';
		//Infobox positionieren
		var LastInfoMax = LastRightPfeilPos - ($('LastInfoBox').getWidth() + MouseX + 25);
		var LastInfoLeft = LastInfoMax < 0 ? (MouseX-$('LastInfoBox').getWidth() - 10) : (MouseX+10);
		$('LastInfoBox').style.left = LastInfoLeft + 'px';
		$('LastInfoBox').style.top = (MouseY-15) + 'px';
		$('LastInfoBox').style.zIndex = 100;

		//Shadow-Layer
		if(!$('LastShadow1')) {
			var LastShadow1 = new Element('div');
			LastShadow1.innerHTML = '<img src="../../Img/Main/transparent.gif" width="1" height="1" />';
			LastShadow1.id = 'LastShadow1';

			LastShadow1.setOpacity(0.2);
			$$('body')[0].appendChild(LastShadow1);
		}
		$('LastShadow1').setStyle('display: block; position: absolute; width: '+($('LastInfoBox').getWidth()-2)+'px; height: 3px; left: ' + (parseInt($('LastInfoBox').style.left) + 2) + 'px; top: '+(parseInt($('LastInfoBox').style.top) + $('LastInfoBox').getHeight()) + 'px;z-index:100');
		if(!$('LastShadow2')) {
			var LastShadow2 = new Element('div');
			LastShadow2.innerHTML = '<img src="../../Img/Main/transparent.gif" width="1" height="1" />';
			LastShadow2.setOpacity(0.2);
			LastShadow2.id = 'LastShadow2';
			$$('body')[0].appendChild(LastShadow2);
		}
		$('LastShadow2').setStyle('display: block; position: absolute; width: 3px; height: '+($('LastInfoBox').getHeight()+1)+'px; left: '+ (parseInt($('LastInfoBox').style.left) + $('LastInfoBox').getWidth()) + 'px; top: '+(parseInt($('LastInfoBox').style.top) + 2) + 'px;z-index:100');

	}

	function ShowFitToolTipRemove() {
		if($('LastInfoBox')) $('LastInfoBox').hide();
		if($('LastShadow1')) $('LastShadow1').hide();
		if($('LastShadow2')) $('LastShadow2').hide();
	}


// ##### DIV Fit Tool Tip #####
function DivFitTooltip()
{
	initTranslation();
	var hilfSizeChart = SizeChart;

	// Name des Bildes auf das ein Mouseover gelegt wird
	var pic_name = "mittelBild";
	var ext = " FIT";

	if(DescStyleFitTip3!='' && DescStyleFitTip3!='EDC16')
	{
		// Leerzeichen aus DescStyleFitTip3 entfernen
		hilfDescStyleFitTip3 = DescStyleFitTip3.replace(/^\s+|\s+$/g,"").toUpperCase();

		if(hilfDescStyleFitTip3.indexOf('LEG') != -1)
		{
				hilfDescStyleFitTip3 = hilfDescStyleFitTip3.substr(0, hilfDescStyleFitTip3.indexOf('LEG'));
				hilfDescStyleFitTip3 = hilfDescStyleFitTip3.replace(/^\s+|\s+$/g,"");
				ext = ' LEG';
		}

		var strFitOut='';
		// Texte vor der Fitbeschreibung
		try{
			var arr_denimpants = new Array(PassformInfoTranslation.translat['waist_lbl'],PassformInfoTranslation.translat['thigh_lbl'],PassformInfoTranslation.translat['leg_lbl']);
		}catch(E){}
		var tooltip_obj = top.FrameFooter.obj_ToolTip;

		if(typeof(tooltip_obj) != 'undefined' && typeof (tooltip_obj[hilfSizeChart]) != "undefined" &&  typeof (tooltip_obj[hilfSizeChart][hilfDescStyleFitTip3.toUpperCase()]) != "undefined")
		{
			try{
				// Bei Anzügen/Sakkos die durch "/" getrennt sind, kein "FIT" anhängen
				if(SizeChart=="0202700" &&  hilfDescStyleFitTip3.indexOf('/') >= 0) { ext = ''; }

				strFitOut += "<ul style=\"width:250px;margin:0; padding:0;list-style: none;overflow:hidden;\"><li style=\"display: inline-block;margin-left:5px\"><b><span style=\"color:#000000;\">"+hilfDescStyleFitTip3 + ext + ' ' + StyleName+"</span></b></li></ul>";
				strFitOut += '<ul style=\"width:250px;list-style-position:outside;list-style-image:url(../../Img/Main/list_style_image.gif);padding-left:15px;margin:5px 0px 5px 5px;font-size:10px;font-family:Verdana">';
					for(i=0;i<tooltip_obj[hilfSizeChart][hilfDescStyleFitTip3.toUpperCase()].length;i++){
	  				if((hilfSizeChart != "0100900" && hilfSizeChart != "0100800" && hilfSizeChart != "0200900" && hilfSizeChart != "0200710" && hilfSizeChart != "0200720" && hilfSizeChart != "0200800") || (hilfSizeChart == "0200800" && (hilfDescStyleFitTip3 == "BUSINESS" || hilfDescStyleFitTip3 == "FASHION" || hilfDescStyleFitTip3 == "COMFORT" || hilfDescStyleFitTip3 == "REGULAR" || hilfDescStyleFitTip3 == "SLIM")))
	  					strFitOut += '<li>'+tooltip_obj[hilfSizeChart][hilfDescStyleFitTip3.toUpperCase()][i] + '</li>';
	  				else {
	  					// Bei Shorts und Bermudas die 3. Info im ToolTip weglassen
	  					if((EspritKlasse == "M1C" || EspritKlasse == "M2C" || EspritKlasse == "M3C" || EspritKlasse == "W1C" || EspritKlasse == "W2C" || EspritKlasse == "E1C" || EspritKlasse == "N1C") && i==2 ) { }
	  					else {
	  						strFitOut += '<li><b>' + arr_denimpants[i]+ '</b>' + PassformInfoTranslation.translat[tooltip_obj[hilfSizeChart][hilfDescStyleFitTip3.toUpperCase()][i]] + '</li>';
	  					}
	  				}
  				}
  				strFitOut += '</ul>';

  				$(pic_name).observe('mousemove', function(event) {
						ShowFitToolTip(event, strFitOut);
					});

					$(pic_name).observe('mouseout', ShowFitToolTipRemove);
			}
			catch(e){}
		}
}
}

function stempel()
{
	//2pack
		if (DescStyleFitTip4 == '2pack') {
			$('stempel').src = '../../PicDestStyleSymbol/'+strLng+'/stamp_doublepack.gif';
		}
	//3pack
  	else if (DescStyleFitTip4 == '3pack') {
  		$('stempel').src = '../../PicDestStyleSymbol/'+strLng+'/stamp_3pack.gif';
  	}
	//4pack
  	else if (DescStyleFitTip4 == '4pack') {
  		$('stempel').src = '../../PicDestStyleSymbol/'+strLng+'/stamp_4packgif';
  	}
	//5pack
  	else if (DescStyleFitTip4 == '5pack') {
  		$('stempel').src = '../../PicDestStyleSymbol/'+strLng+'/stamp_5pack.gif';
  	}	
}

function validEmail(email) {
  var strReg = "^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
  var regex = new RegExp(strReg);
  return(regex.test(email));
}