var pixel = function(a){
	var src='573541C573S573542CL90PPV';
	a=a?a:'0';
	var matchval=new RegExp(/\/angebote\/$/i);
	var b=window.location.href;
	if(b.search(matchval)>0) a='000';
	var ssl = "687474703A2F2F73736C2E68757272612E64652F547261636B4974";
	var adr = '';
	for(var i=0; i<ssl.length; i=i+2) adr+=String.fromCharCode(parseInt(ssl.substring(i,i+2),16));
	document.write('<img src="'+adr+'?tid='+src+'&pd='+a+'&ref=[[' + document.referrer + ']]&src=[[' + document.location + ']]" alt="" border="0" width="1" height="1" style="position: absolute; top:-20; left: -20;">');
}
var view = function(trg,ac,mc){
	var f = $('ifr');
	var t = $('trg');
	t.value=trg;
	f.pd.value = ac ? ac : dac;
	f.mc.value = mc ? mc : '';
	f.submit();
}
var visit = function(trg,mc){view(trg,'',mc);}
var form = function(){
	var a = new Element('form',{'action':'http://62.144.160.11/P','id':'ifr','method':'get'});
	var i = [
		{name:'2bV-',value:'',type:'hidden',id:'trg'},
		{name:'pd',value:'',type:'hidden'},
		{name:'mc',value:'',type:'hidden'},
		{name:'src',value:'[['+document.location+']]',type:'hidden'},
		{name:'ref',value:'[['+document.referrer+']]',type:'hidden'}
	];
	i.each(function(el){
		new Element('input',$merge({type:'hidden'},el)).inject(a);
	});
	a.inject($('content'));
}
function init_t(){
	pixel();
}
window.addEvent('domready', function() {
	form();
	price.init();
	PSi.init();
	layout.init();
	toys.init();
	document._sclr = new SClr();
	document._shrt = new Shrt();
	_SBox = new SBox();
});

var makeNewWindow=function(a,b,c,d,e,f,g,h) {
	cP=screen.width?(screen.width-c)/2:0;
	dP=screen.height?(screen.height-d)/2:0;
	c=c?(c=='a'?screen.width-20:c):500; d=d?(d=='a'?screen.height-20:d):450; e=e?e:'no'; f=f?f:'no'; g=g?g:'no'; h=h?h:'no';
	i = "width="+c+",height="+d+",top="+dP+",left="+cP+",status="+e+",toolbar="+f+",menubar="+g+",location="+h+",scrollbars=yes,resizable=yes,screenX=150,screenY=80";
	popupw = window.open(a,b,i);
	if (popupw){ popupw.focus(); }
	return false;
}

var price=function(){
	var init=function(){
		$$('[id*=:]').each(function(el){
			var b = el.id.split(':');
			var c = el.getParent();
			if(b[0]=='pi'){
				el.href = 'javascript:view(\''+b[1]+'\',\'000\')';
			}else{
				if(b[0]=='inactive'){
					var d = new Element('span',{'class':'inactive go',html:'Ce produit est actuellement indisponible.'});
					d.inject(c);
				}else{
					var lnk = 'javascript:view(\''+b[1]+'\',\''+b[2]+'\''+(b[3]?',\''+(b[3])+'\'':'')+')';
					var d = new Element('a',{href:lnk,'class':'go',html:'mehr Details'});
					d.inject(c);
					c.getChildren('.url').each(function(el){el.href=lnk});
				}
			}
			el.erase('id');
		});
	}
	return{
		init: init
	}
}();



