<!--

var mail_info = "info|||||guenstiger@de";
var mail_cr = "cr|||||hsid@de";
var mail_nvd = "nn|||||hsid@de";
var mail_edv = "edv|||||guenstiger@de";
var mail_foto = "foto|||||guenstiger@de";
var mail_faq = "info|||||guenstiger@de";
var mail_haendlerinfo = "haendlerinfo|||||guenstiger@de";
var mail_hier = "post|||||guenstiger@de";
var mail_hifi = "hifi|||||guenstiger@de";
var mail_info = "info|||||guenstiger@de";
var mail_kontakt = "kontakt|||||guenstiger@de";
var mail_presse = "presse|||||guenstiger@de";
var mail_silke = "silke|||||guenstiger@de";
var mail_tk = "tk|||||guenstiger@de";
var mail_tv = "tv|||||guenstiger@de";
var mail_support = "support|||||guenstiger@de";
var mail_preis = "preis|||||guenstiger@de";
var mail_produkt = "produkt|||||guenstiger@de";
var mail_job = "job|||||guenstiger@de";
var mail_haushalt = "haushalt|||||guenstiger@de";
var mail_tipp = "tipp|||||guenstiger@de";
var mail_pn = "pn|||||guenstiger@de";
var mail_post = "post|||||guenstiger@de";
var mail_toolbar = "toolbar|||||guenstiger@de";
var mail_werbung = "werbung|||||guenstiger@de";
var pvcookie = "gtpvcookie";
var pvcookiedom = "guenstiger.de";

function fncReplAndMail(adr) {
	adr = adr.replace('@','.');
	fncMail(adr.replace('|||||','@'));
}

function fncReplAndShow(adr) {
   adr = adr.replace('@','.');
   adr = adr.replace('|||||','@');
   document.write(adr)
}

