var clearElement = new Element('span', {'class': 'clearElement'}); 
var StyleNumber, StyleName, OverStyleName, StyleThumb, Size, SizeNo, ColorNumber, ColorName, aktiveColorIndex, Material, CareSym, EAN, Bestand, Farbe_Vorhanden, AltStyleNr, StyleThumb, alternativeElementToScroll, NewSale;
var Division, Category, Welt, DownWelt, PriceNew, PriceBasic, perfectprice, PicDestSellProzentColor, DescStyleShort, DescStyleLong, Action2, downtop2, PicSrcFit, PicDestStyleZoom, PicDestStyleDsl, PicSrcFlashZoom, ProductTemplate;
var blnNoCrossStyle = false;
var blnOutFitStyle = 'falsch';
var outfitObj=false;
var ModelObj;
var clickSize=false;

var paramArray = document.location.search.replace('?', '').split('&');
if(getParameter('id', paramArray)){
	loadJavascriptFile('../../HtmlJS/'+strLng+'/'+getParameter('id', paramArray)+'.html');
}
function preInitPage() {
	var paramArray = document.location.search.replace('?', '').split('&');
	if(getParameter('id', paramArray)){
		loadJavascriptFile('../../HtmlJS/'+strLng+'/'+getParameter('id', paramArray)+'.html');
	}
}
function getParameter(strParameter, arrTempUrl){ TMParrUrl = (arrTempUrl != undefined) ? arrTempUrl : arrUrl; for(var p=0;p<TMParrUrl.length;++p) { arrElements = TMParrUrl[p].split('='); if(arrElements[0] == strParameter) { return arrElements[(arrElements.length-1)]; } } return false; }
function getContentSize() { if (document.innerHeight) { /* Firefox */	return new Array(document.innerWidth, document.innerHeight); } else if(document.offsetWidth) { /* works in Explorer 6 Strict, Mozilla (not FF) and Safari */ return new Array(document.offsetWidth , document.offsetHeight); } else if(window.innerWidth) { return new Array(window.innerWidth, window.innerHeight); } else if(document.all.pageBody.offsetWidth) { return new Array(document.all.pageBody.offsetWidth , document.all.pageBody.offsetHeight); } return false; }
function loadJavascriptFile(javascriptFileStr) { if(javascriptFileStr != undefined) { for(j=0 ;j < $$("script").length ; j++) { script_text=$$("script")[j].src; if(script_text.indexOf(javascriptFileStr) != -1) { return false; } } var script_function=new Element('script', { 'src': javascriptFileStr,'type':'text/javascript' }); $$("head")[0].appendChild(script_function); } }

var DivisionArr, CategoryArr, WeltArr, intProductId;


function InitPage(intCalls, intMaxCalls) {	


	spvWTStatus = 'view';
	if(intCalls == undefined) {
		intCalls = 0;
	}
	if(intMaxCalls == undefined) {
		intMaxCalls = 15;
	}
	if(blnHtmlJSOk) {
		InitPageShow();
	} else {
		if(intCalls <= intMaxCalls) {
			window.setTimeout("InitPage('"+(++intCalls)+"', '"+intMaxCalls+"');", 100);
		} else {
			document.body.innerHTML = '<center><p><b>A product with ID '+intProductId+' is currently not available!</b></p></center>';
		}
	}
	
	

}

