//International
var template = crossStyleObj = activeColor = ColorNr = masterStyleId = masterStyleNumber = null;
var crossMouseOver 													= new Object();
var activeStlyeList 												= new Array();
var csTemplate 											= new Object();
csTemplate['_Suitings']							=  new Object();
csTemplate['_Suitings']['styleStart'] 			= 0;
csTemplate['_Suitings']['styleAnzahl'] 			= 4;
csTemplate['_Suitings']['srcPfad']					= 'PicSrcFlat';
csTemplate['_Suitings']['crossTarget']			= 'CrossFlaeche';
csTemplate['_Suitings']['crossTargetText']	= 'iFrameCS_Text';
csTemplate['_Suitings']['dateiEndung']			= '.jpg';
csTemplate['_Suitings']['genTemplate']			= function() { genSuitingsCrossStyles(); };
csTemplate['_Outfit']									=  new Object();
csTemplate['_Outfit']['styleStart'] 			= 0;
csTemplate['_Outfit']['styleAnzahl'] 			= 4;
csTemplate['_Outfit']['srcPfad']					= 'PicSrcFlat';
csTemplate['_Outfit']['imgSize']					= new Array('120', '128');
csTemplate['_Outfit']['crossTarget']			= 'crossBilder';
csTemplate['_Outfit']['crossTargetText']	= 'crossText';
csTemplate['_Outfit']['dateiEndung']			= '.jpg';
csTemplate['_Outfit']['genTemplate']			= function() { genOutfitCrossStyles(); };
csTemplate['_OutfitV2']									=  new Object();
csTemplate['_OutfitV2']['styleStart'] 				= 0;
csTemplate['_OutfitV2']['styleAnzahl'] 			= 4;
csTemplate['_OutfitV2']['srcPfad']					= 'PicSrcFlat';
csTemplate['_OutfitV2']['imgSize']					= new Array('120', '128');
csTemplate['_OutfitV2']['crossTarget']				= 'crossBilder';
csTemplate['_OutfitV2']['crossTargetText']		= 'crossText';
csTemplate['_OutfitV2']['dateiEndung']			= '.jpg';
csTemplate['_OutfitV2']['genTemplate']			= function() { genOutfitV2CrossStyles(); };
csTemplate['_KidsOutfitV2']									=  new Object();
csTemplate['_KidsOutfitV2']['styleStart'] 				= 0;
csTemplate['_KidsOutfitV2']['styleAnzahl'] 			= 4;
csTemplate['_KidsOutfitV2']['srcPfad']					= 'PicSrcFlat';
csTemplate['_KidsOutfitV2']['imgSize']					= new Array('120', '128');
csTemplate['_KidsOutfitV2']['crossTarget']				= 'crossBilder';
csTemplate['_KidsOutfitV2']['crossTargetText']		= 'crossText';
csTemplate['_KidsOutfitV2']['dateiEndung']			= '.jpg';
csTemplate['_KidsOutfitV2']['genTemplate']			= function() { genOutfitV2CrossStyles(); };
csTemplate['_Bettwaesche']								=  new Object();
csTemplate['_Bettwaesche']['styleStart'] 			= 1;
csTemplate['_Bettwaesche']['styleAnzahl'] 		= 3;
csTemplate['_Bettwaesche']['srcPfad']					= 'PicDestStyleSuitings';
csTemplate['_Bettwaesche']['imgSize']					= new Array('108', '105');
csTemplate['_Bettwaesche']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_Bettwaesche']['mastercrossTarget']	= 'CrossStylesTable';
csTemplate['_Bettwaesche']['crossTarget']			= 'CrossFlaecheContent';
csTemplate['_Bettwaesche']['dateiEndung']		= '.jpg';
csTemplate['_Bettwaesche']['dateiEndungBig']		= '.jpg';
csTemplate['_Bettwaesche']['genTemplate']		= function() { genDefaultCrossStyles();};
csTemplate['_Bodywear']								=  new Object();
csTemplate['_Bodywear']['styleStart'] 			= 1;
csTemplate['_Bodywear']['styleAnzahl'] 			= 3;
csTemplate['_Bodywear']['srcPfad']				= 'PicDestStyleSuitings';
csTemplate['_Bodywear']['imgSize']				= new Array('108', '105');
csTemplate['_Bodywear']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_Bodywear']['mastercrossTarget']	= 'CrossStylesTable';
csTemplate['_Bodywear']['crossTarget']			= 'CrossFlaecheContent';
csTemplate['_Bodywear']['dateiEndung']		= '.jpg';
csTemplate['_Bodywear']['dateiEndungBig']		= '.jpg';
csTemplate['_Bodywear']['genTemplate']		= function() { genDefaultCrossStyles();};
csTemplate['_Standard']									= new Object();
csTemplate['_Standard']['styleStart'] 				= 1;
csTemplate['_Standard']['styleAnzahl'] 			= 3;
csTemplate['_Standard']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_Standard']['imgSize']					= new Array('86', '93');
csTemplate['_Standard']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_Standard']['dateiEndung']			= '.gif';
csTemplate['_Standard']['dateiEndungBig']	= '.jpg';
csTemplate['_Standard']['mastercrossTarget']= 'CrossStylesTable';
csTemplate['_Standard']['crossTarget']			= 'CrossFlaecheContent';
csTemplate['_Standard']['genTemplate']		= function() { genDefaultCrossStyles();};
csTemplate['_StandardV2']									= new Object();
csTemplate['_StandardV2']['styleStart'] 				= 1;
csTemplate['_StandardV2']['styleAnzahl'] 			= 3;
csTemplate['_StandardV2']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_StandardV2']['imgSize']					= new Array('108', '105');
csTemplate['_StandardV2']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_StandardV2']['dateiEndung']			= '.gif';
csTemplate['_StandardV2']['dateiEndungBig']	= '.jpg';
csTemplate['_StandardV2']['mastercrossTarget']= 'crossStyles';
csTemplate['_StandardV2']['crossTarget']			= 'CrossStyleSlide';
csTemplate['_StandardV2']['genTemplate']		= function() { genDefaultCrossStylesV2();};
csTemplate['_Sonnenbrillen']									= new Object();
csTemplate['_Sonnenbrillen']['styleStart'] 				= 1;
csTemplate['_Sonnenbrillen']['styleAnzahl'] 			= 3;
csTemplate['_Sonnenbrillen']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_Sonnenbrillen']['imgSize']					= new Array('86', '93');
csTemplate['_Sonnenbrillen']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_Sonnenbrillen']['dateiEndung']			= '.gif';
csTemplate['_Sonnenbrillen']['dateiEndungBig']	= '.jpg';
csTemplate['_Sonnenbrillen']['mastercrossTarget']= 'CrossStylesTable';
csTemplate['_Sonnenbrillen']['crossTarget']			= 'CrossFlaecheContent';
csTemplate['_Sonnenbrillen']['genTemplate']		= function() { genDefaultCrossStyles();};
csTemplate['_Schuhe']									= new Object();
csTemplate['_Schuhe']['styleStart'] 				= 1;
csTemplate['_Schuhe']['styleAnzahl'] 				= 3;
csTemplate['_Schuhe']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_Schuhe']['imgSize']					= new Array('86', '93');
csTemplate['_Schuhe']['srcPfadBig'] 				= 'PicSrcCrossSellingFlat';
csTemplate['_Schuhe']['dateiEndung']			= '.gif';
csTemplate['_Schuhe']['dateiEndungBig']		= '.jpg';
csTemplate['_Schuhe']['mastercrossTarget']	= 'CrossStylesTable';
csTemplate['_Schuhe']['crossTarget']				= 'CrossFlaecheContent';
csTemplate['_Schuhe']['genTemplate']			= function() { genDefaultCrossStyles();};
csTemplate['_Uhren']										= new Object();
csTemplate['_Uhren']['styleStart'] 					= 1;
csTemplate['_Uhren']['styleAnzahl'] 				= 3;
csTemplate['_Uhren']['srcPfad']						= 'PicDestStyleSuitingsSmall';
csTemplate['_Uhren']['imgSize']						= new Array('86', '93');
csTemplate['_Uhren']['srcPfadBig'] 				= 'PicSrcCrossSellingFlat';
csTemplate['_Uhren']['dateiEndung']				= '.gif';
csTemplate['_Uhren']['dateiEndungBig']		= '.jpg';
csTemplate['_Uhren']['mastercrossTarget']	= 'CrossStylesTable';
csTemplate['_Uhren']['crossTarget']				= 'CrossFlaecheContent';
csTemplate['_Uhren']['genTemplate']			= function() { genDefaultCrossStyles();};
csTemplate['_Guertel']									= new Object();
csTemplate['_Guertel']['styleStart'] 				= 1;
csTemplate['_Guertel']['styleAnzahl'] 				= 3;
csTemplate['_Guertel']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_Guertel']['imgSize']					= new Array('86', '93');
csTemplate['_Guertel']['srcPfadBig'] 				= 'PicSrcCrossSellingFlat';
csTemplate['_Guertel']['dateiEndung']			= '.gif';
csTemplate['_Guertel']['dateiEndungBig']		= '.jpg';
csTemplate['_Guertel']['mastercrossTarget']	= 'CrossStylesTable';
csTemplate['_Guertel']['crossTarget']				= 'CrossFlaecheContent';
csTemplate['_Guertel']['genTemplate']			= function() { genDefaultCrossStyles();};
csTemplate['_Schmuck']									= new Object();
csTemplate['_Schmuck']['styleStart'] 				= 1;
csTemplate['_Schmuck']['styleAnzahl'] 			= 3;
csTemplate['_Schmuck']['srcPfad']					= 'PicDestStyleSuitingsSmall';
csTemplate['_Schmuck']['imgSize']					= new Array('86', '93');
csTemplate['_Schmuck']['srcPfadBig'] 			= 'PicSrcCrossSellingFlat';
csTemplate['_Schmuck']['dateiEndung']			= '.gif';
csTemplate['_Schmuck']['dateiEndungBig']	= '.jpg';
csTemplate['_Schmuck']['mastercrossTarget']= 'CrossStylesTable';
csTemplate['_Schmuck']['crossTarget']			= 'CrossFlaecheContent';
csTemplate['_Schmuck']['genTemplate']		= function() { genDefaultCrossStyles();};
csTemplate['hinweislayer']								= new Object();
csTemplate['hinweislayer']['styleStart'] 			= 1;
csTemplate['hinweislayer']['styleAnzahl'] 		= 3;
csTemplate['hinweislayer']['srcPfad']				= 'PicSrcCrossSellingFlat';
csTemplate['hinweislayer']['dateiEndung']		= '.jpg';
csTemplate['hinweislayer']['crossTarget']		= 'CrossFrame2';
csTemplate['hinweislayer']['genTemplate']	= function() { genHinweislayerCrossStyles(); };
csTemplate['hinweislayerV2']								= new Object();
csTemplate['hinweislayerV2']['styleStart'] 			= 1;
csTemplate['hinweislayerV2']['styleAnzahl'] 		= 3;
csTemplate['hinweislayerV2']['srcPfad']				= 'PicSrcCrossSellingFlat';
csTemplate['hinweislayerV2']['imgSize']				= new Array('175', '280');
csTemplate['hinweislayerV2']['dateiEndung']		= '.jpg';
csTemplate['hinweislayerV2']['crossTarget']		= 'crossTableContent';
csTemplate['hinweislayerV2']['genTemplate']	= function() { genHinweislayerCrossStylesV2(); };

