// JavaScript Document - all globally used functions
var isMac = (navigator.platform.indexOf("Mac") != -1) ? true : false;
var isIE = (navigator.appName.indexOf("Microsoft") == -1) ? false : true;
var isNetscape = (navigator.appName.indexOf("Netscape") == -1) ? false : true;
var mainStyle = "";
var divText = "";
if(isPartnerPageString == ''){
	var isPartnerPage = false;
}else{
	var isPartnerPage = true;
}
function setCSSs(){
	if (isNetscape && isMac){
			mainStyle = "mainFireFoxApple";
	}else if(isNetscape){
			mainStyle = "mainFireFoxPC";
	}else{
			mainStyle = "main";
	}
	if(isPartnerPage){
		//dealing with partnerpages
		mainStyle += isPartnerPageString;
	}
	document.write('<link href="'+toRootPath+'css/'+ mainStyle+'.css" rel="stylesheet" type="text/css" />');
		//alert('<link href="'+toRootPath+'css/'+ mainStyle+'.css" rel="stylesheet" type="text/css" />');
}
if(!isPrintVersion) {
    setCSSs();
}

//Basic Macromedica Funtions:
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	//writeText('<font color="#FFFFFF">'+x.src + '</font>', 'logoDiv');
}

function MM_showHideLayers() {
	//v6.0
	var i, p, v, obj, args = MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i += 3) {
		if ((obj=MM_findObj(args[i])) != null) {
			v = args[i+2];
			if (obj.style) {
				obj = obj.style;
				v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
			}
			obj.visibility = v;
		}
	}
}
//
var MM_FlashCanPlay = false;
//
var m_flash6Installed = false;
var m_flash7Installed = false;
var m_flash8Installed = false;
var m_flash9Installed = false;
var m_flash10Installed = false;
var m_maxVersion = 10;             // highest version we can actually detect
var m_actualVersion = 0;          // version the user really has
var m_hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var m_requiredVersion = 7;   // Version the user needs to view site (max 9, min 2)

