///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 	Beispiel für einen Aufruf:
//	parent.erstelleObjekt("ProduktError('A34563', 'green', 'XS','','')");
//	parent.HinweisLayer(parent.objProdukt.NichtLieferbar, this.name, 1, <auszuführendeFunktion>);			<- 1=ok, 2=ok,abbrechen

objMeldungslayer = "";																														//Fehlermeldungen 08.06.07

function erstelleObjekt(newObj)
{
	eval("objMeldungslayer = new " + newObj);
}

function ProduktError(StyleNumber, ColorNumber, Size, Anzahl, Bestellwert)
{
	this.Bestellmenge     = TexteErr['Bestellmenge'];
	this.Bestellwert      = TexteErr['Bestellwert'];
	this.MaxAnzahl        = TexteErr['MaxAnzahl'];
	this.NichtLieferbar   = TexteErr['NichtLieferbar'];
	this.NiedrigerBestand = TexteErr['NiedrigerBestand'];
	this.PopupHilfe       = TexteErr['PopupHilfe'];
	this.maxBestellmenge  = TexteErr['maxBestellmenge'];
	this.CookieBlock      = TexteErr['CookieBlock'];
	this.MaxBestellwert   = TexteErr['MaxBestellwert'];
	this.MinBestellwert   = TexteErr['MinBestellwert'];
	this.noKK   					= TexteErr['noKK'];
		
	if(StyleNumber != "")
	{
		this.NichtLieferbar 	= this.NichtLieferbar.replace(/(\{StyleNumber\})/g, StyleNumber);
	}
	if(ColorNumber != "")
	{
		this.NichtLieferbar 	= this.NichtLieferbar.replace(/(\{Farbe\})/g, ColorNumber);
	}
	if(Size != "")
	{
		this.NichtLieferbar 	= this.NichtLieferbar.replace(/(\{Größe\})/g, Size);
	}
	if(Anzahl != "")
	{
		this.Bestellmenge	 		= this.Bestellmenge.replace(/(\{Anzahl\})/g, Anzahl);
		this.maxBestellmenge	= this.maxBestellmenge.replace(/(\{Anzahl\})/g, Anzahl);
	}
	if(Bestellwert != "")
	{
		this.Bestellwert 			=	this.Bestellwert.replace(/(\{Bestellwert\})/g, Bestellwert);
	}
}

var screenBreite=0;
var screenHoehe=0;

function HinweisLayer(Inhalt, objName)
{
	screenBreite 		= document.getElementsByTagName('body')[0].offsetWidth;
	screenHoehe 		= document.getElementsByTagName('body')[0].offsetHeight + 10;
	if(document.all)
	{
		screenHoehe = document.getElementsByTagName('body')[0].scrollHeight;
		screenBreite -= 16;
	}	
	GroesseX	= 380;
	GroesseY	= 0;
	PosX			= (screenBreite / 2) - (GroesseX / 2);
	PosY 		  = 50;
	
	Div = '\
					<div id="div_fader" style="visibility:hidden; background-color:#FFF; position:absolute; filter:alpha(opacity=80);-moz-opacity:0.80; opacity: 0.8; z-index:999;top:0px; left:0px; width:808px; height:' + top.getPageSize(this)[1] + 'px;"></div>\
		 			<div id="div_anzeige" style="visibility:hidden; position:absolute; z-index:1000;top:' + PosY + 'px; left:' + PosX + 'px; width:' + GroesseX + 'px; height:' + GroesseY + 'px;">\
						<table border="0" cellpadding="0" cellspacing="0" style="background-color:white; border:8px solid #AFBEC5" width="' + GroesseX + '" height="' + GroesseY + '">\
							<tr>\
								<td valign="middle" align="left" style="padding:7px" class="medium" id="div_anzeige_inhalt">' + Inhalt + '</td>\
							</tr>\
							<tr>\
								<td>&nbsp;</td>\
							</tr>\
							<tr>\
								<td align="center">\
									<table border="0" style="background-color:#E7EBEE" cellpadding="7" cellspacing="0" width="' + eval(GroesseX-30) + '">\
										<tr>\
											<td align="left" class="medium">'+Texte['mehrinfos']+'</td>\
										</tr>\
									</table>\
								</td>\
							</tr>\
							<tr>\
								<td align="center"><div id="buttons" align="center"></div></td>\
							</tr>\
							<tr>\
								<td>&nbsp;</td>\
							</tr>\
						</table>\
					</div>';
	document.write(Div);
}

