var eventX = 0, eventY = 0, aEv = true, oldTh = 330, ctimeout = false;

function TMTools()
{
	if (ctimeout) window.clearTimeout(ctimeout);
	ctimeout = window.setTimeout("MoveTools()", 300);
	if (aEv)
	{
		window.onscroll = TMTools;
		window.onresize = TMTools;
		aEv = false;
	}
}

function getMovetTool(h2)
{
	try
	{
		var h1 = oldTh;
		if (h1 != h2)
		{
			oldTh = h1 + (h1 < h2 ? 1 : -1);
			if (document.all)
			{
				//getMovetTool(h2);
				document.getElementById("ToolsTAB").style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=2); progid:DXImageTransform.Microsoft.Wipe(GradientSize=.50, wipeStyle=0, motion='forward')";
				document.getElementById("ToolsTAB").filters[0].Apply();
				document.getElementById("ToolsTAB").style.display = "none";
				document.getElementById("ToolsH").height = oldTh;
				document.getElementById("ToolsH").height = h2;
				document.getElementById("ToolsTAB").filters[0].Play();
				document.getElementById("ToolsTAB").style.display = "";
				document.getElementById("ToolsH").height = h2;
			}
			else
			{
				document.getElementById("ToolsH").height = oldTh;
				ctimeout = window.setTimeout("getMovetTool(" + h2 + ")", 5);
			}
		}
	}
	catch(e) {}
}

function MoveTools()
{
	var h, Bh = 440, Th = 400, Sc = 0;
	try
	{
		if (window.innerHeight)
			Bh = window.innerHeight;
		else if (document.body && document.body.offsetHeight)
			Bh = document.body.offsetHeight;
		
		if (window.pageYOffset) 
			Sc = window.pageYOffset;
		else if (document.body && document.body.scrollTop)
			Sc = document.body.scrollTop;

		h = (Bh - Th)/2 + Sc;
		if (h < 0) h = 200;
		/*
		if (h > oldTh)
		{
			for (var j = oldTh; j <= h; j++)
			{
				document.getElementById("ToolsH").height = j;
			}
		}
		else
		{
			for (var j = oldTh; j >= h; j--)
			{
				document.getElementById("ToolsH").height = j;
			}
		}*/
		getMovetTool(h);
	}
	catch(e) {}
}

function setEvent(e)
{
	if (e.x)
	{
		eventX = e.x + (document.documentElement.scrollLeft > 0 ? document.documentElement.scrollLeft : document.body.scrollLeft);
		eventY = e.y + (document.documentElement.scrollTop > 0 ? document.documentElement.scrollTop : document.body.scrollTop);
	}
	else if (e.clientX)
	{
		eventX = parseInt(e.clientX) + parseInt(window.pageXOffset);
		eventY = parseInt(e.clientY) + parseInt(window.pageYOffset);
	}
}

/*################ BEGIN Images-functions ##################*/

function BildDown(DownURL,winfeatures) {
	window.open(DownURL,'Filedown','top=0,left=0' + (winfeatures ? (','+winfeatures) : '') );
}
function getAttrib(selEl, nm, default_value)
{
	if(typeof(default_value) == "undefined") default_value = "";
	var v = default_value;
	if (selEl.getAttribute)
	{
		if (selEl.getAttribute(nm,0) != null) v = selEl.getAttribute(nm,0);
	}
	else if (selEl.attributes)
	{
		var oAttrColl = selEl.attributes;
		var oAttr = oAttrColl.getNamedItem(nm);
		if(oAttr != null) v = oAttr.value;
	}
	if (nm == "noWrap") v = selEl.noWrap;
	if (nm == "class") v = selEl.className;
	return '' + v;
}

