/* <!-- Version 6 / Datum: 17.01.2005 / Bearbeiter: mlau --> */
if (typeof webRoot == 'undefined' || webRoot == 0 || webRoot == '0' || webRoot == ''){
	if (location.protocol  == 'https:'){
		var webRoot = "https://www.otto.de:443/is-bin/intershop.static/WFS/OttoDe/-/de_DE/imagesOnline/";
	} else {
		var webRoot = "http://www.otto.de:80/is-bin/intershop.static/WFS/OttoDe/-/de_DE/imagesOnline/";
	}
}

var warda = false;

function showLeerGif() {
	var gfx = webRoot + "sonstiges/leer.gif";
	var laufi = 0; while (document.images[laufi]) {if (document.images[laufi].name == "leer") {document.images[laufi].src = gfx;}laufi++;}
}

function Euroumrechnung(para) {
	return para;     
}

function bildwechsel(name) {
	zustand = document.images[name].src;
	zustand = zustand.slice(zustand.length-6,zustand.length-4);
	if (name == "bestell") {
		zustandneu = (zustand == "00") ? "01" : "00";
		document.images[name].src = eval(name + "_" + zustandneu + ".src");
	} else {
		zustandneu = (zustand == "00") ? "10" : "00";
		document.images[name].src = eval(name + "_" + zustandneu + ".src");
	}
}

function changecolor(colorvalue, elementname){	
	document.getElementById(elementname).style.color=colorvalue;
}	

function ChangePic(welches,quelle) {document.images[welches].src = webRoot + quelle + ".gif";}

function SNavi(jump) {
	if(jump != '') {
		document.location.href = jump;
	}
}

function getElementTopPos(element) {if (document.getElementById) {if (element.tagName.toUpperCase() != "BODY") {if ((element.tagName.toUpperCase() != "TD") && (element.tagName.toUpperCase() != "TBODY")) {return element.offsetTop + getElementTopPos(element.parentNode);} else {return getElementTopPos(element.parentNode);}} else {return (element.offsetTop);}}}

function getElementLeftPos(element) {
	if (document.getElementById) {
		if (element.tagName.toUpperCase() != "BODY") {
			if ((element.tagName.toUpperCase() != "TBODY")&&(element.tagName.toUpperCase() != "TR")) {
				return element.offsetLeft + getElementLeftPos(element.parentNode);
			} else {
				return getElementLeftPos(element.parentNode);
			}
		} else {
			return (element.offsetLeft);
		}
	}
}

function scrollToId(id) {if (id == "top") {window.scrollTo (0,0);} else {if (document.getElementById) {if (document.getElementById(id) != null){window.scrollTo (getElementLeftPos(document.getElementById(id)),getElementTopPos(document.getElementById(id)));}}}}

