
	// version information GENERATED- DO NOT TOUCH //
	var SX_Main_Content_last_update="[versionem2800rc03]";

	//////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////



	var f_configurationwin = null;

	function openconfigpopup(popupid)
	{
				// fuer localisierung der inhalte wird hier per JS die aktuelle Locale aus der URL gezogen
		var myLoc = location + " ";
		var js_locale = myLoc.match(/\/(.._..)\//);
		//since eMart 2.x: split locale into countryKey and languageKey:
		var countryKey = js_locale[0].substr(4,2);
		var languageKey = js_locale[0].substr(1,2);

		f_configurationwin=window.open('/intershoproot/eCS/eMart/media/empty.html', popupid, 'alwaysRaised=1,toolbar=0,status=0,location=0,directories=0,menubar=0,resizable=1,scrollbars=1,width=350,height=250');
		f_configurationwin.document.writeln("<!-- start - the following content was generated by javascript [file: SX_Main_Content.js] -->");
		f_configurationwin.document.writeln("<link rel=\"stylesheet\" href=\"/intershoproot/eCS/eMart/media/portal/SX_Main_Stylesheet.css?lastupdate=[versionem2800rc03]\" type=\"text/css\">");
		f_configurationwin.document.writeln("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" width=\"20\"><img src=\"/intershoproot/eCS/eMart/media/portal/" + languageKey + "/c_warten.gif\" width=\"57\" height=\"53\" border=\"0\"></td>");
		f_configurationwin.document.writeln("<td align=\"left\"><img src=\"/intershoproot/eCS/eMart/media/portal/" + languageKey + "/c_bitte_warten.gif\" height=\"53\" border=\"0\"></td></tr></table>");
		f_configurationwin.document.writeln("<!-- end -->");
		f_configurationwin.focus();
	}

	function meinFehler(Nachricht,Datei,Zeile)
	{
	   Fehler = "Fehlermeldung: "+ Nachricht+"\nTemplate: "+Datei+"\n"+"Zeile: "+Zeile;
	   zeigeFehler();
	   return true;
	}

	function zeigeFehler()
	{
	   alert(window.Fehler)
	}

	function setTarget(formname, targetname)
	{
		document.forms[formname].target = targetname;
   	}

	function closePopUp()
	{
		if((f_configurationwin != null) && (!f_configurationwin.closed))
		{
			f_configurationwin.close();
			window.focus();
		}
	}

	function redirectToPopUp(formname)
	{
		var popupid = 'f_configuration';  // build popupid (name/title) to have unique instances

		if((f_configurationwin != null) && (!f_configurationwin.closed))
		{
			f_configurationwin.focus();
			return false;
		}
		else
		{
			f_configurationwin = "avoid"; // to avoid double-submit
			openconfigpopup(popupid);
			setTarget(formname, popupid);
			return true;
		}
	}


	// framework, is used by the treeapplet to store the current treestatus and current selected category from the outter frame
	function setData(keyName, Value)
	{
		try
		{
			top[keyName] = Value;
		}
		catch(exc) // fallback for some browsers
		{
		    var allCookies = document.cookie;
			var json = '';
			if (allCookies.match(/Data=(.+?);/)
			    ||allCookies.match(/Data=(.+?)$/))
			{
				json = RegExp.$1;
				json = unescape(json);
			}
			var hash;
			eval('hash = {'+json+'}');
			hash[keyName] = Value;

			json = '';
			for(var key in hash)
			{
			  if (json.length > 0)
			  {
			    json += ',';
			  }
			  json += "'" + key + "':'" + hash[key] + "'";
			}

			var expire = new Date();
			expire.setTime(expire.getTime() + 1000*60*30); // now + 30min
			var cookie = 'Data=' + escape(json)
			           + '; expires=' + expire.toGMTString()
			           + ';path=/';
			var regex = new RegExp(keyName + '=(?:.*?);\s(?:expires=.*?|path=.*?|;)*');
			if (allCookies.match(regex))
			{
				document.cookie = allCookies.replace(regex, cookie);
			}
			else
			{
				document.cookie = cookie;
			}
		}
	}


	// framework, is used by the treeapplet to read the current treestatus and current selected category from the outter frame
	function getData(keyName)
	{
		try
		{
			if (top[keyName]) { return top[keyName]; }
		}
		catch(exc) // fallback for some browsers
		{
		    var allCookies = document.cookie;
			if (allCookies.match(/Data=(.+?);/)
			    || allCookies.match(/Data=(.+?)$/))
			{
				var json = RegExp.$1;
				json = unescape(json);

				var hash;
				eval('hash = {'+json+'}');

				if (hash[keyName])
				{
				  return hash[keyName];
				}
			}
		}
		return "";
	}



// function cr (call_ref): lookup entry, change location assigned to entry
	function cr(cap)
	{
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			top.topframe.emart_navi.cr(cap);
		}
	}




	
	localMenueItem = "";
	localSubItem = "";