function OpenFoto(BildURL, x, y) {
	var win = "";
	win = window.open("","bild",'height=' + y + ',width=' + x +',location=0,status=0,toolbar=no,resizable=0,scrollbar=no,top=0,left=0');
	win.document.writeln('<html><head><title>Das Bild</title>');
	win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	win.document.writeln('</head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	win.document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">');
	win.document.writeln('<tr><td align="center">');
	win.document.writeln('<a href="javascript:window.close()">');
	win.document.writeln('<img src="' + BildURL + '" border=0  alt="Fenster schließen">');
	win.document.writeln('</a></td></tr></table></body></html>');
	win.document.close();
	win.focus();
}
function in_array(needle, arr)
{
	var CurStr = new String("," + arr + ",");
	if (CurStr.indexOf("," + needle + ",") == -1) return false;
	else return true;
}
function getTitle(node)
{
	if (typeof(node) == "undefined") return "";
	if (node.childNodes.length == 0) return "";
	for (var i = 0; i < node.childNodes.length; i++)
	{
		if (typeof(node.childNodes[i].tagName) == "undefined") continue;
		if (node.childNodes[i].tagName.toLowerCase() == "img")
		{
			if (node.childNodes[i].title != "") return node.childNodes[i].title.substr(0,90);
			else if (node.childNodes[i].alt != "")
			{
				if(node.childNodes[i].alt == "Bitte klicken zum Vergrößern" || node.childNodes[i].alt == "Bitte klicken zum Vergößern") return document.title.substr(0,90);
				else return node.childNodes[i].alt.substr(0,90);
			}
		}
	}
	return "";
}
var allCollection = new Array();
var allImgTitles = new Array();
var curPos = 0;
var setLoupe = false;
function getDoBildImgs(BILD)
{
	allCollection = new Array();
	if (document.getElementsByTagName)
		var elements=document.getElementsByTagName('a');
	else if (document.all)
		var elements=document.all('a');
	var txt;
	if(elements.length > 0)
	{
		var re=new RegExp("[ \t\n\r\f]","gi");
		for (var i = 0; i < elements.length; i++)
		{
			txt = new String(elements[i].href);
			if (txt.toLowerCase().indexOf("javascript:") == -1)
			{
				txt = new String(getAttrib(elements[i],"onclick"));
				if (txt.indexOf("DoBild(") != -1) txt = "javascript:"+txt;
			}
			txt = txt.replace(re, "");
			if (txt.toLowerCase().indexOf("javascript:") != -1 && txt.indexOf("DoBild(") != -1)
			{
				txt = txt.substring(txt.indexOf("'")+1, txt.lastIndexOf("'"));
				if (!setLoupe)
				{
					//addEvent(elements[i], "mousemove", addLoupe);
					//addEvent(elements[i], "mouseover", addLoupe);
elements[i].style.cursor = "url('"+http_host+"navigation/loupe.png'), url("+http_host+"navigation/loupe.cur), pointer";
				}
				if (!in_array(txt, allCollection))
				{
					if (txt == BILD) curPos = allCollection.length;
					allCollection.push(txt);
					allImgTitles[allCollection.length-1] = getTitle(elements[i]);
				}
			}
		}
	}
	setLoupe = true;
}
var currentSize = {w:320,h:128};
function DoBild(BILD)
{
	getDoBildImgs(BILD);
	if (DoBildWindowClose == "") DoBildWindowClose = "Bitte klicken zum Verkleinern";
	var x = 0;
	var y = 0;

	if (typeof window.pageXOffset != 'undefined')
	{
		x = window.pageXOffset;
		y = window.pageYOffset;
	}
	else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat')
	{
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	else if (typeof document.body != 'undefined')
	{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}

	if (!document.getElementById("sashadow"))
	{
		var b = document.createElement("div");
		b.id = "sashadow";
		b.style.display = "none";
		b.innerHTML = "&nbsp;";
		addEvent(b, "click", HideImage);
		if(typeof(HideVariante) != "undefined") addEvent(b, "click", HideVariante);
		addEvent(window, "resize", HideImage);
		if(typeof(HideVariante) != "undefined") addEvent(window, "resize", HideVariante);
		document.getElementsByTagName("body")[0].appendChild(b);
	}
	if (!document.getElementById("imagelayer"))
	{
		var b = document.createElement("div");
		b.id = "imagelayer";
		b.style.display = "none";
		document.getElementsByTagName("body")[0].appendChild(b);
	}
	
	var b_g = document.getElementById("sashadow");
	var b_i = document.getElementById("imagelayer");

	b_i.style.left = x+"px";
	b_i.style.top = y+"px";

	var h = 0, w = 0;
	if (document.documentElement) h = parseInt(document.documentElement.scrollHeight);
	if (document.body.scrollHeight > h) h = parseInt(document.body.scrollHeight);
	if (document.body.clientHeight > h) h = parseInt(document.body.clientHeight);
	if (h > 0)
	{
		if (!document.all) h += 20;
		b_g.style.height = h+"px";
	}

	if (document.documentElement) w = parseInt(document.documentElement.scrollWidth);
	if (w == 0) h = parseInt(document.body.scrollWidth);
	if (document.body.clientWidth > w) w = parseInt(document.body.clientWidth);
	if (w > 0) b_g.style.width = w+"px";


	b_i.innerHTML = "<table border=0 cellspacing=0 cellpadding=1 style='width:100%;height:100%;'><tr><td align='center' valign='middle'><table border=0 cellspacing=0 cellpadding=8 bgcolor=#FFFFFF style='border:1px solid #000;'><tr><td bgcolor=#FFFFFF><div style='text-align:center;clear:both;height:26px;'><img src='" +  http_host + "navigation_gray/img_close.gif' border='0' style='cursor:pointer;float:right;' onclick='HideImage();'><span id='ecomasImageTitle' style='line-height:26px;'>&nbsp;</span></div><div style='clear:both;'><img src='" +  http_host + "navigation/pixel.gif' border='0' width='1' height='1'></div><a href='#' onclick='HideImage();return false;' id='ecomasResizedLink'><img src='" + BILD + "' alt='" + DoBildWindowClose + "' title='" + DoBildWindowClose + "' onLoad='resizeImage()' width='1' height='1' id='ecomasResizedImage' style='display:none;'><img src='" +  http_host + "navigation/pixel.gif' id='ecomasLoadImage' style='width:" + currentSize.w + "px;height:" + currentSize.h + "px;background-image:url(" +  http_host + "navigation/img_load.gif);background-position: center;background-repeat:no-repeat;' border='0' onClick='HideImage();'></a><div id='ArraowsLayer' style='padding-top:3px;'><img src='" +  http_host + "navigation/pixel.gif' style='width:150px;height:26px;' align='right'><img src='" +  http_host + "navigation/pixel.gif' style='width:150px;height:26px;' align='left'></div></td></tr></table></td></tr></table>";

	b_g.style.display = "";
	b_i.style.display = "";
}
function HideImage()
{
	var b_g = $("sashadow");
	var b_i = $("imagelayer");
	if(b_g != null)
	{
		if(typeof(OpenedGroupID) == "undefined") OpenedGroupID = "zhopa";
		if($('tr_'+OpenedGroupID) == null) b_g.style.display = "none";
		else if($('tr_'+OpenedGroupID) != null && $('tr_'+OpenedGroupID).style.display == "none") b_g.style.display = "none";
	}
	if(b_i != null) b_i.style.display = "none";
	currentSize = {w:128,h:128};
}
var cS = 10;
function resizeImage()
{
	var ibj = document.getElementById("ecomasResizedImage");
	var img = new Image();
	img.src = ibj.src;
	var sta = (img.width - currentSize.w)/cS;
	var stb = (img.height - currentSize.h)/cS;
	document.getElementById("ecomasLoadImage").style.backgroundImage = "";
	
	dynamicImage(currentSize.w,currentSize.h,img.width,img.height,sta, stb);
}
function dynamicImage(wc,hc,w,h,sta,stb, curCS)
{
	var ibj = document.getElementById("ecomasLoadImage");
	if (typeof(curCS) == "undefined") curCS = 0;
	curCS++;
	wc = Math.round(wc + sta);
	hc = Math.round(hc + stb);
	ibj.style.width = wc.toString()+"px";
	ibj.style.height = hc.toString()+"px";
	if (curCS >= cS)
	{
		ibj.style.backgroundImage = "url(" + document.getElementById("ecomasResizedImage").src + ")";
		currentSize.w = w;
		currentSize.h = h;

		document.getElementById("ecomasImageTitle").innerHTML = (allImgTitles[curPos] == "" || typeof(allImgTitles[curPos]) == "undefined") ? "&nbsp;" :  allImgTitles[curPos];

		var  HTML = "";
/*		if (curPos < (allCollection.length -1))
			HTML = "<img src='" +  http_host + "navigation/img_arrow_r.gif' style='width:150px;height:26px;cursor:pointer;' align='right' onClick='DoBild(\"" + allCollection[parseInt(curPos)+1] + "\");'>";
		else
			HTML = "<img src='" +  http_host + "navigation/pixel.gif' style='width:150px;height:26px;' align='right'>";
		if (curPos > 0)
			HTML += "<img src='" +  http_host + "navigation/img_arrow_l.gif' style='width:150px;height:26px;cursor:pointer;' align='left' onClick='DoBild(\"" + allCollection[parseInt(curPos)-1] + "\");''>";
		else
			HTML += "<img src='" +  http_host + "navigation/pixel.gif' style='width:150px;height:26px;' align='left'>";*/
		document.getElementById("ArraowsLayer").innerHTML = HTML;
		return;
	}
	window.setTimeout("dynamicImage(" + wc + ","+ hc +"," + w + "," + h + "," + sta + "," + stb + "," + curCS + ")", 0);
}
var LTime = false;
function addLoupe(e)
{
	if (LTime) window.clearTimeout(LTime);
	var top = 0, left = 0;
	if (!document.getElementById) return;
	if (typeof window.pageXOffset != 'undefined')
	{
		left = window.pageXOffset;
		top = window.pageYOffset;
	}
	else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat')
	{
		left = document.documentElement.scrollLeft;
		top = document.documentElement.scrollTop;
	}
	else if (typeof document.body != 'undefined')
	{
		left = document.body.scrollLeft;
		top = document.body.scrollTop;
	}
	else return;

	left = parseInt(left);
	top = parseInt(top);
	if (e.x)
	{
		left += e.x;
		top += e.y;
	}
	else if (e.clientX)
	{
		left += e.clientX;
		top += e.clientY;
	}
	else return;
	
	left = left;
	top = top - 48;
	var c = document.getElementById("Layer2");
	c.innerHTML = "<img src='"+http_host+"navigation/loupe.png' style='vertical-align: middle;'> <span style='background-color:#fff;'>Vergr&ouml;&szlig;ern</span>";
	c.style.visibility = "visible";
	c.style.left = left.toString()+"px";
	c.style.top = top.toString()+"px";
	LTime = window.setTimeout("hideKommentar()",1000);
}
/*################ END Images-functions ####################*/

//################################################################################################################
// BEGINN Highlights

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];}
}
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 animation()
{
  createLayer("Layer2");
  showTrustedInfo();
  hidePullDown();
 
 if(typeof(Ebene1)=="undefined")return false;

 if(document.getElementById("e1_"+Ebene1))
 {
      document.getElementById("e1_"+Ebene1).className = "e1_a";  
 }
 
 if(document.getElementById("e2_"+Ebene2))
 {
     document.getElementById("e2_"+Ebene2).className = "e2_a";
 }

 if(document.getElementById("e3_"+Ebene3))
 {
     document.getElementById("e3_"+Ebene3).className = "e3_a";
 }

 if(document.getElementById("e4_"+Ebene4))
 {
     document.getElementById("e4_"+Ebene4).className = "e4_a";
 }

 CheckFontSize();
  TMTools();

}