function initCrossStyles(styleNumber, ColorNr, template)
{
	if(window.location.toString().indexOf('iFrame') != -1) {
		if($('CrossStylesTable')) $('CrossStylesTable').hide();
		return false;
	}
	if($(csTemplate[template]['crossTarget'])) {
	$(csTemplate[template]['crossTarget']).innerHTML = '';	
	this.template = template;
	this.ColorNr = ColorNr;
	try {
			var outfitObj 					= new XML.ObjTree();
			transport 							= outfitObj.parseHTTP('../../CrossXML/'+StyleNumber.toUpperCase()+ '.xml');
			var crossStyleList			= transport;		
			crossStyleList 					= crossStyleList.land;	
			if(crossStyleList.CrossStyles.length == undefined) {	
				if(crossStyleList.CrossStyles['-masterFlagHidden'] == 'Falsch' ) {		
					crossStyleObj 				= crossStyleList.CrossStyles;
					masterStyleId 				= formatStyleId(crossStyleObj['-masterId']);
					masterStyleNumber 		= crossStyleObj['-masterStyleNumber'];
					crossStyleObj 				= crossStyleObj.CrossStyle;
				}
			} else {
				for(i=0; i < crossStyleList.CrossStyles.length; ++i) {			
					if(crossStyleList.CrossStyles[i]['-language'] == strLng && crossStyleList.CrossStyles[i]['-masterFlagHidden'] == 'Falsch' )	{
						crossStyleObj 				= crossStyleList.CrossStyles[i];
						masterStyleId 				= formatStyleId(crossStyleObj['-masterId']);
						masterStyleNumber 		= crossStyleObj['-masterStyleNumber'];
						crossStyleObj 				= crossStyleObj.CrossStyle;
					}
				}							
			}
			if(typeof crossStyleObj != 'undefined') {
				if(getActiveColor(ColorNr)) {
					if(getVisibilStyles()) {
						csTemplate[template]['genTemplate']();
					} else {
						if($("CrossFlaeche")) $("CrossFlaeche").style.visibility = "hidden";
					}
				}
			}
		} catch(e) {
			if($("CrossFlaeche")) $("CrossFlaeche").style.visibility = "hidden";			
			if($("CrossStylesTable")) $("CrossStylesTable").hide();			
			blnNoCrossStyle = true;
		}
	}
}

function initCrossStylesHidden(styleNumber, ColorNr, template)
{
	this.template = template;
	this.ColorNr = ColorNr;
	var inputFileName = '../../CrossXML/' + styleNumber + '.xml';
	new Ajax.Request(inputFileName,{
		asynchronous: false,
		onSuccess: function(transport) {
			var crossJson 				= new XML.ObjTree();		
			var crossStyleList			= crossJson.parseXML(transport.responseText);		
			crossStyleList 				= crossStyleList.land;	
			if(crossStyleList.CrossStyles.length == undefined) {	
				if(crossStyleList.CrossStyles['-masterFlagHidden'] == 'Falsch' ) {		
					crossStyleObj 				= crossStyleList.CrossStyles;
					masterStyleId 				= formatStyleId(crossStyleObj['-masterId']);
					masterStyleNumber 	= crossStyleObj['-masterStyleNumber'];
					crossStyleObj 				= crossStyleObj.CrossStyle;
				}
			} else {
				for(i=0; i < crossStyleList.CrossStyles.length; ++i) {			
					if(crossStyleList.CrossStyles[i]['-language'] == strLng && crossStyleList.CrossStyles[i]['-masterFlagHidden'] == 'Falsch' )	{
						crossStyleObj 				= crossStyleList.CrossStyles[i];
						masterStyleId 				= formatStyleId(crossStyleObj['-masterId']);
						masterStyleNumber 	= crossStyleObj['-masterStyleNumber'];
						crossStyleObj 				= crossStyleObj.CrossStyle;
					}
				}							
			}		
		},
		onFailure: function() {
			$("CrossStylesTable").style.display = "none";
		}	
	});
}

function getCrossRefpage()
{
	var refPageArr = document.location.href.split('/Shop/');
	var refPageStr = refPageArr[(refPageArr.length - 1)].replace(document.location.search, '');
	refPageStr = refPageStr.replace('#', '');
	var documentParameterArr = document.location.search.split('&');
	var refPageOrg = getParameter('refpage', documentParameterArr);			
	var refpage = '&refpageCross=' + refPageStr;
	
	if(refPageOrg) {
		refpage = refpage + '&refpage=' + refPageOrg;
	}	
	return refpage;
}

function changeCrossColor(ColorNr)
{
	if(crossStyleObj != null) {
		$(csTemplate[template]['crossTarget']).innerHTML = '';
		if($(csTemplate[template]['crossTargetText'])) {
			$(csTemplate[template]['crossTargetText']).innerHTML = '';
		}
		activeColor 		= null;
		activeColor		= new Array();
		activeStlyeList = null;
		activeStlyeList = new Array();
		this.ColorNr = ColorNr;	
		if(getActiveColor(ColorNr)) {
			if(getVisibilStyles()) {
				csTemplate[template]['genTemplate']();	
			}
		} else {
			if($("CrossStylesTable").style.visibility == 'visible' || $("CrossStylesTable").style.visibility == '') {
				$("CrossStylesTable").style.visibility = 'hidden';
			}
			if($("CrossStylesTable").style.display == "block" || $("CrossStylesTable").style.display == "") {
				$("CrossStylesTable").style.display = "none";
			}				
			if($('CrossStyleReiter')) $('CrossStyleReiter').hide();
			if($('detailBild')) $('detailBild').style.border = '1px solid lightgrey';
		}	
	}
}

function getActiveColor(ColorNr)
{
	activeColor = null;
	if(crossStyleObj.length == undefined) {
		if(crossStyleObj['-masterColor'] == ColorNr) {
			activeColor	= crossStyleObj.StyleInfo;
		} 
	} else {
		for(var i=0; i < crossStyleObj.length; ++i) {		
			if(crossStyleObj[i]['-masterColor'] == ColorNr) {
				activeColor	= crossStyleObj[i].StyleInfo;
			}
		}
	}

	if(activeColor == null) {
		blnNoCrossStyle = true;
		return false;
	} else {
		blnNoCrossStyle = false;
		return true;	
	}
}