// Neuer ESPRIT-Hinweislayer 15.10.2008
function newHinweisLayer()
{
	/* div_faderNEW */
	faderTop = 110;
	faderLeft = 0;
	faderWidth = 769;
	faderHeight = (document.getElementById("faderPosition").offsetTop - 30);
	
	/* div_anzeigeNEW */
	paddingBtn = 80;
	GroesseX	= 620;
	GroesseY	= 243;
	PosX = ((faderWidth / 2) - (GroesseX / 2))
	PosY = 0; // wird beim Aufruf initialisiert
	
	// Anpassungen an den IE
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		 // div_anzeige
		 paddingBtn = 70;
		 
		 // div_fader
		 faderHeight += 2;
		 faderWidth = 765;
	}
	
	Div = '\
				<div id="div_faderNEW" style="visibility:hidden; background-color:#000000; position:absolute; filter:alpha(opacity=83);-moz-opacity:0.83; z-index:999; top:' + faderTop + 'px; left:' + faderLeft + 'px; width:' + faderWidth + 'px; height:' + faderHeight + 'px;"></div>\
				 <div id="div_anzeigeNEW" style="border:4px solid red; background-color:#FFFFFF; position:absolute; visibility:hidden; width:' + GroesseX + 'px; height:' + GroesseY + 'px; z-index:1000; top:' + PosY + 'px; left:' + PosX + 'px;">\
   			  <div style="width:184px; height:243px; float:left; background-image:url('+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_gesicht.jpg); background-repeat:no-repeat;"></div>\
   			  <div style="width:427px; height:243px; float:right;">\
   				 <div style="width:94px; height:13px; padding-top:10px; float:right;"><input height="13" width="94" type="image" border="0" onmouseup="events(\'otherPayment()\');" src="'+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_button_close.gif" /></div>\
   				 <div id="div_caption_inhalt" style="font-family:Verdana, serif; font-size:12px; color:#787171; padding-top:' + paddingBtn + 'px; padding-left:10px;"></div>\
   				 <div id="div_btn" style="height:43px; width:400px; padding-top:20px; float:left;"></div>\
   			 </div>\
   		  </div>\
   		 </div>';
 	
	document.write(Div);	
}