/**
 * Trusted anzeigen
 **/
function showTrustedInfo()
{
//  createLayer("TrustedShops");
  //$("row_top").innerHTML += '<div style="position:absolute;margin:60px 0 0 480px;"><a href="https://www.trustedshops.de/shop/certificate.php?shop_id=X546495171298D4321BB8CA61ECCC6F71" target="_blank"><img src="/navigation/trusted-siegel.gif" alt="weserlandmoebel.de trägt das Trusted Shops Zertifikat mit Käuferschutz." title="weserlandmoebel.de trägt das Trusted Shops Zertifikat mit Käuferschutz."></div>';

$("row_top").innerHTML += '<div style="position:absolute;margin:48px 0 0 480px;" id="TrustedShopSiegel"><div style="vertical-align:middle;width:200px;margin-top:0px;border:0px solid #C0C0C0;padding:2px;" id="tsInnerBox"><div style="text-align:center;width:70px;float:left; border:0px solid; padding:2px;" id="tsSeal"><a target="_blank" href="https://www.trustedshops.de/shop/certificate.php?shop_id=X546495171298D4321BB8CA61ECCC6F71"><img style="border: 0px none;" src="/navigation/trusted-siegel.gif" title="Klicken Sie auf das G&uuml;tesiegel, um die G&uuml;ltigkeit zu pr&uuml;fen!"></a></div><div style="text-align:left;line-height:125%;width:120px;float:left;border:0px solid; padding:2px;" id="tsText"><a style="font-weight:normal;text-decoration:underline;color:#000000;" title="Mehr Informationen zu weserlandmoebel.de" href="http://www.trustedshops.de/profil/weserlandmoebel-de_X546495171298D4321BB8CA61ECCC6F71.html" target="_blank">weserlandmoebel.de</a> <span style="font-weight:normal;text-decoration:none;color:#000000;">wurde von Trusted Shops erfolgreich geprüft: Sicher einkaufen mit</span> <a style="font-weight:normal;text-decoration:underline;color:#000000;" href="http://www.trustedshops.de/info/garantiebedingungen/" target="_blank">Käuferschutz.</a> <a style="font-weight:normal;text-decoration:none;color:#000000;" title="Mehr Informationen zu weserlandmoebel.de" href="http://www.trustedshops.de/profil/weserlandmoebel-de_X546495171298D4321BB8CA61ECCC6F71.html" target="_blank">Mehr...</a></div><div style="clear: both;"></div>';
}