function getVisibilStyles()
{
	for(var i=0; i < activeColor.length; ++i) {	
		activeStlyeList.push(activeColor[i]);	
	} 
	if(activeStlyeList.length == undefined || activeStlyeList.length <= 0) {
		return false;
	} else {
		return true;
	}
}

function formatStyleId(styleId)
{
	for(intK = styleId.length; intK < 8; intK++) {
		 styleId = '0'+styleId;	
	}
	return styleId;
}

var suitingStylelink = new Object();
function genSuitingsCrossStyles()
{	
	var styleAnzahl 	= csTemplate[template]['styleAnzahl'] + csTemplate[template]['styleStart'];
	var imgPfad 		= picServerBase + csTemplate[template]['srcPfad']	+'/';
	var textList 			= new Element('ul', {'style': 'margin:0; padding:0;list-style:none; font-size:7pt; '});
	var picList 			= new Element('ul', {'style': 'list-style:none;float:left; margin:0; padding:0;'});
	
	// Wenn nicht ausreichend Styles Sichtbar sind:
	if(styleAnzahl > activeStlyeList.length) {
		styleAnzahl = 	activeStlyeList.length;
	} 

	for(var i=0; i < styleAnzahl; ++i) {
		var isSoldout = false;
		var ersatzStyle = i +2;
		if(activeStlyeList[i].FlagHidden == 'Wahr' && i <=1) {
			isSoldout = true;
		} else if(i>1 && i< 4) {
			if((i== 2 || i== 3) && typeof activeStlyeList[ersatzStyle] != 'undefined' && activeStlyeList[i].FlagHidden == 'Wahr' && activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
				activeStlyeList[i] = activeStlyeList[ersatzStyle];
			} else {	
				if(activeStlyeList[i].FlagHidden == 'Falsch') {
					isSoldout = false;
				} else {
					isSoldout = true;
				}
			}
		}

		// BildElemente Suitings
		styleID 			= formatStyleId(activeStlyeList[i]['-id']);
		styleColor 	= activeStlyeList[i].CrossStyleColorNumber;
		suitingStylelink[styleID] 		= 'id=' + styleID + '&color=' + styleColor + '&language='+ strLng;
		picLiElement 								= new Element('li', {'style': 'float:left; margin:0; padding:0; font-size:10px; '}); 
		imgSrc 										= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndung'];
		masterPicDiv 								= new Element('div', {'style': 'height: 160px; width: 150px; position:relative;'});
		imgObj 										= new Element('img', {'id': 'pic_'+styleID, 'src' :  imgSrc, 'width': 150, 'height': 160, 'style': 'cursor:pointer;'});	
		imgCount 									= new Element('img', {'id': 'picCount_'+styleID, 'src' : '../../Img/Product/' + strLng + '/outfit_'+ (i+1) + '.gif', 'style': 'position:absolute; top:5px; left:5px; z-index:2;'});
		mehrDivElement			 				= new Element('div', {'id': 'mehrDiv_'+styleID, 'style': 'cursor:pointer; position:absolute; bottom:10px; left:10px; z-index:2; color:#FF0000; background:#FFFFFF;'});
		mehrSpanElement 						= new Element('span', {'style': 'text-decoration:underline;'})
		mehrSpanElement.innerHTML 	= Texte['more'];
		mehrDivElement.innerHTML 		= '+ ';
		mehrDivElement.appendChild(mehrSpanElement);
		masterPicDiv.appendChild(imgCount);
		masterPicDiv.appendChild(imgObj);
		masterPicDiv.appendChild(mehrDivElement);
		picLiElement.appendChild(masterPicDiv);
		picList.appendChild(picLiElement);
		if(isSoldout) {
			var soldoutDiv = new Element('div', {'style': 'position:absolute; top:72px; left:47px; z-index:2; height:17px; width:57px;'})
			var soldoutImg = new Element('img', {'src': '../../Img/Product/'+strLng+'/ausverkauft.gif'});	
			soldoutDiv.appendChild(soldoutImg);
			masterPicDiv.appendChild(soldoutDiv);
		}		

		mehrDivElement.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]]);} );
		imgObj.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]]);}) ;
		
		// TextElemente Suitings
		imgCountText = new Element('img', {'id': 'text_'+i, 'src' : '../../Img/Product/' + strLng + '/outfit_'+ (i+1) + '.gif'});
		listCountDiv = new Element('div', {'id': 'countText_' + styleID,  'style': 'width:116px; font-size:7pt; '});
		listPreisDiv = new Element('div', {'id': 'preisDiv_' + styleID, 'style': 'cursor:pointer;font-size: 10px; color: rgb(102, 102, 102);'});
		if(activeStlyeList[i].PriceBasic == activeStlyeList[i].PriceNew) {
			preis = ToCurr(activeStlyeList[i].PriceBasic);
		} else {
			preis = ToCurr(activeStlyeList[i].PriceNew);
		}
		listPreisDiv.innerHTML =  waehrung + ' ' +preis;
		pixelStr = '.text.cs' + i;
		listPreisDiv.observe('click', function(event) {
																				CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]]); 
																				wtClickPixel(pixelStr); 
																				} );
		listCountDiv.appendChild(imgCountText);
		listTitleText = new Element('span', {'id': 'textTitel_'+styleID, 'style': 'width:175px;text-decoration:underline;color:#666666; cursor:pointer;'});
		listTitleText.innerHTML = activeStlyeList[i].StyleName;
		listTitleText.observe('click', function(event) {
																				CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]]); 
																				wtClickPixel(pixelStr); 
																				} );
		var listPointText = new Element('li', {'style': 'width:180px;'});		
			listPointText.appendChild(listCountDiv);		
			listPointText.appendChild(listTitleText);		
			listPointText.appendChild(listPreisDiv);
		// Fittip
		if(activeStlyeList[i].DescStyleFitTip3 != undefined) {
						
			var fittipSpan 	= new Element('span', {'style': 'color:#FF0000; font-size:7pt;'});	
			
			var fitText = activeStlyeList[i].DescStyleFitTip3;			
			var fitSizeChart = activeStlyeList[i].SizeChart;			
			var fitPicDestBrand=activeStlyeList[i].PicDestBrand.slice(activeStlyeList[i].PicDestBrand.indexOf('brand_')+6,activeStlyeList[i].PicDestBrand.indexOf('.gif'));
			var fitOverStyleName = activeStlyeList[i].OverStyleName;					
			
			fittipSpan.innerHTML = FitText+': <span style="color:#FF0000; font-size:7pt; text-decoration:underline; cursor:pointer;" onmousedown="WinOutFitLayer(\''+fitSizeChart+'\',\''+fitPicDestBrand+'\',\''+fitText+'\',\''+fitOverStyleName+'\');">'+ fitText + '</span>';
			strDivision = activeStlyeList[i].Division;		
						
			listPointText.appendChild(fittipSpan);
		}		
		textList.appendChild(listPointText);		
	}
	$(csTemplate[template]['crossTargetText']).appendChild(textList);
	$(csTemplate[template]['crossTarget']).appendChild(picList)
	$(csTemplate[template]['crossTarget']).style.width = '301px';
	$(csTemplate[template]['crossTarget']).style.height = '320px';	
}

