

var flgAktiv = null;

Array.prototype.in_array = function(needle) {
	for(var i=0; i < this.length; i++) if(this[ i] === needle) return true;
	return false;
}


var SearchFewo = {
	strAjaxScriptCategoryPath 	: '/inc.fewoFilter.ajax',
	strForm						: '',
	flgUpdate					: true,
	flgChangeClickAktiv			: false,
	strDate						: '',
	strDauer					: '',
	updateList : function(strFormName){
		this.strForm = strFormName;
		this.flgUpdate = false;
		
		if(flgAktiv == null){
			flgAktiv = setInterval("SearchFewo.getList()",1000);	
		}
	},
	getList : function (){
		if(this.flgUpdate == false){
			this.flgUpdate = true;
		}else {
			window.clearInterval(flgAktiv);
			flgAktiv = null;
			params = this.getFormData();
			
			var strFormName = this.strForm;
			
			this.showLoaderGif();
			
			var url = url_adress + '/inc.fewoFilter.ajax';
			var daten 	= 'Ajax=1'+params;
			var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: daten,
				onComplete: function(transport){
					if(200 == transport.status){
						xml = transport.responseXML;
						SearchFewo.setDetails(xml,strFormName);	
					}
				}
			});
			
		}
	},
	getArticleList : function(strFormName,site){
		
		this.strForm = strFormName;
		params = this.getFormData();
		
		this.showLoaderGif();
		
		
		pos = cumulativeOffset(document.getElementById('articleLines'));
		
		var width 	= document.getElementById('articleLines').offsetWidth || 0;
		var height 	= document.getElementById('articleLines').offsetHeight || 0;
		
		document.getElementById('warte_container').style.top 	= pos[1]+'px';
		document.getElementById('warte_container').style.left 	= pos[0]+'px';
		
		document.getElementById('warte_container').style.width 	= width+'px';
		document.getElementById('warte_container').style.height	= height+'px';
		
		document.getElementById('warte_container').style.visibility = 'visible';
		document.getElementById('warte_container').style.display 	= 'block';
		
		objThis = this;
		var url = url_adress + '/inc.FewoArticleList.ajax/';
		var daten 	= 'page='+site+params;
		var myAjax = new Ajax.Request(
		url, 
		{
			method: 'get', 
			parameters: daten,
			onComplete: function(transport){
				
				if(200 == transport.status){
					objThis.setArticleList(transport.responseText,strFormName);
				}
			}
		});
		
	},
	getFormData : function(){
		var daten = '';
		this.flgChangeClickAktiv 		= false;
		
		/**
		*Formular durchlaufen und alle Daten sammeln
		*/
		for(var i= 0, l = document.forms[this.strForm].elements.length; i < l; ++i){
		
			daten= daten +'&'+document.forms[this.strForm].elements[i].name+'=';
			if(document.forms[this.strForm].elements[i].type == 'checkbox'){
				if(document.forms[this.strForm].elements[i].checked == true){
					this.flgChangeClickAktiv = true;
					daten= daten+''+document.forms[this.strForm].elements[i].value;
				}
			}else if(document.forms[this.strForm].elements[i].type == 'select-one') {
			
				if(	document.forms[this.strForm].elements[i].value != '' &&
					document.forms[this.strForm].elements[i].name.indexOf('filter') > -1	
				){
					this.flgChangeClickAktiv = true;
					
				}else if(	document.forms[this.strForm].elements[i].value != '' &&
							document.forms[this.strForm].elements[i].name.indexOf('dauer') > -1
				){
					if(this.strDauer != document.forms[this.strForm].elements[i].value){
						this.flgChangeClickAktiv = true;	
						this.strDauer = document.forms[this.strForm].elements[i].value;
					}
				}
				daten= daten+''+encodeURIComponent(document.forms[this.strForm].elements[i].value);
			
			}else if(document.forms[this.strForm].elements[i].type == 'text'){
				if(	document.forms[this.strForm].elements[i].value != '' &&
					document.forms[this.strForm].elements[i].name.indexOf('from_datum') > -1 
				){
					
					if(document.forms[this.strForm].cid_fewo.value > 0 ){
						if(this.strDate != document.forms[this.strForm].elements[i].value){
							this.strDate = document.forms[this.strForm].elements[i].value;
							this.flgChangeClickAktiv = true;					
						}
					}
				}
				
				daten = daten+''+document.forms[this.strForm].elements[i].value;
				
			
			} else {
				
				if(	document.forms[this.strForm].elements[i].name == 'from' ||
					document.forms[this.strForm].elements[i].name == 'to'	
				){
					if(document.forms[this.strForm].cid_fewo.value > 0 ){
						daten = daten+''+document.forms[this.strForm].elements[i].value;
					}
				} else {
				
					daten = daten+''+document.forms[this.strForm].elements[i].value;
				}
			}
		}
		return daten;
	},
	setArticleList : function(text,strFormName){
		this.hideLoaderGif();
		
		window.scrollTo(0,0);
		
		my_Json = eval('(' + text + ')');
		
		var arrMenu = new Array();
		var z = arrMenu.length;
		
		var paramsForm = this.getFormData();
		
		// Menue 
		for(menus in my_Json.menu){
			if(menus == 'menu'){
				for(site in my_Json.menu[menus]){
					arrMenu[z] 			= new Object();
					arrMenu[z]['url']	= my_Json.menu[menus][site].url;
					arrMenu[z]['active']= my_Json.menu[menus][site].active;
					arrMenu[z]['id']	= my_Json.menu[menus][site].id;
					arrMenu[z]['page']	= my_Json.menu[menus][site].page;
					
					if(arrMenu[z]['active'] != 'null'){
						var active_page = arrMenu[z]['page'];
					}
					
					z++;
				}
			}
		}

		
		// Anzahl der Treffer und Begin und End der Artikel
		var beginOfshownArticle = my_Json.article.beginOfshownArticle;
		var endOfshownArticle 	= my_Json.article.endOfshownArticle;
		var totalcount			= my_Json.article.totalcount;
		var page				= my_Json.article.page;
		var intPageSize			= my_Json.article.intPageSize;
		
		var laenge = document.getElementById('articleLines').childNodes.length-1;
		
		
		
		document.getElementById('articleLines').innerHTML = '';
		
		/*for(var b=0; b < laenge; b++){
			if(document.getElementById('articleLines').childNodes[0].id != 'warte_container'){
				document.getElementById('articleLines').removeChild(document.getElementById('articleLines').childNodes[0]);
			}
		}*/
		
		if(totalcount > 0){
			for(sort in my_Json.article.sortLink){
				if(sort == 'active'){
					var sortLink_active		= my_Json.article.sortLink[sort];
				}else if(sort == 'default'){
					var sortLink_default	= my_Json.article.sortLink[sort];
				}else if(sort == 'price'){
					var sortLink_price		= my_Json.article.sortLink[sort];
				}
			}
		
			
			var article = 0

			var endOfshownArticleSite = endOfshownArticle - ( (page-1 ) * intPageSize);
			
			// Artikel aus dem JSON String ermitteln
			do{	
				var titel 		= htmlDecode(my_Json.article.articles[article].title);
				var land  		= my_Json.article.articles[article].location_land;
				
				if( my_Json.article.articles[article].price_standart == 'null'){
					var slot_begin 	= my_Json.article.articles[article].price_duration_begin;
					var slot_end 	= my_Json.article.articles[article].price_duration_end;
					var slot_zusatz	= my_Json.article.articles[article].price_duration_zusatz;
					
					var price_euro = '';
					var price_cent = '';
					for(elemPrice in my_Json.article.articles[article].price){
						if(elemPrice == 'euro' || elemPrice == 'break'){
							price_euro+= my_Json.article.articles[article].price[elemPrice];
						}
						if(elemPrice == 'cent'){
							price_cent+= my_Json.article.articles[article].price[elemPrice];
						}
					}
				}else{
					var slot_begin 	= null;
					var slot_end 	= null;
					var slot_zusatz	= null;
					
					if(my_Json.article.articles[article].price == 'null'){
						var price_euro = '';
						var price_cent = '';
						for(elemPrice in my_Json.article.articles[article].price_standart){
							if(elemPrice == 'euro' || elemPrice == 'break'){
								price_euro+= my_Json.article.articles[article].price_standart[elemPrice];
							}
							if(elemPrice == 'cent'){
								price_cent+= my_Json.article.articles[article].price_standart[elemPrice];
							}
						}
					}else {
						var price_euro = '';
						var price_cent = '';
						for(elemPrice in my_Json.article.articles[article].price){
							if(elemPrice == 'euro' || elemPrice == 'break'){
								price_euro+= my_Json.article.articles[article].price[elemPrice];
							}
							if(elemPrice == 'cent'){
								price_cent+= my_Json.article.articles[article].price[elemPrice];
							}
						}
						
						slot_begin 	= my_Json.article.articles[article].price_duration_begin;
						slot_end 	= my_Json.article.articles[article].price_duration_end;
						slot_zusatz	= my_Json.article.articles[article].price_duration_zusatz;
					}
				}
				var currency 	= htmlDecode(my_Json.article.articles[article].price_currency_html);
				var url			= my_Json.article.articles[article].location_url_erento+paramsForm;
				var regio 		= my_Json.article.articles[article].cat_name;
				var cat_url		= strHomeUrl+my_Json.article.articles[article].world_url+'/'+my_Json.article.articles[article].group_url+'/'+my_Json.article.articles[article].cat_url;
				var group_url	= strHomeUrl+my_Json.article.articles[article].world_url+'/'+my_Json.article.articles[article].group_url+'/';
				var txt 		= htmlDecode(my_Json.article.articles[article].short_text);
				var cat_name	= htmlDecode(my_Json.article.articles[article].cat_name);	
				var group_name	= htmlDecode(my_Json.article.articles[article].group_name);	
				var land_kurz	= my_Json.article.articles[article].location_land_iso;
				var ort			= htmlDecode(my_Json.article.articles[article].location_city);
				var plz			= htmlDecode(my_Json.article.articles[article].location_plz);
				var userId      = my_Json.article.articles[article].uid;
				
				
				var arrProps	= new Array();
				
				// Artikelbild
				if(my_Json.article.articles[article].pic == 'null'){
					var image = 'null';
				}else {
					var image = my_Json.article.articles[article].pic.src;
				}
				
				if(my_Json.article.articles[article].propertys) {
					// Properties 
					for(var p = 0, k = my_Json.article.articles[article].propertys.length; p < k ; ++p){
						if(my_Json.article.articles[article].propertys[p].art == 'select' && my_Json.article.articles[article].propertys[p].property != 'Qualit&auml;t'){
							if(my_Json.article.articles[article].propertys[p].value != '' && my_Json.article.articles[article].propertys[p].value != null){
								z = arrProps.length;
								arrProps[z] 	= new Array();
								arrProps[z][0] 	= my_Json.article.articles[article].propertys[p].property;
								arrProps[z][1] 	= my_Json.article.articles[article].propertys[p].value;
								if(z == 3){
									break;
								}
							}
						}
					}
				}
				// Preis
				if(price_euro == undefined){
					price_euro = '0,';
				}
				if(price_cent == undefined){
					price_cent = '00';
				}
		
				// Artikel der AL hinzufügen
				buildArtikel.setParameter({titel : titel,land : land, price_euro : price_euro, price_cent : price_cent,currency : currency, url: url,regio : regio, cat_url: cat_url, group_url : group_url, txt : txt,   image : image,cat_name : cat_name,group_name : group_name,arrProps : arrProps, slot_begin : slot_begin, slot_end : slot_end, slot_zusatz : slot_zusatz , page : active_page, ort : ort, land_kurz : land_kurz, plz : plz, uid : userId});
	
				buildArtikel.build();
	
				article++;
				
			}while(article < endOfshownArticleSite);
			
			buildMenu.setParameter({begin : beginOfshownArticle,end : endOfshownArticle,total : totalcount, page : page, menu : arrMenu,strForm : strFormName, sortLink_default : sortLink_default, sortLink_price : sortLink_price, sortLink_active : sortLink_active});
			buildMenu.build();
		}else {
			// Leere Artikelliste erstellen
			buildMenu.emptyList();
		}
		
		document.getElementById('warte_container').style.visibility = 'hidden';
		document.getElementById('warte_container').style.display 	= 'none';
	},
	// Details der Eigenschaften über XML Kontainer 
	setDetails : function(xml,strFormName){
		this.hideLoaderGif();
		
		if(xml.childNodes.length > 1){
			data = xml.childNodes[1];
		} else {
			data = xml.childNodes[0];	
		}
		
		// Fewo World Form
		if(strFormName == 'SearchFeWoWorld'){
			for( var i = 0,l = data.getElementsByTagName('countArticle').length; i < l ; ++i){
				if(data.getElementsByTagName('countArticle')[i].childNodes.length > 0){
					/*if(data.getElementsByTagName('countArticle')[i].firstChild.nodeValue > 0){*/
						document.getElementById('FeWoWorldArticleCount').style.visibility = 'visible';
						document.getElementById('previsionArticleCount').innerHTML = data.getElementsByTagName('countArticle')[i].firstChild.nodeValue;					
					/*} else {
						document.getElementById('FeWoWorldArticleCount').style.visibility = 'hidden';
					}*/
				}
			}
			
			var arrElementeForm = new Array();
			
			for(var i = 0, l = document.forms[strFormName].elements.length; i < l ; ++i){
				arrElementeForm.push(document.forms[strFormName].elements[i].name);
			}
			
			for(var i = 0, l = data.childNodes.length; i < l ; ++i){
				if(arrElementeForm.in_array(data.childNodes[i].nodeName) && document.forms[strFormName][data.childNodes[i].nodeName].type == 'select-one'){
					var arrayWerte = new Object();
					for(var e = 0 , k = data.childNodes[i].childNodes.length; e < k; ++e){
						arrayWerte[data.childNodes[i].childNodes[e].nodeName] =  data.childNodes[i].childNodes[e].firstChild.nodeValue;
					}
					for(var e = 0 , k = document.forms[strFormName][data.childNodes[i].nodeName].length; e < k; ++e){
						if(document.forms[strFormName][data.childNodes[i].nodeName].options[e].value > 0){	
							var txt = document.forms[strFormName][data.childNodes[i].nodeName].options[e].text;
							/*var begin = txt.indexOf('(');
							
							if(begin > -1){
								txt = txt.substr(0,begin);
								txt = txt+'('+arrayWerte['wert'+document.forms[strFormName][data.childNodes[i].nodeName].options[e].value]+')';
							}else {
								txt = txt+' ('+arrayWerte['wert'+document.forms[strFormName][data.childNodes[i].nodeName].options[e].value]+')';
							}*/
							
							document.forms[strFormName][data.childNodes[i].nodeName].options[e].text = txt;
						}
					}
				}
			}
			
		}else if(strFormName == 'SearchFewo'){
			var flgCheckFilter = false;
			for(var i = 0, l = data.childNodes.length; i < l ; ++i){
				if(data.childNodes[i].nodeName == 'countArticle'){
					if(this.flgChangeClickAktiv == true){
						document.getElementById('count_countArticle_check').innerHTML = '('+data.childNodes[i].firstChild.nodeValue+')';
						document.getElementById('count_countArticle_select').innerHTML = '('+data.childNodes[i].firstChild.nodeValue+')';
					}else {
						document.getElementById('count_countArticle_check').innerHTML = '('+data.childNodes[i].firstChild.nodeValue+')';
						document.getElementById('count_countArticle_select').innerHTML = '('+data.childNodes[i].firstChild.nodeValue+')';
					}
				}else if(document.forms[strFormName][data.childNodes[i].nodeName].type == 'select-one'){
					var arrayWerte = new Object();
					for(var e = 0 , k = data.childNodes[i].childNodes.length; e < k; ++e){
						arrayWerte[data.childNodes[i].childNodes[e].nodeName] =  data.childNodes[i].childNodes[e].firstChild.nodeValue;
					}
					for(var e = 0 , k = document.forms[strFormName][data.childNodes[i].nodeName].length; e < k; ++e){
						var txt =document.forms[strFormName][data.childNodes[i].nodeName].options[e].text;
						/*var begin = txt.indexOf('(');
						
						if(begin > -1){
							txt = txt.substr(0,begin);
							txt = txt+'('+arrayWerte['wert'+document.forms[strFormName][data.childNodes[i].nodeName].options[e].value]+')';
						}*/
						document.forms[strFormName][data.childNodes[i].nodeName].options[e].text = txt;
					}
				}else if(document.forms[strFormName][data.childNodes[i].nodeName].type == 'checkbox'){
					if(data.childNodes[i].firstChild.firstChild.nodeValue < 1 && document.forms[strFormName][data.childNodes[i].nodeName].checked == false){
						document.getElementById('check_filter_'+document.forms[strFormName][data.childNodes[i].nodeName].name).style.visibility = 'hidden';
						document.getElementById('check_filter_'+document.forms[strFormName][data.childNodes[i].nodeName].name).style.display 	= 'none';
					}else {
						flgCheckFilter = true;
						/*filter = 'count_'+ document.forms[strFormName][data.childNodes[i].nodeName].name;				
						document.getElementById(filter).innerHTML = '('+data.childNodes[i].firstChild.firstChild.nodeValue+')';*/
						
						document.getElementById('check_filter_'+document.forms[strFormName][data.childNodes[i].nodeName].name).style.visibility = 'visible';
						document.getElementById('check_filter_'+document.forms[strFormName][data.childNodes[i].nodeName].name).style.display = 'block';
					}
				}
				
			}
			
			if(flgCheckFilter == true){
				document.getElementById('button_search_check').style.visibility = 'visible';
				document.getElementById('button_search_check').style.display 	= 'block';
			}else {
				document.getElementById('button_search_check').style.visibility = 'hidden';
				document.getElementById('button_search_check').style.display 	= 'none';
			}
		}
	},
	checkLandRegionOrtAnzahl : function(){
		if(document.forms[this.strForm].plz_fewo.value != '' && document.forms[this.strForm].plz_fewo.value != '0'){
			index 	= document.forms[this.strForm].plz_fewo.selectedIndex;
			anzahl 	= document.forms[this.strForm].plz_fewo.options[index].text;
			
			strPosBegin	= anzahl.indexOf('(');
			strPosEnd	= anzahl.indexOf(')');
			count = anzahl.substring(strPosBegin+1,strPosEnd);
			
			
		}else if (document.forms[this.strForm].cid_fewo.value > 0){
			index = document.forms[this.strForm].cid_fewo.selectedIndex;
			anzahl = document.forms[this.strForm].cid_fewo.options[index].text;
			
			strPosBegin	= anzahl.indexOf('(');
			strPosEnd	= anzahl.indexOf(')');
			count = anzahl.substring(strPosBegin+1,strPosEnd);
			
		}else if (document.forms[this.strForm].gid_fewo.value > 0){
			index = document.forms[this.strForm].gid_fewo.selectedIndex;
			anzahl = document.forms[this.strForm].gid_fewo.options[index].text;
			
			strPosBegin	= anzahl.indexOf('(');
			strPosEnd	= anzahl.indexOf(')');
			count = anzahl.substring(strPosBegin+1,strPosEnd);
			
		}
		
		return count;
	},
	showLoaderGif : function(){
		if(this.strForm == 'SearchFeWoWorld'){
			if(document.getElementById('fewo_loader_gif')){
				document.getElementById('fewo_loader_gif').style.visibility 	= 'visible';
				document.getElementById('fewo_loader_gif').style.display 		= 'block';
			}
		}else if(this.strForm == 'SearchFewo'){
			if(document.getElementById('loader_al')){
				document.getElementById('loader_al').style.visibility 	= 'visible';
				document.getElementById('loader_al').style.display 		= '';
			}
		}
	},
	hideLoaderGif : function(){
		
		if(document.getElementById('fewo_loader_gif')){
			document.getElementById('fewo_loader_gif').style.visibility 	= 'hidden';
			document.getElementById('fewo_loader_gif').style.display 		= 'none';
		}
		
		if(document.getElementById('loader_al')){
			document.getElementById('loader_al').style.visibility 	= 'hidden';
			document.getElementById('loader_al').style.display 		= 'none';
		}
		
	}
}