if(isIE && !isMac)
{
	document.write('<scr' + 'ipt type="text/vbscript"\> \n');
	document.write('on error resume next \n');
	document.write('m_flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
	document.write('m_flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('m_flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('m_flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('m_flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
	document.write('<\/scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
	
}

 
if (navigator.plugins) 
{
		//alert(navigator.plugins["Shockwave Flash" + isVersion2].description);
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) 
		{
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.substring(16));
			//alert(flashDescription);
			m_flash6Installed = flashVersion == 6;
			m_flash7Installed = flashVersion == 7;
			m_flash8Installed = flashVersion == 8;
			m_flash9Installed = flashVersion == 9;
			m_flash10Installed = flashVersion >= 10;
		}
}
  
for (var i = 6; i <= m_maxVersion; i++) 
	if (eval("m_flash" + i + "Installed") == true) m_actualVersion = i;
  
if(navigator.userAgent.indexOf("WebTV") != -1) m_actualVersion = 4;  
  
if (m_actualVersion >= m_requiredVersion) 
{
	m_hasRightVersion = true;
	MM_FlashCanPlay = true;
} 
//
function flashMovie(w, h, sr, id, fvars, lay) {
	this.w = w;
	this.h = h;
	this.src = sr;
	this.id = id;
	this.fvars = fvars;
	this.lay = lay;
	this.isPlaying = false;
	this.addVars = "";
	this.requiredVersion = 6;
	this.playOn = function() {
		if (!this.isPlaying) {
			if (isMac) {
				this.addVars = "&playExternal=true";
				this.writeInFlash(true);
			} else {
				if (movieIsLoaded(thisMovie(this.id))) {
					thisMovie(this.id).Play();
				}
			}
			this.isPlaying = true;
		}
	}
	this.writeInFlash = function(replaceDiv) {
		var textFlash = '<object id="'+this.id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.requiredVersion+',0,0,0" width="'+this.w+'" height="'+this.h+'">';
		textFlash += '<param name="movie" value="'+this.src+'" />';
		textFlash += '<param name="FlashVars" value="'+this.fvars+this.addVars+'&isMac='+isMac+'" />';
		textFlash += '<param name="menu" value="false" />';
		textFlash += '<param name="quality" value="high" />';
		textFlash += '<param name="scale" value="noscale" />';
		textFlash += '<embed name="'+this.id+'" src="'+this.src+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+this.fvars+this.addVars+'&isMac='+isMac+'" menu="false" quality="high" swLiveConnect="true" scale="noscale" width="'+this.w+'" height="'+this.h+'"></embed>';
		textFlash += '</object>';
		replaceDiv = replaceDiv + "";
		if (replaceDiv == "false") {
			document.write(textFlash);
		} else {
			writeText(textFlash, this.lay);
		}
	}
	this.changePlayStatus = function () {
		this.isPlaying = !this.isPlaying;
	}
}

function thisMovie(nm) {
	if (isIE) {
		return window[nm];
	} else {
		return document[nm];
	}
}

function movieIsLoaded(theMovie) {
	if (typeof (theMovie) != "undefined") {
		return theMovie.PercentLoaded() == 100;
	} else {
		return false;
	}
}

var modemSpeed, speedTimer;
var imageGalleryMovie, imageGalleryButton, streamingMovie, streamingMovieButton, doSpeedCheck, flashAnimationMovie, flashAnimationButton;
var pdfButton, contactLinkButton, sendLinkButton, printVersionButton, tvMovieButton;
function extrasBar(ig, sv, fa, pdf, cl, tv, zi) {
	this.imageGallery = ''+ig;
	this.streamingVideo = ''+sv;
	this.flashAnimation = ''+fa;
	this.pdfFile = ''+pdf;
	this.contactLink = ''+cl;
	this.tvMovie = ''+tv;
	this.zoomImage = '' + zi;
	this.iconCounter = 0;
	
	if (this.imageGallery != "") {
		imageGalleryMovie = new flashMovie('592', '320', toRootPath+'swf/pictureGallery.swf', 'picGallery', 'galleryPath='+toRootPath+this.imageGallery+'&toRoot='+toRootPath, 'divAnimations');
		imageGalleryButton = new toolBarItem("MM_showHideLayers('divAnimations','','show');imageGalleryMovie.writeInFlash(true);", "writeText('"+extraLinks[2]+"', 'iconsText');", toRootPath+"images/icons/imageGallery.gif");
		imageGalleryButton.writeButton();
		this.iconCounter += 1;
	}
	if (this.streamingVideo != "" || this.tvMovie != ""){
		modemSpeed = readCookie('modemSpeed');
		if (navigator.cookieEnabled && modemSpeed == null) {
			doSpeedCheck = new flashMovie('1', '1', toRootPath+'swf/speedTest.swf', 'speedy', 'toRoot='+toRootPath);
			doSpeedCheck.writeInFlash(false);
		}
	}
	if (this.streamingVideo != "") {
		if (modemSpeed != null && modemSpeed == "no") {
			streamingMovie = new flashMovie('592', '320', toRootPath+'swf/streamingVideo/base.swf', 'streamingVideo', 'streamingVideo='+toRootPath+this.streamingVideo, 'divAnimations');
			streamingMovie.requiredVersion = 7;
			streamingMovieButton = new toolBarItem("MM_showHideLayers('divAnimations','','show'); MM_showHideLayers('leftNav','','hide'); MM_showHideLayers('crossMktArea','','hide'); MM_showHideLayers('searchDiv','','hide'); streamingMovie.writeInFlash(true);", "writeText('"+extraLinks[3]+"', 'iconsText');", toRootPath+"images/icons/streamingVideo.gif");
			streamingMovieButton.writeButton();
		this.iconCounter += 1;
		}
	}
	if (this.flashAnimation != "") {
		flashAnimationMovie = new flashMovie('592', '320', toRootPath+this.flashAnimation, 'flashAni', '', 'divAnimations');
		flashAnimationButton = new toolBarItem("MM_showHideLayers('divAnimations','','show');flashAnimationMovie.writeInFlash(true);", "writeText('"+extraLinks[4]+"', 'iconsText');", toRootPath+"images/icons/aniCam.gif");
		flashAnimationButton.writeButton();
		this.iconCounter += 1;
	}
	if (this.pdfFile != "") {
		pdfButton = new toolBarItem("Popper('"+toRootPath+this.pdfFile+"', 700, 600, 1)", "writeText('PDF downloaden', 'iconsText');", toRootPath+"images/icons/pdf.gif");
		pdfButton.writeButton();
		this.iconCounter += 1;
	}
	var cLArr = this.contactLink.split("|")
	if (cLArr[0]!='') {
		var clText = "";
		var clickStuff = "";
		
		if (typeof (document.cmsVarToForm) != "undefined") {
			clickStuff = "document.cmsVarToForm.submit();";	
		} else {
			clickStuff = "document.location.href ='"+ toRootPath + siteLang+ "/" + cLArr[0] + fileExt +"'";
		}
		if (isPartnerPage){
			clText = extraLinksPartner[0];
		}else{
			clText = extraLinks[0];
		}
		
		if (cLArr.length > 1 && cLArr[1]!='') clText = cLArr[1];
		if (isPartnerPage) clText += " " + partnerName;
		contactLinkButton = new toolBarItem(clickStuff, "writeText('"+clText+"', 'iconsText');", toRootPath+"images/icons/sendComment.gif");
		contactLinkButton.writeButton();
		this.iconCounter += 1;
	}
	
	//if((this.streamingVideo == "" || modemSpeed == "yes") && this.tvMovie != ""){
	if(this.tvMovie != ""){
			tvMovieButton = new toolBarItem("crossMktAreaMovie.playOn()", "writeText('"+extraLinks[6]+"', 'iconsText');", toRootPath+"images/icons/webCam.gif");
			tvMovieButton.writeButton();
			this.iconCounter += 1;
	}
	
	//to come when FAQ Chapter is ready to go online:
	//if(detPage){
	if(detPage && pageURL.indexOf('faq') < 0){
		var printLink = toRootPath+siteLang+"/"+pageURL+".printVersion"+fileExt;

		printVersionButton = new toolBarItem("printVersion('"+printLink+"');", "writeText('"+extraLinks[9]+"', 'iconsText');", toRootPath+"images/icons/print.gif");
		printVersionButton.writeButton();
		this.iconCounter += 1;
	}

	if(this.iconCounter < 8){
		//if(this.iconCounter == 1201){
		if(!isPartnerPage){
			sendLinkMovie = new flashMovie('211', '338', toRootPath+'swf/sendLink3.swf', 'flashSendLink', 'pageURL='+siteLang+'/'+pageURL+fileExt, 'divCrossMktArea');
		}else{
			sendLinkMovie = new flashMovie('211', '338', toRootPath+'swf/sendLinkPartner2.swf', 'flashSendLink', 'pageURL='+siteLang+'/'+pageURL+fileExt+'&pNr='+partnerNr, 'divCrossMktArea');
		}
		sendLinkButton = new toolBarItem("saveText('divCrossMktArea'); sendLinkMovie.writeInFlash(true);", "writeText('"+extraLinks[5]+"', 'iconsText');", toRootPath+"images/icons/sendToFriend.gif");
		sendLinkButton.writeButton();
		this.iconCounter += 1;
	}
	
	if (this.zoomImage != "") {
		var fillerW = 200-((this.iconCounter+1)*25);
		document.write('<img src="'+toRootPath+'images/filler.gif" width="'+ fillerW +'" height="22" border="0" id="zoomImg" name="zoomImg" />');
		zoomImageButton = new toolBarItem("MM_showHideLayers('zoomImageDiv','','show')", "writeText('"+extraLinks[7]+"', 'iconsText');", toRootPath+"images/icons/zoom.gif");
		zoomImageButton.writeButton();
		this.iconCounter += 1;
		if (this.zoomImage.indexOf('_por')>0) {
			setZoomCapability (230, this.zoomImage);
		}else{
			setZoomCapability (320, this.zoomImage);
		}
	}
}

function setZoomCapability (w, src) {
	var tableText = '<table width="'+ w + '" border="0" cellspacing="0" cellpadding="0"><tr><td height="16" align="right" class="borderHeader" background="'+toRootPath+'images/bgHeader_'+w+'.jpg"><a href="javascript://" onclick="MM_showHideLayers(\'zoomImageDiv\',\'\',\'hide\');" class="news">&#xa0;<font color="#FFFFFF">X</font></a></td></tr><tr><td class="borderBottom"><img src="'+toRootPath+src+'" width="'+ w +'" id="zoomImageSrc"  name="zoomImageSrc"  /></td></tr></table>';
	writeText(tableText, 'zoomImageDiv');
}

function changeCrossMktArea(){
	writeText(divText, 'divCrossMktArea');
}

function backToCrossMktArea(){
	crossMktAreaMovie.writeInFlash(true);
}
	      		

function reloadPageAndCookIt(cName, cVal, cExp){
	createCookie(cName, cVal, cExp);
	location.reload();
}

function toolBarItem(oc, os, iName) {
	this.onclickString = oc;
	this.onmouseoverString = os;
	this.srcImageName = iName;
	this.writeButton = function() {
		if(this.srcImageName.indexOf('zoom.gif') != -1){
			//document.write('<span id="zoomButLayer"><a href="#" onClick="'+ this.onclickString + '" onmouseover="'+this.onmouseoverString+'"><img src="'+this.srcImageName+'" width="25" height="22" border="0" /></a></span>');
			document.write('<span id="zoomButLayer"><a href="javascript:'+ this.onclickString +'" onmouseover="'+this.onmouseoverString+';status=\'\';return true;"><img src="'+this.srcImageName+'" width="25" height="22" border="0" /></a></span>');
		}else{
			//document.write('<a href="#" onClick="'+ this.onclickString + '" onmouseover="'+this.onmouseoverString+'"><img src="'+this.srcImageName+'" width="25" height="22" border="0" /></a>');
			//alert(this.onclickString);
			document.write('<a href="javascript:'+ this.onclickString +'" onmouseover="'+this.onmouseoverString+';status=\'\';return true;"><img src="'+this.srcImageName+'" width="25" height="22" border="0" /></a>');
		}
	};
}

function writeText(txt, div) {
	var Tekst = txt;
	var thisDiv = MM_findObj(div, '');
	if(thisDiv != "undefined" && thisDiv != null){
			thisDiv.innerHTML = '';
			thisDiv.innerHTML = Tekst;
		if( isNetscape && txt == '' && thisDiv.id.indexOf('zoom') == -1  ){
			MM_showHideLayers( thisDiv.id,'','hide');
		}else if( thisDiv.id.indexOf('zoom') == -1 ){
			MM_showHideLayers( thisDiv.id,'','show');
		}	
	}

}

function saveText(div) {
	var thisDiv = MM_findObj(div, '');
	divText = thisDiv.innerHTML;
}
//Print version:
function printVersion(urll) {
	var druck=window.open(urll,"Print","toolbar=0,location=0,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=690,height=550,left=50,top=50");
	druck.focus;
}

//function to change status of row of pics
function turnOnImage(nr, imgName, imgSrc, imgSrcOn) {
	totNr = 1;
	while (document.images[imgName+totNr] != null) {
		if (totNr != nr) {
			document.images[imgName+totNr].src = imgSrc.replace(parseFloat(nr), totNr);
		}
		totNr += 1;
	}
	document.images[imgName+nr].src = imgSrcOn;
}
//Pop up:
function Popper(Page, Breedte, Hoogte, Rand) {
	window.open(Page, "home"+Breedte+"", "height="+Hoogte+",width="+Breedte+",menubar=0,resizable=0,scrollbars="+Rand+",status=0,titlebar=1,toolbar=0");
}
//Temp Pop up für Verpackungsseite from xsl form order data seite:
function verp(Breedte, Hoogte, Rand) {
	var br = (isNetscape)?610:592;
	window.open(toRootPath+'verpackung.html', "home"+br+"", "height="+Hoogte+",width="+Breedte+",menubar=0,resizable=0,scrollbars="+Rand+",status=0,titlebar=1,toolbar=0");
}

//To move layer:
var positionLeft = 0;
function placeLayer(layer, b) {
	positionLeft = b/2;
	e = document.getElementById(layer);
	e.style.left = positionLeft+'px';
	e.style.zIndex = 20;
}
//To change the css class of a layer:
function changeClass(layer, cl) {
	document.getElementById(layer).className = cl;
}

function swapClass(obj, cl) {
	obj.className = cl;
}

//Desktopfunctions, news desktopbilder...
desktopStatus = 0;
tempSrcPic = '';
tempResolution = '';
function desktopChooser(imgSrc, imgRes) {
	if (imgRes == 0) {
		desktopStatus = 0;
	}
	if (desktopStatus == 0) {
		document.images.picT.src = imgSrc;
		writeText('&nbsp;', 'desktopText1');
		MM_showHideLayers('desktopText2', '', 'show');
		writeText('&nbsp;', 'desktopText3');
		desktopStatus = 1;
		tempSrcPic = imgSrc;
	} else if (desktopStatus == 1) {
		document.images.picT.src = tempSrcPic;
		if (imgRes == 0) {
			tempResolution = "";
			var linkRes = '';
		} else if (imgRes == 1) {
			tempResolution = "1280 x 1024";
			var linkRes = tempSrcPic.replace("800", "1280");
		} else if (imgRes == 2) {
			tempResolution = "1024 x 768";
			var linkRes = tempSrcPic.replace("800", "1024");
		} else if (imgRes == 3) {
			tempResolution = "800 x 600";
			var linkRes = tempSrcPic;
		}
		linkRes = linkRes.replace('/thumbs', '');
		writeText('&nbsp;', 'desktopText1');
		MM_showHideLayers('desktopText2', '', 'show');
		var linkTest = '<a href="'+linkRes+'" target="_blank"><img src="../../../images/downloadOn.gif" width="80" height="20" border="0"></a><br><br>('+tempResolution+')';
		writeText(linkTest, 'desktopText3');
		desktopStatus = 1;
	}
}
//Changing Opacity images for overview pages:
//Fader from http://www.brainerror.net/scripts_js_blendtrans.php
//change the opacity for different browsers 
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style;
	object.opacity = (opacity/100);
	object.MozOpacity = (opacity/100);
	object.KhtmlOpacity = (opacity/100);
	object.filter = "alpha(opacity="+opacity+")";
}
function blendSmallImage(divid, imageid, imagefile, millisec) {
	MM_showHideLayers(divid, '', 'show');
	var speed = Math.round(millisec/100);
	var timer = 0;
	//set the current image as background 
	document.getElementById(divid).style.backgroundImage = "url("+document.getElementById(imageid).src+")";
	//make image transparent 
	changeOpac(0, imageid);
	//make new image 
	document.getElementById(imageid).src = imagefile;
	//fade in image
	for (i=0; i<=100; i++) {
		setTimeout("changeOpac("+i+",'"+imageid+"')", (timer*speed));
		timer++;
	}
}
function timeOutBlender() {
	MM_showHideLayers('blenddiv', '', 'hide');
	window.clearTimeout(timeBlender);
	startedBlender = false;
}

function detailListing(col){
	this.withColors = "" + col;
	if(this.withColors != ""){
		this.withColors = "yes";
	}
	this.linkTitles = new Array(3);
	for(i=0;i<5;i++){
		if (document.all) {
			this.linkTitles[i] = document.all['detail'+i].innerHTML;
		} else if (document.getElementById) {
			this.linkTitles[i] = document.getElementById('detail'+i).innerHTML;
		}
	}
	this.writeProductLinks = function (nr){
		this.curNr = 0 + nr;
		this.stringToWrite = "";
		if(partnerNr != ''){
			this.stringToWrite = "<a href=\"javascript:alert('coming soon...');\"><img src=\""+toRootPath+"images/icons/shopbasketArrow.gif\" width=\"20\" height=\"24\" border=\"0\" name=\"shopLink\" id=\"shopLink\" />";
			this.stringToWrite += "<u>Preis &euro; 24,50</u></a><br /><br />";
		}else{
			this.stringToWrite = "<br /><br /><br />";
		}
		for(i=0;i<5;i++){
			if(!this.linkTitles[i] == ""){
				if(this.curNr == i){
					this.curClass = "linksOn";
					this.imgTag = "On";
				}else{
					this.curClass = "";
					this.imgTag = "";
				}
				if(i == 4 && this.withColors != ""){
					this.stringToWrite += "<a href=\"javascript://\" onclick=\"MM_showHideLayers('zoomButLayer', '', 'hide'); linkSet.writeProductLinks("+ i +");\" class=\""+this.curClass+"\" onmouseOver=\"MM_swapImage('contentLink"+i+"','','"+toRootPath+"images/arrow_hor_darkGoldOn.gif',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+toRootPath+"images/arrow_hor_darkGold"+this.imgTag+".gif\" width=\"10\" height=\"12\" border=\"0\" name='contentLink"+i+"' id='contentLink"+i+"' /> "+cmsLang[i]+"</a><br /><br />";
				}else if(i != 4){
					this.stringToWrite += "<a href=\"javascript://\" onclick=\"MM_showHideLayers('zoomButLayer', '', 'show'); linkSet.writeProductLinks("+ i +");\" class=\""+this.curClass+"\" onmouseOver=\"MM_swapImage('contentLink"+i+"','','"+toRootPath+"images/arrow_hor_darkGoldOn.gif',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\""+toRootPath+"images/arrow_hor_darkGold"+this.imgTag+".gif\" width=\"10\" height=\"12\" border=\"0\" name='contentLink"+i+"' id='contentLink"+i+"' /> "+cmsLang[i]+"</a><br /><br />";
				}
				
			}
		}
		writeText(this.stringToWrite, 'detailLinks');
		writeText(this.linkTitles[this.curNr], 'prodDetText');
	}
}

function butSwap(stat) {
	if (stat == "on") {
		MM_showHideLayers('displayBut', '', 'hide');
		MM_showHideLayers('iconLabels', '', 'show');
	} else {
		MM_showHideLayers('displayBut', '', 'show');
		MM_showHideLayers('iconLabels', '', 'hide');
	}
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

function writeFlashMovie(vers, w, h, src, fvars, bg, wm){
		var textFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		textFlash += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=';
		textFlash += vers+',0,0,0" width="'+w+'" height="'+h+'">';
		textFlash += '<param name="movie" value="'+src+'" />';
		textFlash += '<param name="FlashVars" value="'+fvars+'" />';
		textFlash += '<param name="menu" value="false" />';
		textFlash += '<param name="quality" value="high" />';
		textFlash += '<param name="scale" value="noscale" />';
		textFlash += '<param name="wmode" value="'+wm+'" />';
		if(bg!=''){
			textFlash += '<param name="bgcolor" value="'+bg+'" />';
		}
		textFlash += '<embed src="'+src+'" type="application/x-shockwave-flash" ';
		textFlash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" ';
		textFlash += 'flashvars="'+fvars+'" menu="false" quality="high" ';
		textFlash += 'wmode="'+wm+'" scale="noscale"';
		if(bg!=''){
			textFlash += ' bgcolor="'+bg+'"';
		}
		textFlash += ' width="'+w+'" height="'+h+'"></embed>';
		textFlash += '</object>';
		document.write(textFlash);
}

function writeFlashMovieLay(vers, w, h, src, fvars, bg, wm, lay){
		var textFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		textFlash += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=';
		textFlash += vers+',0,0,0" width="'+w+'" height="'+h+'">';
		textFlash += '<param name="movie" value="'+src+'" />';
		textFlash += '<param name="FlashVars" value="'+fvars+'" />';
		textFlash += '<param name="menu" value="false" />';
		textFlash += '<param name="quality" value="high" />';
		textFlash += '<param name="scale" value="noscale" />';
		textFlash += '<param name="wmode" value="'+wm+'" />';
		if(bg!=''){
			textFlash += '<param name="bgcolor" value="'+bg+'" />';
		}
		textFlash += '<embed src="'+src+'" type="application/x-shockwave-flash" ';
		textFlash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" ';
		textFlash += 'flashvars="'+fvars+'" menu="false" quality="high" ';
		textFlash += 'wmode="'+wm+'" scale="noscale"';
		if(bg!=''){
			textFlash += ' bgcolor="'+bg+'"';
		}
		textFlash += ' width="'+w+'" height="'+h+'"></embed>';
		textFlash += '</object>';
		writeText(textFlash, lay);
}

function checkSearchForm(field)
{
	if (field.value.length <3)
		{alert('Eingabe mindestens 3 Zeichen');
		field.focus();
		return false;
	} else {
		return true;
	}
}

function changeDivColor (div, color, colorName){
	MM_showHideLayers('divDetailInfo', '', 'show');
	MM_showHideLayers('divDetailInfoBG', '', 'show');
	MM_showHideLayers(div, '', 'show');
	var thisDiv = MM_findObj(div, '');
	thisDiv.style.backgroundColor = "#"+color;
	var thisSpan = MM_findObj('titleAddText', '');
	thisSpan.innerHTML = "- " + colorName;
}
function changeBakset(totA, prodC){
	var tempString = "<a href=\""+toRootPath+siteLang+"/shop/warenkorb.ran.aspx\" class=\"gold\">"+prodC +" Artikel im Warenkorb<br />Summe "+totA+"</a>";
	if(custID != "0" && custID != ""){
		tempString += '<br/><br/><a href="'+toRootPath+'de/partner/wishlist/detail.ran.aspx?chosenWishList='+chosenWL+'" class="gold"><img src="'+toRootPath+'images/icons/wishListButGold.gif" width="21" height="21"> Zur Wunschliste</a>';
	}else{
		tempString += '<br/><br/><a href="javascript:showLogin();" class="gold"><img src="'+toRootPath+'images/icons/wishListButGold.gif" width="21" height="21"> Login Wunschliste</a>';
	}
	writeText(tempString, 'basketDiv');
}
function showLogin(){
	window.scrollTo(0, 0);
	writeFlashMovieLay(6, 211, 320, toRootPath+'swf/loginWL.swf', 'toRoot='+toRootPath, '#65657B', 'window', 'divCrossMktArea');
}
function hideLogin(id, pn){
	if (typeof (document.cmsVarToForm) == "undefined"){
		document.location.href = toRootPath+'de/partner/wishlist/detail.ran.aspx?chosenWishList='+id+'&pNr='+pn;
	}else{
		document.location.reload();
	}
}
