function init() {
    var as = document.getElementsByTagName('a');
    for(var i = 0; i < as.length; i++) {
        if (as[i].className.indexOf('external') != -1)
            as[i].target = '_blank';
    }
    var lis = document.getElementsByTagName('li');
    for(var i = 0; i < lis.length; i++) {
        if (lis[i].className.indexOf('external') != -1) {
            var as = lis[i].getElementsByTagName('a');
            for (var ai = 0; ai < as.length; ai++) {
                as[ai].target = '_blank';
            }
        }
    }
    
    var nav = document.getElementById('navMain').getElementsByTagName('li');
    for (var i = 0; i < nav.length; i++) {
        nav[i].onmouseover = function(){
            this.className += " sfhover";
        }
        nav[i].onmouseout = function() {
            this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
    
}
if (window.attachEvent) window.attachEvent("onload", init);
else if (window.addEventListener) window.addEventListener('load', init, false);
    
/* Datenschutz */

function teilnahme_service_kundenkarte() {
	var width  = 500;
	var height = 330;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_teilnahme_service_kundenkarte.html','teilnahmebed','resizable=0,scrollbars=auto,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}

function erw_datenschutz() {
	var width  = 500;
	var height = 390;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_erw_datenschutz.html','datenschutz','resizable=0,scrollbars=auto,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}

function nutzungsrechte() {
	var width  = 500;
	var height = 500;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_nutzungsrechte.html','datenschutz','resizable=0,scrollbars=yes,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}

function ehwmTeilnahmebed() {
	var width  = 500;
	var height = 450;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_ehwm_tielnahmebedingungen.html','datenschutz','resizable=0,scrollbars=yes,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}


/* TV Spots */

function tv_spot_erfinder() {
	var width  = 320;
	var height = 280;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_q12008_erfinder.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}

function tv_spot_gelq3_2008_uni() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gelq3_2008_uni.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}


function tv_spot_gelq3_2008_color() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gelq3_2008_color.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}


function tv_spot_gelq3_2008_sensitive() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gelq3_2008_sensitive.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}	

function tv_spot_gelq3_2008_vernel() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gelq3_2008_vernel.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}	

function tv_spot_20grad() {
	var width  = 320;
	var height = 280;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_20grad.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}

function tv_spot_ub() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_unser_bestes.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}

function tv_spot_gel() {
	var width  = 320;
	var height = 260;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gel.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}


function tv_spot() {
	var width  = 320;
	var height = 240;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}


function tv_spot_gold() {
	var width  = 320;
	var height = 200;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gold.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}

function tv_spot_gold_color() {
	var width  = 320;
	var height = 200;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	
	Fenster = window.open('/popup_stream_gold_color.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}

function tv_spot_acticpower() {
	var width  = 320;
	var height = 200;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;

	Fenster = window.open('/popup_stream_acticpower.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}


function tv_spot_hygienespueler() {
	var width  = 320;
	var height = 200;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;

	Fenster = window.open('/popup_stream_hygienespueler.html','Fenster','resizable=1,scrollbars=0,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	Fenster.focus();
}



function map_derendorf() {
	var width  = 500;
	var height = 520;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_service_anfahrt_derendorf.html','teilnahmebed','resizable=0,scrollbars=auto,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}

function map_oberkassel() {
	var width  = 500;
	var height = 520;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_service_anfahrt_oberkassel.html','teilnahmebed','resizable=0,scrollbars=auto,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}


var maxlang = 150;
var formfeld = '';
function countSigns() {
    var val = document.getElementById('ecardsCustomText').value;
    if(val.length > maxlang) {
        document.getElementById('ecardsCustomText').value = formfeld;
        return;
    }
    else {
        formfeld = val;
        signsLeft = (maxlang - val.length);
        div = document.getElementById("toolTipLayer");
        div.innerHTML = "Verbleibende Zeichen: " + signsLeft;
    }	
}	

var maxlang = 160;
var formfeld = '';
function ehwm_countSigns() {
    var val = document.getElementById('ehwmCustomText').value;
    if(val.length > maxlang) {
        document.getElementById('ehwmCustomText').value = formfeld;
        return;
    }
    else {
        formfeld = val;
        signsLeft = (maxlang - val.length);
        div = document.getElementById("toolTipLayer");
        div.innerHTML = "Noch Zeichen: " + signsLeft;
    }	
}


function faq_rundum() {
	var width  = 810;
	var height = 620;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_faq.html','faq','resizable=1,scrollbars=1,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}


function faq_sens() {
	var width  = 810;
	var height = 620;
	var y = (screen.availHeight - height) /2;
	var x = (screen.availWidth - width) /2;
	var micro = window.open('/popup_faq.html#faqsensStart','faq','resizable=1,scrollbars=1,status=0,location=0,width='+width+',height='+height+', top='+y+',left='+x);
	micro.focus();
}

function UnTip(){

}