var toys = function(){
	var options = {
	}
	var init = function(what){
		if($('e404')){
			$('e404').innerHTML = "<a href=\"javascript:visit('RV')\">"+$('e404').innerHTML+"</a>";
		}
		$$('.external').each(function(el){
			el.addEvent('click',function(e){e.stop();makeNewWindow(dview(el.href),'','a','a','yes','yes','yes','yes','yes');});
		});
		
	}
	var dview = function(a){
		a = a.replace(/^.*?\('(.*?)'.*$/,'$1');
		var b = $('ifr').action+'?'+$('trg').name+'='+a;
		return b;
	}
	return{
		init: init
	}
}();

var layout = function(){
	var options = {
	}
	var init = function(){
		var a = new Element('div',{'id':'wrapper'}).wraps($('content'));
		header(a);
		
		if (typeof smapfl === "undefined") {
			left(a);
		} else if(smapfl === true) {
			siteMap();
		} 
		$$('.full','#info')[0]?right():'';
		footer(a);
		$$('.index')[1]?$$('.index')[0].inject($$('.index')[1],'top'):'';
		$$('.hproduct')[0]?product($$('.hproduct')[0]):'';
		$$('.l1')[0]?l1():'';
	}
	var header = function(where){
		var a = new Element('div',{'id':'header'});
		new Element('a',{'id':'logo', 'href':"javascript:visit('1m_')"}).inject(a);
		a.inject(where,'top');
	}
	
	var siteMap = function (){
		window.addEvent('load', function() {
            var hsch = $('htmlsitemap').getChildren();
            var l = [];
			var a = new Element('div',{'id':'left'});
			var b = new Element('div',{'id':'htmlsitemap_jump' , 'class':'htmlsitemap_jump'});
			b.inject(a);
			a.inject($('wrapper'));
            hsch.each(function(el, i) {
                $('htmlsitemap_jump').adopt([new Element('a', {
                    'href': '#' + el.getChildren()[0].get('name'),
                    'html': el.getChildren()[0].get('html')
                    })]);
            });
		});
	}
	
	var left = function(where){
		var a = new Element('div',{'id':'left'});
		var m = $('menu');
		if(m){m.addClass('mainnavigation').inject(a);}else{
			var lm = new Element('ul',{'class':'mainnavigation'});
			var i = [
				{href:"javascript:visit('1nc')", html:'Herren-Mode'},
				{href:"javascript:visit('1mV')", html:'Damen-Mode'},
				{href:"javascript:visit('1mW')", html:'Klepper-Shop'},
				{href:"javascript:visit('1n5')", html:'Reduzierte Angebote'}
			];
			i.each(function(el){
				new Element('a',el).inject(new Element('li').inject(lm));
			});
			lm.inject(a);
		}
		
		
		new Element('a',{'href':"javascript:visit('1m_')", html:'<img border="0 alt="" src="/angebote//x0ojmQ/direktbestellung.png">'}).inject(a);
		var ln = new Element('ul',{'class':'mainnavigation'});
		var j = [
				{href:"javascript:visit('1mU')", html:'Service &amp; Hilfe'},
				{href:"javascript:visit('1n6')", html:'Kontakt'},
				{href:"javascript:visit('1n1')", html:'Filialen &amp; Hotelverkauf'},
				{href:"javascript:visit('1na')", html:'&Uuml;ber Walbusch'}
			]
    j.each(function(el){
			new Element('a',el).inject(new Element('li').inject(ln));
		});
		ln.inject(a);
		
		a.inject(where)
	}
	var right = function(){
		var b = new Element('div',{'class':'right rc'}).wraps($('content'));
		var a = new Element('div',{'id':'right'});		
		new Element('a',{'class': 'banner', href:"javascript:visit('1nb')", html:'<img border="0 alt="" src="/angebote/x0ojmQ/right_side1.jpg">'}).inject(a);
		new Element('a',{'class': 'banner', href:"javascript:visit('1m-')", html:'<img border="0 alt="" src="/angebote/x0ojmQ/right_side2.jpg">'}).inject(a);
		new Element('a',{'class': 'banner', href:"javascript:visit('1n2')", html:'<img border="0 alt="" src="/angebote/x0ojmQ/right_side3.jpg">'}).inject(a);
		a.inject(b)
	}
	var footer = function(where){
		var a = new Element('div',{'id':'footer'});
    var lm = new Element('ul',{'class':'footerlinks'});
		var i = [
			{href:"javascript:visit('1n6')", 'html':'Kontakt'},
			{href:"javascript:visit('1n0')", 'html':'Newsletter'},
			{href:"javascript:visit('1n1')", 'html':'Filialen'},
			{href:"javascript:visit('1n9')", 'html':'Presse-Service'},
			{href:"javascript:visit('1n3')", 'html':'Impressum'},
			{href:"javascript:visit('1n4')", 'html':'AGB'},
			{href:"javascript:visit('1n7')", 'html':'Datenschutz'},
			{href:"javascript:visit('1mZ')", 'html':'Anbieterkennzeichnung'},
			{href:"javascript:visit('1mY')", 'html':'Seiten&uuml;bersicht'}
		];
		i.each(function(el){
			new Element('a',el).inject(new Element('li').inject(lm));
		});
		if($('fadoptme')) new Element('li').adopt($('fadoptme')).inject(lm,'top');
		lm.inject(a);
		
		new Element('a',{id:'bvh', href:"javascript:visit('1mX')", 'html':'<img src="/angebote//x0ojmQ/bvh_icon.gif" alt="Logo BVH">'}).inject(a,'top');
		new Element('p',{html:'Preise inkl. gesetzlicher MwSt., zzgl.&nbsp;<a href="javascript:visit(\'1n8\')">Versandkosten</a>'}).inject(a);
		new Element('div',{'class':'copyright', html:'Walbusch Walter Busch GmbH &amp; Co. KG, 42646 Solingen'}).inject(a);
		a.inject(where,'after');
	}
	var product = function(where){
		$('content').addClass('right');
		if($('p_headline')){
			new Element('div',{'class':'header', 'html':'Top-Produkt'}).inject(where, 'before');
		}else{
			new Element('div',{'class':'header', 'html':'Beschreibung'}).inject(where.getChildren('.description')[0], 'before');
		}
		var z = where.getChildren('.zoom')[0];
		z.set({
			'events': {'click': function(e){ e.stop();Slimbox.open(this.href);}}, 
			'html': '<span>Bild vergr&ouml;&szlig;ern: ' + z.get('html') + '</span>'
		});
		where.getChildren('.go')[0].inject(where.getChildren('.price')[0],'before');
		if($$('.scrollable.related', '.scrollable.bestsellers')[0]){
		
		
		
			new Element('a',{'class': 'banner', href:"javascript:visit('1nb')", html:'<img border="0 alt="" src="/angebote//x0ojmQ/right_side2.jpg">'}).inject(new Element('div',{'class':'ban'}).wraps($$('.scrollable.related', '.scrollable.bestsellers')[0]));
		}
		if($$('.l2')[0]){
			var l2 = $$('.l2')[0];
			l2.addClass('short');
		}
	}
	var l1 = function(){
		$$('.l1 dd').each(function(el){
			new Element('a',{'class':'image', 'href':el.getChildren('.go')[0].href}).wraps(el.getChildren('.photo')[0]);
		});
	}
	return{
		init: init
	}
}();

var Shrt = new Class({
	initialize:function(){
		this.items = $$('.shortme');
		this.proc_all();
	},
	proc_all:function(){
		if(!this.items) return;
		this.ioht = [];
		this.ca = this.items.length;
		while(this.ca--){
			if(this.checkCL()) this.mk_short();
		}
	},
	checkCL:function(){
		this.iss = this.items[this.ca].getScrollSize().y + (this.items[this.ca].getElementsByTagName('br').length * parseInt(this.items[this.ca].getStyle('line-height')));
		this.ias = this.items[this.ca].getStyle('min-height').toInt() + this.items[this.ca].getStyle('padding-top').toInt() + this.items[this.ca].getStyle('padding-bottom').toInt() + this.items[this.ca].getStyle('border-top-width').toInt() + this.items[this.ca].getStyle('border-bottom-width').toInt();
		//console.log(this.iss, this.ias);
		if(this.iss>this.ias && this.ias!=0){
			this.items[this.ca].id=this.items[this.ca].id?this.items[this.ca].id:'short-'+this.ca;
			this.ioht[this.items[this.ca].id] = {mx:this.iss,mn:this.ias};
			return true;
		}
		else return false;
	},
	mk_short:function(){
		this.items[this.ca].addClass('short').removeClass('shortme').addClass('shortened');
		this.spacer = new Element('div',{'class':'spacer'});
		this.btn = new Element('a',{href:'#','class':'shrt_btn'});
		this.btn.addEvent('click',function(e){
			e.stop();
			document._shrt.slide(this);
		});
		this.btn.inject(this.items[this.ca],'top');
		this.spacer.inject(this.items[this.ca],'top');
	},
	slide:function(i){
		i.getParent().morph({height:i.getParent().hasClass('short')? this.ioht[i.parentNode.id].mx : this.ioht[i.parentNode.id].mn});
		i.getParent().toggleClass('short');
	}
});

var SClr = new Class({
	initialize:function(){
		this.cnt = $$('.scrollme');
		if(!this.cnt) return;
		['dw','dh','ki','kh','ow','oh','cit','msr','csm','itemsBU','btns','elw','elh'].each(function(el){
			eval( 'this.'+el+' = [];');
		}, this);
		this.cntl = this.cnt.length;
		while(this.cntl-- && this.cnt[this.cntl].getStyle('display')!=='none'){
			if(!this.cnt[this.cntl].getFirst()) continue;
			this.elw[this.cntl] = this.cnt[this.cntl].getFirst().getSize().x + this.cnt[this.cntl].getFirst().getStyle('margin-left').toInt() + this.cnt[this.cntl].getFirst().getStyle('margin-right').toInt();
			this.elh[this.cntl] = this.cnt[this.cntl].getFirst().getSize().y + this.cnt[this.cntl].getFirst().getStyle('margin-top').toInt() + this.cnt[this.cntl].getFirst().getStyle('margin-bottom').toInt();
			this.ow[this.cntl] = this.cnt[this.cntl].getScrollSize().x;
			this.oh[this.cntl] = this.cnt[this.cntl].getSize().y;
			this.dw[this.cntl] = Math.floor(this.ow[this.cntl] / this.elw[this.cntl] );
			this.dh[this.cntl] = Math.floor(this.oh[this.cntl] / this.elh[this.cntl] );
			this.ki[this.cntl] = this.cnt[this.cntl].getChildren().length;
			this.kh[this.cntl] = Math.ceil(this.ki[this.cntl] / this.dw[this.cntl] );
			
			if(this.cnt[this.cntl].hasClass('vertical')){
				if(this.kh[this.cntl] > this.dh[this.cntl]) {this.buildUITB(this.cntl);} // vertical scroll
				else{this.wrapItemsTB(this.cntl);}
			}else{
				if(this.ki[this.cntl] > this.dw[this.cntl] ) this.buildUILR(this.cntl); // horisontal scroll
			}
		}
	},
	buildUITB:function(i){
		this.wrapItemsTB(i);
		this.btns[i] ={
			top: new Element('a',{'class':'sclr-btn scroll-top disabled'}),
			bottom: new Element('a',{'class':'sclr-btn scroll-bottom'})
		}
		this.btns[i].top.addEvent('click',function(e){e.stop(); document._sclr.scrollT(i);});
		this.btns[i].bottom.addEvent('click',function(e){e.stop(); document._sclr.scrollB(i);});
		this.btns[i].top.inject(this.wrpprCnt,'top');
		this.btns[i].bottom.inject(this.wrpprCnt,'top');
	},
	wrapItemsTB:function(i){
		this.itemsBU[i] = this.cnt[i].clone(true,true);
		this.wrpprCnt = new Element('div',{'class':'scroller vertical',id:'scroller-'+i, 'style':'height:'+(this.elh[i]*this.dh[i])+'px'});
		this.itemsBU[i].inject(this.wrpprCnt);
		this.wrpprCnt.replaces(this.cnt[i]);
		this.itemsBU[i].removeClass('scrollme').removeClass('vertical');
		this.cit[i] = 0;
		this.csm[i] = 0;
		this.msr[i] = this.kh[i] - this.dh[i];
		this.itemsBU[i].setStyles({
			height:this.elh[i]*this.kh[i],
			'margin-top':0
		});
		this.itemsBU[i].set('morph',{duration:'long',transition:'bounce:out'});
	},
	scrollB:function(i){
		if(this.cit[i]==this.msr[i]) return;
		this.itemsBU[i].morph({'margin-top':this.csm[i]-this.elh[i]});
		this.csm[i]=this.csm[i]-this.elh[i]; this.cit[i]++;
		if (this.cit[i]==1 && this.btns[i].top.hasClass('disabled')) this.btns[i].top.removeClass('disabled');
		if(this.cit[i]==this.msr[i] && !this.btns[i].bottom.hasClass('disabled')) this.btns[i].bottom.addClass('disabled');
	},
	scrollT:function(i){
		if(this.cit[i]==0) return;
		this.itemsBU[i].morph({'margin-top':this.csm[i]+this.elh[i]});
		this.csm[i]=this.csm[i]+this.elh[i]; this.cit[i]--;
		if (this.cit[i]==0 && !this.btns[i].top.hasClass('disabled')) this.btns[i].top.addClass('disabled');
		if(this.cit[i]==this.msr[i]-1 && this.btns[i].bottom.hasClass('disabled')) this.btns[i].bottom.removeClass('disabled');
	},
	//lr
	buildUILR:function(i){
		this.wrapItemsLR(i);
		this.btns[i] ={
			left: new Element('a',{'class':'sclr-btn scroll-left disabled'}),
			right: new Element('a',{'class':'sclr-btn scroll-right'})
		}
		this.btns[i].left.addEvent('click',function(e){e.stop(); document._sclr.scrollL(i);});
		this.btns[i].right.addEvent('click',function(e){e.stop(); document._sclr.scrollR(i);});
		this.btns[i].left.inject(this.wrpprCnt,'top');
		this.btns[i].right.inject(this.wrpprCnt,'top');
	},
	wrapItemsLR:function(i){
		this.itemsBU[i] = this.cnt[i].clone(true,true);
		this.wrpprCnt = new Element('div',{'class':'scroller',id:'scroller-'+i, 'style':'width:'+(this.elw[i]*this.dw[i])+'px'});
		this.itemsBU[i].inject(this.wrpprCnt);
		this.wrpprCnt.replaces(this.cnt[i]);
		this.itemsBU[i].removeClass('scrollme');
		this.cit[i] = 0;
		this.csm[i] = 0;
		this.msr[i] = this.ki[i] - this.dw[i];
		this.itemsBU[i].setStyles({
			width:this.elw[i]*this.ki[i],
			'margin-left':0
		});
		this.itemsBU[i].set('morph',{duration:'long',transition:'bounce:out'});
	},
	scrollR:function(i){
		if(this.cit[i]==this.msr[i]) return;
		this.itemsBU[i].morph({'margin-left':this.csm[i]-this.elw[i]});
		this.csm[i]=this.csm[i]-this.elw[i]; this.cit[i]++;
		if (this.cit[i]==1 && this.btns[i].left.hasClass('disabled')) this.btns[i].left.removeClass('disabled');
		if(this.cit[i]==this.msr[i] && !this.btns[i].right.hasClass('disabled')) this.btns[i].right.addClass('disabled');
	},
	scrollL:function(i){
		if(this.cit[i]==0) return;
		this.itemsBU[i].morph({'margin-left':this.csm[i]+this.elw[i]});
		this.csm[i]=this.csm[i]+this.elw[i]; this.cit[i]--;
		if (this.cit[i]==0 && !this.btns[i].left.hasClass('disabled')) this.btns[i].left.addClass('disabled');
		if(this.cit[i]==this.msr[i]-1 && this.btns[i].right.hasClass('disabled')) this.btns[i].right.removeClass('disabled');
	}
});
var SBox = new Class({
	Implements: Options,
	options:{
		SBtype:0 
	},
	initialize: function(options){
		this.setOptions(options);
		this.prnd;
		this.createSB();
	},
	createSB: function(){
	switch(this.options.SBtype){
		case 0:
			this.prnd = new Element('div',{id:'SBitCnt'});
			this.tmpic = new Element('div',{id:'SBitInnerCnt',html:'<div id="SBit_hdr">Suche im Online-Shop</div>'}).inject(this.prnd);			
			this.tmp = new Element('form',{name:'SBi_form'});
			this.tmpinput = new Element('input',{
				id:'SBit1_qti',
				type:'text',
				name:'query',
				value:this.getKwFR(),
				events:{
					focus:function(){
						if(this.value=='Suchbegriff oder Artikel-Nr.') this.value = '';
					},
					blur:function(){
						if(this.value=='') this.value='Suchbegriff oder Artikel-Nr.';
					}
				}
			});
			if(this.tmpinput.value=='') this.tmpinput.value='Suchbegriff oder Artikel-Nr.';
			this.tmpinput.inject(this.tmp);
			this.tmpbtn = new Element('button',{id:'SBit_sbb',html:'<span>suchen</span>'});
			this.tmpbtn.addEvent('click',function(e){
				e.stop();
				if($('SBit1_qti').value=='Suchbegriff oder Artikel-Nr.' || !$('SBit1_qti').value)
					alert('Bitte geben Sie einen Suchbegriff ein!');
				else _SBox.search($('SBit1_qti').value);
			});
			this.tmpbtn.inject(this.tmp);
			this.tmpbtnshadow = new Element('div',{id:'SBit_sbb_shadow'}).inject(this.tmp);
			this.tmp.addEvent('submit',function(e){
				e.stop();
				if($('SBit1_qti').value=='Suchbegriff oder Artikel-Nr.' || !$('SBit1_qti').value)
					alert('Bitte geben Sie einen Suchbegriff ein!');
				else _SBox.search($('SBit1_qti').value);
			});
			this.tmp.inject(this.tmpic);
			this.prnd.inject($('header'));
			new Element('div',{id:'SBitCntShadow'}).inject($('header'));
		break;
		}
	},
	getKwFR:function(){
		this.docref = document.referrer;
		if(this.docref.search(/^https?:\/\/(.*?)?google(syndication)?\./)>-1){
			this.refkw = this.docref.replace(/^.*(\?|\&)(q|as_q|as_epq|es_eq|as_oq|query|suchstr|ref)=/i,'').replace(/\&.*$/,'');
			this.convertKw();
			return this.refkw;
		}
		if(this.docref.search(/^https?:\/\/(.*?)?yahoo\./)>-1){
			this.refkw = this.docref.replace(/^.*(\?|\&)p=/,'').replace(/\&.*$/,'');
			this.convertKw();
			return this.refkw;
		}
		if(this.docref.search(/^https?:\/\/(.*?)?bing\./)>-1){
			this.refkw = this.docref.replace(/^.*(\?|\&)(q|mt)=/i,'').replace(/\&.*$/,'');
			this.convertKw();
			return this.refkw;
		}
		if(this.docref.search(/^https?:\/\/(.*?)?web\.de/)>-1){
			this.refkw = this.docref.replace(/^.*(\?|\&)(su)=/i,'').replace(/\&.*$/,'');
			this.convertKw();
			return this.refkw;
		}
		if(this.docref.search(/^https?:\/\/(.*?)?alltheweb\.com/)>-1){
			this.refkw = this.docref.replace(/^.*(\?|\&)(q|query)=/i,'').replace(/\&.*$/,'');
			this.convertKw();
			return this.refkw;
		}
		//try default ptterns
		this.refkw = this.docref.replace(/^.*(\?|\&)(q|query|keyword|keywords|qt|fq)=/i,'').replace(/\&.*$/,'');
		if(this.refkw.search(/^https?:\/\//i)===-1){
			this.convertKw();
			return this.refkw;
		}
		return '';
	},
	convertKw:function(){
		this.refkw = this.refkw.replace(/\+/g,' ');
		this.refkw = decodeURIComponent(this.refkw);
		this.refkw = unescape(this.refkw);
	}, 
	search:function(a){
		document.location='http://ssl.hurra.com/TrackIt?tid=573543C573S573542CL90PPC&url=[[http://www.walbusch.de/walbusch-de/pages/ffSearchResult.jsf?query='+a+'&pid=hurra&wid=hurra&campaign=walbusch_hurra]]&pd=0&ref=[[' + document.referrer + ']]&src=[[' + document.location + ']]';
	}
});
/*


$VAR1 = {
          'alphabetic_index_desc' => 'Index',
          'categories_max_deep' => '2',
          'categories_name' => '&nbsp;',
          'clear_unneded_lists' => '1',
          'count_list_allproducts1' => '10',
          'count_list_allproducts2' => '5',
          'count_list_allproducts3' => '5',
          'count_list_bestproducts' => '3',
          'count_list_left' => '30',
          'count_list_left1' => '20',
          'count_list_left1_split' => '180',
          'count_list_left2' => '30',
          'count_list_left2_split' => '80',
          'count_list_p40bestsellers' => '8',
          'count_list_rankproducts' => '8',
          'count_list_rankproducts_split' => '360',
          'count_list_rankword_family' => '20',
          'count_list_rankword_split' => '80',
          'count_list_word1' => '10',
          'count_list_word2' => '5',
          'count_list_word3' => '5',
          'cpp_how_many_words' => '3',
          'cpp_how_many_words_for_rankword' => '3',
          'cpp_how_many_words_in_keywords' => '1',
          'description_length' => '100',
          'domain_dir' => 'walbusch.hurraproxy.com',
          'empty_local_root_url' => '1',
          'fill_rankproducts_with_left' => '0',
          'fullcategories_count' => '12',
          'fullcategories_deep' => '1',
          'fullcategories_order' => "Herren | Herren-Anzughemden
Herren | Herren-Freizeithemden
Herren | Herren-Hosen
Herren | Herren-Strickwaren
Herren | Herren-Schuhe
Herren | Herren-Freizeitanz\x{fc}ge und Badebekleidung
Herren | Herren-H\x{fc}te, M\x{fc}tzen, Schals, Handschuhe
Herren | Herren-Jacken und M\x{e4}ntel
Herren | Herren-Sakkos und Anz\x{fc}ge
Herren | Herren-Socken und Str\x{fc}mpfe
Herren | Herren-Tag- und Nachtw\x{e4}sche
Herren | Krawatten, G\x{fc}rtel, Accessoires
Damen | Damenblusen
Damenn | Damen-Hosen
Damen | Damen-Schuhe
Damen | Damen-Blazer und Westen
Damen | Damen-Freizeitbekleidung und Heimtextilien
Damen | Damen-H\x{fc}te, M\x{fc}tzen, Schals, Handschuhe
Damen | Damen-Jacken und M\x{e4}ntel
Damen | Damen-Kombinationen
Damen | Damen-R\x{f6}cke
Damen | Damen-Socken und Str\x{fc}mpfe
Damen | Damen-Strickwaren
Damen | Damen-T\x{fc}cher, G\x{fc}rtel und Accessoires",
          'fullcategories_separator' => ' | ',
          'fullcategories_total_count' => '9999',
          'html_root_page' => '/angebote/',
          'language' => 'de',
          'linkzip_ip' => '62.144.160.11',
          'list_bestproducts_disable' => '0',
          'list_bestproducts_inactive_use' => '0',
          'list_fullcategories_disable' => '0',
          'list_fullcategories_inactive_use' => '1',
          'list_left1_disable' => '0',
          'list_left1_inactive_use' => '0',
          'list_left2_disable' => '0',
          'list_left2_inactive_use' => '0',
          'list_left2_min_set' => '80',
          'list_left_loop' => '1',
          'list_random_left2_count' => '3',
          'list_random_rankword_family_count' => '3',
          'list_rankproducts_disable' => '0',
          'list_rankproducts_inactive_use' => '1',
          'list_rankproducts_slider_disable' => '0',
          'list_rankproducts_slider_inactive_use' => '1',
          'list_rankword2_structure' => 'children',
          'list_rankword_family_deep' => '1',
          'list_rankword_family_loop' => '1',
          'list_rankword_structure' => 'children',
          'list_related_disable' => '0',
          'list_related_inactive_use' => '0',
          'list_word_fill_up_with_list_left' => 'yes',
          'max_products_per_domain' => '300000',
          'navi_index_name' => 'Walbusch',
          'navi_separator' => ' > ',
          'no_new_products' => '1',
          'no_word_pages' => '1',
          'output_charset' => 'latin1',
          'page_random_words_1' => '5',
          'path_type' => 'title',
          'product_page_extension' => 'html',
          'proxy_client_url' => 'www.walbusch.de/angebote/',
          'rankwords_structure_version' => '2',
          'ros_use_it' => '1',
          'seocms_pages' => '1',
          'serialize' => '1',
          'short_title_length' => '60',
          'site_dir' => '/projects/positioning/spool/walbusch/xpi',
          'sql_eval_body' => '$rh->{\'cropped_description\'} = $_;',
          'sql_eval_imageurl' => '$_ or ($_ = \'x0ojmQ/null.gif\' );',
          'sql_eval_thumburl' => '$_ or ($_ = \'x0ojmQ/null_small.gif\' );',
          'templates_before_save_eval' => 's{http://62.144.160.30/sTrackIt\\?tid=}{./?tid=}gs;
	s{"http://(?:linkzip.net|62.144.160.11)/P\\?([^=]+)=([^&"]+).*?(mc=(\\d+))?"}{\'"javascript:visit(\'.("\\x5C\'$2\\x5C\'".(($4)?",$4":\'\')).\')"\'}gse;',
          'topcategories' => '1',
          'topcategories_deep' => '2',
          'tpl_404' => '404_page.html',
          'tpl_category_page' => 'list_page.html',
          'tpl_cssjs_dir' => 'x0ojmQ',
          'tpl_directory' => 'templates',
          'tpl_footer' => 'footer_template.html',
          'tpl_header' => 'header_template.html',
          'tpl_index' => 'index_page.html',
          'tpl_product_filename' => 'product_page.html',
          'trackit_link_start' => 'http://ssl.hurra.com/TrackIt?tid=573543C573S573542CL90PPC&url=[[',
          'trackit_link_stop' => ']]',
          'url_join' => '_',
          'use_pmod' => '1',
          'use_sitemaps' => '1',
          'use_template_toolkit' => '1'
        };


*/
var PSi = new Object({
	options:{
		elems:['.price'],
		excludeClasses:['price'],
		configs:{
			global:{hsep:'.', dsep:',', nozeros:false, zeroprice:false,zeros:',-',fillzeros:true}
		}
	},
	init:function(){
		this.getElems();
		this.processElems();
	},
	getElems:function(){
		this.elems = $$(this.options.elems);
		this.maxelem = this.elems.length;
	},
	processElems:function(){
		this.ci = 0;
		for(this.ci;this.ci<this.maxelem;this.ci++){ this.getCC(); }
	},
	combineOptions:function(){
		this.config = this.options.configs.global;
		if(this.options.configs[this.cecns]){ for(this.copti in this.options.configs[this.cecns]) this.config[this.copti] = this.options.configs[this.cecns][this.copti]; }
	},
	getCC:function(){
		this.cecns = this.elems[this.ci].className.replace(new RegExp('\\s?('+this.options.excludeClasses.join('|')+')\\s?','g'),'');
		this.combineOptions();
		this.ceprefix = this.elems[this.ci].getElements('.prefix');
		for(this.cepi=0;this.cepi<this.ceprefix.length;this.cepi++) this.ceprefix[this.cepi].parentNode.removeChild(this.ceprefix[this.cepi]);
		this.cesuffix = this.elems[this.ci].getElements('.suffix');
		for(this.cepi=0;this.cepi<this.cesuffix.length;this.cepi++) this.cesuffix[this.cepi].parentNode.removeChild(this.cesuffix[this.cepi]);
		this.ceprice = this.elems[this.ci].innerHTML;
		this.ceprice = this.ceprice.replace(/-/,'00').replace(/,/,'.').replace(/\s+/,'');
		this.cepparts = this.ceprice.split('.');
		if(!this.cepparts[1]) this.cepparts[1] = this.config.fillzeros ? '00'  : '';
		if(this.config.fillzeros && this.cepparts[1].length<2) this.cepparts[1] = parseInt(this.cepparts[1],10).toPrecision(2).toString().replace(/\.|,/,'');
		if(parseFloat(this.ceprice)==0){
			if(this.config.zeroprice){ this.elems[this.ci].innerHTML = this.config.zeroprice; return; }
			if(this.config.nozeros){ this.retNoZeros();	return; }
			if(this.config.zeros){ this.retZeros(); return; }
		}
		if(this.config.hsep && this.cepparts[0].length>3){
			while(this.cepparts[0].search(/^\d{4}/)>-1){ this.cepparts[0] = this.cepparts[0].replace(/(.*?)(\d{3}(?:$|,))/,"$1"+this.config.hsep+"$2"); }
		}
		if(!parseInt(this.cepparts[1]) && this.config.nozeros){ this.retNoZeros(); return; }
		if(!parseInt(this.cepparts[1]) && this.config.zeros){ this.retZeros(); return; }
		this.retDefault();
		return;
	},
	retNoZeros:function(){
		this.elems[this.ci].innerHTML = this.cepparts[0] + (!parseInt(this.cepparts[1]) ? '' : this.config.dsep + this.cepparts[1] );
		if(this.ceprefix[0]) this.elems[this.ci].insertBefore(this.ceprefix[0],this.elems[this.ci].firstChild);
		if(this.cesuffix[0]) this.elems[this.ci].appendChild(this.cesuffix[0]);
	},
	retZeros:function(){
		this.elems[this.ci].innerHTML = this.cepparts[0] + (!parseInt(this.cepparts[1]) ? this.config.zeros : this.config.dsep + this.cepparts[1] );
		if(this.ceprefix[0]) this.elems[this.ci].insertBefore(this.ceprefix[0],this.elems[this.ci].firstChild);
		if(this.cesuffix[0]) this.elems[this.ci].appendChild(this.cesuffix[0]);
	},
	retDefault:function(){
		this.elems[this.ci].innerHTML = this.cepparts[0] + this.config.dsep + this.cepparts[1];
		if(this.ceprefix[0]) this.elems[this.ci].insertBefore(this.ceprefix[0],this.elems[this.ci].firstChild);
		if(this.cesuffix[0]) this.elems[this.ci].appendChild(this.cesuffix[0]);
	}
});

var Slimbox=(function(){var F=window,n=Browser.Engine.trident4,u,g,G=-1,o,w,E,v,y,M,s,m={},t=new Image(),K=new Image(),I,a,h,q,J,e,H,c,A,L,x,i,d,C;F.addEvent("domready",function(){$(document.body).adopt($$(I=new Element("div",{id:"lbOverlay",events:{click:D}}),a=new Element("div",{id:"lbCenter"}),H=new Element("div",{id:"lbBottomContainer"})).setStyle("display","none"));h=new Element("div",{id:"lbImage"}).injectInside(a).adopt(q=new Element("div",{styles:{position:"relative"}}).adopt(J=new Element("a",{id:"lbPrevLink",href:"#",events:{click:B}}),e=new Element("a",{id:"lbNextLink",href:"#",events:{click:f}})));c=new Element("div",{id:"lbBottom"}).injectInside(H).adopt(new Element("a",{id:"lbCloseLink",href:"#",events:{click:D}}),A=new Element("div",{id:"lbCaption"}),L=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}))});function z(){var N=F.getScroll(),O=F.getSize();$$(a,H).setStyle("left",N.x+(O.x/2));if(v){I.setStyles({left:N.x,top:N.y,width:O.x,height:O.y})}}function l(N){["object",n?"select":"embed"].forEach(function(P){Array.forEach(document.getElementsByTagName(P),function(Q){if(N){Q._slimbox=Q.style.visibility}Q.style.visibility=N?"hidden":Q._slimbox})});I.style.display=N?"":"none";var O=N?"addEvent":"removeEvent";F[O]("scroll",z)[O]("resize",z);document[O]("keydown",p)}function p(O){var N=O.code;return u.closeKeys.contains(N)?D():u.nextKeys.contains(N)?f():u.previousKeys.contains(N)?B():false}function B(){return b(w)}function f(){return b(E)}function b(N){if(N>=0){G=N;o=g[N][0];w=(G||(u.loop?g.length:0))-1;E=((G+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";m=new Image();m.onload=k;m.src=o}return false}function k(){a.className="";d.set(0);h.setStyles({backgroundImage:"url("+o+")",display:""});q.setStyle("width",m.width);$$(q,J,e).setStyle("height",m.height);A.set("html",g[G][1]||"");L.set("html",(((g.length>1)&&u.counterText)||"").replace(/{x}/,G+1).replace(/{y}/,g.length));if(w>=0){t.src=g[w][0]}if(E>=0){K.src=g[E][0]}M=h.offsetWidth;s=h.offsetHeight;var P=Math.max(0,y-(s/2)),N=0,O;if(a.offsetHeight!=s){N=i.start({height:s,top:P})}if(a.offsetWidth!=M){N=i.start({width:M,marginLeft:-M/2})}O=function(){H.setStyles({width:M,top:P+s,marginLeft:-M/2,visibility:"hidden",display:""});d.start(1)};if(N){i.chain(O)}else{O()}}function j(){if(w>=0){J.style.display=""}if(E>=0){e.style.display=""}C.set(-c.offsetHeight).start(0);H.style.visibility=""}function r(){m.onload=$empty;m.src=t.src=K.src=o;i.cancel();d.cancel();C.cancel();$$(J,e,h,H).setStyle("display","none")}function D(){if(G>=0){r();G=w=E=-1;a.style.display="none";x.cancel().chain(l).start(0)}return false}Element.implement({slimbox:function(N,O){$$(this).slimbox(N,O);return this}});Elements.implement({slimbox:function(N,Q,P){Q=Q||function(R){return[R.href,R.title]};P=P||function(){return true};var O=this;O.removeEvents("click").addEvent("click",function(){var R=O.filter(P,this);return Slimbox.open(R.map(Q),R.indexOf(this),N)});return O}});return{open:function(P,O,N){u=$extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},N||{});x=new Fx.Tween(I,{property:"opacity",duration:u.overlayFadeDuration});i=new Fx.Morph(a,$extend({duration:u.resizeDuration,link:"chain"},u.resizeTransition?{transition:u.resizeTransition}:{}));d=new Fx.Tween(h,{property:"opacity",duration:u.imageFadeDuration,onComplete:j});C=new Fx.Tween(c,{property:"margin-top",duration:u.captionAnimationDuration});if(typeof P=="string"){P=[[P,O]];O=0}y=F.getScrollTop()+(F.getHeight()/2);M=u.initialWidth;s=u.initialHeight;a.setStyles({top:Math.max(0,y-(s/2)),width:M,height:s,marginLeft:-M/2,display:""});v=n||(I.currentStyle&&(I.currentStyle.position!="fixed"));if(v){I.style.position="absolute"}x.set(0).start(u.overlayOpacity);z();l(1);g=P;u.loop=u.loop&&(g.length>1);return b(O)}}})();