var buildMenu = {
	begin 	: 1,
	end		: 1,
	total	: 1,
	page	: 1,
	menu	: new Array(),
	activePage	: 1,
	lastPage	: 0,
	strForm		: '',
	sortLink_default : '',
	sortLink_price : '',
	sortLink_active : '',
	overrides : [
	'begin',
	'end',
	'total',
	'page',
	'menu',
	'strForm',
	'sortLink_default',
	'sortLink_price',
	'sortLink_active'
	],
	setParameter : function(params){
		for (var i = 0; i < buildMenu.overrides.length; i++) {
			var name = buildMenu.overrides[i];
			this[name] = params && typeof params[name] != 'undefined' ?
				params[name] : buildMenu[name];
		}
	},
	emptyList: function (){
		this.deleteCells();
	
		document.getElementById('shown_article_top').innerHTML = '';
		document.getElementById('shown_article_bottom').innerHTML = '';
		
		div = document.getElementById('null_Treffer').cloneNode(true);
		div.style.display 		= 'block';
		div.style.visibility 	= 'visible';
		
		this.deleteCells();
		this.hideBack();
		this.hideNext();
		
		//document.getElementById('articleLines').insertBefore(div,document.getElementById('warte_container'));
		document.getElementById('articleLines').appendChild(div);
	},
	build : function (){
		switch(intCountryId){
			case '3':
			case '17':
			case '22':
				var txt_von = 'von';
				break;
			case '8':
			case '28':
				var txt_von = 'from';
				break;
			default:
				var txt_von = 'von';
				break;
		}

		document.getElementById('shown_article_top').innerHTML = this.begin+' - '+this.end+' '+txt_von+' '+this.total;
		document.getElementById('shown_article_bottom').innerHTML = this.begin+' - '+this.end+' '+txt_von+' '+this.total;
		
		this.deleteCells();
		
		if(this.menu.length > 1){
		
			for(var i = 0,l = this.menu.length; i < l ; ++i){
				
				td = document.getElementById('menu_seiten');
				if(this.menu[i]['active'] == '1'){
					var span 	= document.createElement('SPAN');
					var txt 	= document.createTextNode(this.menu[i]['page']);
					span.className = 'span_bold';
					span.appendChild(txt);
					td.appendChild(span);
					this.activePage = this.menu[i]['page'];
				} else {
					var txt 	= document.createTextNode(this.menu[i]['page']);
					a = document.createElement('A');
					a.className = 'blaetter hand';
					a.onclick	= new Function("getArticleList('"+this.strForm+"','"+this.menu[i]['page']+"');");
					b = document.createElement('B');
					
					b.appendChild(txt);
					a.appendChild(b);
					td.appendChild(a);
				}
				
				this.lastPage = this.menu[i]['page'];
				
				var span_pipe 	= document.createElement('SPAN');
				span_pipe.innerHTML = '&nbsp;|&nbsp;&nbsp;';
				td.appendChild(span_pipe);
			}

			td.style.display 	= 'block';
			td.style.visibility = 'visible';
			
			if(this.activePage > 1){
				this.showBack();
				this.buildPreviousPage(this.activePage-1);
				this.showPipe();
			}else if(this.activePage <= 1){
				this.hideBack();
				this.hidePipe();
			}
			
			if(this.activePage == this.lastPage){
				this.hideNext();
				this.hidePipe();
			}else {
				this.buildNextPage(this.activePage*1+1);
				this.showNext();
			}
		}else {
			this.hideNext();
			this.hidePipe();
		}
		
		this.PriceTopTd();
	},
	PriceTopTd : function(){
		
		if(this.sortLink_price != '') {
			if(this.sortLink_active == 'price' || this.sortLink_active == 'default'){
				document.getElementById('pricedesc').style.visibility 		= 'hidden';
				document.getElementById('pricedesc').style.display 			= 'none';
			
				document.getElementById('price').style.visibility 			= 'visible';
				document.getElementById('price').style.display 				= 'block';
				document.getElementById('sort').value 						= 'price';
				document.getElementById('price').onclick = new Function("sortRichtung('"+this.strForm+"','"+this.activePage+"','pricedesc');");
				
				for(var i = 0, l = document.getElementById('price').getElementsByTagName('A').length; i < l ; ++i){
					document.getElementById('price').getElementsByTagName('A')[i].href = "javascript:void(0);";
				}
				
				
				this.hideNormalPreisTd();
				
				
				
				if(document.getElementById('preis_sort_td')){
					$('preis_sort_td').stopObserving('mouseover', ArticleList.showLayerOverLib);
					$('preis_sort_td').onmouseover = new Function("return nd();");
				}
				
			}else if(this.sortLink_active == 'pricedesc'){
				document.getElementById('price').style.visibility 		= 'hidden';
				document.getElementById('price').style.display 			= 'none';
				
				document.getElementById('pricedesc').style.visibility 	= 'visible';
				document.getElementById('pricedesc').style.display 		= 'block';
				document.getElementById('sort').value 					= 'pricedesc';
				document.getElementById('pricedesc').onclick = new Function("sortRichtung('"+this.strForm+"','"+this.activePage+"','price');");
				
				for(var i = 0, l = document.getElementById('pricedesc').getElementsByTagName('A').length; i < l ; ++i){
					document.getElementById('pricedesc').getElementsByTagName('A')[i].href = "javascript:void(0);";
				}
				
				this.hideNormalPreisTd();
			
			
			
				if(document.getElementById('preis_sort_td')){
					$('preis_sort_td').stopObserving('mouseover',ArticleList.showLayerOverLib);
					$('preis_sort_td').onmouseover = new Function("return nd();");
				}
			}	
		}else {
			document.getElementById('sort').value 				= 'default';
			this.showNormalPreisTd();
		}
	},
	hideNormalPreisTd : function(){
		document.getElementById('preis_td_default').style.visibility 	= 'hidden';
		document.getElementById('preis_td_default').style.display 		= 'none';
	},
	showNormalPreisTd : function(){
		document.getElementById('price').style.visibility 			= 'hidden';
		document.getElementById('price').style.display 				= 'none';
		
		document.getElementById('pricedesc').style.visibility 		= 'hidden';
		document.getElementById('pricedesc').style.display 			= 'none';
	
		document.getElementById('preis_td_default').style.visibility 	= 'visible';
		document.getElementById('preis_td_default').style.display 		= 'block';
		
	},
	deleteCells : function(){
		if(document.getElementById('menu_seiten')){
			document.getElementById('menu_seiten').innerHTML = '';
		}
	},
	buildPreviousPage : function(site){
		for(var i = 0, l = document.getElementById('back_bottom').getElementsByTagName('A').length; i < l; ++i){
			document.getElementById('back_bottom').getElementsByTagName('A')[i].href = "javascript:void(0);";
			document.getElementById('back_bottom').getElementsByTagName('A')[i].onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
		}
		
		for(var i = 0, l = document.getElementById('back_arrow_bottom').getElementsByTagName('A').length; i < l; ++i){
			document.getElementById('back_arrow_bottom').getElementsByTagName('A')[i].href = "javascript:void(0);";
			document.getElementById('back_arrow_bottom').getElementsByTagName('A')[i].onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
		}
		
		if(document.getElementById('back_head_link')) {
			document.getElementById('back_head_link').onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
			document.getElementById('back_head_link').href = "javascript:void(0);";
		}
		
	},
	buildNextPage : function(site){
		for(var i = 0, l = document.getElementById('next_bottom').getElementsByTagName('A').length; i < l; ++i){
			document.getElementById('next_bottom').getElementsByTagName('A')[i].href = "javascript:void(0);";
			document.getElementById('next_bottom').getElementsByTagName('A')[i].onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
		}
		
		for(var i = 0, l = document.getElementById('next_arrow_bottom').getElementsByTagName('A').length; i < l; ++i){
			document.getElementById('next_arrow_bottom').getElementsByTagName('A')[i].href = "javascript:void(0);";
			document.getElementById('next_arrow_bottom').getElementsByTagName('A')[i].onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
		}
		
		if(document.getElementById('next_head_link')) {
			document.getElementById('next_head_link').onclick = new Function("getArticleList('"+this.strForm+"','"+site+"');");
			document.getElementById('next_head_link').href = "javascript:void(0);";
		}
		
	},
	showBack : function(){
		if(document.getElementById('back_bottom')){
			document.getElementById('back_bottom').style.visibility 		= 'visible';
		}

		if(document.getElementById('back_arrow_bottom')){
			document.getElementById('back_arrow_bottom').style.visibility 	= 'visible';
		}
	
		if(document.getElementById('back_head')){
			document.getElementById('back_head').style.visibility 			= 'visible';
			document.getElementById('back_head').style.display 				= 'inline';
		}
	},
	hideBack : function(){
		if(document.getElementById('back_arrow_bottom')){
			document.getElementById('back_bottom').style.visibility 		= 'hidden';
		}

		if(document.getElementById('back_arrow_bottom')){
			document.getElementById('back_arrow_bottom').style.visibility 	= 'hidden';
		}
		
		if(document.getElementById('back_head')) {
			document.getElementById('back_head').style.visibility 			= 'hidden';
		}
	},
	showNext : function(){
		
		if(document.getElementById('next_arrow_bottom')){		
			document.getElementById('next_arrow_bottom').style.visibility 		= 'visible';
		}

		if(document.getElementById('next_bottom')){
			document.getElementById('next_bottom').style.visibility 			= 'visible';
		}
		
		if(document.getElementById('next_head')) {
			document.getElementById('next_head').style.visibility 			= 'visible';
			document.getElementById('next_head').style.display 				= 'inline';
		}
	},
	hideNext : function(){
		if(document.getElementById('next_arrow_bottom')){			
			document.getElementById('next_arrow_bottom').style.visibility 		= 'hidden';
		}

		if(document.getElementById('next_bottom')){
			document.getElementById('next_bottom').style.visibility 			= 'hidden';
		}
		
		if(document.getElementById('next_head')) {
			document.getElementById('next_head').style.visibility 			= 'hidden';
			document.getElementById('next_head').style.display 				= 'none';
		}
		
		
	},
	showPipe : function(){
		if(document.getElementById('next_back_head_pipe')){
			document.getElementById('next_back_head_pipe').style.visibility = 'visible';
		}
	},
	hidePipe : function(){
		if(document.getElementById('next_back_head_pipe') ) {
			document.getElementById('next_back_head_pipe').style.visibility = 'hidden';
		}
	}
}