var MouseOverPullDown=false;
var paintedID=0;
function showPullDown(ID)
{
  if(typeof(CatMenuARRAY)=="undefined" || typeof(CatMenuARRAY[ID])=="undefined" || CatMenuARRAY[ID].length==0)
  {
   MouseOverPullDown=false;
   hidePullDown(1);
  }
  else if(document.getElementById && document.getElementById("pull_down"))
  {
   if(ID!=Ebene1)
   { 
    if(paintedID>0)document.getElementById("e1_"+paintedID).className="e1";
    document.getElementById("e1_"+ID).className="e1_a";
    paintedID=ID;
   }
   setMenu2HTML(ID);
//   document.getElementById("pull_down").style.height="230px";
   document.getElementById("pull_down").style.display = "";
  }
}

function hidePullDown(do_it)
{//alert("hidePullDown("+((typeof(do_it)=="undefined")?"undefined":"1")+")");
 if(typeof(do_it)=="undefined")
 {
   TOF = setTimeout("hidePullDown('1')", 500);
 }
 else
 {
  if(document.getElementById && document.getElementById("pull_down") && !MouseOverPullDown)
  {
   document.getElementById("pull_down").style.display = "none";
   if(paintedID>0)
   {
    document.getElementById("e1_"+paintedID).className="e1";
    paintedID=0;
   } 
  }
 }
}