function fncMail(adr) {
	parent.location='mailto:' + adr;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

imag = new Array()
	imag[26] = "../bilder/index_tiger_tv1.gif"
	imag[27] = "../bilder/index_tiger_tv_ani.gif"
	imag[28] = "../bilder/index_tiger_telefon1.gif"
	imag[29] = "../bilder/index_tiger_telefon_ani.gif"
	imag[30] = "../bilder/index_tiger_hifi1.gif"
	imag[31] = "../bilder/index_tiger_hifi_ani.gif"
	imag[32] = "../bilder/index_tiger_edv1.gif"
	imag[33] = "../bilder/index_tiger_edv_ani.gif"
	imag[34] = "../bilder/index_tiger_haushalt1.gif"
	imag[35] = "../bilder/index_tiger_haushalt_ani.gif"
	imag[36] = "../bilder/index_tiger_specials1.gif"
	imag[37] = "../bilder/index_tiger_specials_ani.gif"
    
	
function swtch(num,imgname)
{
     imgname.src = imag[num];
}

function LinienMenue(withTd, onOff) {
	if (onOff == 1) {
		withTd.style.borderTopColor= '#EDEDED'; 
		withTd.style.borderBottomColor = '#EDEDED';
	} else {
		withTd.style.borderTopColor= '#000066'; 
		withTd.style.borderBottomColor = '#000066';
	}
}
function LinienMenueSub(withTd, onOff) {
	if (onOff == 1) {
		withTd.style.borderTopColor= '#C1C1FF';  //F0F0FF
		withTd.style.borderBottomColor = '#C1C1FF';
	} else {
		withTd.style.borderTopColor= '#000066'; 
		withTd.style.borderBottomColor = '#000066';
	}
}


function ShowHinweis()
 {
  document.all['mit'].style.display = "inline";
  document.all['ohne'].style.display = "none";
  window.scroll(0,1000000);
 }

function focus_suchbox()
	{
	if(document.SucheProduktStart && document.SucheProduktStart.suche)
		{
 		document.forms['SucheProduktStart'].suche.value = '';
 		document.forms['SucheProduktStart'].suche.focus();
		}
	}

var cookiedom
cookiedom = "testbericht.guenstiger.de"
var cookieDeath
cookieDeath = new Date();
cookieDeath.setTime(cookieDeath.getTime()+1209600000);
str_cookieDeath = cookieDeath.toGMTString();

function setCookie(name, value) {
  if(getCookie(name).indexOf(value) == -1) {
	var curCookie = name + "=" + getCookie(name) + value + "."; 
	document.cookie = curCookie+";path=/;domain=" + cookiedom + ";expires=" + str_cookieDeath;
  }
  location.reload();
}
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=/;domain=" + cookiedom + ";expires=Thu, 01-Jan-70 00:00:01 GMT";   
  }
  location.reload();
}
function deleteCookieValue(name, value) {
	if (getCookie(name)) {
	  var newVals = "";
	  var curVals = getCookie(name);
	  newVals = curVals.replace((value + "."), "");
	  document.cookie = name + "=" + escape(newVals)+";path=/;domain=" + cookiedom + ";expires=" + str_cookieDeath;  
    }
    window.location.href = "main.asp?showmz=1"
}
function deleteCookieValueOnPopUp(name, value) {
	if (getCookie(name)) {
	  var newVals = "";
	  var curVals = getCookie(name);
	  newVals = curVals.replace((value + "."), "");
	  document.cookie = name + "=" + escape(newVals)+";path=/;domain=" + cookiedom + ";expires=" + str_cookieDeath;  
    }
    window.location.href = "gt_testproduktvergleich.asp"
}
function showAllProduktDetails() {
	document.all['produktmehrdetailsbtn'].style.display = "none";
   document.all['produktmehrdetails'].style.display = "inline";
}
function weiterepreisemore() {
	var anker_pos = location.href.lastIndexOf('#');
	var new_href = location.href;
	if(anker_pos>0) {
		new_href = new_href.substring(0,anker_pos);
	}
	/*
	if(!isNaN(refPreisAnsicht) || refPreisAnsicht > 0) {
		if(new_href.indexOf('&pdetail') > 0) {
			new_href = new_href.substring(0,new_href.indexOf('&pdetail'));
		}
		new_href = new_href + '&pdetail=0';
	}
	*/
	location.href = new_href + "#ankerweiterepreise";
	document.getElementById('weiterepreise').scrolling="yes";
	document.getElementById('weiterepreise').height="500";	
	document.getElementById('weiterepreisebox').style.display = "inline";
}
//Array für die Fotos
var multiprodfotos;
//Zaehler für den Zyklus
var multiprodfotos_v = 0;
//Handle zum Zyklus
var multiprodfoto_zyklus;
//Ordner fuer die weiteren Fotos
var multifotofolder = ""
//Funktion zum Aufrufen einer Ansicht
function showProdFotoAutoCall(index) {
	if(index >= 0 && index < multiprodfotos.length) {
		document.getElementById("divProdFoto").innerHTML = "<IMG src=\"" + multifotofolder + "/" + multiprodfotos[index] + "\" border=0>"
		for(i=0;i<multiprodfotos.length;i++) {
			if(i != index) {
				document.getElementById("mpf"+i).src = "../bilder/" + i + "off.gif";
			} else {
				document.getElementById("mpf"+i).src = "../bilder/" + i + "on.gif";
			}
		}
	} else {
		//falscher index
	}	
}
//Funktion zum Stoppen des Zyklus und anschliessendes Aufrufen einer Ansicht
function showProdFoto(index) {
	stop_cycleProdFoto();
	showProdFotoAutoCall(index);
}
//Funktion, die während eines Zyklus 1 bis n mal aufgerufen wird
function call_cycleProdFoto() {
	var pfl = multiprodfotos.length;
	showProdFotoAutoCall((++multiprodfotos_v) % pfl, true);
}
//Funktion, die den Zyklus startet
function cycleProdFoto() {
	multiprodfoto_zyklus = window.setInterval("call_cycleProdFoto()",3000);
}
//Funktion, die den Zyklus beendet
function stop_cycleProdFoto() {
	window.clearInterval(multiprodfoto_zyklus);
}
//Zeigt das Produktfoto anhand der Mausposition in einem Layer an
function picDivShow(imgPath) {
	varPicDivImg = document.getElementById('picDivImg');
	varPicDivImg.src = imgPath;
	varPicDiv = document.getElementById('picDiv');
	varPicDiv.style.display = "";
}
//Versteckt das Produktfoto-Layer wieder
function picDivHide() {
	varPicDiv = document.all.picDiv;
	varPicDivImg.src = '../bilder/picload.gif';
	varPicDiv.style.display = "none";
}
//Klappt die Meinungen auf
function showMeinungMehr(id) {
	document.all['meinungmehrdetailsbtn['+id+']'].style.display = "none";
   document.all['meinungmehrdetails['+id+']'].style.display = "inline";
}
//Klappt die Beschreibung auf
function showTopBeschreibungMehr(id) {
	document.all['topbeschreibungmehrbtn['+id+']'].style.display = "none";
   document.all['topbeschreibungmehr['+id+']'].style.display = "inline";
}
//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,'lower');
	strTemp = strTemp.replace(/>/g,'greater');
	strTemp = strTemp.replace(/\\/g,'');
	return strTemp;
}
//sendet ein Formular nur dann ab, wenn ein bezeichnetes Inputfeld einen Wert hat
function submitIfValue(formToSubmit,idOfValueField) {
	if(document.forms[formToSubmit].elements[idOfValueField].value.length > 0) {
		document.forms[formToSubmit].submit();
	}
}