/*

*/
var buildArtikel = {
	titel 		: '',
	txt   		: '',
	image 		: '',
	props 		: '',
	regio 		: '',
	land  		: '',
	price_euro 	: '',
	price_cent 	: '',	
	url   		: '',
	currency 	: '',
	cat_url		: '',
	group_url	: '',
	cat_name	: '',
	group_name	: '',
	ort			: '',
	land_kurz	: '',
	plz			: '',
	arrProps	: '',
	slot_begin	: null,
	slot_end	: null,
	slot_zusatz : null,
	page		: null,
	uid			: null,
	overrides : [
	'titel',
	'txt',
	'image',
	'props',
	'regio',
	'land',
	'price_euro',
	'price_cent',
	'currency',
	'url',
	'cat_url',
	'group_url',
	'cat_name',
	'group_name',
	'arrProps',
	'slot_begin',
	'slot_end',
	'slot_zusatz',
	'page',
	'ort',
	'land_kurz',
	'plz',
	'uid',
	],
	setParameter : function(params){
		for (var i = 0; i < buildArtikel.overrides.length; i++) {
			var name = buildArtikel.overrides[i];
			this[name] = params && typeof params[name] != 'undefined' ?
				params[name] : buildArtikel[name];
		}
		
		if(this.txt.length > 113){
			this.txt = this.txt.substr(0,113)+'...';
		}
		
		if(this.titel.length > 70){
			this.titel = this.titel.substr(0,70)+'...';
		}
		
		if(document.getElementById('from').value != '' && document.getElementById('to').value != ''){
			this.url +='&from='+ document.getElementById('from').value+'&to='+document.getElementById('to').value;
		}
		
		if(this.page != null){
			this.url +='&page='+ this.page;
		}
	},	
	build : function (){
		
		var table = document.createElement('TABLE');
		table.setAttribute("cellSpacing","0");
		table.setAttribute("cellPadding","0");
		//table.setAttribute("style","empty-cells: show;");
		table.className = "fewoArtikel";
		
		var tbody = document.createElement('TBODY');
		var tr    = document.createElement('TR');
	
		tr.onmouseover = new Function("overtr(this);");
		tr.onmouseout = new Function("outoftr(this);");
		//tr.setAttribute("style","background-color: rgb(255, 255, 255);");

		

		td = this.buildImageTd();
		tr.appendChild(td);
		
		td = this.buildTitleTd();
		tr.appendChild(td);

		td = this.buildPropsTd();
		tr.appendChild(td);
		
		td_v = this.buildVertralBorderTd();
		tr.appendChild(td_v);
		
		
		td = this.buildLocTd();
		tr.appendChild(td);
		td_v = this.buildVertralBorderTd();
		tr.appendChild(td_v);
		
		td = this.buildPriceTd();
		tr.appendChild(td);
		
		
		
		tbody.appendChild(tr);
		tr = this.buildLastRow();
		tbody.appendChild(tr);
		
		
		
		table.appendChild(tbody);

		document.getElementById('articleLines').className = "fewo_AllArticles";
		//document.getElementById('articleLines').insertBefore(table,document.getElementById('warte_container'));
		document.getElementById('articleLines').appendChild(table);

	},
	buildLastRow : function(){
		var tr = document.createElement('TR');
		var td = document.createElement('TD');
		//td.setAttribute("style","height: 1px; background-color: rgb(204, 204, 204);");
		td.className = "fewo_lastRow";
		
		td.setAttribute("colSpan","7");
		
		tr.appendChild(td);
		
		return tr;
		
	},
	buildVertralBorderTd : function (){
		var td = document.createElement('TD');
		td.className = 'articlelist_verticalborder';
		
		var img = document.createElement('IMG');
		img.src = strBilderUrl + 'spacer.gif';
		
		td.appendChild(img);
		
		return td;
	},
	buildImageTd : function() {
		
		var td = document.createElement('TD');
		td.className = "fewoImageTd";
		
		td.setAttribute("align","left");
		td.onclick = new Function("location.href='"+this.url+"'");
		var div = document.createElement('DIV');
		
		if(this.image != 'null'){
			this.image = strArtBilderUrl + this.image;
			//div.setAttribute("style","height: 90px; background-image: url("+this.image+"); background-repeat: no-repeat; background-position: 5px;");
			div.style.backgroundImage = "url("+this.image+")";
			div.className = "Image";
		} else {
			div.className = 'nopic_small';
			this.image = strBilderUrl + 'sprite_articlelist.png';
			div.style.backgroundImage = "url("+this.image+")";
			div.style.height = "90px";
			
			
		}
		
		
		div.setAttribute("align","left");
		
		
		
		td.appendChild(div);
		
		return td;
	},
	buildTitleTd : function(){
		var td = document.createElement('TD');
		td.className = "fewoTitleTd";
		
		td.setAttribute("align","left");
		td.setAttribute("vAlign","top");
		td.onclick = new Function("location.href='"+this.url+"'");
		
		
		
		var a = document.createElement('A');
		a.title = this.titel;
		a.className = 'artikel';
		a.href = this.url;
		var txt_titel = document.createTextNode(this.titel);
		a.appendChild(txt_titel);
		
		var ln = document.createElement('BR');
		var txt = document.createTextNode(this.txt);
		
		td.appendChild(a);
		td.appendChild(ln);
		td.appendChild(txt);
		
		return td;
	},
	buildPropsTd : function(){
		var td = document.createElement('TD');
		var div = document.createElement('DIV');
		
		
		for(var i = 0, l = this.arrProps.length; i < l; ++i){
			var b1 		= document.createElement('B');
			var ln 		= document.createElement('BR');
			var txt1 	= document.createTextNode(htmlDecode(this.arrProps[i][0])+':');
			var txt2 	= document.createTextNode(htmlDecode(' '+this.arrProps[i][1]));
			b1.appendChild(txt1);
			div.appendChild(b1);
			div.appendChild(txt2);
			div.appendChild(ln);
		}
		
		td.className = 'vam';
		td.setAttribute("align","left");
		td.setAttribute("vAlign","top");
		div.className = "fewo_Props";
		td.appendChild(div);
		
		td.className = "fewo_PropsTd";
		
		//td.setAttribute("style","padding: 5px; cursor: pointer; width: 125px;");
		td.onclick = new Function("location.href='"+this.url+"'");
		
		
		
		//alert(this.arrProps);
		
		
		return td;
	},
	buildLocTd : function(){
		var td = document.createElement('TD');
		var table = document.createElement('TABLE');
		table.setAttribute("width","100%");
		var tbody = document.createElement('TBODY');
		var tr1 = document.createElement('TR');
		var tr2 = document.createElement('TR');
		var img = document.createElement('IMG');
		
		td.setAttribute("align","center");
		td.setAttribute("vAlign","middle");
		//td.setAttribute("style","");
		td.className = "fewo_Loc";
		
		td.onclick = new Function("location.href='"+this.url+"'");
		
		var td1 = document.createElement('TD');
		td1.setAttribute("align","center");
		//td1.setAttribute("style","height: 40px;");
		td1.className = "Locs";
		
        td1.appendChild(
            document.createTextNode(
                this.cat_name +
                ', ' +
                this.group_name
            )
        );
        
        div = document.createElement('DIV');
        div.className = "location";
        
        div.appendChild(
            document.createTextNode(
                this.land_kurz +
                '-' +
                this.plz +
                ' ' +
                this.ort
            )
        );
        td1.appendChild(div);
		
		tr1.appendChild(td1);
		
		var td2 = document.createElement('TD');
		td2.setAttribute("align","center");
		//td2.setAttribute("style","height: 40px;");
		td2.className = "Locs";
		
		
		
		//img.src = this.image;
		//td2.appendChild(img);
		
		tr2.appendChild(td2);
		
		tbody.appendChild(tr1);
		//tbody.appendChild(tr2);
		table.appendChild(tbody);
		
		td.appendChild(table);
		
		return td;
	},
	buildPriceTd : function(){
		switch(intCountryId){
			case '3':
			case '17':
			case '22':
				var txt_ab = 'ab';
				var txt_class_button = 'but_detail_country_3';
				break;
			case '8':
			case '28':
				var txt_ab = 'from';
				var txt_class_button = 'but_detail_country_8';
				break;
			default:
				var txt_ab = 'ab';
				var txt_class_button = 'but_detail_country_3';
				break;
		}
		
		var td = document.createElement('TD');
		td.setAttribute("vAlign","bottom");
		td.setAttribute("align","center");
		//td.setAttribute("style","cursor: pointer; width: 143px;");
		td.className = "PriceTd";
		
		var div = document.createElement('DIV');
		//div.setAttribute("style","width: 142px; height: 80px; padding-bottom: 10px;");
		div.className = "PriceDiv";
				
		var table = document.createElement('TABLE');
		//table.setAttribute("style","height: 100%;");
		table.className = "Price";
		
		table.setAttribute("cellspacing","0");
		table.setAttribute("cellpadding","0");
		
		var tbody = document.createElement('TBODY');
		
		
		
		var tr_inner_div 		= document.createElement('TR');
		var td_inner_div 		= document.createElement('TD');
		td_inner_div.className 	= 'vab';
		td_inner_div.setAttribute("align","center");
		
		// Price Ansicht
			var table_price = document.createElement('TABLE');
			var tbody_price = document.createElement('TBODY');
			
			var tr_price = document.createElement('TR');
			var td_euro_price = document.createElement('TD');
			var td_cent_price = document.createElement('TD');
			
			if(this.price_euro.length > 5 ){
				td_euro_price.className = 'preis_euro_19 td_vert';
			} else {
				td_euro_price.className = 'preis_euro td_vert';
			}

			
			td_euro_price.setAttribute("align","left");
			
			if (this.uid != 516334) {
				if (intCountryId == '8') {
					var txt_euro = document.createTextNode(this.currency+this.price_euro);
				} else {
					var txt_euro = document.createTextNode(this.currency+' '+this.price_euro);
				}
			} else {
				if (intCountryId == '8') {
					var txt_euro = document.createTextNode(txt_ab+' '+this.currency+this.price_euro);
				} else {
					var txt_euro = document.createTextNode(txt_ab+' '+this.currency+' '+this.price_euro);
				}
			}
			td_euro_price.appendChild(txt_euro);
			
			td_cent_price.className = 'preis_cent td_pad_7';
			td_cent_price.setAttribute("align","left");
			var u_cent = document.createElement('U');
			var txt_cent = document.createTextNode(this.price_cent);	
			u_cent.appendChild(txt_cent);
			td_cent_price.appendChild(u_cent);
			
			tr_price.appendChild(td_euro_price);
			tr_price.appendChild(td_cent_price);
			tbody_price.appendChild(tr_price);
			table_price.appendChild(tbody_price);
		// Price Ansicht	
		td_inner_div.appendChild(table_price);
		
		if(this.slot_begin != null && this.slot_end != null){
			if(this.slot_zusatz != null){
				txt_slot = document.createTextNode(this.slot_zusatz);
			}else {
				txt_slot = document.createTextNode(this.slot_begin+' - '+this.slot_end);
			}
			td_inner_div.appendChild(txt_slot);
		}
		
				
		var ln = document.createElement('BR');
		td_inner_div.appendChild(ln);
		
		var a = document.createElement('A');
		a.className = txt_class_button;
		a.style.backgroundImage = "url("+strBilderUrl+"sprite_articlelist.png)";
		//a.setAttribute("style","background-image: url("+strBilderUrl+"sprite_articlelist.png);");
		
		a.title = 'Details';
		
		a.href = this.url;
		
		td_inner_div.appendChild(a);
		tr_inner_div.appendChild(td_inner_div);
		tbody.appendChild(tr_inner_div);
		
		table.appendChild(tbody);
		div.appendChild(table);
		
		td.appendChild(div);
		
		
		
		return td;
		
	},
	buildArtikelLink : function(elem){
		elem.onclick = new Function("location.href='"+this.url+"'");
	}
}