function setMenu2HTML(ID)
{
 strHTML="";
 if(typeof(CatMenuARRAY[ID])!="undefined")
 {
   for(var i=0;i<CatMenuARRAY[ID].length;i++)
   {
    if(CatMenuARRAY[ID][i]["image"]=="")CatMenuARRAY[ID][i]["image"]="/navigation/shop/noimage1.jpg";
    strHTML+="<div class='pulldown_elm'><a href='/"+CatMenuARRAY[ID][i]["url"]+"'><img src='"+CatMenuARRAY[ID][i]["image"]+"' border='0'><div>"+CatMenuARRAY[ID][i]["name"]+"</div></a></div>";
   }
 }

 document.getElementById("inner_frame2_welcome").innerHTML = strHTML;
}
// END Highlights




function OpenFoto(BildURL, x, y) {
var win = "";
win = window.open("","bild",'height=' + y + ',width=' + x +',location=0,status=0,toolbar=no,resizable=0,scrollbar=no,top=0,left=0');
win.document.writeln('<html><head><title>Das Bild</title>');
win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
win.document.writeln('</head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
win.document.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">');
win.document.writeln('<tr><td align="center">');
win.document.writeln('<a href="javascript:window.close()">');
win.document.writeln('<img src="' + BildURL + '" border=0  alt="Fenster schließen">');
win.document.writeln('</a></td></tr></table></body></html>');
win.document.close();
//win.resizeTo(x,y);
win.focus();
}

function BildDown(DownURL,winfeatures) {
	window.open(DownURL,'Filedown','top=0,left=0' + (winfeatures ? (','+winfeatures) : '') );
}

if ( WebmerkQueryA == "" ) WebmerkQueryA='PC-Systeme: Druecken Sie Strg + D; Apple-Macintosh-Systeme: Druecken Sie Befehlstaste + D';
if ( WebmerkQueryB == "" ) WebmerkQueryB='PC-Systeme: Druecken Sie Strg + G; Apple-Macintosh-Systeme: Druecken Sie Befehlstaste + G';
if ( WebmerkFavtext == "" ) WebmerkFavtext = "Weserlandmöbel...";
if ( WebmerkQuery == "" ) WebmerkQuery = "Möchten Sie diese Webseite zu Ihren Favoriten hinzufügen?";

function Webmerk()
{
	if (document.all) // IE
	{
		if (confirm(WebmerkQuery)) window.external.addFavorite('http://www.weserlandmoebel.de',WebmerkFavtext);
	}
	else if (document.layers) // NS 4
	{
		alert(WebmerkQueryA);
	} else if (!document.all && document.getElementById) {
		if(navigator.appName == "Netscape") { // NS > 6
			alert(WebmerkQueryA );
		}
	}
}

function _Get_Cookie(name) { 
   var start = document.cookie.indexOf(name+"="); 
   var len = start+name.length+1; 
   if ((!start) && (name != document.cookie.substring(0,name.length))) return 0; 
   if (start == -1) return 0; 
   var end = document.cookie.indexOf(";",len); 
   if (end == -1) end = document.cookie.length; 
   return unescape(document.cookie.substring(len,end)); 
} 

function _Set_Cookie(name,value,expires,path,domain,secure) { 
    var cookieString = name + "=" +escape(value) + 
       ( (expires) ? ";expires=" + expires.toGMTString() : "") + 
       ( (path) ? ";path=" + path : "") + 
       ( (domain) ? ";domain=" + domain : "") + 
       ( (secure) ? ";secure" : "");
    document.cookie = cookieString; 
} 

function _Delete_Cookie(name,path,domain)
{
   if (_Get_Cookie(name)) document.cookie = name + "=" +
      ( (path) ? ";path=" + path : "") +
      ( (domain) ? ";domain=" + domain : "") +
      ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}

var ISZero = 0;

function MakeFontSize(PLUSSize)
{
	if (document.styleSheets && (document.styleSheets[0].rules || document.styleSheets[0].cssRules) )
	{
		FontnameArr = new Array("xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large");
		if ( (ISZero <= -3 && PLUSSize > 0) || (ISZero >= 7 && PLUSSize < 0) || (ISZero < 7 && ISZero > -3) )
		{
			ISZero += PLUSSize;
			var RulesLength = ( document.styleSheets[0].rules ) ? document.styleSheets[0].rules.length : document.styleSheets[0].cssRules.length;
			for(i=0; i < RulesLength; i++)
			{
				curRule = ( document.styleSheets[0].rules ) ? document.styleSheets[0].rules[i] : document.styleSheets[0].cssRules[i];
				if (curRule.style.fontSize != null) {
					FontString = new String(curRule.style.fontSize);
					ISFONTNONAME = -1;
					for (j = 0; j < FontnameArr.length; j++) {
						if (FontString == FontnameArr[j]) {
							ISFONTNONAME = j;
							break;
						}
					}
					
					if (ISFONTNONAME == -1) {
						ClassFontSize = (FontString.substr(0, FontString.length-2)) * 1;
						ClassFontFormat = FontString.substr(FontString.length-2, 2);
						if (ClassFontSize > 1 ) {
							ClassFontSize += PLUSSize;
							curRule.style.fontSize = (ClassFontSize +  ClassFontFormat);
						}
					} else {
						ISFONTNONAME += PLUSSize
						if (ISFONTNONAME > -1 && ISFONTNONAME < FontnameArr.length)
							curRule.style.fontSize = FontnameArr[ISFONTNONAME];
					}
				}
			}
			// cookie speichern
			var today = new Date(); 
			var zero_date = new Date(0,0,0); 
			today.setTime(today.getTime() - zero_date.getTime()); 
			var cookie_expire_date = new Date(today.getTime() + (8 * 7 * 86400000)); 
			_Set_Cookie("_fontsize", ISZero, cookie_expire_date,"/", document.domain,0);
		}
	}
}


// Scriftgr. ändern
function CheckFontSize()
{
	if ( _Get_Cookie("_fontsize") )
	{
		mCounter = _Get_Cookie("_fontsize")*1;
		if (mCounter != 0 ) MakeFontSize(mCounter)
	}
}

/***   Editable: ***/
var backcolor	= '#FFFFE1';		// Hintergrund
var bordercolor	= '#000000';		// Ramenfarbe
var textcolor	= '#000000';		// Textfarbe
var displaytime	= '1000000';		// Zeit
var tablewidth	= '230';			// Tabellenbreite in px
var object		= 'Layer2';			// objekt - Ebene ID
/*******************/
var tipTimer;	// dHTML Toolltip Timer

function locateObject(n, d) { //v3.0
  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=locateObject(n,d.layers[i].document); return x;
}


function hideKommentar() 
{	if (document.all) {
		locateObject(object).style.visibility="hidden";
		locateObject(object).style.left = 1;
		locateObject(object).style.top = 1;
		return false
	} else if (document.layers) {
		locateObject(object).visibility="hide";
		locateObject(object).left = 1;
		locateObject(object).top = 1;
		return false
	} else if (document.getElementById&&!document.all) {
		document.getElementById(object).style.visibility="hidden";
		document.getElementById(object).style.left = 1;
		document.getElementById(object).style.top = 1;
		return false;
	} else return true;
}

function showKommentar(e, tipContent)
{	window.clearTimeout(tipTimer);
	if (document.all)
	{		locateObject(object).style.top=document.body.scrollTop+event.clientY-10;
			locateObject(object).innerHTML='<table style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="'+tablewidth+'" border="0" cellspacing="1" cellpadding="1"><tr><td><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table>';
			if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
			{	locateObject(object).style.left = document.body.scrollLeft+event.clientX - tablewidth - 30;
			} else locateObject(object).style.left=document.body.scrollLeft+event.clientX+30;
		locateObject(object).style.visibility="visible";
		tipTimer=window.setTimeout("hideKommentar('"+object+"')", displaytime);
		return true;
	} else if (document.layers)
	{	locateObject(object).document.write('<table width="'+tablewidth+'" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="100%" border="0" cellspacing="0" cellpadding="2"><tr bgcolor="'+backcolor+'"><td><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')
		locateObject(object).document.close();
		locateObject(object).top=e.y-10;
		if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth)) locateObject(object).left = window.innerWidth - locateObject(object).clip.width-80;
		else locateObject(object).left=e.x+30;
		locateObject(object).visibility="show";
		tipTimer=window.setTimeout("hideKommentar('"+object+"')", displaytime);
		return true;
	} else if (document.getElementById&&!document.all)
	{	document.getElementById(object).style.top= window.pageYOffset + e.clientY-10;		
		document.getElementById(object).innerHTML='<table style="font-family: Arial, Helvetica, sans-serif; font-size: 11px; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="'+tablewidth+'" border="0" cellspacing="1" cellpadding="1"><tr><td><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> ';
		if ((e.clientX + window.innerWidth - tablewidth - 80) > (window.pageXOffset + window.innerWidth)) document.getElementById(object).style.left = window.pageXOffset + e.clientX-tablewidth-50;
		else document.getElementById(object).style.left=window.pageXOffset + e.clientX+30;
		document.getElementById(object).style.visibility="visible";
		tipTimer=window.setTimeout("hideKommentar('"+object+"')", displaytime);
		return true;
	} else return true;
}