function InitPageShow() {
	
var paramArray = document.location.search.replace('?', '').split('&');
if(getParameter('id', paramArray)){
	loadJavascriptFile('../../HtmlJS/'+strLng+'/'+getParameter('id', paramArray)+'.html');
}
	
	formElement 			= $('ProductView');
	if(blnHtmlJSOk) {	
		wtInitSPVPixel();
		getActiveStyleColor();
		if(SizeChart == '0100900' || SizeChart == '0100800' || SizeChart == '0200900' || SizeChart == '0200800') {
			blnOutFitStyle = 'WAHR';
		}
		setAlternativeAnsichten();
		passformDisplay();
		NewSale = NewSale;
		WeltArr	 	= (typeof OldWelt != 'undefined') ? OldWelt.split(',') : Welt.split(',');
		DivisionArr	 	= (typeof OldDivision != 'undefined') ? OldDivision.split(',') : Division.split(',');
		CategoryArr 	= (typeof OldCategory != 'undefined') ? OldCategory.split(',') : Category.split(',');		
		intProductId = ID;	
		setStempel();
		alternativeElementToScroll = new ObjectScroller($('alternativeListe'), $('alternativeLinks'), $('alternativeListeUp'), $('alternativeListeDown'), 114);
		/* Animiertes / Verz�gertes Scrollen ist zur Zeit nicht m�glich? */
		for(var i=0; i < arrAlternativeansichten.length; ++i) {
			alternativeElementToScroll.addImage(arrAlternativeansichten[i]);
		}
		for(var i=0; i < arrAlternativeansichten.length; ++i) {
			alternativeElementToScroll.addImage(arrAlternativeansichten[i]);
		}		
		/* Detail IMG */
		$('detailImg').src = picServerBase+ 'PicDetail/' + StyleNumber + '_' + aktiveColorNo  + '.jpg';
		$('detailImg').observe('click', function(){ detailImageClicked(); });
    setDetailPic.init();
    
		/* Farb/Gr��enauswahl*/
		writeSizeTable();		
		$('groessenTitle').innerHTML 	= 'SIZES/AVAILABILITY';
		if (writeFarbTable()) {
			$('farbenTitle').innerHTML = 'COLOR';
			$('farben').style.display = 'block';
		}
		else {
			$('farbenTitle').style.display = 'none';
		}
		
		if(SizeChart == '0100900' || SizeChart == '0100800' || SizeChart == '0200900' || SizeChart == '0200800') {
			$('product_bild').src = picServerBase + 'PicProductCSOutfit/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
			$('product_bild').observe('error', function() {
				$('product_bild').src = picServerBase + 'PicProductFrontView/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
			});
		} else {
			$('product_bild').src = picServerBase + 'PicProductFrontView/'  + StyleNumber + '_' + aktiveColorNo  + '.jpg';
		}
		
		$('product_bild').observe('click', moreInfoWindowGroesse);	
		$('vergroessern').observe('click', moreInfoWindowGroesse);
		$('passformBT').observe('click', passformClicked);
		$('backToOverview').observe('click', function() {				
			backToOverview();
			wt_sendinfo(strLng+'.product_detail.back_to_overview','click');
		});
		if(SizeChart==""){
			$('groesseninfoBT').style.display="none";
		}else{									
			$('groesseninfoBT').observe('click', function(){initStyleInfoLayer(); });								
		}
		/* Warenkorb-Box */
		$('StyleName').innerHTML = '<span id="stylespan">' + StyleName + '</span>';	
		if(PicDestBrand == '') { PicDestBrand = 'none.gif'; }
		$('PicDestBrand').src =  '../../PicDestBrand/New/' + PicDestBrand;
		var DescStyleShort_anzeige = DescStyleShort;
		var maxLength = 60;
		if(DescStyleShort.length > maxLength) {
			DescStyleShort_anzeige = DescStyleShort.substring(0,maxLength);
			DescStyleShort_anzeige = DescStyleShort_anzeige.substring(0, DescStyleShort_anzeige.lastIndexOf(' ')) + '&nbsp;...';
		}
		
		if((DescStyleShort_anzeige.indexOf(DescStyleFitTip3)  != -1 && DescStyleFitTip3.length > 0) || DescStyleFitTip3.length > 0) {

			$('DescStyleShort').innerHTML = DescStyleShort_anzeige;
			$('DescStyleShort').innerHTML = DescStyleShort_anzeige.replace(DescStyleFitTip3, '');

			var DescStyleFitTip3Element = new Element('span', {'id': 'DescStyleFitTip3', 'style': 'text-decoration: underline; color:#FF0000; cursor:pointer;'});
			$('StyleName').innerHTML += '';
			if(SizeChart=="0100800" || SizeChart=="0100900"){
				DescStyleFitTip3Element.innerHTML = DescStyleFitTip3 + '<br >';
			}else{
				DescStyleFitTip3Element.innerHTML = 'FIT: ' + DescStyleFitTip3 + '<br >';
			}
			
			DescStyleFitTip3Element.observe('click', passformClicked);
			
			$('StyleName').innerHTML += '<br>'+StyleName;
			$('StyleName2').appendChild(DescStyleFitTip3Element);
			
	    document.getElementById('stylespan').style.display = 'none';

		} else {
			$('DescStyleShort').innerHTML = DescStyleShort_anzeige;
		}
		$('wkMehrLink').innerHTML += 'more';
		$('wkMehrLink').observe('click', function()  { wtClickPixel('.more') });
				
		var mehrLinkElement = $('wkMehrLinkMaster');
		$('DescStyleShort').appendChild(mehrLinkElement);
		if(DescStyleShort.length <= 0) {
			$('wkMehrLinkMaster').style.display = 'none';
		}		
		if(PriceNew != PriceBasic) {
			var priceBasicSpan = new Element('span', {'class': 'basic'});
				priceBasicSpan.innerHTML = '$ ' + PriceBasic;				
			$('PreisSpan').appendChild(priceBasicSpan);			
			var priceNewSpan = new Element('span', {'class': 'new'});	
				priceNewSpan.innerHTML = 'Now $ ' + PriceNew;
			$('PreisSpan').appendChild(priceNewSpan);	
		} else {
			$('PreisSpan').innerHTML = 	'$ ' + PriceBasic;
		}
		$('stylenumber').innerHTML 	= StyleNumber;
		$('warenkorbBT').observe('click', function(){
			if(clickSize==true) {
				AddItem(); genHinweislayerCrossStyles();
			} else {
				showSizeLayer();
			}
		})
		/* Style Bilder merken */
		stylePics = $('alternativeLinks').childElements();
		stylePics.push($('product_bild'));
		stylePics.push($('detailImg'));
		var tmpArray = stylePics;
		stylePics = null;
		stylePics = new Array();
		for(var i=0; i < tmpArray.length; ++i) {
			var testObj = null;
			if(tmpArray[i].src != undefined) {
				testObj = tmpArray[i];
			} else if(tmpArray[i].firstChild != null) {
				if(tmpArray[i].childElements().length == 2) {
					testObj = tmpArray[i].childElements()[1];
				} else {
					testObj = tmpArray[i].firstChild;
				}				
			}
			if(testObj != null) {
				if(testObj.src.indexOf(picServerBase) != -1) {
					stylePics.push(testObj);
				}				
			}	
		}
		tmpArray = null;	
		/* More Info Layer */
		MatrixChange();
		$('td_DescStyleShort').innerHTML = DescStyleShort;
		$('td_DescStyleLong').innerHTML = DescStyleLong;
		$('td_Material').innerHTML = Material;
		$('td_CareSym').innerHTML = CareSym;
		$('td_StyleName').innerHTML =  StyleName +',';
		$('td_PriceNew').innerHTML = RoundValue(PriceNew);
		$('PicDestStyleOver_List_Basket_Img').src = '../../PicDestStyleThumb/'+StyleNumber+'_'+ColorNumber+'.gif';
		sendProductView(spvWTStatus);	
		
	} else {
		document.body.innerHTML = '<center><p><b>A product with ID '+intProductId+' is currently not available!</b></p></center>';	
		return;
	}
	// Fit Tooltip
	DivFitTooltip();	
	setTimeout(sendSPVPixel, 300);
	// zuletzt gesehen f�llen -- Ingo 10.09.2007
	LastView(ID, PicProductFrontView, PicDestBrand, StyleName, PriceNew, NewSale, ColorNumber);
	if(typeof setStyleInfoLayerBT != 'undefined') {
		setStyleInfoLayerBT();
	}
	

}