// function current_menue : highlight selected menue
	function current_menue(newMenueItem, newSubItem)
	{

		if ((typeof newMenueItem == "undefined") || (newMenueItem == "")) { newMenueItem = localMenueItem; } else { localMenueItem = newMenueItem; }
		if ((typeof newSubItem == "undefined") || (newSubItem == "")) { newSubItem = localSubItem; } else { localSubItem = newSubItem; }

		if ((top) && (top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			top.topframe.emart_navi.current_menue(newMenueItem, newSubItem);
		}
		else
		{
			setTimeout("current_menue();", 500);
		}
	}
// function current_menue_ex : highlight selected menue for external Catalog, is needed because of different frame structure
	function current_menue_ex(newMenueItem, newSubItem){
		if ((typeof newMenueItem == "undefined") || (newMenueItem == "")) { newMenueItem = localMenueItem; } else { localMenueItem = newMenueItem; }
		if ((typeof newSubItem == "undefined") || (newSubItem == "")) { newSubItem = localSubItem; } else { localSubItem = newSubItem; }
		
		if ((parent.parent.emart_main_navi)){
			parent.parent.emart_main_navi.current_menue_ex(newMenueItem, newSubItem);
		}
		else{
			setTimeout("current_menue();", 500);
		}
		
	}

//SX_Main_Content: function getcookieval :
	function getCookieVal (offset)
	{
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}

//SX_Main_Content: function getcookie :

	function GetCookie (name) {
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen)
		{
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return "";
	}

//SX_Main_Content: function setcookie :

	function SetCookie (name, value)
	{
		var Verfall = 1000*60*60*24*365;
		var jetzt = new Date();
		var expires = new Date(jetzt.getTime() + Verfall);

		document.cookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		"; path=/";
	}



	MiniBasket_Total = "[noMinibasketInfo]";
	MiniBasket_NoPositions = "";
	username = "[noUserInfo]";

	function receiveUserNameFromNavigation()
	{
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar) && (top.topframe.emart_navi.username))
		{
			username = top.topframe.emart_navi.username;
			document.getElementById("UserNameTextBox").innerHTML = username + ",&nbsp;";
		}
		else
		{ setTimeout("receiveUserNameFromNavigation();", 500); }
	}

	function receiveMiniBasketFromNavigation(text_emptybasket, text_position, text_positions)
	{

		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			MiniBasket = top.topframe.emart_navi.MiniBasketValues;
			MiniBasket_Content = "";
			if (MiniBasket && (MiniBasket != ""))
			{
				var MiniBasket_Values = MiniBasket.split("|");
				MiniBasket_Total = MiniBasket_Values[0];
				MiniBasket_NoPositions = MiniBasket_Values[1];
				if (MiniBasket_NoPositions == 0)		{	MiniBasket_Content = text_emptybasket; }
				else if (MiniBasket_NoPositions == 1)	{	MiniBasket_Content = "&nbsp;" + MiniBasket_NoPositions + "&nbsp;" + text_position + MiniBasket_Total; }
				else									{	MiniBasket_Content = "&nbsp;" + MiniBasket_NoPositions + "&nbsp;" + text_positions + MiniBasket_Total; }

			}
			document.getElementById("MiniBasketTextBox").innerHTML = MiniBasket_Content;
		}
		else
		{
		  var fcn = function()
		  {
		    receiveMiniBasketFromNavigation(text_emptybasket, text_position, text_positions);
		  };
		  setTimeout(fcn, 500); }
	}


	function receiveTreePageLoaded()
	{
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar) && (top.topframe.emart_navi.TreePageLoaded == "true"))
		{
			document.getElementById('waitimages').style.display="none";
			if (document.getElementById('notincaseofwaitingimage')) { document.getElementById('notincaseofwaitingimage').style.display="block"; }
		}
		else
		{ setTimeout("receiveTreePageLoaded();", 500); }
	}


	function setTreePageLoaded()
	{
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			top.topframe.emart_navi.TreePageLoaded = "true";
		}
		else
		{ setTimeout("setTreePageLoaded();", 500); }
	}





	localMiniBasket = "";
	function setMiniBasket(newMiniBasketValues)
	{
		if ((!newMiniBasketValues) || (newMiniBasketValues == "")) { newMiniBasketValues = localMiniBasket; } else { localMiniBasket = newMiniBasketValues; }
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			top.topframe.emart_navi.MiniBasketValues = newMiniBasketValues;
		}
		else
		{ setTimeout("setMiniBasket();", 500); }
	}

	localFSCustomer = "";
	localFSCustomerID = "";
	function setFSCustomer(newFSCustomer, newFSCustomerID)
	{
		if ((!newFSCustomer) || (newFSCustomer == "")) { newFSCustomer = localFSCustomer; } else { localFSCustomer = newFSCustomer; }
		if ((!newFSCustomerID) || (newFSCustomerID == "")) { newFSCustomerID = localFSCustomerID; } else { localFSCustomerID = newFSCustomerID; }
		if ((top.topframe) && (top.topframe.emart_navi) && (top.topframe.emart_navi.main_navi_existancevar))
		{
			top.topframe.emart_navi.FSCustomerValue = newFSCustomer;
			top.topframe.emart_navi.document.getElementById("FSCustomerValueTextBox").innerHTML = newFSCustomer;
			top.topframe.emart_navi.document.getElementById("FSCustomerValueTextBox").title = newFSCustomer;
			top.topframe.emart_navi.FSCustomerValueID = newFSCustomerID;
		}
		else
		{ setTimeout("setFSCustomer();", 500);}
	}

	function avoiddoublesubmit(mess_spec,time_amount)
	{

		if(sendEnabled)
		{
			//set message for first click
			if (mess_spec)
			{
				text_avoiddoubleclick = eval('text_avoiddoubleclick'+mess_spec);
			}
			sendEnabled = false;

			if (time_amount)
			{
				var t = time_amount * 1;
				setTimeout("sendEnabled = true;", t);
			}
			else
			{
				setTimeout("sendEnabled = true;", 30000);
			}
			return true;
		}
		else
		{
			alert(text_avoiddoubleclick);
			return false;
		}
	}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//[date:20040929] Javascript Funktionen encodeURIComponent()/decodeURIComponent() fuer aeltere Browser, welche diese noch nicht implementiert haben (zB. IE 5.0)