var aktiveTemplate = new Object();
function genOutfitCrossStyles()
{
	
	var styleAnzahl 	= csTemplate[template]['styleAnzahl'] + csTemplate[template]['styleStart'];
	var imgPfad 		= picServerBase + csTemplate[template]['srcPfad']	+'/';
	var textList 			= new Element('ul', {'style': 'margin:0; padding:0;list-style:none; font-size:7pt; '});
	var picList 			= new Element('ul', {'style': 'list-style:none;float:left; margin:0; padding:0;'});
	
	// Wenn nicht ausreichend Styles Sichtbar sind:
	if(styleAnzahl > activeStlyeList.length) {
		styleAnzahl = 	activeStlyeList.length;
	} 
	
	for(var i=0; i < styleAnzahl; ++i) {
		var isSoldout = false;
		var ersatzStyle = i +2;
		if(activeStlyeList[i].FlagHidden == 'Wahr' && i <=1) {
			isSoldout = true;
		} else if(i>1 && i< 4) {
			if((i== 2 || i== 3) && typeof activeStlyeList[ersatzStyle] != 'undefined' && activeStlyeList[i].FlagHidden == 'Wahr' && activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
				activeStlyeList[i] = activeStlyeList[ersatzStyle];
			} else {	
				if(activeStlyeList[i].FlagHidden == 'Falsch') {
					isSoldout = false;
				} else {
					isSoldout = true;
				}
			}
		}

		// BildElemente Suitings
		styleID 			= formatStyleId(activeStlyeList[i]['-id']);
		styleColor 	= activeStlyeList[i].CrossStyleColorNumber;
		if(activeStlyeList[i].ProductTemplate == '_StandardV2' || activeStlyeList[i].ProductTemplate ==  '_Outfit') {
			aktiveTemplate[styleID] = '_Outfit_iFrame';
		} else {
			aktiveTemplate[styleID] = '_Suitings_iFrameV2';	
		}
		suitingStylelink[styleID] 		= 'id=' + styleID + '&color=' + styleColor + '&language='+ strLng;
		picLiElement 								= new Element('li', {'style': 'float:left; margin:0; padding:0; font-size:10px; '}); 
		imgSrc 										= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndung'];
		masterPicDiv 								= new Element('div', {'style': 'height: 135px; width: 135px; position:relative; border-right: 1px solid #d2d2d2; border-bottom: 1px solid #d2d2d2; overflow:hidden;'});
		if(!Prototype.Browser.IE) {
			imgObj 										= new Element('img', {'id': 'pic_'+styleID, 'src' :  imgSrc, 'style': 'width:'+csTemplate[template]['imgSize'][0]+'px; height: '+csTemplate[template]['imgSize'][1]+'px; margin: 5px 0px 0px 5px; cursor:pointer;'});	
		} else {
			imgObj 										= new Element('img', {'id': 'pic_'+styleID, 'src' :  '../../Img/transparent.gif', 'style': 'width:'+csTemplate[template]['imgSize'][0]+'px; height: '+csTemplate[template]['imgSize'][1]+'px; margin: 5px 0px 0px 5px; cursor:pointer; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + imgSrc + '",sizingMethod="scale")'});			
		}
		imgCount 									= new Element('img', {'id': 'picCount_'+styleID, 'src' : '../../Img/Product/' + strLng + '/outfit_'+ (i+1) + '.gif', 'style': 	'position:absolute; top:5px; left:5px; z-index:2;'});
		mehrDivElement			 				= new Element('div', {'id': 'mehrDiv_'+styleID, 'style': 'cursor:pointer; position:absolute; bottom:10px; left:10px; 	z-index:2; color:#FF0000; background:#FFFFFF;'});
		mehrSpanElement 						= new Element('span', {'style': 'text-decoration:underline;'})
		mehrSpanElement.innerHTML 	= Texte['more'];
		mehrDivElement.innerHTML 		= '+ ';
		mehrDivElement.appendChild(mehrSpanElement);
		masterPicDiv.appendChild(imgCount);
		masterPicDiv.appendChild(imgObj);
		picLiElement.appendChild(masterPicDiv);
		picList.appendChild(picLiElement);
		if(isSoldout) {
			var soldoutDiv = new Element('div', {'style': 'position:absolute; top:72px; left:47px; z-index:2; height:17px; width:57px;'})
			var soldoutImg = new Element('img', {'src': '../../Img/Product/'+strLng+'/ausverkauft.gif'});	
			soldoutDiv.appendChild(soldoutImg);
			masterPicDiv.appendChild(soldoutDiv);
			imgObj.setStyle('cursor: auto;');
		} else {
			mehrDivElement.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);} );
			imgObj.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);}) ;			
		}
		
		// TextElemente Suitings
		imgCountText = new Element('img', {'id': 'text_'+i, 'src' : '../../Img/Product/' + strLng + '/outfit_'+ (i+1) + '.gif'});
		listCountDiv = new Element('div', {'id': 'countText_' + styleID,  'style': 'width:116px; font-size:7pt; '});
		listPreisDiv = new Element('div', {'id': 'preisDiv_' + styleID, 'style': 'cursor:pointer;font-size: 10px; color: rgb(102, 102, 102);'});
		if(activeStlyeList[i].PriceBasic == activeStlyeList[i].PriceNew) {
			listPreisDiv.innerHTML =  waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic);
		} else {
			listPreisDiv.innerHTML =  '<span class="PriceOld">'+ waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic) + '</span> <span class="PriceNew">'+Texte['now']+' '+ waehrung + ' ' + ToCurr(activeStlyeList[i].PriceNew) + '</span>';
		}
		pixelStr = '.text.cs' + i;
		listPreisDiv.observe('click', function(event) {
																				CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]); 
																				wtClickPixel(pixelStr); 
																				} );
		listCountDiv.appendChild(imgCountText);
		listTitleText = new Element('span', {'id': 'textTitel_'+styleID, 'style': 'width:175px;text-decoration:underline;color:#666666; cursor:pointer;'});
		listTitleText.innerHTML = activeStlyeList[i].StyleName + '<br />';
		listTitleText.observe('click', function(event) {
																				CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]); 
																				wtClickPixel(pixelStr); 
																				} );
		var listPointText = new Element('li', {'style': 'width:180px;'});		
			listPointText.appendChild(listCountDiv);		
			listPointText.appendChild(listTitleText);
		// Fittip		
		if(activeStlyeList[i].DescStyleFitTip3 != undefined) {						
			var fittipSpan 	= new Element('span', {'style': 'color:#FF0000; font-size:7pt;'});	
			
			var fitText = activeStlyeList[i].DescStyleFitTip3;			
			var fitSizeChart = activeStlyeList[i].SizeChart;			
			var fitPicDestBrand=activeStlyeList[i].PicDestBrand.slice(activeStlyeList[i].PicDestBrand.indexOf('brand_')+6,activeStlyeList[i].PicDestBrand.indexOf('.gif'));
			var fitOverStyleName = activeStlyeList[i].OverStyleName;					
			
			fittipSpan.innerHTML = FitText+': <span style="color:#FF0000; font-size:7pt; text-decoration:underline; cursor:pointer;" onmousedown="WinOutFitLayer(\''+fitSizeChart+'\',\''+fitPicDestBrand+'\',\''+fitText+'\',\''+fitOverStyleName+'\');">'+ fitText + '</span>';
			strDivision = activeStlyeList[i].Division;		
					
			listPointText.appendChild(fittipSpan);
		}		
		listPointText.appendChild(listPreisDiv);		
		textList.appendChild(listPointText);
	}
	
	$(csTemplate[template]['crossTargetText']).appendChild(textList);
	$(csTemplate[template]['crossTarget']).appendChild(picList);
	$(csTemplate[template]['crossTarget']).style.width = '272px';
	$(csTemplate[template]['crossTarget']).style.height = '270px';	
}