function showSizeLayer() {
	var groesseHinweis = new Element('div', {'id': 'sizeLayerWahlen'}).setStyle('background-color:#FF0000;height:35px;position:absolute;right:285px;top:0px;width:145px;');
	$('groessen').appendChild(groesseHinweis)
	var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin-bottom:0;margin-left:7px;margin-right:0;margin-top:9px;')
	groessenText.innerHTML = '<span style="font-size: 14px;">1.</span> Please select a size';
	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:90px;height:47px;position:absolute;right:285px;width:160px;');
	$('warenkorbInfo').appendChild(groesseHinweis)
	var groessenText = new Element('div').setStyle('color:white;font-family:Arial;font-size:12px;font-weight:bold;margin-bottom:0;margin-left:0px;margin-right:0;margin-top:9px;text-align:center;')
	groessenText.innerHTML = '<span style="font-size: 14px;">2.</span> Then click on<br />"ADD TO SHOPPING CART"';
	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 sizeChilds = $('groesseListe').childElements();
	for(var i=0; i < sizeChilds.length; ++i) {
		sizeChilds[i].observe('click', function(){ $('sizeLayerWahlen').remove(); $('sizeLayerDannWK').remove(); if($('sizeLayerDannWK')) { $('sizeLayerWahlen').hide(); $('sizeLayerDannWK').hide(); } /*this.stopObserving('click')*/ });
	}
}

function backToOverview(strTarget){
	
	var hostNameStr = document.location.protocol + '//' + document.location.hostname + '/';
	var refPageStr 		= document.referrer;

  if(strTarget == undefined) strTarget = '';  	
		var newHref = null;
		var Links = parent.FrameMainNavi.document.getElementsByTagName('a');
		
		
		for(var intING = 0; intING < Links.length; intING++){
			if(Links[intING].style.color == '#ff0000' || Links[intING].style.color == 'rgb(255, 0, 0)')
				newHref = Links[intING].href;
		}
		
		if(newHref == null){
			if(location.href.indexOf('XmlSuche')>0) {
				this.location.href = '../../XmlSuche/us/XmlMain.html';
			} 
			else if(location.href.indexOf('refpage')>0)
			{
				strRefPage=location.href.slice(location.href.indexOf('refpage')+8,location.href.indexOf('.html&statDivision')+5);
				this.location.href='../../'+strRefPage+'?lastID=' + intProductId;
			}
			else if(typeof strRefPage != "undefined"){
				this.location.href = "../../" + strRefPage + "?lastID=" + intProductId;				
			}
			else{		
				
				if(Category.indexOf(',')>=0){
					Category = Category.substring(0,Category.indexOf(','));
					//alert(Category.substring(0,Category.indexOf(',')));
				}
				
				if(Action3!=""){
				strRefPage = "../../HtmlOverAction3/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_" + Action3.replace(/\W/gi, "_") + "_" + Action3.replace(/\W/gi, "_") + "_" + SubAction3.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
				}
				
				if(Action4!=""){
				strRefPage = "../../HtmlOverAction4/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_" + Action4.replace(/\W/gi, "_") + "_" + Action4.replace(/\W/gi, "_") + "_" + SubAction4.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
				}
				
				if(Action5!=""){
				strRefPage = "../../HtmlOverAction5/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_" + Action5.replace(/\W/gi, "_") + "_" + Action5.replace(/\W/gi, "_") + "_" + SubAction5.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
				}
				
				
				if(Action7!=""){
				strRefPage = "../../HtmlOverAction7/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_" + Action7.replace(/\W/gi, "_") + "_" + Action7.replace(/\W/gi, "_") + "_" + SubAction7.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
				}
				
				if(Action8!=""){
				strRefPage = "../../HtmlOverAction8/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_" + Action8.replace(/\W/gi, "_") + "_" + Action8.replace(/\W/gi, "_") + "_" + SubAction8.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
				}	
				
				else{
				strRefPage = "../../HtmlOver/" + strLng + "/" + Welt.replace(/\W/gi, "_") + "_all_products_" + Division.replace(/\W/gi, "_") + "_" + Category.replace(/\W/gi, "_") + ".html?lastID=" + intProductId;				
				this.location.href = strRefPage;
			}
			}
		}else{
			if(newHref.indexOf('?') >= 0){
				parent.FrameMainNavi.location.href = encodeURI(newHref) + "&amp;showOver=true" + "&amp;lastID=" + intProductId;
			}
			else{
				this.location.href = newHref + "?lastID=" + intProductId;
			}
		}

}