function getArticleList(strName,site) {
	SearchFewo.getArticleList(strName,site);
}

function sortRichtung(strName,site,sort){
	document.getElementById('sort').value = sort;
	getArticleList(strName,site);
}


function htmlDecode(text){
	
	
	text = text.replace(/&amp;#8211;/g,'-');	
	text = text.replace(/&lt;/g,'<');
	text = text.replace(/&gt;/g,'>');
	text = text.replace(/&auml;/g,'ä');
	text = text.replace(/&ouml;/g,'ö');
	text = text.replace(/&uuml;/g,'ü');
	text = text.replace(/&Auml;/g,'Ä');
	text = text.replace(/&Ouml;/g,'Ö');
	text = text.replace(/&Uuml;/g,'Ü');
	text = text.replace(/&szlig;/g,'ß');
	text = text.replace(/&sup2;/g,'²');
	
	
	// Pfund ersetzen
	text = text.replace(/&pound;/g,'£');
	//Eurozeichen
	text = text.replace(/&8364;/g,'€');
	text = text.replace(/&#38;euro;/g,'€');
	text = text.replace(/&amp;euro;/g,'€');
	text = text.replace(/&euro;/g,'€');
	text = text.replace(/&quot;/g,'"');
	text = text.replace(/&apos;/g,'\'');
	text = text.replace(/&amp;nbsp;/g,' ');
	text = text.replace(/&amp;/g,'&');
	

	text = text.replace(/&agrave;/g,'à');
	text = text.replace(/&Agrave;/g,'À');

	text = text.replace(/&aacute;/g,'á');
	text = text.replace(/&Aacute;/g,'À');

	text = text.replace(/&eacute;/g,'é');
	text = text.replace(/&Eacute;/g,'É');
	text = text.replace(/&egrave;/g,'è');
	text = text.replace(/&Egrave;/g,'È');
	text = text.replace(/&ccedil;/g,'Ç');
	text = text.replace(/&Ccedil;/g,'ç');
	
	text = text.replace(/&iacute;/g,'í');
	text = text.replace(/&Iacute;/g,'Í');
	text = text.replace(/&iuml;/g,'ï');
	text = text.replace(/&Iuml;/g,'Ï');
	text = text.replace(/&Ograve;/g,'Ò');
	text = text.replace(/&ograve;/g,'ò');
	text = text.replace(/&Oacute;/g,'Ó');
	text = text.replace(/&oacute;/g,'ó');
	text = text.replace(/&Uacute;/g,'Ú');
	text = text.replace(/&uacute;/g,'ú');
	text = text.replace(/&Ocirc;/g,'Ô');
	text = text.replace(/&ocirc;/g,'ô');
	text = text.replace(/&Acirc;/g,'Â');
	text = text.replace(/&acirc;/g,'â');
	text = text.replace(/&Ucirc;/g,'Û');
	text = text.replace(/&ucirc;/g,'û');
	text = text.replace(/&Oslash;/g,'Ø');
	text = text.replace(/&oslash;/g,'ø');
	text = text.replace(/&aelig;/g,'æ');
	text = text.replace(/&Aelig;/g,'Æ');
	text = text.replace(/&aring;/g,'å');
	text = text.replace(/&Aring;/g,'Å');
	
	
	
		
	return text;

}


//-------------------------------------------------------------------------------------------------------------------------
// URL Parameter auslesen
//-------------------------------------------------------------------------------------------------------------------------

	// get URl-parameter 
	function getValue(name,url){
	   var i=1  //Suchposition in der URL
	   var suche = name+"="
	   while (i<url.length){
	      if (url.substring(i, i+suche.length)==suche){
	         var ende = url.indexOf("&", i+suche.length)
	         ende = (ende>-1) ? ende : url.length
	         var loca = url.substring(i+suche.length, ende)
	         return unescape(loca)
	      }
	      i++
	   }
	   return ""
	}
	
	
	function _setStyle(element, declaration) {
	   if (declaration.charAt(declaration.length-1)==';')
	     declaration = declaration.slice(0, -1);
	   var k, v;
	   var splitted = declaration.split(';');
	   for (var i=0, len=splitted.length; i<len; i++) {
	      k = rzCC(splitted[i].split(':')[0]);
	      v = splitted[i].split(':')[1];
	      eval("element.style."+k+"='"+v+"'");
	
	   }
	 }
	 
//-------------------------------------------------------------------------------------------------------------------------
// Date functions
//-------------------------------------------------------------------------------------------------------------------------	 
	 function checkDateFewo(month, day, year){
		  var monthLength = 
		    new Array(31,28,31,30,31,30,31,31,30,31,30,31);
		
		  if (!day || !month || !year)
		    return false;
		
		  // check for bisestile year
		  if (year/4 == parseInt(year/4))
		    monthLength[1] = 29;
		
		  if (month < 1 || month > 12)
		    return false;
		
		  if (day > monthLength[month-1])
		    return false;
		    
		  if(day < 1)
		  	return false;
		  
		  
		  return true;
	}
	
	function checkDateString(formName,elem){
		// Fehler Format
		var fehler 		= false;
		// Fehler Datum
		var fehlerDate 	= false;
		
		var objDate = new Date();
		var timeNow = objDate.getTime();
		
		
		strDate = document.forms[formName][elem].value;
		
		if(strDate != ''){
			// Datum auf korrekt ueberpruefen
			if(strDate.indexOf('.') > -1){
				var tmp = strDate.split('.');
				if(tmp.length < 3){
					fehler = true;
				} else {
					for(var i = 0 , l = tmp.length; i < l; ++i ){
						if(!is_numeric(tmp[i])){
							fehler = true; 
							break;
						} else {
							if(tmp[i] < 10 && tmp[i].length < 2){
								tmp[i] = '0'+tmp[i];
							}
						}
					}
					
					if(!checkDateFewo(tmp[1],tmp[0],tmp[2])){
						fehlerDate = true;
					}else {
						if(tmp[2].length != 4 ){
							fehler = true;
						}
						
						document.forms[formName][elem].value = tmp[0]+'.'+tmp[1]+'.'+tmp[2];
					}
				}
				
				
			} else {
				fehler = true;
			}
			
			// ueberpruefen ob das Datum auch nicht in der Vergangenheit liegt
			objDateUser = new Date(tmp[2], tmp[1], tmp[0],23,59,0);
			timeUser = objDateUser.getTime();
			
			if(timeNow > timeUser ){
				fehlerDate = true;
			}
			
		
			if(fehlerDate == true){
				/*document.getElementById('datum_nicht_korrekt').style.top 	= pos[1]-40+'px';
				document.getElementById('datum_nicht_korrekt').style.left 	= pos[0]-200+'px';*/
				
				document.getElementById('datum_nicht_korrekt').style.display 		= 'block';
				document.getElementById('datum_nicht_korrekt').style.visibility 	= 'visible';
				
				
				
				
				document.getElementById('closeDatumKorrekt').onclick = new Function("hideDivFehlerMeldung('datum_nicht_korrekt');");
				
				return false;
				
			}else if(fehler == true){
				/*document.getElementById('format_nicht_korrekt').style.top 	= pos[1]-40+'px';
				document.getElementById('format_nicht_korrekt').style.left 	= pos[0]-200+'px';
				*/
				document.getElementById('format_nicht_korrekt').style.display 		= 'block';
				document.getElementById('format_nicht_korrekt').style.visibility 	= 'visible';
				
				document.getElementById('closeFormatKorrekt').onclick = new Function("hideDivFehlerMeldung('format_nicht_korrekt');");
				
				return false;
			}
			
			CalenderArticleListFewo.setMarkierung(tmp[2]+''+tmp[1]+''+tmp[0],'aktiv');
		}
		return true;
	}
	
	function hideDivFehlerMeldung(elem){
		document.getElementById(elem).style.display 		= 'none';
		document.getElementById(elem).style.visibility 	= 'hidden';
	}
	
	
	
	var cumulativeOffset = function(element) {
		
		var valueT = 0, valueL = 0;
		
		do {
			
				valueT += element.offsetTop  || 0;
				
				valueL += element.offsetLeft || 0;
				
				element = element.offsetParent;
			
		} while (element);
		
		return [valueL, valueT];
	
	} 
	
	
	function showToolTip(text){
		if($('from').value == '' || $('to').value == ''){
			return overlib(text,BGCOLOR,'#FF0000',BORDER, 1,FGCOLOR,'#FFFFFF');
		}
	}
	
	function hideToolTip(){
		return nd();
	}