var aktiveTemplate = new Object();
var SoldOutID = new Object();
function genOutfitV2CrossStyles()
{	
	var styleAnzahl 	= csTemplate[template]['styleAnzahl'] + csTemplate[template]['styleStart'];
	var imgPfad 		= picServerBase + csTemplate[template]['srcPfad']	+'/';
	var textList 			= new Element('ul', {'style': 'margin:0; padding:0;list-style:none; font-size:7pt; '});
	var picList 			= new Element('ul', {'style': 'list-style:none;float:left; margin:0; padding:0;'});
	
	// Wenn nicht ausreichend Styles Sichtbar sind:
	if(styleAnzahl > activeStlyeList.length) {
		styleAnzahl = 	activeStlyeList.length;
	} 
	
	for(var i=0; i < styleAnzahl; ++i) {
		var isSoldout = false;
		var ersatzStyle = i +2;
		if(activeStlyeList[i].FlagHidden == 'Wahr' && i <=1) {
			isSoldout = true;
		} else if(i>1 && i< 4) {
			if((i== 2 || i== 3) && typeof activeStlyeList[ersatzStyle] != 'undefined' && activeStlyeList[i].FlagHidden == 'Wahr' && activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
				activeStlyeList[i] = activeStlyeList[ersatzStyle];
			} else {	
				if(activeStlyeList[i].FlagHidden == 'Falsch') {
					isSoldout = false;
				} else {
					isSoldout = true;
				}
			}
		}

		// BildElemente Suitings
		styleID 			= formatStyleId(activeStlyeList[i]['-id']);
		styleColor 	= activeStlyeList[i].CrossStyleColorNumber;
		if(activeStlyeList[i].ProductTemplate == '_StandardV2' || activeStlyeList[i].ProductTemplate ==  '_Outfit' || activeStlyeList[i].ProductTemplate ==  '_OutfitV2' || activeStlyeList[i].ProductTemplate ==  '_SchuheV2' || activeStlyeList[i].ProductTemplate == '_KidsOutfitV2') {
			aktiveTemplate[styleID] = '_Outfit_iFrame';
		} else {
			aktiveTemplate[styleID] = '_Suitings_iFrameV2';
		}
		suitingStylelink[styleID] = 'id=' + styleID + '&color=' + styleColor + '&language='+ strLng;
		picLiElement = new Element('li', {'style': 'float:left; margin:0; padding:0; font-size:10px; ', id:'OutfitCS_'+styleID}); 
		imgSrc = imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndung'];
		masterPicDiv = new Element('div', {'style': 'height: 135px; width: 267px; position:relative; border-right: 1px solid #d2d2d2; border-bottom: 1px solid #d2d2d2; overflow:hidden;'});
		if(!Prototype.Browser.IE) {
			imgObj = new Element('img', {'id': 'pic_'+styleID, 'src' :  imgSrc, 'style': 'width:'+csTemplate[template]['imgSize'][0]+'px; height: '+csTemplate[template]['imgSize'][1]+'px; cursor:pointer;position: absolute; top:2px;'});	
		} else {
			imgObj = new Element('img', {'id': 'pic_'+styleID, 'src' :  '../../Img/transparent.gif', 'style': 'position: absolute; top:3px;width:'+csTemplate[template]['imgSize'][0]+'px; height: '+csTemplate[template]['imgSize'][1]+'px; cursor:pointer; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + imgSrc + '",sizingMethod="scale")'});			
		}
		var picTextDiv = new Element('div').setStyle('position: absolute; left: 135px; top: 34px; width: 123px');
		var picLiText = new Element('span').setStyle('text-decoration: underline; cursor: pointer;');
		picLiText.id = 'StyleName_'+styleID;
		picLiText.innerHTML = activeStlyeList[i].OverStyleName;
		picLiText.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);} );
		picTextDiv.appendChild(picLiText);
		if(activeStlyeList[i].DescStyleFitTip3 != undefined) {
			var fittipSpan 	= new Element('span', {'style': 'color:#FF0000; font-size:7pt; position: relative; top: 3px;'});
			var fitText = activeStlyeList[i].DescStyleFitTip3;
			var fitSizeChart = activeStlyeList[i].SizeChart;
			var fitPicDestBrand=activeStlyeList[i].PicDestBrand.slice(activeStlyeList[i].PicDestBrand.indexOf('brand_')+6,activeStlyeList[i].PicDestBrand.indexOf('.gif'));			
			
			
			fitText = fitText.replace(/^\s+|\s+$/g,"");	//Leerzeichen aus DescStyleFitTip3 entfernen 					
			if(typeof(window.checkFitException) == "function" && checkFitException(fitSizeChart,fitText)){ // checkFitException steht in FitGuide.js
				fittipSpan.innerHTML = '<br />'+FitText+': <span style="color:#FF0000; font-size:7pt;">'+ fitText + '</span>';
			}else{
				fittipSpan.innerHTML = '<br />'+FitText+': <span style="color:#FF0000; font-size:7pt; text-decoration:underline; cursor:pointer;" onmousedown="WinOutFitLayer(\''+fitSizeChart+'\',\''+fitPicDestBrand+'\',\''+fitText+'\',\''+fitOverStyleName+'\');">'+ fitText + '</span>';
			}
			picTextDiv.appendChild(fittipSpan);
		}
		listPreisDiv = new Element('span', {'id': 'preisDiv_' + styleID, 'style': 'cursor:pointer;font-size: 10px; color: rgb(102, 102, 102);position: relative; top:3px;'});
		if(pricereduction == true) {
			if(activeStlyeList[i].PriceBasic == activeStlyeList[i].PriceNew) {
				listPreisDiv.innerHTML =  '<br />'+waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic);
			} else if(activeStlyeList[i].PriceBasic != activeStlyeList[i].PriceNew) {
				listPreisDiv.innerHTML =  '<br /><span class="PriceOld">'+ waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic) + '</span><br /><span class="PriceNew">'+Texte['now']+' '+ waehrung + ' ' + ToCurr(activeStlyeList[i].PriceNew) + '</span>';
			}
		} else {
			listPreisDiv.innerHTML =  '<br />'+waehrung + ' ' +ToCurr(activeStlyeList[i].PriceNew);
		}
			
		if(typeof(fittipSpan) != 'undefined') {
			listPreisDiv.style.top = '5px';
		}
		if(isSoldout == true) {
			listPreisDiv.setStyle('cursor: auto');
		} else {
			listPreisDiv.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);} );
		}
		picTextDiv.appendChild(listPreisDiv);
		mehrDivElement			 				= new Element('div', {'id': 'mehrDiv_'+styleID, 'style': 'cursor:pointer; position:absolute; bottom:10px; left:10px; 	z-index:2; color:#FF0000; background:#FFFFFF;'});
		mehrSpanElement 						= new Element('span', {'style': 'text-decoration:underline;'})
		mehrSpanElement.innerHTML 	= Texte['more'];		
		mehrDivElement.innerHTML 		= '+ ';
		mehrDivElement.appendChild(mehrSpanElement);
		masterPicDiv.appendChild(picTextDiv);
		masterPicDiv.appendChild(imgObj);
		picLiElement.appendChild(masterPicDiv);
		picList.appendChild(picLiElement);
		
		var SoldOutContainer 	= new Element('div', {id:'SoldOutContainer_'+styleID}).setStyle({position:'absolute', top:'2px', left:'2px', height:'131px', width:'263px'});
		SoldOutID[styleID] = SoldOutContainer;
		SoldOutContainer.hide();
		if(isSoldout) SoldOutContainer.show();
		var SoldOut_Dimmer 		= new Element('div', {id:'SoldOut_Dimmer_'+i}).setStyle({position:'absolute',top:'0px', left:'0', height:'100%', width:'100%', backgroundColor:'black', opacity:'0.2'});
		var SoldOut_Img				= new Element('img', {id:'SoldOut_Img_'+i, src:'../../Img/Product/'+strLng+'/outfitv2_keystyle_soldout_text.gif'}).setStyle({position:'absolute', zIndex:'10'});
		var SoldOut_Mouse			= new Element('img', {id:'SoldOut_Mouse_'+i, src:'../../Img/Main/'+strLng+'/transparent.gif', height:'20', width:'35'}).setStyle({position:'absolute', top:'55px', right:'0', zIndex:'15', cursor:'help', border:'0px solid blue'}).observe('mouseover', function(){showSoldOutInfoLayer(this.id)});

		SoldOutContainer.appendChild(SoldOut_Dimmer);
		SoldOutContainer.appendChild(SoldOut_Img);
		SoldOutContainer.appendChild(SoldOut_Mouse);
		masterPicDiv.appendChild(SoldOutContainer);

		imgObj.setStyle('cursor: auto;');
		
		var CrossJs = '../../HtmlJS/'+strLng+'/'+styleID+'.html';
		new Ajax.Request(CrossJs, {
			method: 'get',
		  onSuccess: function(transport) {
					eval(transport.responseText);
					var CSAktiv = false;
					for(var r=0; r < ColorNameArr.length; ++r) {
						for(var b=0;b < SizeColCount; ++b)
					  {
				  		if(GetBestand(b,r) > 0 & GetColorName(r,9)=='1') {
				  			CSAktiv = true;
				  			break;
				  		}
						}
						if(CSAktiv == true) break;
					}		
					if(CSAktiv == false) {					
						SoldOutID[ID].show();
					}													
		  },
		  onFailure: function() {} 
		});		

		mehrDivElement.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);} );
		imgObj.observe('click', function(event) { CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]);}) ;
		
		// TextElemente Suitings
		imgCountText = new Element('img', {'id': 'text_'+i, 'src' : '../../Img/Product/' + strLng + '/outfit_'+ (i+1) + '.gif'});
		listCountDiv = new Element('div', {'id': 'countText_' + styleID,  'style': 'width:116px; font-size:7pt; '});
		listPreisDiv = new Element('div', {'id': 'preisDiv_' + styleID, 'style': 'cursor:pointer;font-size: 10px; color: rgb(102, 102, 102);'});
		if(activeStlyeList[i].PriceBasic == activeStlyeList[i].PriceNew) {
			listPreisDiv.innerHTML =  waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic);
		} else {
			listPreisDiv.innerHTML =  '<span class="PriceOld">'+ waehrung + ' ' +ToCurr(activeStlyeList[i].PriceBasic) + '</span> <span class="PriceNew">'+Texte['now']+' '+ waehrung + ' ' + ToCurr(activeStlyeList[i].PriceNew) + '</span>';
		}
		pixelStr = '.text.cs' + i;
		listPreisDiv.observe('click', function(event) {
			CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]); 
			wtClickPixel(pixelStr); 
		});
		listCountDiv.appendChild(imgCountText);
		listTitleText = new Element('span', {'id': 'textTitel_'+styleID, 'style': 'width:175px;text-decoration:underline;color:#666666; cursor:pointer;'});
		listTitleText.innerHTML = activeStlyeList[i].StyleName + '<br />';
		listTitleText.observe('click', function(event) {
																				CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[1]], aktiveTemplate[this.id.split('_')[1]]); 
																				wtClickPixel(pixelStr); 
																				} );
		var listPointText = new Element('li', {'style': 'width:180px;'});		
			listPointText.appendChild(listCountDiv);		
			listPointText.appendChild(listTitleText);
		// Fittip		
		if(activeStlyeList[i].DescStyleFitTip3 != undefined) {			
						
			var fittipSpan 	= new Element('span', {'style': 'color:#FF0000; font-size:7pt;'});	
			
			var fitText = activeStlyeList[i].DescStyleFitTip3;
			var fitSizeChart = activeStlyeList[i].SizeChart;			
			var fitPicDestBrand=activeStlyeList[i].PicDestBrand.slice(activeStlyeList[i].PicDestBrand.indexOf('brand_')+6,activeStlyeList[i].PicDestBrand.indexOf('.gif'));
			var fitOverStyleName = activeStlyeList[i].OverStyleName;					
			
			fittipSpan.innerHTML = FitText+': <span style="color:#FF0000; font-size:7pt; text-decoration:underline; cursor:pointer;" onmousedown="WinOutFitLayer(\''+fitSizeChart+'\',\''+fitPicDestBrand+'\',\''+fitText+'\',\''+fitOverStyleName+'\');">'+ fitText + '</span>';
			strDivision = activeStlyeList[i].Division;		
					
			listPointText.appendChild(fittipSpan);
		}		
		listPointText.appendChild(listPreisDiv);		
		textList.appendChild(listPointText);
	}
	
	if(styleAnzahl < 4) {
		$(csTemplate[template]['crossTarget']).style.borderBottom = 0;
		$(csTemplate[template]['crossTarget']).style.height = '541px';
	} else {
		$(csTemplate[template]['crossTarget']).style.borderBottom = 1;
		$(csTemplate[template]['crossTarget']).style.height = '540px';	
	}

	$(csTemplate[template]['crossTarget']).appendChild(picList);
	$(csTemplate[template]['crossTarget']).style.width = '268px';
}