function initModelInfo()
{
	$('modelInfoTitle').innerHTML = 'MODEL INFO';
	$('modelInfoText').innerHTML = 'Our model is <span id="modelGroesse" class="heightlight"></span>&nbsp;tall and wears size <span id="StyleGroesse" class="heightlight"></span>.';
	var inputFileName = '../../HtmlModelMessure/' + strLng + '/' + StyleNumber + '_' + Season + '_'+ SeasonJahr + '.xml';
	new Ajax.Request(inputFileName,{
		onSuccess: function(transport) {	
			var ModelJSON = new XML.ObjTree();
			var ModelObj = ModelJSON.parseXML(transport.responseText).styleNumber;	
			if(ModelObj.styleColor.length == undefined) {
				$('modelGroesse').innerHTML = ModelObj.styleColor.modelGroesse + ' Inch';
				$('StyleGroesse').innerHTML 	=  ModelObj.styleColor.groesse;
			} else {
				for(var i=0; i < ModelObj.styleColor.length; i++) {
					if(ModelObj.styleColor[i]['-colorNr'] == act_color) {
						$('modelInfo').style.display = 'block';
						$('modelGroesse').innerHTML = ModelObj.styleColor[i].modelGroesse + ' Inch';
						$('StyleGroesse').innerHTML 	= ModelObj.styleColor[i].groesse;
					} else {
						$('modelInfo').style.display = 'none';		
					}
				}
			}										
		},
		onFailure: function() {
			$("modelInfo").style.display = "none";
		}
	});
}

function getActiveStyleColor()
{
	var ColorCheckAktiv;
	var ColorSelect = false;
	
	var paramArray = document.location.search.replace('?', '').split('&');
	if(getParameter('color', paramArray) || getParameter('defcolor', top.location.search.replace('?', '').split('&')) || getParameter('color', top.location.search.replace('?', '').split('&'))){
		for(var i=0; i < ColorNameArr.length; ++i) {
			if(ColorNameArr[i][1] == getParameter('color', paramArray) || ColorNameArr[i][1] == getParameter('defcolor', top.location.search.replace('?', '').split('&')) || ColorNameArr[i][1] == getParameter('color', top.location.search.replace('?', '').split('&'))){
				aktiveColor = i;
				aktiveColorIndex = aktiveColor;
				aktiveColorNo = ColorNameArr[i][1];
			}
		}
	} else {
		aktiveColor = 0;
		aktiveColorIndex = aktiveColor;
	}	
	if(aktiveColorNo == null) {
		for(var i=0; i < ColorNameArr.length; ++i) {
			if(ColorSelect == false) {
			  for(var b=0;b<SizeColCount;b++)	{
		  		if(GetBestand(b,i) > 0 & GetColorName(i,9)=='1' && ColorSelect == false) {
		  			ColorCheckAktiv = i;
		  			ColorSelect = true;
		  			break;
		  		}
		  	}
	  	} else {
	  		break;
	  	}
		}
		aktiveColor = ColorCheckAktiv;
		aktiveColorIndex = aktiveColor;
		aktiveColorNo = ColorNameArr[ColorCheckAktiv][1];
	}
	ColorNumber = aktiveColorNo;
	ColorName = ColorNameArr[aktiveColorIndex][0];

}

function writeFarbTable()
{
	var farbthumbPath = 'PicDestStyleThumbMuster/';
	var displayColorsCount = 0;
	for(var i=0; i < ColorNameArr.length; ++i) {
		var ColorCheckAktiv = false;		
		for(var b=0;b<SizeColCount;b++)
	  {
	  		if(GetBestand(b,i) > 0 & GetColorName(i,9)=='1') {
	  			ColorCheckAktiv = true;
	  			break;
	  		}	 
		}
		if(ColorCheckAktiv == true && ColorNameArr[i][9] != 0) {
			
			var imageSpan = new Element('div', {'id': 'span_colorElement_'+  i, 'style': 'float:left; margin-left:'+((i > 0) ? ((Prototype.Browser.IE) ? '-1' : '2') : '2')+'px;' });
			var colorImage = new Image();					
			colorImage.src = picServerBase + farbthumbPath + ColorNameArr[i][3];
			colorImage.id = 'colorElement_'+  i;
			colorImage.alt = 'COLOR: ' + ColorNameArr[i][0].toUpperCase();
			colorImage.title = 'COLOR: ' + ColorNameArr[i][0].toUpperCase();		
			if(aktiveColorNo == ColorNameArr[i][1]) {
				imageSpan.setStyle({
				width: '40px', height: '33px', backgroundImage: 'url("'+colorImage.src+'")', backgroundRepeat: 'no-repeat'
				});
				$(imageSpan).update('<img src="../../Img/Product/us/activ_color_frame.gif" alt="COLOR: ' + ColorNameArr[i][0].toUpperCase()+'" title="COLOR: ' + ColorNameArr[i][0].toUpperCase()+'"/>');
			
				colorImage.width  = 36;
				colorImage.height = 31;
			} else {
				imageSpan.setStyle({
				width: '40px', height: '33px', padding: '0px'
				});				
				colorImage.width  = 40;
				colorImage.height = 33;
			}
			if(aktiveColorNo != ColorNameArr[i][1])
				imageSpan.appendChild(colorImage);
			$('farbenListe').appendChild(imageSpan);

			if($('span_colorElement_'+  i))
				$('span_colorElement_'+  i).observe('click', function() { changeColor(this.id); });
			else
				$(colorImage.id).observe('click', function() { changeColor(this.id); });
			displayColorsCount++;
		}
		addOption('farbliste' ,ColorNameArr[i][1]);		
	}
	$('farbliste').options[aktiveColorIndex].selected = true;	
	return displayColorsCount > 1;	
}