// Buttons für den neuen ESPRIT Hinweislayer 15.10.2008
function addButtonsInLayerNEW(btnAnzahl, btnFunktion)
{
		/*** Bei abweichender Layerbreite (aktuell: 630px) die "paddings" für Buttons anpassen ***/
		
		Div = '<div style="float:left; padding-left:120px;"><input type="image" src="'+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_button_ok.gif" name="order_ok" id="order_ok" border="0" width="154" height="41" onMouseUp="events(\''+ btnFunktion +'\');" /></div>';
	
		// Bei OK-Button-Klick ==> Layer schließen
		if(!btnFunktion)
		{
			Div = '<div style="float:left; padding-left:120px;"><input type="image" src="'+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_button_ok.gif" name="order_ok" id="order_ok" border="0" width="154" height="41" onMouseUp="document.getElementById(\'div_faderNEW\').style.visibility=\'hidden\';setTimeout(\'document.getElementById(\\\'div_anzeigeNEW\\\').style.visibility=\\\'hidden\\\'\',100);" /></div>';
		}
		else
		{
			document.getElementById("div_caption_inhalt").style.paddingTop = 50;
		}
		
		if(btnAnzahl == 2)
		{
			Div  = '<div style="float:left; padding-left:50px;"><input type="image" src="'+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_button_ok.gif" name="order_ok" id="order_ok" border="0" width="154" height="41" onMouseUp="events(\''+ btnFunktion +'\');" /></div>';
			Div += '<div><input type="Image" src="'+Texte['pfad']+'/Shop/Img/Main/'+strLng+'/meldungslayer_button_cancel.gif" name="order_cancel" id="order_cancel" border="0" width="154" height="41" onMouseUp="document.getElementById(\'div_faderNEW\').style.visibility=\'hidden\';setTimeout(\'document.getElementById(\\\'div_anzeigeNEW\\\').style.visibility=\\\'hidden\\\'\',100);" /></div>';
			document.getElementById("div_caption_inhalt").style.paddingTop = 50;
		}
		
		if(document.getElementById('div_btn'))
		{
			document.getElementById('div_btn').innerHTML = Div;
		}
		else
		{
			return false;
		}
}

function addButtonsInLayer(LayerArt, buttonFunktion)
{
	
	Div = '<br><input type="button" style="border:1px solid #AFBEC5; background-color:#F7F7F7;" id="btnOk" value=" ok " onMouseUp="events(\''+buttonFunktion+'\');"></input>';
	
	if(LayerArt==2)
	{
		 Div += ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="button" id="btnAbbrechen" style="border:1px solid #AFBEC5; background-color:#F7F7F7;" value="abbrechen" onMouseUp="document.getElementById(\'div_fader\').style.visibility=\'hidden\';setTimeout(\'document.getElementById(\\\'div_anzeige\\\').style.visibility=\\\'hidden\\\'\',100);"></input>';
	}

	if(document.getElementById('buttons'))
	{
		document.getElementById('buttons').innerHTML = Div;
	}
	else
	{
		return false;
	}
}

function events(buttonFunktion)
{
	document.getElementById('div_fader').style.visibility='hidden';
	setTimeout('document.getElementById(\'div_anzeige\').style.visibility=\'hidden\'',100);
	return eval(buttonFunktion);
}

/*-------------------------
		Bestätigungslayer
-------------------------*/

function erstelleBestaetigungsDiv()
{
	if(blnNoCrossStyle || NewSale=='sale')
	{
		document.write('\
										<div id="size_tip_layer_small" style="position:absolute; left:187px; top:252px; z-index:100; visibility:hidden;">\
											<div style="position:absolute; top:0px; left:0px; width:210px; height:40px; text-align:right;"><a id="SizeTipHrefSale"><img src="../../Img/transparent.gif" id="SizeTipImgSale"></a></div>\
											<div id="size_tip_sale_text" style="position:absolute; top:3px; left:65px; width:210px; height:40px; text-align:right; z-index:1000;"></div>\
										</div>\
										<!-- Großer Layer mit dem langen Text -->\
										<div id="size_tip_layer_big" style="position:absolute; z-index:101; width:300px; height:134px; text-align:right; visibility:hidden;"></div>'); // Update 13.10.2008 -ab
	}
	else
	{
		document.write('\
										<div id="size_tip_layer_small" style="position:absolute; left:304px; top:40px; z-index:100; visibility:hidden;">\
											<div style="position:absolute; top:0px; left:0px; width:210px; height:40px; text-align:right;"><a id="SizeTipHrefRegular"><img src="../../Img/transparent.gif" id="SizeTipImgRegular"></a></div>\
											<div id="size_tip_sale_text" style="position:absolute; top:3px; left:65px; width:210px; height:40px; text-align:right; z-index:1000;"></div>\
										</div>\
										<!-- Großer Layer mit dem langen Text -->\
										<div id="size_tip_layer_big" style="position:absolute; left:304px; top:40px;  z-index:101; width:300px; height:134px; visibility:hidden;"></div>'); // Update 13.10.2008 -ab
	}
	
	screenBreite 		= document.getElementsByTagName('body')[0].offsetWidth;
	screenHoehe 		= document.getElementsByTagName('body')[0].offsetHeight + 10;
	if(document.all)
	{
		screenHoehe = document.getElementsByTagName('body')[0].scrollHeight;
		screenBreite -= 16;
	}

document.write('\
\
<!-- Layer zum Darstellen der Schattierungen (werden bei beiden Bestätigungslayern benötigt) -->\
\
		<div id="schattenDiv1" style="z-index:27;position:absolute; background-color:#FFF; width:808px;height:'+top.getPageSize(this)[1]+';top:0px; left:0px; opacity: 0.85; filter:alpha(opacity=85);-moz-opacity:0.85; align:left; visibility:hidden;"><a href="javascript:bestaetigung_unsichtbar()"><img src="../../Img/transparent.gif" border="0" width:'+top.getPageSize(this)[0]+';height:'+top.getPageSize(this)[1]+'></a></div>\
		<div id="schattenDivMI2" onclick="MoreInfo()" style="z-index:28; position:absolute; background-color:black; top:35px; left:38px; height:385px; width:470px; filter:alpha(opacity=10);-moz-opacity:0.10; visibility:hidden;"><img src="'+Texte['pfad']+'/Shop/Img/transparent.gif" border="0" width="405" height="325"></div>\
\
<!--	ENDE Layer zum Darstellen der Schattierungen ENDE -->\
\
\
\
<!-- Warenkorbbestätigungslayer Layer  mit CrossStyles -->\
\
		<div id="bestaetigung" style="border:1px solid #B7B7B7;position:absolute; z-index:99;top:10px; left:10px; width:584px; background-color:white;height:499px;visibility:hidden;">\
			<div style="position:absolute; z-index:58; top:5px; right:5px; width:12px; height:12px;"><a href="javascript:bestaetigung_unsichtbar()"><img src="../../Img/Product/'+strLng+'/cross_close.gif"></a></div>\
			<div style="position:absolute; z-index:61; top:86px; left:11px; width:152px; height:30px;"><a href="javascript:bestaetigung_unsichtbar()"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="152" height="30" border="0"></a></div>\
				<!--<div style="position:absolute; z-index:60; top:86px; left:385px; width:184px; height:30px;"><a href="../../basket_'+strLng+'_exe.htm" target="FrameMainMain"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="184" height="30" border="0"></a></div>-->\
				<div style="position:absolute; z-index:60; top:86px; left:385px; width:184px; height:30px;"><a href="../../HtmlNaviDir/'+strLng+'/start_frameset_basket.html" target="FrameStart"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="184" height="30" border="0"></a></div>\
				<table cellspacing="0" cellpadding="0" style="background-color:#FFFFFF; width:584px; border:0px solid green; background-image:url(../../Img/Product/'+strLng+'/cross_title_'+strLng.toUpperCase()+'.gif);background-repeat:no-repeat;">\
					<tr>\
						<td style="width:40px; height:78px; text-align:left; vertical-align:middle; padding-left:10px;padding-top:15px"><img src="http://pics.esprit.de/PicDestStyleThumb/'+StyleNumber+'_'+ColorNumber+'.gif"  border="0" style="border:1px solid #EFEDDF;" id="PicDestStyleOver_List_Cross_Img"></td>\
						<td style="border:0px solid green; width:544px; text-align:left; height:78px; padding-left:15"><span style="font-size:16px;font-weight:bolder;color:#96675D">Gr&ouml;&szlig;e:</span>&nbsp;&nbsp;<span id="groesse" style="font-size:16px;font-weight:bolder;color:#656565"></span><br><span style="font-size:9px;font-weight:bolder;color:#656565">'+StyleName+', <span id="priceSpanBig">&euro;'+PriceNew+'</span></span></td>\
					</tr>\
					<tr>\
						<td colspan="2" style="background-image:url(../../Img/Product/'+strLng+'/cross_unter_title_DE.gif);background-repeat:no-repeat;width:584;height:46;" width="584" height="46">&nbsp;</td>\
					</tr>\
					<tr>\
						<td colspan="2" width="584" style="border:0px solid green"><img src="../../Img/Product/'+strLng+'/cross_sub_title_DE.gif" border="0" /><div id="CrossFrame2" style="width:584px; height:300px;"></div><!--<iframe name="CrossFrame2" id="CrossFrame2" src="../Promo40.html" width="584" height="375" style="border:0;" frameborder="0" scrolling="no"></iframe>--></td>\
					</tr>\
				</table>\
		</div>\
\
<!-- ENDE Warenkorbbestätigungslayer Layer  mit CrossStyles ENDE -->\
\
\
\
<!-- Warenkorbbestätigungslayer Layer  ohne CrossStyles (für SALE und Suitings)-->\
\
		<div id="sale_bestaetigung" style="position:absolute; z-index:99; top:180px; left:80px; width:404px; height:176px; visibility:hidden;">\
			<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" border="0" style="width:404px; height:176px; background-image:url(../../Img/Product/' + strLng + '/cross_background_small.gif); background-repeat: no-repeat;" id="sale">\
				<tr>\
					<td style="width:40px; height:78px; text-align:left; vertical-align:top; padding-left:10px; padding-top:25px;"><img src="http://pics.esprit.de/Shop/PicDestStyleThumb/'+StyleNumber+'_'+ColorNumber+'.gif" style="border:1px solid #EFEDDF;" id="PicDestStyleOver_List_Cross_Img2"></td>\
					<td style="width:544px; height:78px; text-align:left; vertical-align:top; padding-left:15px; padding-top:25px; font-size:16px; font-weight:900; color:#96675D;">Gr&ouml;&szlig;e:&nbsp;&nbsp;<span id="sale_groesse" style="color:#656565"></span><br><span style="font-size:9px; color:#656565;">'+StyleName+',</span> <span style="font-size:9px;font-weight:bolder;color:#656565" id="priceSpanSale">&euro;'+PriceNew+'</span></td>\
				</tr>\
			</table>\
			<div style="position:absolute; z-index:58; top:8px; right:13px; width:12px; height:12px;"><a href="javascript:bestaetigung_unsichtbar()"><img src="../../Img/Product/'+strLng+'/cross_close.gif"></a></div>\
			<!--<div style="position:absolute; z-index:60; top:129px; left:205px; width:184px; height:30px;"><a href="../../basket_'+strLng+'_exe.htm" target="FrameMainMain"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="184" height="30" border="0"></a></div>-->\
			<div style="position:absolute; z-index:60; top:129px; left:205px; width:184px; height:30px;"><a href="../../HtmlNaviDir/'+strLng+'/start_frameset_basket.html" target="FrameStart"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="184" height="30" border="0"></a></div>\
			<div style="position:absolute; z-index:61; top:129px; left:13px; width:182px; height:30px;"><a href="javascript:bestaetigung_unsichtbar()"><img src="../../Img/Product/'+strLng+'/transparent.gif" width="182" height="30" border="0"></a></div>\
		</div>\
\
<!-- ENDE Warenkorbbestätigungslayer Layer  ohne CrossStyles (für SALE und Suitings) ENDE-->\
\
\
\
<!-- MoreInfo-Layer || Material + Pflege + Lanftext -->\
\
		<div id="MoreInfo" style="border:1px solid #666666; position:absolute; z-index:99; top:30px; left:33px; height:385px; background-color:white; visibility:hidden;">\
			<div style="position:absolute; top:5px; right:5px; width:18px; height:16px;"><a href="javascript:MoreInfo()" onfocus="if(this.blur)this.blur()"><img src="../../Img/Main/'+strLng+'/new_schliessen.gif" border="0"></a></div>\
			<br><br>\
			<table bgcolor="#ffffff" align="left">\
				<tr>\
					<td align="left">\
						<table border="0" cellspacing="0" cellpadding="0" width="460">\
							<tr>\
								<td align="left" valign="top" width="420" height="40"><img src="../../PicTmpl/'+strLng+'/moreinfo.gif" border="0" alt="close window" width="300" height="40"></td>\
							</tr>\
							<tr>\
								<td style="text-align:left; vertical-align:top; width:420px; height:30px; font-weight:900; padding-left:30px; padding-right:10px;">' + DescStyleShort + '</td>\
							</tr>\
							<tr>\
								<td style="text-align:left; vertical-align:top; width:420px; height:170px; padding-left:30px; padding-right:10px;">'+DescStyleLong+'</td>\
							</tr>\
							<tr>\
								<td id="material_td" style="text-align:left; vertical-align:bottom; width:420px; padding-left:30px; padding-right:10px;">'+Material+'</td>\
							</tr>\
							<tr>\
								<td id="caresym_td" style="text-align:left; vertical-align:bottom; width:260px; padding-left:30px; padding-right:10px;">'+CareSym+'</td>\
							</tr>\
						</table>\
					</td>\
					<td valign="bottom">\
');
				// - AH - 15.04.09
				if(Material!=""){document.getElementById('material_td').style.height='30px';}
				if(CareSym!=""){document.getElementById('caresym_td').style.height='30px';}
				// -	
				
				if(Welt=="women" && (Category.indexOf(Texte['stiefel']) >= 0 || Category.indexOf(Texte['stiefelette']) >= 0 ||  Category.indexOf(Texte['boots']) >= 0 ||  Category.indexOf(Texte['flatbooties']) >= 0))
								{document.write('<img src="../../Img/Product/'+strLng+'/hinweislayer_boots_measures.gif"></td>');}		
				else if(DivisionID=='17')
								{document.write('<img src="../../Img/Product/'+strLng+'/tuev.gif"></td>');}		
document.write('\
					</td>\
				</tr>\
			</table>\
		</div>\
');
}

// Für neuen ESPRIT Layer
function getMsgPositionNEW(layerHeight)
{
	var faderHeight = (document.getElementById("faderPosition").offsetTop - 31);
	var msgShowPosition = ((faderHeight / 2) - (layerHeight / 2) + 110); //110px abstand von Top
	
	// Anpassung an den IE
	if(navigator.appName == "Microsoft Internet Explorer") msgShowPosition += 7;
	
	return msgShowPosition;	
}