function genDefaultCrossStyles()
{
	var styleAnzahl 		= csTemplate[template]['styleAnzahl'] + csTemplate[template]['styleStart'];
	var styleAnzahlFinal = 0;
	var imgPfad 			= picServerBase + csTemplate[template]['srcPfad']	+ '/';
	var imgPfadBig 		= picServerBase + csTemplate[template]['srcPfadBig']	+ '/';
	var styleRefpages 	= getCrossRefpage();	
	/* Wenn nicht ausreichend Styles Sichtbar sind: */
	if(styleAnzahl > activeStlyeList.length) {
		styleAnzahl = 	activeStlyeList.length;
	} 
	for(var i=csTemplate[template]['styleStart']; i < styleAnzahl; ++i) {
		var ersatzStyle = i +3;
		if(typeof activeStlyeList[ersatzStyle] != 'undefined') {
			if( (activeStlyeList[i].FlagHidden == 'Wahr') ) {
				if(activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
					activeStlyeList[i] = activeStlyeList[ersatzStyle];		
				}
			} 
		}
		linkStr = 'HtmlProduct'+activeStlyeList[i].ProductTemplate + '.html?id='+formatStyleId(activeStlyeList[i]['-id'])
																										+ '&defcolor='+activeStlyeList[i].CrossStyleColorNumber
																										+ '&MasterStyle=' + masterStyleNumber
																										+ '&SelectedColor=' + ColorNr
																										+ '&MasterID=' + masterStyleId
																										+ styleRefpages;
		linkObj 							= new Element('a', {'href': linkStr});
		imgSrc 							= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndung'];
		imgSrcBig						= imgPfadBig + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndungBig'];
		var imgId 						= 'crossStyle_' + i;
		imgObj 							= new Element('img', {'id': imgId, 'src' :  imgSrc, 'border': '0', 'style': 'margin: 0 0 -2px 0;'});
		var aktiveStyleName 		= activeStlyeList[i].StyleName;
		if(activeStlyeList[i].PriceBasic!=activeStlyeList[i].PriceNew) {
			var aktivePreis 				= ToCurr(activeStlyeList[i].PriceNew);
		} else {
			var aktivePreis 				= ToCurr(activeStlyeList[i].PriceBasic);
		}
		crossMouseOver[imgId] 	= 'vergroessern(\''+imgSrcBig+'\', \''+aktiveStyleName+'\', \''+ aktivePreis+'\');';
		imgObj.observe('mouseover',  function(event) {  eval(crossMouseOver[this.id]); } ); 
		imgObj.observe('mouseout', function(event) { verkleinern(); });
		linkObj.appendChild(imgObj);		
		if(activeStlyeList[i].FlagHidden != 'Wahr') {
			$(csTemplate[template]['crossTarget']).appendChild(linkObj);
			styleAnzahlFinal++;
		}
	}	
	if(styleAnzahlFinal >= 1) {
		blnNoCrossStyle = false;
		if($("CrossStylesTable").style.visibility == 'hidden') {
			$("CrossStylesTable").style.visibility = 'visible';
		}
		if($("CrossStylesTable").style.display == "none") {
			$("CrossStylesTable").style.display = "block";
		}
	} else {
		blnNoCrossStyle = true;
		if($("CrossStylesTable").style.visibility == 'visible') {
			$("CrossStylesTable").style.visibility = 'hidden';
		}
		if($("CrossStylesTable").style.display == "block") {
			$("CrossStylesTable").style.display = "none";
		}		
	}
}

function genHinweislayerCrossStylesNeu()
{	
	if($(csTemplate['hinweislayer']['crossTarget']) != null) {
		$(csTemplate['hinweislayer']['crossTarget']).innerHTML = '';
		var styleAnzahl 		= csTemplate['hinweislayer']['styleAnzahl'] + csTemplate['hinweislayer']['styleStart'];
		var imgPfad 			= picServerBase + csTemplate['hinweislayer']['srcPfad']	+ '/';
		var styleRefpages	= getCrossRefpage();
		/* Wenn nicht ausreichend Styles Sichtbar sind: */
		if(styleAnzahl > activeStlyeList.length) {
			styleAnzahl = 	activeStlyeList.length;
		} 		
		//CS Texte
		var CrossTexte = new Element('div');
		CrossTexte.setStyle('position: absolute; bottom: 8px; left: 11px;');
		$('WKLayer').appendChild(CrossTexte);		
		var descriptList = new Element('ul', {'style': 'width:570px; margin:20px 7px 0 7px;padding:0;color: rgb(95, 95, 95); background-color: rgb(243, 240, 236); list-style:none; float:left; font-size:10px; '});
		for(var i=csTemplate['hinweislayer']['styleStart'] ; i < styleAnzahl; ++i) {
			var ersatzStyle = i +3;
			if(typeof activeStlyeList[ersatzStyle] != 'undefined') {
				if( (activeStlyeList[i].FlagHidden == 'Wahr') ) {
					if(activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
						activeStlyeList[i] = activeStlyeList[ersatzStyle];		
					}
				} 
			}
			if(activeStlyeList[i].FlagHidden != 'Wahr') {
				var CrossListDiv = new Element('div');
				CrossListDiv.setStyle('width: 210px; float: left;');
				var imgSrc 	= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate['hinweislayer']['dateiEndung'];
				var imgObj 										= new Element('img', {'src' :  imgSrc, 'style': 'cursor:pointer;'});	
				var linkStr = 'HtmlProduct'+activeStlyeList[i].ProductTemplate+'.html?id='+formatStyleId(activeStlyeList[i]['-id'])
																												+ '&defcolor='+activeStlyeList[i].CrossStyleColorNumber
																												+ '&MasterStyle=' + masterStyleNumber
																												+ '&SelectedColor=' + ColorNr
																												+ '&MasterID=' + masterStyleId
																												+ styleRefpages;				
				//Bild verlinken
				var CrossLink = new Element('a');
				CrossLink.href = linkStr;
				CrossLink.appendChild(imgObj);
				CrossListDiv.appendChild(CrossLink);
				$(csTemplate['hinweislayer']['crossTarget']).appendChild(CrossListDiv);
				//Texte verlinken
				var CrossLink = new Element('a');		
				CrossLink.href = linkStr;			
				//Texte
				var SaleTextDiv = new Element('div');
				SaleTextDiv.setStyle('float: left; width: 210px;');			
				
				var SaleText = new Element('div').setStyle('font-family: Arial, Verdana, Helvetiva; font-size: 12px; margin-left: 20px;');
				SaleText.innerHTML = activeStlyeList[i].StyleName;
				SaleTextDiv.appendChild(SaleText);
				var SaleText = new Element('div').setStyle('font-family: Arial, Verdana, Helvetiva; font-size: 12px; color: #000000; margin-left: 20px;');
				if(activeStlyeList[i].PriceBasic != activeStlyeList[i].PriceNew) {
					preis = ToCurr(activeStlyeList[i].PriceNew);
				} else {
					preis = ToCurr(activeStlyeList[i].PriceBasic);
				}
				SaleText.innerHTML = waehrung + ' ' + preis;
				SaleTextDiv.appendChild(SaleText);
				CrossTexte.appendChild(SaleTextDiv);
			}	
		}
	}
}