function detailImageClicked()
{
	initMasterLayer();

	var ZoomPicture 											= PicSrcFlashZoom;
	ZoomPicture 													= ZoomPicture.substring(0, ZoomPicture.length - 3);
	replacer 															= ZoomPicture.substring((ZoomPicture.lastIndexOf("_") + 1 ), ZoomPicture.lastIndexOf("."));
	
	if(Category == "sunglasses" || Division == "sunglasses" || Category.indexOf('sunglasses') >= 0) {
		var replacer = ZoomPicture.replace(ZoomPicture.substring((ZoomPicture.indexOf('_') + 1), ZoomPicture.length - 1), aktiveColorNo);
	}
	
	OldColor 																							= "_" + aktiveColorNo;
	NewColor 																							= "_" + replacer;
	ZoomPicture 																					= ZoomPicture.replace(NewColor, OldColor); 

	/**/ZoomPicture = ZoomPicture.replace('.', '');


	var frameSize = getContentSize();
	if(Prototype.Browser.IE) {
		$('closeLayer').style.right		= (frameSize[0] - 796) + 'px';
	} else {
		$('closeLayer').style.right		= (frameSize[0] - 796) + 'px';
	}
	$('closeLayer').style.top 			= '12px';
	$('closeLayer').style.backgroundColor = 'white';
	$('flashLayer').style.display = 'block';	
	$('closeLayer').innerHTML='<img src="../../Img/Product/us/ansichtenlayer/schliessen.gif" />';
	$('flashLayerSchatten').style.display = 'block';
	$('flashLayer').style.width 	= '789px';
	$('flashLayer').style.height 	= '445px';
	$('flashLayer').style.padding 	= '5px';
	$('flashLayer').style.left 		= '5px';
	$('flashLayer').style.top		= '5px';
	var so = new SWFObject(zoomFlashPath, "flashLayer", "789", "450", "7", "#ffffff");
		so.addParam("quality", "high"); // Parameter anh�ngen
		so.addParam("scale", "noscale");
		so.addParam("wmode", "opaque");
		//so.addParam("allowScriptAccess", "sameDomain");
		so.addVariable("language", "en");
		so.addVariable("startCrop", "0,0,1,1");		
		so.addVariable("zoomimagename", ZoomPicture);
		if(Division == 'jeans' || parent.parent.OldDivision=='jeans'){		
			so.addVariable("zoomimagename2", ZoomPicture2); // R�ckansicht
		}
		so.addVariable("zoom_url", "http://zoom.esprit-online-shop.com/");			
		so.write("flashLayer");		
}

function passformClicked()
{	
	var brand=PicDestBrand.slice(PicDestBrand.indexOf('brand_')+6,PicDestBrand.indexOf('.gif'));		
	
	WinOutFitLayer(SizeChart,brand,DescStyleFitTip3);
	
}

function WinOutSizeChart_v2()
{			
	if( SizeChart != "" ){		
		var size_pixel=SizeChart.slice(0,SizeChart.indexOf('_layer'));				
		initMasterLayer();		
		
		$(SizeChart).style.display='block';
		
		parent.parent.wt_sendinfo('us.cat.popup.'+size_pixel+'');		
	}
}

function initMasterLayer()
{	
	var frameSize = getContentSize();
	$('masterLayer').style.display 	= 'block';
	$('flashLayerSchatten').style.display = 'none';
	$('masterLayer').style.width 	= frameSize[0] + 'px';
	$('masterLayer').style.height 	= frameSize[1] + 'px';	
	$('shadowLayer').style.width 	= frameSize[0] + 'px';
	$('shadowLayer').style.height 	= frameSize[1] + 'px';
	$('shadowLayer').setOpacity(0.30);
	$('shadowLayer').observe('click', function() { closeLayer(); wt_sendinfo(strLng+'.cat.layerclick.close'); });
	$('closeLayer').observe('click', function() { closeLayer(); });

}

function closeLayer()
{
	$('masterLayer').childElements()[4].innerHTML = '';
	$('flashLayerSchatten', 'flashLayer', 'passformLayer', 'xxlLayer').invoke('hide');
	$('closeLayer').removeClassName ('passformLayercloseLayer');
	try
	{
	$(SizeChart).style.display = 'none';
	}catch(E){}
	
	$('masterLayer').style.display = 'none';
}