function DecodeString(wert) {
	var result = wert;
	var maxi = result.length;
	var i = 0;
	while ((result.search("&") != -1) && (i < maxi)) {
		result = result.replace(/\&nbsp\;/," ");
		result = result.replace(/\&auml\;/,"?");
		result = result.replace(/\&Auml\;/,"?");
		result = result.replace(/\&ouml\;/,"?");
		result = result.replace(/\&Ouml\;/,"?");
		result = result.replace(/\&uuml\;/,"?");
		result = result.replace(/\&Uuml\;/,"?");
		result = result.replace(/\&szlig\;/,"?");
		result = result.replace(/\&raquo\;/,"?");
		result = result.replace(/\&laquo\;/,"?");
		result = result.replace(/\&frac12\;/,"?");
		result = result.replace(/\&frac14\;/,"?");
		result = result.replace(/\&frac34\;/,"?");
		result = result.replace(/\&quot\;/,"");
		result = result.replace(/\&ordm\;/,"?");
		result = result.replace(/\&rdquo\;/,"");
		result = result.replace(/\&ldquo\;/,"");
		result = result.replace(/\&acute\;/,"?");
		result = result.replace(/\&amp\;/,"&");
		result = result.replace(/\&ecirc\;/,"?");
		result = result.replace(/\&eacute\;/,"?");
		result = result.replace(/\&egrave\;/,"?");
		result = result.replace(/\&euml\;/,"?");
		result = result.replace(/\&agrave\;/,"?");
		result = result.replace(/\&aacute\;/,"?");
		result = result.replace(/\&acirc\;/,"?");
		result = result.replace(/\&Oslash\;/,"?");
		result = result.replace(/\&\#150\;/,"-");
		result = result.replace(/\&\#151\;/,"-");
		result = result.replace(/\&sup2\;/,"?");
		result = result.replace(/\&sup3\;/,"?");		
		i++;
	}
	return result;
}

function getParamValueFromURL(param) {
	// diese Methode sucht innerhalb der URl einen Parameter unter dem ubergebenen Namen
	// und liefert dessen Wert als String im Returnvalue der Funktion zurueck
	var docparam_string = "";
	var ergebniswert = "";
	if (this.location.search != "") {
		docparam_string = this.location.search.replace("?","");
		var docparam_array  = docparam_string.split("&");
		for (var i = 0; i < docparam_array.length; i++) {
			if (docparam_array[i].indexOf(param + "=") == 0) {
				ergebniswert = docparam_array[i].replace(param + "=","");
			}
		}									
	}
	return ergebniswert;
}

function getCenterPosition(pwidth,pheight) {
	var x = (screen.width-pwidth) / 2;
	var y = (screen.height-pheight) / 2;
	var fc_js_pos = ",left="+x+",top="+y+",screenX="+x+",screenY="+y;
	
	return fc_js_pos;
}

function OpenDruck(breite,hoehe,Ziel) {
	fc_js_pos = getCenterPosition(breite,hoehe);
	options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=yes,status=no,menubar=yes,resizable=no"+fc_js_pos;
	newwindow = open(Ziel,'Drucken',options);
}

function OpenPopUp(breite,hoehe,Ziel) {
	OpenPopUpName(breite,hoehe,'PopUp',Ziel)
}

function PopUpNoFrames(breite,hoehe,Ziel) {
	fc_js_pos = getCenterPosition(breite,hoehe);
	options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=yes,status=yes,menubar=no,resizable=no"+fc_js_pos;
	popup = open(Ziel,'PopUp',options);
}

function OpenPopUpZoom(breite,hoehe,Ziel) {
	if (screen.height>=700) {
		hoehe = eval(hoehe*1 + 13);
	}

	fc_js_pos = getCenterPosition(breite,hoehe);
	options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=auto,status=yes,menubar=no,resizable=no"+fc_js_pos;
	popup = open(Ziel,'ZoomPopUp',options);
}

function openDelWin( windowURL, windowName, windowFeatures ) { 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 

function OpenPopUpScroll(breite,hoehe,Ziel) {
	fc_js_pos = getCenterPosition(breite,hoehe);
	options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=auto,status=yes,menubar=no,resizable=no"+fc_js_pos;
	popup = open(Ziel,'PopUp',options);
}

function OpenPopUpFixed(breite,hoehe,Ziel) {
	fc_js_pos = getCenterPosition(breite,hoehe);
	options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=auto,status=no,menubar=no,resizable=no"+fc_js_pos;
	var x = Math.round(100000000 + (99999999 * Math.random()));
	x = open(Ziel,x,options);
}

function OpenPopUpName(breite,hoehe,pop_name,Ziel) {
	OpenPopUpNamePara(breite,hoehe,pop_name,'',Ziel);
}

function OpenPopUpNamePara(breite,hoehe,pop_name,para,Ziel) {
	var fc_js_pos = getCenterPosition(breite,hoehe);
	
	var options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=auto,status=no,menubar=no,resizable=no"+fc_js_pos;
	if (para == 'scroll') {
		options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no"+fc_js_pos;
	}
	if (para == 'noscroll') {
		options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no"+fc_js_pos;
	}

	if 	(pop_name == ''){
		pop_name = 'Popup';	
	}	
	
	
	var newwindow = open(Ziel,pop_name,options);
	if (newwindow != null){
		newwindow.focus();
	}		
}

function OpenPopUpRatgeberDwnl(ratID,ziel){
	fc_js_pos = getCenterPosition(480,540);
	if((ratID.charAt(0) == 'R') || (ratID.charAt(0) == 'r')){
		ziel += "&ratID="+ratID.toLowerCase();
		window.open(ziel,'RatgeberDwnlPopUp',"width=480, height=390, toolbars=no, locationbar=no, directories=no, menubar=no, resizable=no, status=no"+fc_js_pos);
	}
	else {
		ziel += "&ratID="+ratID.toLowerCase();
		window.open(ziel,'RatgeberDwnlPopUp',"width=480, height=540, toolbars=no, locationbar=no, directories=no, menubar=no, resizable=no, status=no"+fc_js_pos);
	}
}

	function openHelp(ziel,helpTheme, subTheme) {
	  var url = ziel+"&helpTheme=" + helpTheme;	
	  if ((subTheme != "Undefined") && (subTheme != "")) {
	  	url += "&subTheme="+subTheme;
	  }
	  helpWindow = window.open(url, "helpWindow", "width=510,height=550,resizable=yes,scrollbars=yes");
	  helpWindow.focus();
	}

function check() {
	var anzahl = top._popcont.document.notiz.length;
	if(top._popfoot.document.allemarkieren.checkbox.checked == true) {
		for(i=0;i<anzahl;i=i+2) {
			top._popcont.document.notiz.elements[i].checked = true;
		}
	}
}

function check2()	{
	var anzahl = top._popcont.document.notiz.length;
	for(i=0;i<anzahl;i=i+2) {
		if(top._popcont.document.notiz.elements[i].checked != true)	{
			top._popfoot.document.allemarkieren.checkbox.checked = false;
		}
	}
}

function tgcheck() {
	var anzahl = document.notiz.length;
	if(document.notiz.alle.checked == true) {
		for(i=0;i<anzahl;i=i+2) {
			document.notiz.elements[i].checked = true;
		}
	}
}

function tgcheck2()	{
	var anzahl = document.notiz.length;
	for(i=0;i<anzahl;i=i+2) {
		if(document.notiz.elements[i].checked != true)	{
			document.notiz.alle.checked = false;
		}
	}
}

function e(){}

//Cookies f?r Warenkorbanzeige und Begruessung
var domain = "www.otto.de";
var cookieName1 = "OV_Money";
var cookieName2 = "OV_Article";
var today = new Date();
var expireDate = new Date();
var money;
var article;
var bg_color = "#EEDA9F";
var desc = false;
expireDate.setTime(today.getTime() + 1000*60*60*24*365);

//setCookie Warenkorb
function setCookie(name, value, expires, domain) {
	var new_cookie = name + "=" + escape(value) + "; path=/";
	document.cookie = new_cookie;
}
//getCookie Warenkorb
function getCookie(cookieName,cc) {
	var myCookie = document.cookie;
	var prefix = cookieName + "=";
	var begin = myCookie.indexOf("; " + prefix);
    var end;
	
	if (begin == -1) {
    	begin = myCookie.indexOf(prefix);
		if (begin == -1) {
			if (cookieName == cookieName1) {
				if(cc=="DEM"){
				money = "0,00 DM";
				}
				if(cc=="EUR"){
				money = "0,00 EUR";
				}
			}
			if (cookieName == cookieName2) {
			article ="0";
			bg_color = "#C9E4E6";
			}
			return null;
		}
	}
	else {
	   begin += 2;
	}
	var tmp = myCookie.substring(begin + prefix.length);
	if(tmp.indexOf(';') != -1) {
		end = begin + prefix.length + tmp.indexOf(';');
	}
	else {
		end = myCookie.length;
	}
    if (cookieName == cookieName1) {
		money = unescape(myCookie.substring(begin + prefix.length, end));
	}
	if (cookieName == cookieName2) {
		article = unescape(myCookie.substring(begin + prefix.length, end));
		if(article == "0"){bg_color = "#C9E4E6";}
	}
}
//Loeschen des Cookies Name und Vorname des Kunden
function removeNameCookie() {

	var cookieNameFName = "OV_FName";
	var cookieNameLName = "OV_LName";

	var prefixFName = cookieNameFName + "=";
	var prefixLName = cookieNameLName + "=";

	var myCookie = document.cookie;

	var beginFName  = myCookie.indexOf("; " + prefixFName);
	var beginLName  = myCookie.indexOf("; " + prefixLName);
	var firstName	= "unknown";
	var lastName	= "unknown";

	var new_cookie  = cookieNameFName + "=" + escape(firstName) + "; path=/";
	document.cookie = new_cookie;
	new_cookie  = cookieNameLName + "=" + escape(lastName) + "; path=/";
	document.cookie = new_cookie;
}

function getCookieFirstName() {

	var cookieFName = "OV_FName";
	var prefixFName = cookieFName + "=";
	var myCookie = "cookie";

	if (document.cookie) {
		myCookie = document.cookie;
	}

	var beginFName = myCookie.indexOf(prefixFName);
	var endFName;
	var vFName;

	if (beginFName != -1) {
		var tmp = myCookie.substring(beginFName + prefixFName.length);
		if(tmp.indexOf(';') != -1) {endFName = beginFName + prefixFName.length + tmp.indexOf(';');} else {endFName = myCookie.length;}
		vFName = unescape(myCookie.substring(beginFName + prefixFName.length, endFName));
	} else {
		vFName = "";
	}
	return vFName;
}

function getCookieTitle() {
	var cookieLName = "OV_Title";
	var prefixLName = cookieLName + "=";
	var myCookie = "cookie";
	if (document.cookie) {
		myCookie = document.cookie;
	}
	var beginLName = myCookie.indexOf(prefixLName);
	var endLName;
	var vLName;
	if (beginLName != -1) {
		var tmp = myCookie.substring(beginLName + prefixLName.length);
		if(tmp.indexOf(';') != -1) {endLName = beginLName + prefixLName.length + tmp.indexOf(';');} else {endLName = myCookie.length;}
		vLName = unescape(myCookie.substring(beginLName + prefixLName.length, endLName));
	} else {
		vLName = "";
	}
	return vLName;
}

function getCookieLastName() {

	var cookieLName = "OV_LName";
	var prefixLName = cookieLName + "=";
	var myCookie = "cookie";

	if (document.cookie) {
		myCookie = document.cookie;
	}

	var beginLName = myCookie.indexOf(prefixLName);
	var endLName;
	var vLName;

	if (beginLName != -1) {
		var tmp = myCookie.substring(beginLName + prefixLName.length);
		if(tmp.indexOf(';') != -1) {endLName = beginLName + prefixLName.length + tmp.indexOf(';');} else {endLName = myCookie.length;}
		vLName = unescape(myCookie.substring(beginLName + prefixLName.length, endLName));
	} else {
		vLName = "";
	}
	return vLName;
}

if(!document.cookie) {document.cookie = "OV_Cookie=1; path=/";}

function writeBasket(cc) {
	if(document.cookie) {
		if( desc==true ){
			setCookie(cookieName2,count,expireDate,domain);
			setCookie(cookieName1,sum,expireDate,domain);
		}
		getCookie(cookieName1,cc);
		getCookie(cookieName2,cc);
		var displayamount = "";
		if (money.indexOf("EUR") != -1) {
			displayamount = "&euro; "+ money.slice(0,money.indexOf("EUR")-1);
		} else {
			displayamount = money;
		}
		if (article != "0")
			empty = '';
		else
		    empty = ' empty';	
		document.write('<span class="text '+ empty +'">'+article + ' Artikel <span class="pipe">&nbsp;|&nbsp;</span> <strong> ' + displayamount + '</strong> </span>');
		
	} else {
		document.write("<td style=\"font-size:10px;\">Der Warenkorb wird durch einen ");
		document.write("<a href=\"JavaScript:OpenPopUp('480','390','"+nocookies()+"');\">aktiven Cookie</a> angezeigt.<td>");
	}
} 

// Cookie nach Artikeln auslesen
function hasArticle(){
	var myCookie = document.cookie;
	var prefix = "OV_Article=";
	var begin = myCookie.indexOf("; " + prefix);
	var tmp = "0";
	if (begin != -1) {
		tmp = myCookie.substring(begin+2, myCookie.length);
		if (tmp.indexOf(";") != -1){
			tmp = tmp.substring(0, tmp.indexOf(";"));
		}
		else{
			return false;
		}
		if (tmp.indexOf("=") != -1){
			tmp = tmp.substring(tmp.indexOf("=")+1, tmp.length);
		}
		else{
			return false;
		}
		if (!isNaN(tmp) && tmp != "0"){
			return true;
		}
		else{
			return false;
		}
	}
	else{
		return false;
	}
}

// returns the greeting-message depending on the System-time
function getGreetingMessage(){
	var date = new Date();
	var hour = date.getHours();
	var greeting = "";
	if (hour >= 0 && hour < 11)
		greeting = "Guten Morgen";
	else if (hour < 17)
		greeting = "Guten Tag";
	else if (hour <= 24)
		greeting = "Guten Abend";
	return greeting;
}

function OpenWindow (URL, WinName, Features)
{
	window.open(URL, WinName, Features);
}

// checks whether the checkValue fits the regular expression, optional with variant for date, default for email
function checkRegExp(checkValue,variant) {
	var reg_exp="^[a-zA-Z0-9_][a-zA-Z0-9_.-]*\@[a-zA-Z0-9??????][a-zA-Z0-9??????._-]*\\.[a-zA-Z]{2,5}$";
	if (variant=="date") {
		reg_exp=/[0-3]\d\.[0-1]\d\.[1-2]\d\d\d/;
	}
	if (variant=="partnerArtNo") {
		reg_exp="^[a-zA-Z][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]$";
	}
	if (checkValue.search(reg_exp) == -1) {
		return false;
	}
	return true;
}

// writes data optional with limited length
function writeData(data,maxLength)
{
	var maxNameLength = 10;
	if (maxLength + "" != "undefined")
		maxNameLength = maxLength;
	if (data.length > maxNameLength)
		data = data.substring(0,maxNameLength) + "...";
	if (data.length > 0)
		document.write(data);
}
// writes special userdata
function getLastName(maxLength)
{
	writeData(getCookieLastName(),maxLength);
}
function getFirstName(maxLength)
{
	writeData(getCookieFirstName(),maxLength);
}
function getTitle()
{
	writeData(getCookieTitle());
}
function getSalutation()
{
	if (getCookieTitle() == "Frau")
			writeData("Liebe");
		else if (getCookieTitle() == "Herr")
			writeData("Lieber");
		else if (getCookieTitle() == "Firma")
			writeData("Liebe");
}
function getComma()
{
	if (getCookieTitle()=="Herr" || getCookieTitle()=="Frau")
		writeData(",");
}

//############### Landmark functions ##################################################

/* Version 05.12.06 */



var clientId = 1008;

var praxisHostArr = new Array('ww2.otto.de','www.neu.otto.de','www.otto.de');

var testHost = "yala.otto.de";

var testHostSslEnabled = 0;

var trace_mode = 0;


function getLMServletHost() {
	var host = location.hostname;
	var protocol = "http://";
	var praxisHosts = praxisHostArr.join(" ") + " ";
	if ( praxisHosts.toUpperCase().indexOf( host.toUpperCase() + " " ) > -1 ) {
		if ( location.protocol.toUpperCase().indexOf( "HTTPS" ) > -1 ) 
			protocol = "https://";
	} else {	
		host = testHost;
		if ( testHostSslEnabled == 1 ) 
			if ( location.protocol.toUpperCase().indexOf( "HTTPS" ) > -1 ) 
				protocol = "https://";
	}
	return protocol + host;
}

function hasSid( URL ) {
  var startTag = ";sid=";
  var pos = URL.indexOf( startTag );
  return ( pos > -1 )
}
  
function getSessionIdFromUrl( URL ) {
  var startTag = ";sid=";
  var pos = URL.indexOf( startTag );
  if ( pos != -1 ) URL = URL.substring( pos + startTag.length );
  pos = URL.indexOf( "?" );
  if ( pos != -1 ) URL = URL.substring( 0, pos );
  URL = URL.replace( /=/g, '' );
  return URL;
}

function getSessionId( URL ) {
  if ( hasSid( URL ) )
  	return getSessionIdFromUrl( URL );
  if( document.links ) {
    var found = 0;
    var i = 0;
	var sid = "";
    while( i<document.links.length && found == 0 ) {
      if( hasSid( document.links[ i ].href ) ) {
        sid = getSessionIdFromUrl( document.links[ i ].href );
        found = 1;
      }
	  i++;
	}
	return sid;
  }	
}	


function getArtNoFromProdRef( prodRef ) {
  var artNo = "";
  var arr = prodRef.split( /@/ );
  if ( arr[2] ) {
    var arr2 = arr[2].split( /-/ );
    if ( arr2[0] ) artNo = arr2[0];
  }  
  return artNo;
}


function getStatCookie( name ) {
   name += "=";
   var len = name.length;
   var cookie_len = document.cookie.length;
   var i = 0;
   while ( i < cookie_len ) {
     var j = i + len;
	 if ( document.cookie.substring(i,j) == name ) return getStatCookieValue(j);
	 i = document.cookie.indexOf( " ", i ) + 1;
	 if ( i == 0 ) break;
   }
   return null;
}

function getStatCookieValue( position ) {
   var end = document.cookie.indexOf(";", position );
   if ( end == -1 ) end = document.cookie.length;
   return unescape( document.cookie.substring( position, end ) );
}

function setStatCookie(name, value, expires, path) {
   var exp = new Date();
   exp.setTime(exp.getTime() + expires);
   document.cookie = name + "=" + value + "; expires=" + exp.toGMTString() +
	     ((path == null ) ? "" : ("; path=" + path ));
}

function setStatTempCookie(name, value, path) {
	document.cookie = name + "=" + value + ((path == null ) ? "" : ("; path=" + path ));
}

function getReferrer() {
	var attr = "";
	var wkReferrer = getStatCookie( "wkReferrer" );
	if ( wkReferrer != null && wkReferrer != "" ) {
		if ( wkReferrer.indexOf( location.hostname ) == -1 ) {
			attr = "&setWkReferrer=" + escape( wkReferrer );
		}	
		setStatTempCookie( "wkReferrer", "", "/" );
	}	
	else {
		wkReferrer = document.referrer;
		if ( wkReferrer != null && wkReferrer != "" ) {
			if ( wkReferrer.indexOf( location.hostname ) == -1 ) {
				attr = "&setWkReferrer=" + escape( wkReferrer );
			}	
			setStatTempCookie( "wkReferrer", "", "/" );
		}	
	}
	return attr;	
}

function getLocationSearchImas() {
  var uebergabe=location.search.substring(1,location.search.length);
  uebergabe=unescape(uebergabe);
  var angabenTemp=uebergabe.split("&");
  var angaben=new Array();
  for(z in angabenTemp) {
	var paar=angabenTemp[z].split("=");
	// assoziatives Arrayfeld bilden
	angaben[paar[0]]=paar[1];
  }
  return angaben;
  // access values with angaben[<AttributeName>]
}

function getPromo() {
	var attr = "";
	// get it from anchor
	var hash = location.hash;
	if ( hash.indexOf( "lmPromo" ) > -1 ) {
    	var arr = hash.split( /=/ );
    	if ( arr.length > 1 ) 
    		attr = "&lmPromo=" + escape( arr[1] );
	}
	// get it from parameter
	if ( attr == "" ) {
		var pars = getLocationSearchImas();
		try {
			var lmPromo = pars[ "lmPromo" ];
			if ( lmPromo )
				attr = "&lmPromo=" + escape( lmPromo );
		} catch(e) {
		}	
	}
	return attr;
}


var LMArrLen = 10;
var LMimg = new Array(LMArrLen);
var LMArrPos = 0;

function setLandmarkWithSession( sessionId, landmark, attributes ) {
  var sessionId = clientId + getSessionId( sessionId );
  LMimg[ LMArrPos ] = new Image();
  var URL = getLMServletHost() + "/servlet/LandmarkServlet?clientId=" + clientId + 
                        "&landmark=" + landmark +
                        "&ssid=" + sessionId;
  if ( attributes ) URL = URL + attributes;  
  URL = URL + getReferrer();                      
  URL = URL + getPromo();
  LMimg[ LMArrPos++ ].src = URL;     
  if ( LMArrPos == LMArrLen ) LMArrPos = 0;
  if ( trace_mode != 0 ) alert( "Lm set: " + URL );
}

function setLandmark( landmark, attributes ) {
  // var sessionId = getSessionIdFromUrl( location.href );
  setLandmarkWithSession( location.href, landmark, attributes );
}




var mp_landmark = "";
var mp_attributes = "";
var mp_sessionId = "";
var mp_descriptions = ""; // special var for LM special basket, description will be omitted in case of more than 10 basket entries to avoid too long urls
var mp_count = 0;         // counts number of items in basket 

function startLandmark( landmark ) {
  mp_sessionId = location.href;
  mp_attributes = "";
  mp_descriptions = "";
  mp_count = 0;
  mp_landmark = landmark;
}

function addBasketStatus( status ) {
  var attributes = "&status=";
  if ( status == "5" ) attributes += "BB"; 
  else
    if ( status == "4" ) attributes += "LE"; 
    else attributes += "AN"; 
  addAttribute( attributes );
}

function addAttribute( attribute ) {
  if ( attribute.indexOf( "&" ) != 0 ) attribute = "&" + attribute;
  mp_attributes = mp_attributes + attribute;
}

function addArtDescription( description ) {
  if ( description.indexOf( "&" ) != 0 ) description = "&" + description;
  mp_descriptions = mp_descriptions + description;
  mp_count += 1;
}

function setSessionId( sessionId ) {
  mp_sessionId = sessionId;
}

function setMPLandmark() {
  if ( mp_count <= 10 ) mp_attributes += mp_descriptions;
  setLandmarkWithSession( mp_sessionId, mp_landmark, mp_attributes );
}  



function redirectLandmarkGeneralWithSession( sessionId, landmark, attributes, redirectURL, mitHistory ) {
  var URL = getLMServletHost() + "/servlet/LandmarkServlet?clientId=" + clientId + 
                        "&landmark=" + landmark +
                        "&ssid=" + clientId + sessionId +
			"&redirectUrl=" + escape( redirectURL );
  if ( attributes ) URL = URL + attributes;       
  if ( trace_mode != 0 ) alert( "Lm set: " + URL );
  if ( mitHistory != 0 ) window.document.location.href = URL;
  else 			 window.document.location.replace( URL );
}

function redirectToPartner( sessionId, partnerCode, redirectURL, pageCode, attributes )
{
	redirectLandmarkGeneralWithSession( getSessionId( sessionId ), "partnerRedirect", 
	   "&partner=" + escape( partnerCode ) + "&pc=" + escape( pageCode ) + "&setLmCook=1" + attributes,
	   redirectURL, 1
	);
}

function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}



//alle landmarkfremden Funktionen bitte ueber den Landmarks einfuegen!!!!!!!!!!!!!!!!!!!
	