//[vgl. issue 7166]
if(!encodeURIComponent)
{
	function encodeURIComponent(url)
	{
		var result = url;
		if(url)
		{
			var reserved_chars = new Array("$","&","+",",","/",":",";","=","?","@");
			var masked_chars = new Array("%24","%26","%2B","%2C","%2F","%3A","%3B","%3D","%3F","%40");
			result = "";
			for(var i=0;i<url.length;i++)
			{
				var akt_char = url.charAt(i);
				for(var ii=0;ii<reserved_chars.length;ii++)
				{
					if(akt_char == reserved_chars[ii])
					{
						akt_char = masked_chars[ii];
					}
				}
				result += akt_char;
			}
		}
		return result;
	}
}

if(!decodeURIComponent)
{
	function decodeURIComponent(url)
	{
		var result = url;
		if(url)
		{
			var reserved_chars = new Array("$","&","+",",","/",":",";","=","?","@");
			var masked_chars = new Array("%24","%26","%2B","%2C","%2F","%3A","%3B","%3D","%3F","%40");
			result = "";
			for(var i=0;i<url.length;i++)
			{
				var akt_str = url.charAt(i);
				if(akt_str == "%")
				{
					akt_str = url.substr(i,3);
					for(var ii=0;ii<masked_chars.length;ii++)
					{
						if(akt_str == masked_chars[ii])
						{
							akt_str = reserved_chars[ii];
						}
					}
					i+=2;
				}
				result += akt_str;
			}
			return result;
		}
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/***browsercheck[author:lab][date:20041018]*****************************************************/
//***how to use - example*********************
/*
bi = getBrowserInfo();
if(bi)
{
	alert(bi[0]+", Version "+bi[1]);
}
*/
function getBrowserInfo()
{
	//browser-checklist (browser with these names will be searched)
	//set more exactly browser-name after superordinated name in list, if both are used.
	//like: mozilla first, firefox afterwards
	//otherwise the script will return mozilla instead of firefox
	//(same with MSIE, Opera or Mozilla, Netscape)
	var nav_names = new Array("MSIE",
							  "Firefox",
							  "Opera",
							  "Netscape",
							  "Mozilla",
							  "Mosaic",
							  "Safari",
							  "Konqueror");
	//script
	var result = new Array();
	var b_name = "";
	var b_version = "";
	var name_offset = 0;
	var name_length = 0;
	var userAgent = navigator.userAgent;
	//check
	//->browser-name
	for(var i=0;i<nav_names.length;i++)
	{
		akt_offset = userAgent.indexOf(nav_names[i]);
		if(akt_offset != -1)
		{
			name_offset = akt_offset;
			b_name = nav_names[i];
			name_length = b_name.length;
		}
	}
	//->browser-version
	if(b_name != "")
	{
		result[0] = b_name;
		var version = "";
		var version_found = false;
		var str_read = false;
		var was_true = false;
		var i = name_offset + name_length;
		var reg_version = /[0-9\.,]/;
		for(i; version_found == false; i++)
		{
			var c = userAgent.charAt(i);
			if(c)
			{
				if(!c.match(reg_version))
				{
					str_read = false;
					if(was_true)
					{
						version_found = true;
					}
				}
				else
				{
					str_read = true;
					was_true = true;
				}
				if(str_read)
				{
					version += c;
				}
			}
			else
			{
				version_found = true;
			}
		}
	}
	result[1] = version;

	if(result[0])
	{
		return result;
	}
	else
	{
		return false;
	}
}


// Funktion um Multibrowserf?hig zu sein, da Firefox das Objekt "all" nicht kennt!!!
// im Moment noch auskommentiert da es noch nicht verwendet wird.
var browserID = navigator.appName;
function getbMElement (Id)
{
	if (Id)
	{
		if ((browserID == "Microsoft Internet Explorer"))
		{
			return document.getElementById(Id);
		}
		else
		{
			if (document.getElementById(Id))
			{return document.getElementById(Id);}
			else{return document.getElementsByName(Id)[0];}
		}
	}
}

// funktion fuer "Rund um das Produkt" in storefront und externem katalog
function popup(myurl,/*optionale paramter:*/file, pWidth, pHeight, pCenter)
	{

		<!-- encoding f?r sonderzeichen im file namen -->
		var request = "";
		if(file && (file != ""))
		{
			request = myurl + '&file=' + encodeURIComponent(file);
		}
		else
		{
			request = myurl;
		}
		var width = 300;
		var height = 300;
		if(pWidth && pWidth != "")
		{
			width = pWidth;
		}
		if(pHeight && pHeight != "")
		{
			height = pHeight;
		}

		var arguments = "alwaysRaised=1,toolbar=0,status=0,location=0,directories=0,menubar=0,resizable=yes,scrollbars=yes,width=" +width+ ",height=" +height;
		if(pCenter && pCenter == "center")
		{
			var windowPosition = new Array();
			var resW = screen.availWidth;
			var resH = screen.availHeight;
			windowPosition[0] =  (resW/2) - (width/2);
			windowPosition[1] =  (resH/2) - (height/2) + 20;
			arguments += ", left=" +windowPosition[0]+ ", top=" +windowPosition[1];
		}
		neues_fenster = window.open(request, "Detailansicht", arguments);
		neues_fenster.focus();
	}

/**
* document.getElementsByAttribute
* @param [string attributeName]
* @param [string attributeValue]
* @param [boolean isCommaHyphenOrSpaceSeparatedList:false]
* @return Array of Elements matching the Attribute
*/
document.getElementsByAttribute=function(attrN,attrV,multi){
    attrV=attrV.replace(/\|/g,'\\|').replace(/\[/g,'\\[').replace(/\(/g,'\\(').replace(/\+/g,'\\+').replace(/\./g,'\\.').replace(/\*/g,'\\*').replace(/\?/g,'\\?').replace(/\//g,'\\/');
    var
        multi=typeof multi!='undefined'?
            multi:
            false,
        cIterate=document.getElementsByTagName('*'),
        aResponse=[],
        attr,
        re=new RegExp(multi?'\\b'+attrV+'\\b':'^'+attrV+'$'),
        i=0,
        elm;
    while((elm=cIterate.item(i++))){
        attr=elm.getAttributeNode(attrN);
        if(attr &&
            attr.specified &&
            re.test(attr.value)
        )
            aResponse.push(elm);
    }
    return aResponse;
}

function copyCountryValue(aValue,aTarget)
{
  $(aTarget).value = aValue;
}

function gotoElement(anElementID)
{
  if($(anElementID))
  {
    $(anElementID).scrollIntoView(true);
  }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////