function changeColor(elementID)
{		
	spvWTStatus = 'view';
	
	elementID = elementID.replace('span_', '');
	var aktiveColorIndexArr =  elementID.split('_');
	lastColorNo = aktiveColorNo;
	aktiveColorIndex = aktiveColorIndexArr[1];
	aktiveColorNo = ColorNameArr[aktiveColorIndexArr[1]][1];
	ColorNumber = aktiveColorNo;
	ColorName = ColorNameArr[aktiveColorIndexArr[1]][0];
	changeCrossColor(ColorNameArr[aktiveColorIndexArr[1]][1]);
	formElement.farbliste.selectedIndex = aktiveColorIndexArr[1];
	//initModelInfo();
	for(var i = 0; i < stylePics.length; ++i) {
		changeImageColor(stylePics[i].id)
	}
	for(var i = 0; i < arrAlternativeansichten.length; ++i) {
		arrAlternativeansichten[i]['img'] = arrAlternativeansichten[i]['img'].replace('_'+lastColorNo+'.', '_'+aktiveColorNo+'.');
		arrAlternativeansichten[i]['thumbImg'] = arrAlternativeansichten[i]['thumbImg'].replace('_'+lastColorNo+'.', '_'+aktiveColorNo+'.');
		if(arrAlternativeansichten[i]['imgXXL']) {
			arrAlternativeansichten[i]['imgXXL'] = arrAlternativeansichten[i]['imgXXL'].replace('_'+lastColorNo+'.', '_'+aktiveColorNo+'.');
		}
	}
	writeSizeTable();
	$('PicDestStyleOver_List_Basket_Img').src = '../../PicDestStyleThumb/'+StyleNumber+'_'+ColorNumber+'.gif';
	setAlternativeAnsichten();
	alternativeElementToScroll.reRender(arrAlternativeansichten);
	$('alternativeLinks').setStyle('top: 0px');
	MatrixChange();
	$('PicDestStyleOver_List_Cross_Img').src = '../../PicDestStyleThumb/'+StyleNumber+'_'+ColorNumber+'.gif';
	$('farbenListe').innerHTML = '';
	writeFarbTable();	
	sendProductView(spvWTStatus); 
	setTimeout(sendSPVPixel, 300);
}

function changeImageColor(imageElementID)
{
	try {
	if($(imageElementID)) {
		$(imageElementID).src = $(imageElementID).src.replace('_'+lastColorNo+'.', '_'+aktiveColorNo+'.');
	}
	} catch(e) {}
}

function writeSizeTable() 
{ 
	var sizethumbPath = '../../PicDestSizeThumb/'; 
	$('groesseListe').innerHTML = '';
	$('groessenliste').innerHTML = '';
	for(var i=0; i < SizeArr.length; ++i) { 
		var sizeImage = new Image(); 	
		var sizeStatus;
		var isSelected = false;	
		if(GetBestand(aktiveSize, aktiveColorIndex) == 0) {
			aktiveSize = aktiveSize + 1;
			if(aktiveSize > (SizeArr.length -1)) {
				aktiveSize = 0;
			}
		}
		
		if(GetBestand(i, aktiveColorIndex) != 0) {
			sizeStatus = '';
			if(i == aktiveSize && clickSize==true) { sizeStatus = '_on';  }
		} else { sizeStatus = '_off'; }
		addOption('groessenliste', SizeArr[i][0]);
		sizeImage.src = sizethumbPath + SizeArr[i][1].replace('.gif', sizeStatus+'.gif'); 
		sizeImage.id = 'sizeElement_'+ i;
		sizeImage.style.width = '40px';
		sizeImage.style.height = '14px';

		if(i%6 == 0) {
			sizeImage.style.borderTop = '1px solid white';
		}
		$('groesseListe').appendChild(sizeImage);  
		$('sizeElement_'+ i).observe('click', function(){ clickSize=true;changeSize(this.id); });
	} 
	formElement.groessenliste.selectedIndex = aktiveSize;
}

function changeSize(elementID)
{
	spvWTStatus = 'view';
	var aktiveSizeArr =  elementID.split('_');
	aktiveSize = aktiveSizeArr[1];
	Size = SizeArr[aktiveSize][0];
	SizeNo = SizeArr[aktiveSize][2];
	writeSizeTable();
	formElement.groessenliste.selectedIndex = aktiveSize;	
	MatrixChange();
	sendProductView(spvWTStatus); 
	setTimeout(sendSPVPixel, 300);
}

function addOption(selectBox, sizeStr){
	var optionItem = new Element('option', {
		'value': sizeStr
	});
	optionItem.innerHTML = sizeStr;
	$(selectBox).appendChild(optionItem);
}