//Produktvergleich
function pvCountPids(strPids) {
	var counter = 0;
	for(var i = 0; i < strPids.length; i++) {
		if(strPids.charAt(i) == '.') {
			counter += 1;
		}
	}
	return counter;
}
function pvAppendProduct(pid) {
	if(pvCountPids(getCookie()) < 10) {
		if(!(pvSetCookie().indexOf(pid+'.') >= 0)) {
			pvSetCookie(pid);
		}
	} else {
		alert('Sie können nur maximal 20 Produkte in den Produktvergleich legen!');
	}
}
function pvGetCookie() {
	var dc = document.cookie;
	var prefix = pvcookie + "=";
	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 countPids(strPids) {
	var counter = 0;
 	for(var i = 0; i < strPids.length; i++) {
	 	if(strPids.charAt(i) == '.') {
 			counter += 1;
 		}
	}
 	return counter;
}

function pvSetCookie(value) {
	if(pvGetCookie().indexOf(value) == -1) {
		if(countPids(pvGetCookie()) < 10) {
			var curCookie = pvcookie + "=" + pvGetCookie() + value + ".";
			document.cookie = curCookie+"; path=/; domain=" + pvcookiedom;
			//pv_inc_produktanzahl();
			//location.reload();
			return 0;
		} else {
			alert('Sie können nur maximal 10 Produkte in den Produktvergleich legen!');
			return -1;
		}
	}
}
function pvDeleteCookieReload() {
	if (pvGetCookie()) {
		ok_erase = confirm('Sind Sie sicher, dass alle Produkte aus dem Vergleich entfernt werden sollen?');
		if(true == ok_erase) {
			document.cookie = pvcookie + "=" + "; path=/; domain=" + pvcookiedom + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
			pv_erase_produktanzahl();
			location.reload();
			//history.back();
		}
	}
}
function pvDeleteCookieValueReload(value) {
	if (pvGetCookie()) {
		var newVals = "";
		var curVals = pvGetCookie();
		newVals = curVals.replace((value + "."), "");
		document.cookie = pvcookie + "=" + escape(newVals)+"; path=/; domain=" + pvcookiedom;
		location.reload();
	}
}
function pvDeleteCookieValue(value) {
	if (pvGetCookie()) {
		var newVals = "";
		var curVals = pvGetCookie();
		newVals = curVals.replace((value + "."), "");
		document.cookie = pvcookie + "=" + escape(newVals)+"; path=/; domain=" + pvcookiedom;
		//location.reload();
		//pv_dec_produktanzahl();
		return 0;
	} else {
		return 1;
	}
}
function pv_open_row(strRow) {
	if(document.getElementById('pv_head_' + strRow)) {
		document.getElementById('pv_head_' + strRow).className = 'pvtextbox_grey';
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_row_' + i + '_' + strRow)) {
			document.getElementById('pv_row_' + i + '_' + strRow).className = 'pvtextbox_grey';
		}
	}
	if(document.getElementById('pv_controlimg_' + strRow)) {
		document.getElementById('pv_controlimg_' + strRow).src = '../bilder/closeup.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 = '';	
	}
	/*
	var elements;
  	if(document.all) {
  		elements=document.all;
  	} else {
  		if(document.getElementsByTagName && !document.all) {
  			elements=document.getElementsByTagName("*");
  		}
  	}  	
  	for(i=0; i<elements.length; i++) {
   	if(elements[i].getAttribute("id") != null && elements[i].getAttribute("id") != "") {
   		if(elements[i].getAttribute("id").indexOf(strRow) > -1) {
   			if(elements[i].getAttribute("id").indexOf('head') > -1 || elements[i].getAttribute("id").indexOf('row') > -1) {
   				elements[i].className = 'pvtextbox_grey';
   			} else if(elements[i].getAttribute("id").indexOf('controlimg') > -1) {
   				elements[i].src = '../bilder/closeup.gif';
   				elements[i]["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');
   			} else if(elements[i].getAttribute("id").indexOf('controltext') > -1) {
   				elements[i]["onclick"] = new Function('{pv_close_row(\''+strRow+'\');}');
   			} else if(elements[i].getAttribute("id").indexOf('container') > -1) {
   				elements[i].style.display = '';
   			}
   		}
   	}
  }
  */
}
function pv_close_row(strRow) {
	if(document.getElementById('pv_head_' + strRow)) {
		document.getElementById('pv_head_' + strRow).className = 'pvtextbox';
	}
	for(i = 0; i < 10; i++) {
		if(document.getElementById('pv_row_' + i + '_' + strRow)) {
			document.getElementById('pv_row_' + i + '_' + strRow).className = 'pvtextbox';
		}
	}
	if(document.getElementById('pv_controlimg_' + strRow)) {
		document.getElementById('pv_controlimg_' + strRow).src = '../bilder/opendown.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';	
	}
	/*
	var elements;
  	if(document.all) {
  		elements=document.all;
  	} else {
  		if(document.getElementsByTagName && !document.all) {
  			elements=document.getElementsByTagName("*");
  		}
  	}
  	for(i=0; i<elements.length; i++) {
   	if(elements[i].getAttribute("id") != null && elements[i].getAttribute("id") != "") {
   		if(elements[i].getAttribute("id").indexOf(strRow) > -1) {
   			if(elements[i].getAttribute("id").indexOf('head') > -1 || elements[i].getAttribute("id").indexOf('row') > -1) {
   				elements[i].className = 'pvtextbox';
   			} else if(elements[i].getAttribute("id").indexOf('controlimg') > -1) {
   				elements[i].src='../bilder/opendown.gif';
   				elements[i]["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');
				} else if(elements[i].getAttribute("id").indexOf('controltext') > -1) {
   				elements[i]["onclick"] = new Function('{pv_open_row(\''+strRow+'\');}');   				
   			} else if(elements[i].getAttribute("id").indexOf('container') > -1) {
   				elements[i].style.display = 'none';   				
   			}
   		}
   	}
  }
  */
}
function pv_erase_produktanzahl() {
	if(document.getElementById('pvanzp')) {
		document.getElementById('pvanzp').innerHTML = "0";
	}
}
function pv_inc_produktanzahl() {
	if(document.getElementById('pvanzp')) {
		var oldval, newval, newstr;
		oldval = document.getElementById('pvanzp').innerHTML;
		oldval = parseInt(oldval);
		newval = oldval + 1;
		document.getElementById('pvanzp').innerHTML = newval.toString();
	}
}
function pv_dec_produktanzahl() {
	if(document.getElementById('pvanzp')) {
		var oldval, newval, newstr;
		oldval = document.getElementById('pvanzp').innerHTML;
		oldval = parseInt(oldval);
		if(oldval > 0) {
			newval = oldval - 1;
			document.getElementById('pvanzp').innerHTML = newval.toString();
		} else {
			document.getElementById('pvanzp').innerHTML = "0";
		}
	}
}
function pv_hide_hinweis(id) {
	document.getElementById(id).style.display = "none";
}
function pv_toggle(layerName, pid) {
	if(document.getElementById(layerName)) {
		if(document.getElementById(layerName).checked == true) {
			if(0 == pvSetCookie(pid)) {
				pv_inc_produktanzahl();
				if(document.getElementById('pv_hinweis' + pid)) {
					document.getElementById('pv_hinweis' + pid).style.display = "";
					window.setTimeout('pv_hide_hinweis(\'pv_hinweis' + pid + '\')',3000);
				}
			} else {
				document.getElementById(layerName).checked = false;
			}
		} else {
			if(0 == pvDeleteCookieValue(pid)) {
				pv_dec_produktanzahl();
			}
			if(document.getElementById('pv_hinweis' + pid)) {
				document.getElementById('pv_hinweis' + pid).style.display = "none"; 
			}
		}
	}
}
function pv_append(layerName, pid) {
	if(0 == pvSetCookie(pid)) {
		if(document.getElementById(layerName)) {
			document.getElementById(layerName).checked = true;
			pv_inc_produktanzahl();
			if(document.getElementById('pv_hinweis' + pid)) {
				document.getElementById('pv_hinweis' + pid).style.display = "";
				window.setTimeout('pv_hide_hinweis(\'pv_hinweis' + pid + '\')',2000);
			}
		}
	}
}
function click_out(obj,aid,url) {
	obj.href = 'http://testbericht.guenstiger.de/anbclick.asp?aid=' + aid + '&url=' + url;
}
// -->

