﻿<!--

var herstellerAuswahl = '';
var anbieterAuswahl = '';
var subkatAuswahl = '';

var mail_info_de = "info|||||testeo@de";
var mail_werbung_de = "werbung|||||testeo@de";

var mail_info_pl = "info|||||testeo@pl";
var mail_werbung_pl = "werbung|||||testeo@pl";

var mail_info_uk = "info|||||testeo@co.uk";
var mail_advertisement_uk = "advertisement|||||testeo@co.uk";

var mail_infomaas_de = "info|||||ra-maas@de";

function fncMail(adr) {
	parent.location='mailto:' + adr;
}

function fncReplAndMail(adr) {
	adr = adr.replace('@','.');
	fncMail(adr.replace('|||||','@'));
}

function fncReplAndShow(adr) {
   adr = adr.replace('@','.');
   adr = adr.replace('|||||','@');
   document.write(adr)
}

function showTopMenuKat(id) {
	document.getElementById('topMenuKats_' + id).style.display = "";
	for(var i = 1; i <= 6; i++) {
		if(i != id) {
			document.getElementById('topMenuKats_' + i).style.display = "none";	
		}
	}
}
function hideTopMenuKat(id) {
	document.getElementById('topMenuKats_' + id).style.display = "none";
}
function lockTopMenuKat() {
	topMenuMouseOnMenu = true;	
}
function releaserTopMenuKat() {
	topMenuMouseOnMenu = false;
}
function showCountryMenu() {
	document.getElementById('divCountryMenu').style.display = "";
}
function hideCountryMenu() {
	document.getElementById('divCountryMenu').style.display = "none";
}
function countPids(strPids) {
	var counter = 0;
	for(var i = 0; i < strPids.length; i++) {
		if(strPids.charAt(i) == '.') {
			counter += 1;
		}
	}
	return counter;
}
function pvShowInfoLayer() {
	var pvInfoLayer = document.getElementById("pvInfoLayer")
	if (pvInfoLayer != null) {
		pvInfoLayer.style.visibility = "visible";
		pvInfoLayer.style.height = "2500px";
	}
	window.setTimeout("pvHideInfoLayer()", 2000);
}
function pvHideInfoLayer() {
	var pvInfoLayer = document.getElementById("pvInfoLayer")
	if (pvInfoLayer != null) {
		pvInfoLayer.style.visibility = "hidden";
		pvInfoLayer.style.height = "0px";
	}
}
function TogglePVLayer(layerName) {
	if(document.forms["formPV"].elements[layerName]) {
		if(document.forms["formPV"].elements[layerName].checked == true) {
			//HidePVLayer(layerName);
		} else {
			//ShowPVLayer(layerName);	
		}
	}
}
function ShowPVLayer(layerName) {
	if(document.forms["formPV"].elements[layerName]) {
		document.forms["formPV"].elements[layerName].checked = true;
	}
}
function HidePVLayer(layerName) {
	if(document.forms["formPV"].elements[layerName]) {
		document.forms["formPV"].elements[layerName].checked = false;
	}
}
function hidePVHinweis(id) {
	document.getElementById(id).style.display = "none";
}
function toggleProduktVergleich(layerName,idOfPVDiv, prodfoto, bezeichnung, pid) {
	if(document.forms["formPV"].elements[layerName]) {
		if(document.forms["formPV"].elements[layerName].checked == true) {
			if(appendProduktVergleich(idOfPVDiv, prodfoto, bezeichnung, pid) == "ok") {
				document.forms["formPV"].elements[layerName].checked = true;
				document.getElementById('PVHinweis' + pid).style.display = "";
				window.setTimeout('hidePVHinweis(\'PVHinweis' + pid + '\')',2000);
			} else {
				document.forms["formPV"].elements[layerName].checked = false;			
			}
		} else {
			delPVProduct('testeopv',pid);
			document.forms["formPV"].elements[layerName].checked = false;
			document.getElementById('PVHinweis' + pid).style.display = "none";			
		}
	}
}
//setzt ein produkt in den produktvergleich
//prueft vorher, ob produkt schon im produktvergleich vorhanden
function appendProduktVergleich(idOfPVDiv, prodfoto, bezeichnung, pid) {
	var result = "error"
	if(countPids(getCookie('testeopv')) < 10) {
		if(!(getCookie('testeopv').indexOf(pid+'.') >= 0)) {
			setCookie('testeopv', pid);
			var str = '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"150\">'
			str += '<tr><td bgcolor=\"ffffff\"><img src=\"./images/pixel.gif\" height=\"1\" width=\"1\"></td><td bgcolor=\"ffffff\"><img src=\"./images/pixel.gif\" height=\"1\" width=\"39\"></td><td><img src=\"./images/pixel.gif\" height=\"1\" width=\"90\"></td><td><img src=\"./images/pixel.gif\" height=\"1\" width=\"20\"></td></tr>'
			str += '<tr><td bgcolor=\"ffffff\"><img src=\"./images/pixel.gif\" height=\"40\" width=\"1\"></td>'
			str += '<td bgcolor=\"ffffff\" align=\"center\" valign=\"middle\">'
			str += '<img src=\"' + prodfoto + '\"">'
			str += '</td>'
			str += '<td align=\"left\" valign=\"top\" style=\"padding-top:5px;padding-left:5px;\"><div style=\"width:85px;max-width:85px;overflow:hidden\"><b><span class=\"WHITE_TEXT\">' + bezeichnung.substring(0,23) + '</span></b></div></td>'
			str += '<td align=\"right\" valign=\"top\" style=\"padding-left:3px;padding-right:7px;padding-top:7px\"><img onClick=\"javascript:deleteCookieValueReload(\'testeopv\',' + pid +')\" src=\"./images/pv_prod_off.gif\" width=\"10\" height=\"9\" border=\"0\"></td>'
			str += '</tr>'
			str += '</table>'
			document.getElementById(idOfPVDiv).innerHTML += str;
			result = "ok";
			if(document.forms["formPV"]) {
				if(document.forms["formPV"].elements['layerPVChecked' + pid]) {
					document.forms["formPV"].elements['layerPVChecked' + pid].checked = true;
					
				}
				if(document.getElementById('PVHinweis' + pid)) {
					document.getElementById('PVHinweis' + pid).style.display = "";
					window.setTimeout('hidePVHinweis(\'PVHinweis' + pid + '\')',2000);
				}
			}
		}
		checkPVButtons();
	} else {
		alert('Sie können nur maximal 10 Produkte in den Produktvergleich legen!');
	}
	return result;
}
//sorgt dafuer, dass Buttons auf dem Produktvergleich nur angezeigt werden, wenn es Sinn mach
//z.B. "Liste loeschen" wird nur angezeigt, wenn mind. 1 Produkt im PV
function checkPVButtons() {
	if(!(getCookie('testeopv').length > 0)) {
		document.getElementById('ddProduktVergleichBox').style.display = "none";		
		//document.getElementById('pvdellist').style.visibility = "hidden";
		document.getElementById('PVinfoZiehen').style.display = "inline";					
		document.getElementById('pvcompare').style.visibility = "hidden";
		document.getElementById('pvlinie').style.backgroundColor = "#5E697B";	
	} else {	
		document.getElementById('ddProduktVergleichBox').style.display = "inline";
		//document.getElementById('pvdellist').style.visibility = "visible";
		document.getElementById('PVinfoZiehen').style.display = "none";							
		document.getElementById('pvcompare').style.visibility = "visible";		
		document.getElementById('pvlinie').style.backgroundColor = "#FFFFFF";			
	}
}
//loescht ein Produkt vom PV
function delPVProduct(cookie, value) {
	deleteCookieValueReload(cookie, value);
	checkPVButtons();
}
function clear_main_suche_text() {
	if(document.suche_main && document.suche_main.suche) {
		if(document.forms['suche_main'].suche.value.indexOf('...') > 0) {
	 		document.forms['suche_main'].suche.value = '';
		}
	}
}
function focus_main_suche_text() {
	if(document.suche_main && document.suche_main.suche) {
		document.suche_main.suche.focus();
	}
}
function clear_klein_suche_text() {
	if(document.suche_klein && document.suche_klein.suche) {
 		document.forms['suche_klein'].suche.value = '';
	}
}
//Klappt die Meinungen auf
function showMeinungMehr(id) {
	document.getElementById('meinungmehrdetailsbtn['+id+']').style.display = "none";
   	document.getElementById('meinungmehrdetails['+id+']').style.display = "inline";
}
//Klappt die Beschreibung auf
function showTopBeschreibungMehr(id) {
	document.getElementById('topbeschreibungmehrbtn['+id+']').style.display = "none";
	document.getElementById('topbeschreibungmehr['+id+']').style.display = "inline";
}
//Klappt die Beschreibung auf
function showBeschreibungMehr(id) {
	document.getElementById('beschreibungmehrdetailsbtn['+id+']').style.display = "none";
	document.getElementById('beschreibungmehrdetails['+id+']').style.display = "inline";
	document.getElementById('beschreibungmehrdetailsbtn2['+id+']').style.display = "inline";	
}
//Klappt die Beschreibung auf
function showBeschreibungWeniger(id) {
	document.getElementById('beschreibungmehrdetailsbtn['+id+']').style.display = "inline";	
	document.getElementById('beschreibungmehrdetailsbtn2['+id+']').style.display = "none";
	document.getElementById('beschreibungmehrdetails['+id+']').style.display = "none";
}
//Klappt die Hersteller auf
function showHerstellerMehr() {
	document.getElementById('herstellermehrdetailsbtn').style.display = "none";
   	document.getElementById('herstellermehrdetails').style.display = "inline";
}
function setCookie(name, value) {
	if(getCookie(name).indexOf(value) == -1) {
		var curCookie = name + "=" + getCookie(name) + value + "."; 
		document.cookie = curCookie+";path=/";
	  }
}
function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
    	begin = dc.indexOf(prefix);
    	if (begin != 0) {
			return "";
		}
	} else {
    	begin += 2;
	}
  	var end = document.cookie.indexOf(";", begin);
  	if (end == -1) {
    	end = dc.length;
	}
  	return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name) {
	if (getCookie(name)) {
    	document.cookie = name + "=" + "; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT";
  	}
}
function deleteCookieValue(name, value) {
	if (getCookie(name)) {
		var newVals = "";
	  	var curVals = getCookie(name);
	  	newVals = curVals.replace((value + "."), "");
	  	document.cookie = name + "=" + escape(newVals)+";path=/";
    }
}
function deleteCookieReload(name) {
	if (getCookie(name)) {
    	document.cookie = name + "=" + "; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT";
		location.reload();
  	}
}
function deleteCookieValueReload(name, value) {
	if (getCookie(name)) {
		var newVals = "";
	  	var curVals = getCookie(name);
	  	newVals = curVals.replace((value + "."), "");
	  	document.cookie = name + "=" + escape(newVals)+";path=/";
		location.reload();
    }
}
//Schreibt URLs um, sodass Sonderzeichen ersetzt werden
function cleanLinkString(str) {
	var strTemp
	strTemp = str.replace(/ä/g,'ae');
	strTemp = strTemp.replace(/ /g,'-');
	strTemp = strTemp.replace(/ö/g,'oe');
	strTemp = strTemp.replace(/ü/g,'ue');
	strTemp = strTemp.replace(/Ä/g,'Ae');
	strTemp = strTemp.replace(/Ö/g,'Oe');
	strTemp = strTemp.replace(/Ü/g,'Ue');
	strTemp = strTemp.replace(/ß/g,'ss');
	strTemp = strTemp.replace(/\s/g,'-');
	strTemp = strTemp.replace(/ /g,'-');	
	strTemp = strTemp.replace(/\+/g,'');
	strTemp = strTemp.replace(/\\/g,'');
	strTemp = strTemp.replace(/|/g,'');
	strTemp = strTemp.replace(/&/g,'');
	strTemp = strTemp.replace(/\*/g,'');
	strTemp = strTemp.replace(/€/g,'EUR');
	strTemp = strTemp.replace(/#/g,'-');
	strTemp = strTemp.replace(/\'\'/g,'');
	strTemp = strTemp.replace(/\'/g,'');
	strTemp = strTemp.replace(/\//g,'-');
	strTemp = strTemp.replace(/\(/g,'');
	strTemp = strTemp.replace(/\)/g,'');
	strTemp = strTemp.replace(/:/g,'');
	strTemp = strTemp.replace(/;/g,'');
	strTemp = strTemp.replace(/,/g,''),
	strTemp = strTemp.replace(/</g,'lower');
	strTemp = strTemp.replace(/>/g,'greater');
	strTemp = strTemp.replace(/\\/g,'');
	return strTemp.toLowerCase();
}
function herstellerchange(control) {
	herstellerAuswahl = control.value;
}
function getherstellerauswahl() {
	return cleanLinkString(herstellerAuswahl);
}
function herstellerauswahlclick(newLocation) {
	if(herstellerAuswahl.length > 0) {
		self.location=newLocation;
	}
}
function anbieterchange(control) {
	anbieterAuswahl = control.value;
}
function getanbieterauswahl() {
	return cleanLinkString(anbieterAuswahl);
}
function anbieterauswahlclick(newLocation) {
	if(anbieterAuswahl.length > 0) {
		self.location=newLocation;
	}
}
function subkatchange(control) {
	subkatAuswahl = control.value;
}
function getsubkatauswahl() {
	return cleanLinkString(subkatAuswahl);
}
function subkatauswahlclick(newLocation) {
	if(subkatAuswahl.length > 0) {
		self.location=newLocation;
	}
}
function newBewertungLevel(divid, level, levelfield) {
	var sternkette = '';
	var counter = 1;
	for(var i = 0; i < level; i++) {
		sternkette += '<img onclick="newBewertungLevel(\'' + divid + '\',' + counter + ',\'' + levelfield + '\')" src="./images/stern.gif" border="0">';
		counter++;
	}
	for(var i = 0; i < (5-level); i++) {
		sternkette += '<img onclick="newBewertungLevel(\'' + divid + '\',' + counter + ',\'' + levelfield + '\')" src="./images/stern_ausgegraut.gif" border="0">';
		counter++;
	}		
	document.getElementById(divid).innerHTML = sternkette;	
	document.getElementById(levelfield).value = level;	
}
function showMeinungFormOptions(box_id, new_src) {
	document.getElementById(box_id).src = new_src;			
}
function hideFormOptions(box_id) {
	document.getElementById(box_id).src = "";		
}
function pv_open_row(strRow) {
	if(document.getElementById('pv_controlimg_' + strRow)) {
		document.getElementById('pv_controlimg_' + strRow).src = 'http://www.testeo.de/images/arrowup_m.gif';
		document.getElementById('pv_controlimg_' + strRow)["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');   				
	}
	if(document.getElementById('pv_controltext_' + strRow)) {
		document.getElementById('pv_controltext_' + strRow)["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');		
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_controltextk' + i + '_' + strRow)) {
			document.getElementById('pv_controltextk' + i + '_' + strRow)["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');	  
		}
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_controltextk' + i + 'i_' + strRow)) {
			document.getElementById('pv_controltextk' + i + 'i_' + strRow)["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');	  
		}
	}
	if(document.getElementById('pv_container_' + strRow)) {
		document.getElementById('pv_container_' + strRow).style.display = '';	
	}
}
function pv_close_row(strRow) {
	if(document.getElementById('pv_controlimg_' + strRow)) {
		document.getElementById('pv_controlimg_' + strRow).src = 'http://www.testeo.de/images/arrowdown_m.gif';
		document.getElementById('pv_controlimg_' + strRow)["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');			
	}
	if(document.getElementById('pv_controltext_' + strRow)) {
		document.getElementById('pv_controltext_' + strRow)["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');   		
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_controltextk' + i + '_' + strRow)) {
			document.getElementById('pv_controltextk' + i + '_' + strRow)["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');   
		}
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_controltextk' + i + 'i_' + strRow)) {
			document.getElementById('pv_controltextk' + i + 'i_' + strRow)["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');  
		}
	}
	if(document.getElementById('pv_container_' + strRow)) {
		document.getElementById('pv_container_' + strRow).style.display = 'none';	
	}
}
function click_out(obj,aid,url) {
	obj.href = 'http://www.testeo.de/anbclick.aspx?aid=' + aid + '&url=' + url;
}
// -->