function MatrixChange()
{
  var Col = document.forms[0].ColorList.selectedIndex;
  var Row = document.forms[0].SizeList.selectedIndex;
  if(Col<0) { Col=0; document.forms[0].ColorList.selectedIndex = Col; }
  if(Row<0) { Row=0; document.forms[0].SizeList.selectedIndex = Row; } 
	
  PriceBasic 	= GetPriceBasic(Row, Col);
  PriceNew   	= GetPriceNew(Row, Col);
  /* f�r best�tigungslayer*/
  if(document.getElementById('priceSpanSale')) {
  	document.getElementById('priceSpanSale').innerHTML = '$' + PriceNew;
	}
	if(document.getElementById('priceSpanBig')) {
  	document.getElementById('priceSpanBig').innerHTML = '$' + PriceNew;
	}
  
  ColorName  	= GetColorName(Col,0);
  ColorNumber	= GetColorName(Col,1);
  StyleThumb 	= GetColorName(Col,3);
	
	PicProductFrontView = GetColorName(Col,3);
  PicDestStyleZoom 	= GetColorName(Col,6);
  PicSrcFlashZoom 	= GetColorName(Col,17);
  PicSrcFlash3D			= GetColorName(Col,16);
  PicSrcMacro				= GetColorName(Col,7);
  PicSrcFit  				= GetColorName(Col,8);
  PicDestStyleDsl		= GetColorName(Col,10);
	
  Size       			= GetSize(Row,0);
  SizeThumb  			= GetSize(Row,1);
  SizeNo     			= GetSize(Row,2);
  EAN        			= GetEAN(Row, Col);
  Bestand    			= GetBestand(Row, Col);
  Farbe_Vorhanden	= GetColorName(Col,9);
  AltStyleNr 			= GetAltStyleNr(Row, Col);
	  
//----- SizeTip Gr�sse vorhanden?
  if(blnNoCrossStyle || NewSale=='sale')
  {
	  var strRegSale = "Sale";
	}
	else
	{
		var strRegSale = "Regular";
	}
	
	//Anzahl der Sizes
	var size_anzahl = document.forms[0].SizeList.length;
	
	//aktuelle Bund-L�nge f�r Hosen/Jeans ermitteln
	var SizeSplit = Size.split('/');
	if(SizeSplit[1] != undefined && (Division == "jeans" || Division == "hosen")) {
		var SizeBund = SizeSplit[1];
	} else {
		var SizeBund = false;
	}

	//N�chste oder vorherige Gr��e ermitteln
	if(SizeTip == 1 && Row < size_anzahl-1) {
		//Alle Produkte au�er Jeans/Hosen
		if(SizeBund == false) {
			var nextRow = Row+1;
			//Bei jeans zus�tzlich �berpr�fen, ob noch die selbe Bundl�nge
		} else if(GetSize((Row+1),0).indexOf('/'+SizeBund) != -1) {
			var nextRow = Row+1;
		} else {
			var nextRow = false;
		}
	} else if(SizeTip == 2 && Row > 0) {
		//Alle Produkte au�er Jeans/Hosen
		if(SizeBund == false) {
			var nextRow = Row-1;
			//Bei jeans zus�tzlich �berpr�fen, ob noch die selbe Bundl�nge
		} else if(GetSize((Row-1),0).indexOf('/'+SizeBund) != -1) {
			var nextRow = Row-1;
		} else {
			var nextRow = false;
		}
	} else {
		var nextRow = false;
	}
	
	//Erst unsichtbar machen
	if($('SizeTipImg') != null) {
		document.getElementById("SizeTipImg"+strRegSale).style.display = 'none';
		document.getElementById("size_tip_sale_text").style.display = 'none';
		document.getElementById("SizeTipHref"+strRegSale).style.display = 'none';
	}
	
	//Wenn Bedingung erf�llt, dann anzeigen		
	if(typeof nextRow == "number") {
		
		//Bestand checken	und anzeigen 
		if(SizeTip==2 && GetBestand(nextRow, Col) > 0)
		{
		 	document.getElementById("SizeTipImg"+strRegSale).src="../../Img/Product/"+strLng+"/size_alert_no_txt.gif";
		 	document.getElementById("size_tip_sale_text").innerHTML = "<font color='#9D2626' size='2' face='Arial'>ARTIKEL F�LLT <b><font color='#9D2626' size='2' face='Arial'>GR��ER</font></b> AUS</font><br><a href='#' onclick='empfehlung_auf(2);'><b><u><font color='#666666' face='Arial' style='line-height: 30px;'>Unsere Empfehlung</font></u></b></a>";
		 	document.getElementById("SizeTipHref"+strRegSale).href = "javascript:empfehlung_auf(2);parent.parent.wt_sendinfo('"+strLng+".gr�ssenempfehlung.big_to_big')";
			document.getElementById("SizeTipImg"+strRegSale).style.display = '';
			document.getElementById("size_tip_sale_text").style.display = '';
			document.getElementById("SizeTipHref"+strRegSale).style.display = '';		 	
	  }
	  else if(SizeTip==1 && GetBestand(nextRow, Col) > 0)
	  {
		 	document.getElementById("SizeTipImg"+strRegSale).src="../../Img/Product/"+strLng+"/size_alert_no_txt.gif";
		 	document.getElementById("SizeTipHref"+strRegSale).href = "javascript:empfehlung_auf(1);parent.parent.wt_sendinfo('"+strLng+".gr�ssenempfehlung.big_to_small')";
		 	document.getElementById("size_tip_sale_text").innerHTML = "<font color='#9D2626' size='2' face='Arial'>ARTIKEL F�LLT <b><font color='#9D2626' size='2' face='Arial'>KLEINER</font></b> AUS</font><br><a href='#' onclick='empfehlung_auf(1);'><b><u><font color='#666666' face='Arial' style='line-height: 30px;'>Unsere Empfehlung</font></u></b></a>";
			document.getElementById("SizeTipImg"+strRegSale).style.display = '';
			document.getElementById("size_tip_sale_text").style.display = '';
			document.getElementById("SizeTipHref"+strRegSale).style.display = '';		 	
		}
		
	}
	
//----- SizeTip Gr�sse vorhanden ENDE
	
//----------------------------
// Ingo Ampel 12.04.2006
//----------------------------
  var BestandAlleGroessen = 0;
  for(var allSizes=0;allSizes<SizeColCount;allSizes++)
  {
  	BestandAlleGroessen = BestandAlleGroessen + Number(GetBestand(allSizes,Col));
	}

	var arrStatusbilder = new Array("outfit_available.gif","outfit_few_left.gif","outfit_sold_out.gif");
	
	  if(Bestand<=MinBestand || Farbe_Vorhanden=='0')
  {
    document.images["Ampel"].src  ="../../PicTmpl/"+strLng+"/status_red.gif";
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[2];
  }
  else if(NewSale == "new" && BestandAlleGroessen < 10)
  {
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[1];
  }
  else if(NewSale == "regular" && BestandAlleGroessen < 5)
  {
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[1];
  }
  else if(NewSale == "sale" && BestandAlleGroessen < 3)
  {
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[1];
  }
    else if(NewSale == "outlet" && BestandAlleGroessen < 3)
  {
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[1];
  }
  else
  {
    document.images["Ampel"].src  ="../../PicTmpl/"+strLng+"/status_green.gif";
    document.images["Ampel_2"].src="../../Img/Product/"+strLng+"/"+arrStatusbilder[0];
  }
	
	PriceBasic=eval(String(PriceBasic).replace(",","."));
	PriceNew=eval(String(PriceNew).replace(",","."));

	$('PreisSpan').innerHTML = '';
	if(PriceNew != PriceBasic) {
		var priceBasicSpan = new Element('span', {'class': 'basic'});
			priceBasicSpan.innerHTML = '$ ' + RoundValue(PriceBasic);				
		$('PreisSpan').appendChild(priceBasicSpan);			
		var priceNewSpan = new Element('span', {'class': 'new'});	
			priceNewSpan.innerHTML = 'Now $ ' + RoundValue(PriceNew);
		$('PreisSpan').appendChild(priceNewSpan);	
	} else {
		$('PreisSpan').innerHTML = 	'$ ' + RoundValue(PriceBasic);
	}
	
	
// Preis im Hinweislayer aktualisieren 					-- IL 19.02.2008
	if(document.getElementById('priceSpan'))
	  document.getElementById('priceSpan').innerHTML = "$" + RoundValue(PriceNew);
	if(document.getElementById('priceSpanBig'))
	 	document.getElementById('priceSpanBig').innerHTML = "$" + RoundValue(PriceNew);	
}