var CrossToolTipText;
function genDefaultCrossStylesV2()
{
	CrossToolTipText = new Object();
	$('CrossStyleSlide').style.left = 0;
	var styleAnzahl 	= csTemplate[template]['styleAnzahl'] + csTemplate[template]['styleStart'];
	var imgPfad 			= picServerBase + csTemplate[template]['srcPfad']	+ '/';
	var imgPfadBig 		= picServerBase + csTemplate[template]['srcPfadBig']	+ '/';
	var styleAnzahlFinal = 0;
	var styleRefpages 	= getCrossRefpage();
	/* Wenn nicht ausreichend Styles Sichtbar sind: */
	if(styleAnzahl > activeStlyeList.length) {
		styleAnzahl = 	activeStlyeList.length;
	} 
	if(!$('CrossToolTip')) {
	// ToolTipDiv erstellen
		objFit = new Object();
		objFit = document.createElement("div");
  	objFit.setAttribute("id","CrossToolTip");  	
  	document.getElementsByTagName("body")[0].appendChild(objFit);		
  	$('CrossToolTip').style.display='none';
  	$('CrossToolTip').style.position='absolute';
  	$('CrossToolTip').style.top='0px';
  	$('CrossToolTip').style.left='0px';
  	$('CrossToolTip').style.padding='5px 5px 5px 5px';
  	$('CrossToolTip').style.backgroundColor='#fff';
  	$('CrossToolTip').style.border='1px solid black';
  	$('CrossToolTip').style.zIndex='100';
  	$('CrossToolTip').style.textAlign = 'center';
	}
	
	for(var i=csTemplate[template]['styleStart']; i < styleAnzahl; ++i) {
		var ersatzStyle = i +3;
		if(typeof activeStlyeList[ersatzStyle] != 'undefined') {
			if( (activeStlyeList[i].FlagHidden == 'Wahr') ) {
				if(activeStlyeList[ersatzStyle].FlagHidden != 'Wahr') {
					activeStlyeList[i] = activeStlyeList[ersatzStyle];		
				}
			} 
		}
		var styleListElement = new Element('div', {'id': 'style_li_' + formatStyleId(activeStlyeList[i]['-id']) });
		styleListElement.alt = '';
		styleListElement.title = '';
		styleListElement.setStyle('float: left; width: 139px; margin-top: 5px; height: 124px');
		linkStr = 'HtmlProduct'+activeStlyeList[i].ProductTemplate + '.html?id='+formatStyleId(activeStlyeList[i]['-id'])
																										+ '&defcolor='+activeStlyeList[i].CrossStyleColorNumber
																										+ '&MasterStyle=' + masterStyleNumber
																										+ '&SelectedColor=' + ColorNr
																										+ '&MasterID=' + masterStyleId
																										+ styleRefpages;
		linkObj 							= new Element('a', {'href': 'javascript:void(0);'});
		styleID 			= formatStyleId(activeStlyeList[i]['-id']);
		styleColor 	= activeStlyeList[i].CrossStyleColorNumber;
		suitingStylelink[styleID] 		= 'id=' + styleID + '&color=' + styleColor + '&language='+ strLng;		
		if(activeStlyeList[i].ProductTemplate == '_StandardV2' || activeStlyeList[i].ProductTemplate == '_SchuheV2' || activeStlyeList[i].ProductTemplate == '_BettwaescheV2' || activeStlyeList[i].ProductTemplate == '_SonnenbrillenV2' || activeStlyeList[i].ProductTemplate == '_Tapete' || activeStlyeList[i].ProductTemplate ==  '_Outfit') {
			aktiveTemplate[styleID] = '_Outfit_iFrame';
		} else {
			aktiveTemplate[styleID] = '_Suitings_iFrameV2';	
		}		
		styleListElement.onclick = function() {
			CrossStyleAnzeigen(suitingStylelink[this.id.split('_')[2]], aktiveTemplate[this.id.split('_')[2]]);
			wtClickPixel('.csreiter'+this.childElements()[0].childElements()[0].id.split('_')[1]);
		}
		linkObj.style.marginLeft = '25px';
		imgSrc 							= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndung'];
		imgSrcBig						= imgPfadBig + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate[template]['dateiEndungBig'];
		var imgId 						= 'crossStyle_' + i;	
		
		imgObj = new Image();
		imgObj.src = imgSrc +'?ts='+(new Date()).getTime();
		imgObj.id = imgId;
		imgObj.border = '0';
		imgObj.onerror = function() {
			if(this.id.split('_')[1] == (styleAnzahl-1)) AddCrossCounter();
			this.style.display == 'none';
			this.parentNode.parentNode.remove();
			this.onerror = '';
		}
		imgObj.onload = function() {
			if(this.id.split('_')[1] == (styleAnzahl-1)) AddCrossCounter();
		}
		var aktiveStyleName 		= activeStlyeList[i].StyleName;
		var aktivePreis 				= ToCurr(activeStlyeList[i].PriceBasic);
		var neuerPreis					= ToCurr(activeStlyeList[i].PriceNew);
		if(neuerPreis != aktivePreis && pricereduction) {
			var PreisAnzeige = '<span style="text-decoration: line-through; color: red;">'+aktivePreis+'</span> '+waehrung + neuerPreis;
		} else {
			var PreisAnzeige = waehrung+neuerPreis;
		}
		if(activeStlyeList[i].DescStyleFitTip3 != undefined) {
			CrossToolTipText[styleID] = '<strong>'+activeStlyeList[i].DescStyleFitTip3 + '</strong><br />' + activeStlyeList[i].StyleName + '<br />' + PreisAnzeige;
		} else {
			CrossToolTipText[styleID] = activeStlyeList[i].StyleName + '<br />' + PreisAnzeige;
		}
		var TipObj = {
			
				// Schließt den ToolTip
				FitToolTipClose:function()
				{
					$('CrossToolTip').style.display='none';
				},
				
				// Zeigt den ToolTip an
				FitToolTip:function()
				{
					 $('CrossToolTip').innerHTML = CrossToolTipText[this.id.split('_')[2]];
					 $('CrossToolTip').style.display='block';
					 this.onmousemove = TipObj.showMousePos;
				},
				
				// Ermittelt die Mouse Position
				mouse_pos:function(e) {	
					if(!e) e = window.event;
					var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
					window.document.documentElement : window.document.body;
					return {
						// Position im Dokument
						top: e.pageY ? e.pageY : e.clientY + body.scrollTop - body.clientTop,
						left: e.pageX ? e.pageX : e.clientX + body.scrollLeft  - body.clientLeft
					};
				},
				
				// Verändert die Position von CrossToolTip
				showMousePos:function(e){
					
	    		var divHeight=$('CrossToolTip').getHeight();
	    		var divWidth=$('CrossToolTip').getWidth();
	    
	    		var p = TipObj.mouse_pos(e);
	    		var goleft=divWidth+5;
	    		var gotop=10;    
	    
	    		if(p.top > 420)
	    			gotop=-divHeight;
	    		
	    		if(p.left-goleft < 15) 
	    			goleft=-7;    
	  			
	    		$('CrossToolTip').style.top=p.top+gotop;
	    		$('CrossToolTip').style.left=p.left-goleft;
				} 
				
		}
		styleListElement.observe('mouseover', TipObj.FitToolTip);
		styleListElement.observe('mouseout', TipObj.FitToolTipClose);
		crossMouseOver[imgId] 	= 'vergroessern(\''+imgSrcBig+'\', \''+aktiveStyleName+'\', \''+ aktivePreis+'\');';
		linkObj.appendChild(imgObj);	
		styleListElement.appendChild(linkObj);
		var styleNameSpan = new Element('div', {'class': 'stylename'});	
		styleNameSpan.setStyle('text-align: center; width: 120px; margin-left: 12px;');
		styleNameSpan.innerHTML = activeStlyeList[i].StyleName;
		styleListElement.appendChild(styleNameSpan);
		var stylePriceSpan = new Element('div', {'class': 'priceBasic'});
		styleListElement.appendChild(stylePriceSpan);					
				
		if(activeStlyeList[i].FlagHidden != 'Wahr') {
			$(csTemplate[template]['crossTarget']).appendChild(styleListElement);
			styleAnzahlFinal++;
		}
	}
		
	if(styleAnzahlFinal >= 1) {
		blnNoCrossStyle = false;
		$('CrossStyleReiter').show();
		$('detailBild').style.borderTop = '0px';
	} else {
		blnNoCrossStyle = true;
		$('CrossStyleReiter').hide();
		$('detailBild').style.borderTop = '1px';
	}
}