function CheckSendForm() {
	var dothis = true;
	
	for (i = 0; i < document.ecomasform.elements.length; i++) {
		if (document.ecomasform.elements[i].title != "") {
			if (document.ecomasform.elements[i].type == "text" && document.ecomasform.elements[i].value == "") {
				dothis = false;
			}
			else if (document.ecomasform.elements[i].type == "radio")
			{
				var currentRadiochecked = false;
				for (j = 0 ; j < document.ecomasform.elements.length; j++)
				{
					if (document.ecomasform.elements[j].type == "radio" && document.ecomasform.elements[i].name == document.ecomasform.elements[j].name )
					{
						if (!currentRadiochecked) currentRadiochecked = document.ecomasform.elements[j].checked;
						if (currentRadiochecked) break;
					}
				}
				
				if (!currentRadiochecked)
					dothis = false;
			}
			else if (document.ecomasform.elements[i].type == "checkbox" && document.ecomasform.elements[i].checked == false)
				dothis = false;
				
			if (!dothis)
			{
				alert(document.ecomasform.elements[i].title);
				document.ecomasform.elements[i].focus();
				break;
			}
		}
	}	
	return dothis;
}

function FindFirstField()
{
	for (i = 0; i < document.ecomasform.elements.length; i++) {
		if(document.ecomasform.elements[i].type == "text" || document.ecomasform.elements[i].type == "textarea")
		{
			txt1 = new String(document.ecomasform.outerHTML);
			txt2 = new String(document.ecomasform.elements[i].outerHTML);
			if(txt1.indexOf(txt2) < 1000)
			{
				document.ecomasform.elements[i].focus();
			}
			break;
		}
		else if (i > 4)
			break;
	}
}