function CrossStyleAnzeigen(Param, aktivesTemplate)
{
	document.getElementById("CrossStyleSchatten").style.display = "";
	if(parent.document.getElementById("CrossStyleSchatten2"))
		parent.document.getElementById("CrossStyleSchatten2").style.display = "";
	document.getElementById("CrossStyleAnsicht").style.display = "";
	document.getElementById("CrossStyleIFrame").src = "../" + strLng + "/HtmlProduct"+aktivesTemplate+".html?" + Param;
}

function moreInfoWindowGroesse() {
	if(Division == 'pants' || Division == 'denim'){
	window.open('../WinDslV3.html','WinOutProbleme','width=840,height=755	,screenX=20,screenY=20, scrollbars=no');
	wtClickPixel('.popup.front_image.click');
	
}
else if(Division == 'dresses'){
window.open('../WinDslV3.html','WinOutProbleme','width=840,height=715,screenX=20,screenY=20, scrollbars=no');
wtClickPixel('.popup.front_image.click');
}

else{
	wtClickPixel('.popup.front_image.click');
window.open('../WinDslV3.html','WinOutProbleme','width=840,height=775,screenX=20,screenY=20, scrollbars=no');
}

}
var LastRightPfeilPos = 768; //rechter Pfeil -> StyleLeft-Position
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);

		//alert('MouseY :' +  MouseY + ' | MouseX: ' + MouseX);
		//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';
		}

		// Bermudas/Shorts
		if(hilfSizeChart == "0200720") hilfSizeChart = "0200800";
		if(hilfSizeChart == "0200710") hilfSizeChart = "0200900";
		if(hilfSizeChart == "0100810") hilfSizeChart = "0100800";
		if(hilfSizeChart == "0100820") hilfSizeChart = "0100800";

		// Kds
		if(hilfSizeChart == "0700800") hilfSizeChart = "0700900";
		if(hilfSizeChart == "0800800") hilfSizeChart = "0800900";
		if(hilfSizeChart == "0900800") hilfSizeChart = "0900900";
		if(hilfSizeChart == "1000800") hilfSizeChart = "1000900";

		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=\"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){alert(e);}
		}
}
}

// -----------------------------------------------------


// -------------------------------------------------------------------------------------------------
var setDetailPic = {
	arrPicSrc : new Array(
								'PicDetail',
								'PicFlatViewXXL',
								'PicDestStyleDsl'
							),

	intArrPos		: 0,

	blnPicCheck : false,
	strPicSrc		: '',

	init				: function(){
		setDetailPic.checkPicSrc(setDetailPic.intArrPos);
	},

	checkPicSrc	: function(){

				if(setDetailPic.intArrPos > setDetailPic.arrPicSrc.length)
				{
						$('detailImg').src = '../../Img/transparent.gif';
						return false;
				}
				var PicPath = setDetailPic.arrPicSrc[setDetailPic.intArrPos];
				
				var preLoadPic = new Image;
						preLoadPic.src		 	= picServerBase + PicPath + '/' + StyleNumber + '_' + aktiveColorNo  + '.jpg';

						preLoadPic.onload 	= function(){
								setDetailPic.setImgPath(PicPath, preLoadPic.src);
						};
						preLoadPic.onerror 	= function()
						{
							++setDetailPic.intArrPos;
							setDetailPic.checkPicSrc();
						}
	},

	setImgPath : function(PicPath, PicSrc){
			$('detailImg').src = PicSrc;
			$('detailBild').setStyle({
					'height' 	: '230px',
					'width'		: '273px',
					'overflow': 'hidden'
			});

			var PicCorrect = new Array();

				switch(PicPath)
			{
				case 'PicDetail':
					PicCorrect = ['0', '0'];
				break;

				case 'PicFlatViewXXL':
					PicCorrect = ['-338px', '-85px'];
				break;

				case 'PicDestStyleDsl':
					PicCorrect = ['-243', '-40'];
				break;
			}

			$('detailImg').setStyle({
					'position': 'relative',
					'top'			:	PicCorrect[0],
					'left'		:	PicCorrect[1]
			});

			$('detailImg').show();
	}

}
// -------------------------------------------------------------------------------------------------