function AddCrossCounter() {
	var CrossChild = $('CrossStyleSlide').childElements();
	for(var i=0; i < CrossChild.length; ++i) {
		var CrossZaehler = new Element('div');
		CrossZaehler.setStyle('position: absolute; top: 0px; border: 1px solid #d3d3d3; margin-left: -1px; padding: 1px 3px 1px 3px');
		CrossZaehler.innerHTML = (i+1);
		CrossChild[i].appendChild(CrossZaehler);
	}
	if(CrossChild.length >= 3) {
		$('ReiterPfeilL').show();
		$('ReiterPfeilR').show();
	} else {
		$('ReiterPfeilL').hide();
		$('ReiterPfeilR').hide();				
	}
}

function genHinweislayerCrossStyles()
{	
	if($(csTemplate['hinweislayer']['crossTarget']) != null) {
		$(csTemplate['hinweislayer']['crossTarget']).innerHTML = '';
		var styleAnzahl 		= csTemplate['hinweislayer']['styleAnzahl'] + csTemplate['hinweislayer']['styleStart'];
		var imgPfad 			= picServerBase + csTemplate['hinweislayer']['srcPfad']	+ '/';
		var styleRefpages	= getCrossRefpage();
		/* Wenn nicht ausreichend Styles Sichtbar sind: */
		if(styleAnzahl > activeStlyeList.length) {
			styleAnzahl = 	activeStlyeList.length;
		} 		
		var descriptList = new Element('ul', {'style': 'width:570px; margin:20px 7px 0 7px;padding:0;color: rgb(95, 95, 95); background-color: rgb(243, 240, 236); list-style:none; float:left; font-size:10px; '});
		for(var i=csTemplate['hinweislayer']['styleStart'] ; i < styleAnzahl; ++i) {
			linkStr = 'HtmlProduct'+activeStlyeList[i].ProductTemplate+'.html?id='+formatStyleId(activeStlyeList[i]['-id'])
																											+ '&defcolor='+activeStlyeList[i].CrossStyleColorNumber
																											+ '&MasterStyle=' + masterStyleNumber
																											+ '&SelectedColor=' + ColorNr
																											+ '&MasterID=' + masterStyleId
																											+ styleRefpages;
			linkObj 	= new Element('a', {'href': linkStr});
			imgSrc 	= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate['hinweislayer']['dateiEndung'];
			imgObj 	= new Element('img', {'src' :  imgSrc, 
																'border': '0'});
			if(activeStlyeList[i].FlagHidden != 'Wahr') {																			
				linkObj.appendChild(imgObj);		
			}
			$(csTemplate['hinweislayer']['crossTarget']).appendChild(linkObj);			
			/* BeschreibungsListenpunk	*/	
			descriptListpoint 						= new Element('li', {'style': 'width:185px; height:25px; font-size:7pt; position:relative;  float:left;'});
			var listPfleilImg 							= new Image();
			descDiv 										= new Element('div', {'style': 'width:170px; position:absolute; left:20px; top:0px; font-size:7pt; '});
			listPfleilImg.src 							= '../../Img/Product/' + strLng +  '/cross_iframe_pfeil.gif';	
			listPfleilImg.style.float 					= 'left';	
			listPfleilImg.style.border 				= 0;
			imgPfeilDiv 									= new Element('div', {'style': 'width:14px; font-size:7pt; '});
			imgPfeilDiv.appendChild(listPfleilImg);
			overStyleNameText 					= new Element('div', {'style': 'width:176px; font-size:7pt; '});
			overStyleNameText.innerHTML 	= activeStlyeList[i].StyleName;		
			descriptListpoint.appendChild(imgPfeilDiv);
			descDiv.appendChild(overStyleNameText);		
			listPreisSpan = new Element('div', {'style': 'width:176px; font-size:7pt; cursor:pointer;'});
			if(activeStlyeList[i].PriceBasic != activeStlyeList[i].PriceNew) {
				preis = ToCurr(activeStlyeList[i].PriceNew);
			} else {
				preis = ToCurr(activeStlyeList[i].PriceBasic);
			}
			
			listPreisSpan.innerHTML =  waehrung + ' ' +preis;
			listPreisSpan.observe('click', function(event) { document.location.href = linkStr; });
			descDiv.appendChild(listPreisSpan);
			descriptListpoint.appendChild(descDiv);		
			if(activeStlyeList[i].FlagHidden != 'Wahr') {
				descriptList.appendChild(descriptListpoint);
			}
		}	
		$(csTemplate['hinweislayer']['crossTarget']).appendChild(descriptList);	
	}
}

function genHinweislayerCrossStylesV2()
{	
	if($(csTemplate['hinweislayerV2']['crossTarget']) != null) {
		$(csTemplate['hinweislayerV2']['crossTarget']).innerHTML = '';
		var styleAnzahl 		= csTemplate['hinweislayer']['styleAnzahl'] + csTemplate['hinweislayerV2']['styleStart'];
		var imgPfad 			= picServerBase + csTemplate['hinweislayerV2']['srcPfad']	+ '/';
		var styleRefpages	= getCrossRefpage();
		/* Wenn nicht ausreichend Styles Sichtbar sind: */
		if(styleAnzahl > activeStlyeList.length) {
			styleAnzahl = 	activeStlyeList.length;
		} 		
		var descriptList = new Element('ul', {'style': 'width:570px; margin:20px 7px 0 7px;padding:0;color: rgb(95, 95, 95); list-style:none; float:left; font-size:10px; '});
		$(csTemplate['hinweislayerV2']['crossTarget']).appendChild(descriptList);	
		for(var i=csTemplate['hinweislayerV2']['styleStart'] ; i < styleAnzahl; ++i) {
			linkStr = 'HtmlProduct'+activeStlyeList[i].ProductTemplate+'.html?id='+formatStyleId(activeStlyeList[i]['-id'])
																											+ '&defcolor='+activeStlyeList[i].CrossStyleColorNumber
																											+ '&MasterStyle=' + masterStyleNumber
																											+ '&SelectedColor=' + ColorNr
																											+ '&MasterID=' + masterStyleId
																											+ styleRefpages;
			linkObj 	= new Element('a', {'href': linkStr});
			imgSrc 	= imgPfad + activeStlyeList[i].StyleNumber + '_' + activeStlyeList[i].CrossStyleColorNumber + csTemplate['hinweislayerV2']['dateiEndung'];
			imgObj 	= new Element('img', {'src' :  imgSrc, 
																'border': '0',
																'width':csTemplate['hinweislayerV2']['imgSize'][0],
																'height':csTemplate['hinweislayerV2']['imgSize'][1]});
																
			linkObj.appendChild(imgObj);		
			$(csTemplate['hinweislayerV2']['crossTarget']).appendChild(linkObj);			
			/* BeschreibungsListenpunk	*/	
			descriptListpoint 						= new Element('li', {'style': 'width:185px; height:25px; font-size:10px; position:relative;  float:left;'});
			var listPfleilImg 							= new Image();
			descDiv 										= new Element('div', {'style': 'width:170px; position:absolute; left:18px; top:0px; font-size:10pt; font-weight:bold; '});
			listPfleilImg.src 							= '../../Img/Product/' + strLng +  '/StandartV2/shopping_basket_'+i+'.gif';	
			listPfleilImg.style.float 					= 'left';	
			listPfleilImg.style.border 				= 0;
			imgPfeilDiv 									= new Element('div', {'style': 'width:14px; font-size:7pt; '});
			imgPfeilDiv.appendChild(listPfleilImg);
			overStyleNameText 					= new Element('div', {'style': 'width:176px; font-size:7pt; '});
			overStyleNameText.innerHTML 	= activeStlyeList[i].StyleName;		
			descriptListpoint.appendChild(imgPfeilDiv);
			descDiv.appendChild(overStyleNameText);		
			listPreisSpan = new Element('div', {'style': 'width:176px; font-size:13px; color: #666666; cursor:pointer;'});
			if(activeStlyeList[i].PriceBasic > activeStlyeList[i].PriceNew) {
				preis = ToCurr(activeStlyeList[i].PriceBasic);
			} else {
				preis = ToCurr(activeStlyeList[i].PriceNew);
			}
			
			listPreisSpan.innerHTML =  waehrung + ' ' +preis;
			listPreisSpan.observe('click', function(event) { document.location.href = linkStr; });
			descDiv.appendChild(listPreisSpan);
			descriptListpoint.appendChild(descDiv);			
			descriptList.appendChild(descriptListpoint);
			
		}	
	}
}

function showSoldOutInfoLayer(LayerNumber){

	var LayerPosTop = ( $(LayerNumber).cumulativeOffset()[1] ) - 27;
	var SoldOut_InfoLayer = new Element('img', {id:'SoldOut_InfoLayer', src:'../../Img/Product/'+strLng+'/outfitv2_keystyle_soldout_rollover-element.gif'}).setStyle({position:'absolute', top:LayerPosTop+'px', right:'270px', zIndex:'20'});
	$('masterLayout').appendChild(SoldOut_InfoLayer);
	$(LayerNumber).onmouseout = function(){$('SoldOut_InfoLayer').remove();}
}