function dvoid()
{
}

var http_host = "";
var IsVisible = false;
var arrow_www =  http_host + "navigation/rwww_arrow.gif";
var arrow_www_a = http_host + "navigation/rwww_arrow_a.gif";

function LangSelect()
{
	if (document.getElementById)
	{
		if (document.getElementById("LanguageSelect"))
		{
			document.getElementById("LanguageSelect").style.visibility = IsVisible ? "hidden" : "visible";
			if (document.images["imLanSel"])
			{
				document.images["imLanSel"].src = IsVisible ? (http_host + "navigation/rwww_arrow.gif") : (http_host + "navigation/rwww_arrow_a.gif");
			}
			if (document.getElementById("FlashObject"))
			{
				document.getElementById("FlashObject").style.display = IsVisible ? "" : "none";
			}
			IsVisible = !IsVisible;
		}
	}
}

/*######################################################################################################*/
function addEvent(o,n,h)
{
	if(o.attachEvent) o.attachEvent("on"+n,h);
	else if (o.addEventListener) o.addEventListener(n,h,false);
}
function cancelEvent (e)
{
	try
	{
		if (typeof(e) == "undefined") e = window.event;
		if (typeof(e) == "undefined") return false;
		if(e.preventDefault)
		{
			e.preventDefault();
		}
		else
		{
			e.returnValue=false;
			e.cancelBubble=true;
		}
	}
	catch(e) {}
	return false;
}

addEvent(window,"load",animation);
/*######################################################################################################*/
function $(id)
{
  if (document.getElementById) return document.getElementById(id);
  else return false;
}

