// JavaScript Documentvar DOM = {};DOM.bg = function(root){	obj = this;	var img;	var cBg = function(){		obj.img = document.createElement("img");		obj.img.src = 'img/titel/main_titel.jpg';		anpassen();		root.appendChild(obj.img);					//return thisobj.img;	}	var anpassen = function(){		var screen_w_h = wWidth/wHeight;		var pic_w = 1024;		var pic_h = 677;		var pic_w_h = pic_w/pic_h;		var scale_w_h;		if(pic_w_h>=1){			if (pic_w_h == screen_w_h) {				scale_w_h = Stage.width/pic_w;			} else if (pic_w_h<screen_w_h) {				scale_w_h = wWidth/pic_w;			} else if (pic_w_h>screen_w_h) {				scale_w_h = wHeight/pic_h;			}		}else{			if (pic_w_h == screen_w_h) {				scale_w_h = wWidth/pic_w;			} else if (pic_w_h>screen_w_h) {				scale_w_h = wWidth/pic_w;			} else if (pic_w_h<screen_w_h) {				scale_w_h = wHeight/pic_h;			}		}		if(root.hasChildNodes()){			root.firstChild.style.width = scale_w_h*pic_w+"px";			root.firstChild.style.height = scale_w_h*pic_h+"px";		}	}	return{		getBG : function(){			return cBg();		},		setSize : function(){			anpassen();			}	}}DOM.unternehmen = function(root){	var div = document.createElement("div");		div.id = "fcont2";		var subMetaMenue = document.createElement("div");		var subMen = Array("Geschichte", "Produktion", "Shop");		var subCont = Array('<div id="unternehmenstext" style="clear:both; padding-top:20px;"><h3>Die Lifestyle Company für Bett und Bad</h3><p>In Stuttgart, dort wo bedeutende Markenprodukte geboren wurden, befindet sich unser Firmensitz. Hier arbeiten täglich etwa 120 Menschen dafür, dass Sie gut schlafen. Dass Sie sich wohlig und exklusiv eingepackt über Nacht erholen können. Dass Ihre Bettdecke und Ihr Kissen genau zu Ihren Schlafgewohnheiten, Bedürfnissen und Ansprüchen passen. Für gehobenen Schlafkomfort zu sorgen, das ist unser Anliegen seit fast 40 Jahren.</p><p>Mit der Lust auf Innovationen, mit dem Gespür für neue Möglichkeiten verarbeiten wir nur erstklassige Materialien für unsere Bettdecken, Kissen und für alle unsere neuen Produkte rund um das Thema Schlafen.</p></div>','<div id="unternehmenstext" style="clear:both; padding-top:20px;"><h3>40 Jahre Centa-Star</h3><p>Standort in Stuttgart</p><table><tr><td>1968</td><td>Gründung des Unternehmens</td></tr><tr><td>1991</td><td>Management-buy-out / 40% Anteile in Mitarbeiterhand</td></tr><tr><td>1996</td><td>Gemeinsam mit 3M Deutschland exklusive Entwicklung einer zukunftsweisenden Fasertechnologie für Bettwaren und Einführung der Produktserie „Royal“</td></tr><tr><td>2001</td><td>In Zusammenarbeit mit dem Forschungsinstitut Hohenstein wurde das erste<br>Beratungssystem für Bettwaren entwickelt und im Markt eingeführt</td></tr><tr><td>2001</td><td>Patentanmeldung einer automatisierten Bandeinfassung bei Bettwaren<br>(Fertigautomatisierung)</td></tr><tr><td>2002</td><td>Einführung der Outlast®-Funktionsfaser im Bettwarenbereich </td></tr><tr><td>2002</td><td>Einführung eines neuen und innovativen Flächen- und Vermarktungskonzepts<br>„Shop-in-Shop System“</td></tr><tr><td>2002</td><td>Centa-Star erschließt weitere Exportmärkte</td></tr><tr><td>2006</td><td>Nord Feder wird Centa-Star<br>Geschäftsleitung übernimmt das Unternehmen</td></tr><tr><td>2007</td><td>Erweiterung des Sortiments um Bettzubehör, Badtextilien und Accessoirs<br>Einführung des neuen Markenkonzeptes<br>Partnerschaft mit Mundotextil<br>Eröffnung eigener Centa-Star Shops</td></tr></table></div>', '<div id="unternehmenstext" style="clear:both; padding-top:20px;"><h3>Bettwaren mit High-Tech</h3><p>Centa-Star Bettwaren werden ausschließlich im firmeneigenen Produktionsbetrieb in Stuttgart hergestellt. Unsere Experten entwickeln in Zusammenarbeit mit dem Forschungsinstitut Hohenstein innovative Produkte mit individuellen Herstellungsverfahren. Einzigartige Produktmerkmale wie die Centa-Star Längssteppung oder die patentierte Premium-Biese können wir mit unseren modernen Verfahren in höchster Qualität umsetzen. Wir verbinden seit Jahrzehnten High-Tech-Materialien und Naturprodukte zu hochwertigen Bettwaren „Made in Germany".</p><br><h3>Modernste Verfahren für Frottier</h3><p>Die Frottierproduktion von mundotextil steht wie kaum eine andere in der Branche für Innovation und Qualität. Die ständige Weiterentwicklung der Produktionsverfahren und die konstante Investition in neueste Technologien gewährleisten höchsten Standard. Unter besonderer Berücksichtigung umweltfreundlicher Kriterien werden die Materialien in weltweiter Recherche sorgfältig ausgewählt. Mehrfache Qualitätskontrollen und der Einsatz neuester Webtechniken sorgen dafür, dass am Ende des Herstellungsprozesses erstklassige Produkte stehen.</p></div>', '<div id="unternehmenstext" style="clear:both; padding-top:20px;"><h3>Shopkonzept</h3><p>Mit dem individuell entwickelten Shopkonzept präsentieren sich die Lifestyle - Kollektionen von Centa-Star in einem modernen und hochwertigen Rahmen. Eigene Stores ergänzen seit 2007 das bewährte Shop-in-Shop-System und bieten anspruchsvolle Sortimente rund um das Thema Bett und Bad.</p></div>');		var ul = document.createElement("ul");		ul.id = "subMeta";		for(i in subMen){			ul.appendChild(setBut(i));		}		subMetaMenue.appendChild(ul);		div.appendChild(ul);						var ss =  document.createElement("div");		ss.innerHTML = subCont[0];				div.appendChild(ss); 			function setBut(number){		var li = document.createElement("li");		var a = document.createElement("a");		a.href="#";			li.className = "css"+subMen[number];			var span = document.createElement("div");			a.onclick = function(){				var ss =  document.createElement("div");				ss.innerHTML = subCont[parseInt(number)+1];				div.replaceChild(ss,div.childNodes[1]);				for(i=0;i<this.parentNode.parentNode.childNodes.length;i++){					this.parentNode.parentNode.childNodes[i].firstChild.className ="";				}				this.className ="active";				root.scale.start(false, [{"att":"height","value":"max"}], function(){document.getElementById("ebeneIIII").style.bottom=20+parseInt(this.fcontent.offsetHeight)+"px";},'');				if(number==2){					GLOBAL.testDisplayBG('img/titel/shop_titel.jpg');				}else if(number==1){					GLOBAL.testDisplayBG('img/titel/produktion_titel.jpg');				}else{					GLOBAL.testDisplayBG('img/titel/unternehmen_titel.gif');					}			}										/*var div1 = document.createElement("div");				div1.id = "unternehmenstext";								var knoten = document.getelementById("unternehmenstext");					knoten.parentNode.replaceChild(div1, knoten);*/			span.className = "css"+subMen[i];			a.appendChild(span)			li.appendChild(a);		return li;	}	return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		setColor : function(color){			div.style.color = color;		}	}}DOM.shopfinder = function(root){	var div = document.createElement("div");		div.id = "fcont";		div.innerHTML = "<h3>Shopfinder</h3><p>Bitte geben Sie eine Postleitzahl ein, um den CENTA-STAR Shop in Ihrer Nähe zu finden.</p>";	var label = document.createElement("label");			var text = document.createTextNode("PLZ:");		label.style.marginRight = "15px";	label.appendChild(text);	div.appendChild(label);	var input = document.createElement("input");		input.type = "text";		input.maxLength = "5";		input.onkeyup= function(){			input.value=input.value.replace(/\D+/gi,"");			if(this.value.length>4){				var ul = GLOBAL.searchPlz(this.value);				divShops.hasChildNodes()?divShops.replaceChild(ul,divShops.firstChild):divShops.appendChild(ul);				root.scale.start(false, [{"att":"height","value":"max"}], function(){document.getElementById("ebeneIIII").style.bottom=20+parseInt(this.fcontent.offsetHeight)+"px";},'');			}		}			div.appendChild(input);	//alert(root.scale);		var input2 = document.createElement("input");	input2.type = "button";	input2.value = "senden";	//input2.style.color = "#54301A";	input2.style.background = "none";	/*input2.onclick = function(){		if(input.value!=""){			var ul = GLOBAL.searchPlz(input.value);			divShops.hasChildNodes()?divShops.replaceChild(ul,divShops.firstChild):divShops.appendChild(ul);			root.scale.start(true, [{"att":"height","value":"max"}], '','');		}	}*/	//div.appendChild(input2);	var divShops = document.createElement("div");	divShops.id = "shops";	if(typeof shop!="undefined"&&shop == document.getElementById("shops")){		div.replaceChild(divShops, shop);	}else{		div.appendChild(divShops);	}		return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		setColor : function(color){			div.style.color = color;			input.style.borderColor = color;			input.style.color = color;			input2.style.color = color;		}	}}DOM.downloads = function(root){	var that = this;	var div = document.createElement("div");	div.id = "fcont";	div.innerHTML = "<h3>Downloads</h3><p>Bitte geben Sie Benutzername und Passwort ein, um in den Downloadbereich zu gelangen.</p><br>";		var label1 = document.createElement("label");		label1.style.marginRight = "15px";			var text1 = document.createTextNode("Benutzername:");			var input1 = document.createElement("input");			input1.type = "text";			input1.style.marginBottom = "5px";			label1.appendChild(text1);						div.appendChild(label1);			div.appendChild(input1);					var br = document.createElement("br");		div.appendChild(br);			var label2 = document.createElement("label");				var text2 = document.createTextNode("Passwort:");			label2.style.marginRight = "39px";			var input2 = document.createElement("input");			input2.type = "password";			input2.style.marginRight = "15px";			//input2.style.borderColor = "#54301A";			var input3 = document.createElement("input");			input3.style.background = "none";			input3.type = "button";			input3.value = "senden";			input3.style.padding = "1px";			input3.onclick = function(){				if(input1.value=="unit"&&input2.value=="panimage"){					REQUEST.send("../js/getfilesdir.php", "GET", "", "text", function(baum){that.createBaum(baum)});				} 			}			label2.appendChild(text2);						div.appendChild(label2);			div.appendChild(input2);			div.appendChild(input3);	this.createBaum=function(data){		_data=JSON.parse(data);		while(div.firstChild)			if(div.firstChild) div.removeChild(div.firstChild);		var ul = this.createList(data);		div.appendChild(ul);				/*for(i in _data){			var ebenen = _data[i].name.split("/");			var li = document.createElement("li");			var txt = document.createTextNode(ebenen[ebenen.length-1]);			li.appendChild(txt);						div.appendChild(li);						var ul = document.createElement("ul");			ul.style.marginLeft="20px";			for(j in _data[i].content){				var li = document.createElement("li");				var txt = document.createTextNode(_data[i].content[j].file);				li.appendChild(txt);				ul.appendChild(li);			}						div.appendChild(ul);		}*/		root.scale.start(false, [{"att":"height","value":"max"}], function(){document.getElementById("ebeneIIII").style.bottom=20+parseInt(this.fcontent.offsetHeight)+"px";},'');	},	this.createList = function(data){		var ul = document.createElement("ul");		for(i in _data){				var li = document.createElement("li");				var txt = document.createTextNode(data.file);				li.appendChild(txt);				ul.appendChild(li);		}		return ul;	}	return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		setColor : function(color){			div.style.color = color;			input1.style.borderColor = color;			input1.style.color = color;			input2.style.borderColor = color;			input2.style.color = color;			input3.style.color = color;		},		setBaum:function(Baum){			jObj = JSON.parse(Baum);			createBaum(jObj);		}	}}DOM.sitemap = function(root){	var div = document.createElement("div");	div.id = "fcont";	div.innerHTML = "<h3>Sitemap</h3><p>Bitte geben Sie Benutzername und Passwort ein, um in den Downloadbereich zu gelangen.</p>";	return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		setColor : function(color){			div.style.color = color;		}	}}DOM.contact = function(root){	thisobj = this;	var div = document.createElement("div");	div.id = "fcont";	div.innerHTML = '<h3>Contact</h3><p>Centa-Star GmbH<br>Augsburger Str. 275<br>70327 Stuttgart<br>Deutschland</p><p>Tel.: +49. (0)711. 305 05-0<br>Fax: +49. (0)711. 305 05-30</p><p>E-Mail: <a href="mailto:info@centa-star.com">info@centa-star.com</a><br>Internet: http://www.centa-star.de,<br>http://www.centa-star.com</p>';	return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		setColor : function(color){			div.style.color = color;		}	}}DOM.impressum = function(root){	thisobj = this;	var div = document.createElement("div");	div.id = "fcont";	div.innerHTML = '<h3>Impressum</h3><p>Centa-Star GmbH<br>Augsburger Str. 275<br>70327 Stuttgart<br>Deutschland</p><p>Tel.: +49. (0)711. 305 05-0<br>Fax: +49. (0)711. 305 05-30</p><p>E-Mail: <a href="mailto:info@centa-star.com">info@centa-star.com</a><br>Internet: http://www.centa-star.de,<br>http://www.centa-star.com</p><p>USt.-Ident.-Nr.: DE814743945<br>Sitz: Stuttgart, Deutschland<br>Registergericht Stuttgart: HRB 721181</p><p>Geschäftsführer: Frank Gänser, Thomas Müller, Rudi Sauer</p><p>Fotos: noshe, Tom Rauner, Marcus Sauer, Peter Wagner<p>Illustrationen<br>Julia Böttcher</p><p>Website erstellt von:<br>unit-berlin<br><a href="http://www.unit-berlin.de/" target="_blank">www.unit-berlin.de</p>';	return {		set : function(){			if(root.fcontent.hasChildNodes()){				root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		}	}}DOM.youFont = function(root){	thisobj = this;	var init = function(){		var div = document.createElement("div");		div.id = "flash";					var object = document.createElement("object");			object.width = "50";			object.height = "30";			object.type = "application/x-shockwave-flash";			object.data = "../swf/fontlist.swf";							div.appendChild(object);		return div;	}	return {		set : function(){			var div = init();			if(root.fcontent.hasChildNodes()){					root.fcontent.replaceChild(div, root.fcontent.firstChild);			}else{				root.fcontent.appendChild(div);			}			return false;		},		fontList : function(){			var fontList = fonts.split(",");			//root = document.getElementsByTagName("body")[0];			var selectin = document.createElement("select");			for(var i=0;i<fontList.length;i++){				/*var Suche = /^[a-z ]+$/gi;				if(Suche.test(fontList[i])){*/					var option = document.createElement("option");					//option.style.fontFamily = fontList[i];					option.value = fontList[i];						var text = document.createTextNode(fontList[i]);						option.appendChild(text);					selectin.appendChild(option);				//}			}			root.appendChild(selectin);		}	}}DOM.quadrat = function(breite, hoehe, position, top, left, type, right){	if(hoehe == ""){		hoehe = "auto";		}else{}	var wid = document.createElement("div");	wid.className = "wid";	//wid.style.overflow = "hidden";	if(typeof breite!="undefined")		wid.style.width = breite;	wid.style.position = position;	wid.style.top = top;	wid.style.left = left;	if(typeof right!="undefined"){		wid.style.right = right;	}	wid.style.clear = "both";		var whead = document.createElement("div");			var tl = document.createElement("div");			tl.className = "default_tl"+type;		whead.appendChild(tl);			var tr = document.createElement("div");			tr.className = "default_tr"+type;		whead.appendChild(tr);			var t = document.createElement("div");			t.className = "default_t"+type;		whead.appendChild(t);	wid.appendChild(whead);			var wbody = document.createElement("div");		wbody.className = "default_c"+type;		wbody.style.overflow="hidden";			var l = document.createElement("div");			l.className = "default_l"+type;					wbody.appendChild(l);			var r = document.createElement("div");			r.className = "default_r"+type;		wbody.appendChild(r);			var bg = document.createElement("div");			bg.className = "default_bg"+type;		wbody.appendChild(bg);		wbody.align = "left";	wid.appendChild(wbody);			var wfoot = document.createElement("div");			var bl = document.createElement("div");			bl.className = "default_bl"+type;		wfoot.appendChild(bl);			var br = document.createElement("div");			br.className = "default_br"+type;		wfoot.appendChild(br);			var b = document.createElement("div");			b.className = "default_b"+type;		wfoot.appendChild(b);	wid.appendChild(wfoot);	return wid;}DOM.meldung = function(knoten){	var root = document.getElementById("meldung");	root.appendChild(knoten);	root.style.display = "block";}DOM.bigslideshow=function(data, parent, pData){		this._oldwidth = parseInt(parent.firstChild.offsetWidth);	parent.style.width="900px";	parent.style.right=wWidth/2-450+"px";	parent.firstChild.style.width="auto";	parent.firstChild.style.position = "relative";	parent.firstChild.style.height = "auto";	parent.align="center";	parent.style.textAlign="center";	//parent.firstChild.height="auto";	var that = this;	this._data = window["DATA"+data];	this.activePic=0;	this.bigarr = [];	if(typeof pData!="undefined"){		bigurlschleife({content:pData});		//alert({content.pData});	}else{		bigurlschleife(this._data);	}	for(var i=this.bigarr.length-1;i>=0; i--){		if(this.bigarr[i]==""||typeof this.bigarr[i]=="undefined"){			this.bigarr.splice(i, 1);		}else if(this.bigarr[i].bild==""||typeof this.bigarr[i].bild=="undefined"){			this.bigarr.splice(i, 1);		}		if(typeof this.bigarr[i].text!="undefined"){			var temp = this.bigarr[i].text.split("</h4>");			this.bigarr[i].text=temp[0]+"</h4>";		}	}				if(this.bigarr.length==0){		return false;	}		for(var i=0;i<this.bigarr.length; i++){				if(this.bigarr[i].bild==""|| typeof this.bigarr[i].bild=="undefined"){			this.bigarr.splice(i, 1);		}		var temp = parent.firstChild.src.split("/");		var matcher = new RegExp(temp[temp.length-1], "i");		if(typeof this.bigarr[i]!="undefined"){			var found = this.bigarr[i].bild.search ( matcher , "" );			if(found!=-1){				this.activePic=i;			}		}	}	var thisObj = this;	this.element=DOM.quadrat('170px','', 'absolute', '-10px',parent.offsetWidth/2+'px', '', '');	this.elementcontent = this.element.childNodes[1].childNodes[2];	this.elementcontent.align = "center";	parent.appendChild(this.element);	///prev	var prev = document.createElement("a");	prev.style.fontSize = "15px";	prev.style.vAlign="top";	var txt = document.createTextNode("<<");	prev.appendChild(txt);	this.elementcontent.appendChild(prev);	prev.onclick=function(){		if(that.activePic>0){			that.activePic--;		}else{			that.activePic=that.bigarr.length-1;		}		that.loader.src = "img/logos/lil_logo_ani.gif";		var loadPic = new Image();				loadPic.onload = function(){			parent.firstChild.src = this.src;			//parent.firstChild.style.left = (that._oldwidth-parent.firstChild.offsetWidth)/2+"px";			that.loader.src = "img/logos/lil_logo.gif";			if(that.bigarr[that.activePic].text!="undefined")				that.unertitel.innerHTML=that.bigarr[that.activePic].text;			else				that.unertitel.innerHTML="";		}		loadPic.src =that.bigarr[that.activePic].bild;	}	///Loader	this.loader = document.createElement("img");		this.loader.style.margin="0 10px";	this.loader.src = "img/logos/lil_logo.gif";	this.loader.width="10";	this.loader.height="12";	this.elementcontent.appendChild(this.loader);	///next	var next = document.createElement("a");	next.style.fontSize = "15px";	next.style.vAlign="top";	var txt = document.createTextNode(">>");	next.appendChild(txt);	this.elementcontent.appendChild(next);	next.onclick=function(){		if(that.activePic<that.bigarr.length-1){			that.activePic++;		}else{			that.activePic=0;		}		that.loader.width="10";		that.loader.src = "img/logos/lil_logo_ani.gif";		var loadPic = new Image();				loadPic.onload = function(){			parent.firstChild.src = this.src;			//parent.firstChild.style.left = (that._oldwidth/2-parent.firstChild.offsetWidth)/2+"px";						that.loader.src = "img/logos/lil_logo.gif";			that.loader.width="10";			if(that.bigarr[that.activePic].text!="undefined")				that.unertitel.innerHTML=that.bigarr[that.activePic].text;			else				that.unertitel.innerHTML="";		}		loadPic.src =that.bigarr[that.activePic].bild;	}	this.unertitel = document.createElement("span");	this.unertitel.style.display="block";	this.unertitel.style.textAlign = "left";		if(that.bigarr[this.activePic].text!="undefined")		this.unertitel.innerHTML=that.bigarr[this.activePic].text;	else		this.unertitel.innerHTML="";	this.elementcontent.appendChild(this.unertitel);		this.element.style.left = parseInt(this.element.style.left)-this.element.offsetWidth/2+"px";	function bigurlschleife(data){		if(typeof data.content != "undefined"){			for(var i=0;i<data.content.length;i++){				if(typeof data.content[i]!="undefined"){					if(typeof data.content[i].bigurl!="undefined"&& data.content[i].bigurl!=""){						that.bigarr.push({bild:data.content[i].bigurl, text:data.content[i].text});					}					if(typeof data.content[i].content!="undefined" && typeof data.content[i].content!=""){						if(data.content[i].type!="image"){							bigurlschleife(data.content[i]);						}else{							if(typeof data.content[i].content.bigurl!="undefined"){								that.bigarr.push({bild:data.content[i].content.bigurl, text:data.content[i].content.text});							}						}					}				}			}			//return bigurls;		}	}	function textschleife(data){		var texte=[];		if(typeof data.content != "undefined"){			for(var i=0;i<data.content.length;i++){				if(typeof data.content[i]!="undefined"){					if(typeof data.content[i].text!="undefined"&& typeof data.content[i].text!=""){						texte.push(data.content[i].text);					}					if(typeof data.content[i].content!="undefined" && typeof data.content[i].content!=""){						if(data.content[i].type!="image"){							texte.push(textschleife(data.content[i]).join("#"));						}else{							texte.push(data.content[i].content.text);						}					}				}			}			return texte;		}	}    function trimHtml(s) {		return s.replace(/<.+>/g, '');    }	return{		show:function(){					},		del:function(){			that.element.parentNode.removeChild(that.element)		}	}}