var tm = false;
function scrollDiv (r)
{

  var step = 10;
  var wert = parseInt(document.getElementById('inner_frame').scrollLeft);
      
  if (r) wert += step;
  else wert  -= step;

  document.getElementById('inner_frame').scrollLeft = wert;
  tm =  window.setTimeout("scrollDiv(" + (r ? "true":"false")+")",100);
}
function clearTM()
{
   if (tm) clearTimeout(tm);
   tm = false;
}

var tm2 = false;
function scrollDiv2 (r)
{
  var step = 10;
  var wert = parseInt(document.getElementById('inner_frame2').scrollLeft);
      
  if (r) wert += step;
  else wert  -= step;

  document.getElementById('inner_frame2').scrollLeft = wert;
  tm2 =  window.setTimeout("scrollDiv2(" + (r ? "true":"false")+")",100);
}
function clearTM2()
{
   if (tm2) clearTimeout(tm2);
   tm2 = false;
}

var tmw = false;
function scrollDivWelcome (r)
{
  var step = 10;
  var wert = parseInt(document.getElementById('inner_frame_welcome').scrollLeft);
    
  if (r) wert += step;
  else wert  -= step;

  document.getElementById('inner_frame_welcome').scrollLeft = wert;
  tmw=  window.setTimeout("scrollDivWelcome(" + (r ? "true":"false")+")",100);
}

function clearTMWelcome()
{
   if (tmw) clearTimeout(tmw);
   tmw= false;
}

var tmvp = false;
function scrollDivViewedProds (r)
{
  var step = 10;
  var wert = parseInt(document.getElementById('inner_frameViewedProds').scrollLeft);
      
  if (r) wert += step;
  else wert  -= step;

  document.getElementById('inner_frameViewedProds').scrollLeft = wert;
  tmvp =  window.setTimeout("scrollDivViewedProds(" + (r ? "true":"false")+")",100);
}
function clearTMViewedProds()
{
   if (tmvp ) clearTimeout(tmvp );
   tmvp = false;
}

function guenstiger_gesehen(e,artnr,artname)
{
	if (typeof(artnr) == "undefined") artnr = document.product.prodid.value;
	if (typeof(artname) == "undefined") artname= $("artname").innerHTML;
	var w = 600;
	var h = 490;
	var html = '<iframe src="/scripts/guenstiger.php?to_email='+escape('info@weserlandmoebel.de')+'&to_name='+escape('Weserlandmöbel')+'&artnr=' + escape(artnr) + '&artname=' + escape(artname) + '" style="border: 0px solid ;" width="' + w.toString() + '" frameborder="0" height="' + h.toString() + '"></iframe>';
	$("Layer2").style.width = w.toString() + "px";
	$("Layer2").style.height = h.toString() + "px";


	if(typeof(window.pageXOffset)!="undefined")
        {
         var screen_width_half = parseInt(window.innerWidth/2 + window.pageXOffset);
         var screen_height_half = parseInt(window.innerHeight/2 );
        }
        else if(typeof(document.body) != 'undefined')
        {
         var screen_width_half = window.document.documentElement.clientWidth/2 + window.document.body.scrollLeft;
         var screen_height_half = window.document.documentElement.clientHeight/2 + window.document.body.scrollTop; 
        }

        screen_width_half = parseInt(screen_width_half);
        screen_height_half = parseInt(screen_height_half);

	var left  = parseInt(screen_width_half - w/2 - 20);
	var top = parseInt(screen_height_half - h/2 - 20); 

	$("Layer2").style.top = top.toString()+"px";
	$("Layer2").style.left = left.toString()+"px";
	$("Layer2").style.visibility = "visible";
	$("Layer2").innerHTML = html;
        $("Layer2").style.position = "fixed";

}
var lastZInd = 1000;
function createLayer(namlay,do_it)
{
 if(typeof(do_it)=="undefined")
 {
   if (typeof(TO_CL)!="undefined") window.clearTimeout(TO_CL);
   TO_CL = setTimeout("createLayer('"+namlay+"','1')", 300);
   return false;
 }

	if (typeof(namlay) == "undefined") return;
	if (!$(namlay))
	{
		b=document.createElement("div");
		var zI =  lastZInd + 1;
		b.style.cssText='visibility:hidden;position:absolute;z-index:' + zI.toString() + '';
		b.id = namlay;
		if (document.getElementsByTagName)
		 document.getElementsByTagName("body")[0].appendChild(b);
		else if (document.all)
		 document.all("body").parentNode.appendChild(b);
	}
}



