function click(m) {
	
}

function trim (zeichenkette) {
  // Erst führende, dann Abschließende Whitespaces entfernen
  // und das Ergebnis dieser Operationen zurückliefern
  return zeichenkette.replace (/^\s+/, '').replace (/\s+$/, '');
}
is = new BrowserCheck();
var loggedIn = "false";
loggedIn = "" + getCookie("logged");
if(loggedIn=="null") setCookie("logged", "false", 1000);
function switchLogin(init) {
	loggedIn = "" + getCookie("logged");
	if(!init&&loggedIn=="true") loggedIn = "false";
	else if(!init&&loggedIn=="false") loggedIn = "true";
	if (loggedIn=="true") {
			document.getElementById("loginPrefix").innerHTML="eingeloggt&nbsp;";
			document.getElementById("logintext").innerHTML="jetzt ausloggen";
	}
	else {
			document.getElementById("loginPrefix").innerHTML="";
			document.getElementById("logintext").innerHTML="Hier einloggen [SSL <img src='images/ssl.png' border='0' style='width:1.1em;' />]";
	}
	setCookie("logged", loggedIn, 1000);
}

// Definition der PopUp-Typen
var popupTypes = new Array ();
popupTypes[0] = "width=700,height=420,top=40,left=40,menubar=no,resizable=no";
popupTypes[1] = "width=670,height=420,top=40,left=40,menubar=no,resizable=no";
popupTypes[2] = "width=670,height=500,top=40,left=40,menubar=yes,resizable=yes";
popupTypes[3] = "width=670,height=500,top=40,left=40,menubar=no,resizable=no";
popupTypes[4] = "width=670,height=500,top=40,left=40,menubar=no,resizable=no";
popupTypes["druck"] = "width=670,height=570,top=40,left=40,menubar=no,resizable=no";				// druck
popupTypes["guidedtour"] = "width=1014,height=702,top=0,left=0,menubar=no,resizable=no";
/* happydigits völliger Mist, steht nur noch hier da in den tarifen nicht richtig aufgeräumt wurde
sollte sobal die Happydigits mal sauber entfernt, bzw. alles auf jsf umgestellt wieder rausfliegen
Anfang */
var childWind = null;
function hdclose() {
if (childWind && !childWind.closed) childWind.close();
}
/* Ende */
function invokePopupCommandLink2(action, commandId, formName, clField, popupName, popupFocus, popupParams){
// Popup oeffnen:
var popup = window.open("", popupName, popupParams);
var formeraction = document.forms[formName].action;
// target auf popup umsetzen:
var formerTarget = document.forms[formName].target;
document.forms[formName].target = popupName;
document.forms[formName].action = action;
var dField = document.forms[formName][clField];
dField.value=commandId; document.forms[formName].submit();
var s = document.getElementsByTagName('BODY')[0].style;
// Feldwert wieder auf leer setzen, sonst geht keine andere Aktion mehr!
dField.value = '';
// target auf Ursprungswert zuruecksetzen:
document.forms[formName].target = formerTarget;
document.forms[formName].action = formeraction;
//popup fokusieren
if (popupFocus) {
popup.focus();
}
return false;
}
/* 
 * neue Version des fireup vom 08.05.2003 gerufen wird jetzt popup oder popupCustom 
 */
function popup (type, link, scrollbars) {
var ptype;
if (scrollbars == "no") scrollbars = false;
if (scrollbars) {
scrollbars = "yes";
} else {
scrollbars = "no";
}
if (isNaN(type)) {
ptype = popupTypes[type];
if (type == "bonussystembuchen") {
childWind=window.open(link, ("popup"+type),ptype+",scrollbars=" + scrollbars);
} else {
window.open(link, ("popup"+type),ptype+",scrollbars=" + scrollbars);
}
} else {
ptype = popupTypes[type-1];
window.open(link, ("popup"+type) ,ptype+",scrollbars=" + scrollbars);
}
return false;
}

function getCookie(NameOfCookie){ 
	if (document.cookie.length > 0) { 
		Merkbegin = document.cookie.indexOf(NameOfCookie+"="); 
		if (Merkbegin != -1) { 
			Merkbegin += NameOfCookie.length+1; 
			Merkend = document.cookie.indexOf(";", Merkbegin);
			if (Merkend == -1) Merkend = document.cookie.length;
			return unescape(document.cookie.substring(Merkbegin, Merkend)); 
		} 
	}
	return null; 
}
function setCookie(NameOfCookie, value, expiredays) { 
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString() +"; Path=/");
}

function delCookie (NameOfCookie) { 
	if (getCookie(NameOfCookie)) {
		document.cookie = NameOfCookie + "=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
} 

function m_in(obj) {
	clearTimeout(submen);
	//obj.bgColor = "#FFFFFF"
}

function m_out(obj) {
	clearTimeout(submen);
	//obj.bgColor = "#FFFFFF"
}

old=1
submen=undefined
activeMainmenue=20;

function showSubMenu(nr) {
	clearTimeout(submen);
	nummer = nr
	menu_name = "submenu"+nr
	if (nr>19&&nr!=activeMainmenue) {
		//document.getElementById("mainnavigation").style.height='300px';
		document.getElementById("main"+nr).className = 'mainMenuItemOver';
	}
	if (nr<20&&nr!=activeMainmenue) {
		//document.getElementById("headnavigation").style.height='300px';
		document.getElementById("main"+nr).className = 'headMenuItemOver';
	}
	document.getElementById(menu_name).style.display = 'block'
}

function hideSubMenu(nr) {
	clearTimeout(submen);
	menu_name = "submenu"+nr
	if (nr>19&&nr!=activeMainmenue) {
		//document.getElementById("mainnavigation").style.height='auto';
		if(document.getElementById("main"+nr)) document.getElementById("main"+nr).className = 'mainMenuItem';
	}
	if (nr<20&&nr!=activeMainmenue) {
		//document.getElementById("headnavigation").style.height='auto';
		if(document.getElementById("main"+nr)) document.getElementById("main"+nr).className = 'headMenuItem';
	}
	if(document.getElementById(menu_name))document.getElementById(menu_name).style.display = 'none'
}

function hold_menu() {
	clearTimeout(submen);
}

function menu_over(nr,imgsrc) {
	clearTimeout(submen);
	menu_name = "submenu"+old;
	if (old>19&&old!=activeMainmenue) {
		if(document.getElementById("main"+old)) document.getElementById("main"+old).className = 'mainMenuItem';
	}
	if (old<20&&old!=activeMainmenue) {
		if(document.getElementById("main"+old)) document.getElementById("main"+old).className = 'headMenuItem';
	}
	if(document.getElementById(menu_name)) document.getElementById(menu_name).style.display = 'none';
	old = nr
}

//*********************************************

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_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_swapImgRestorePng() { //v3.0
    a=MM_swapImgRestorePng.arguments; 
	if (a[0]==0) {
		lastOne = currentOne;
		lastSrc = currentSrc;
		currentOne = "";
		currentSrc = 0;
		//alert("lastOne:"+lastOne+",lastSrc:"+lastSrc);
	}
	if (lastOne!="" && lastSrc!=currentSrc) {
		var newImg = menuItem[lastSrc];
		document.getElementById(lastOne).filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = newImg.src;
	}
}


function MM_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.getElementById(n); 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];
		
	}
  }
}

function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") this.b = "nc"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion);
	this.nc = (this.b=="nc" && this.v>=4);
	this.nc4 = (this.b=="nc" && this.v==4);
	this.nc6 = (this.b=="nc" && this.v>=5);
	this.ie = (this.b=="ie" && this.v>=4 && navigator.userAgent.indexOf('Opera')<0);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0);
	this.ie7 = (navigator.userAgent.indexOf('MSIE 7')>0);
	this.badie = (this.b=="ie" && !(navigator.userAgent.indexOf('MSIE 5.5')>0) && !(navigator.userAgent.indexOf('6')>0));
	if (this.ie5) this.v = 5
	if (this.ie6) this.v = 6
	this.min = (this.nc||this.ie);
}

//************************************************************************************************
// FAQ
//************************************************************************************************

var c 		 = 0;
var speed  = 2000;

function show_faq(w) {	
	t = c;	
	if(c>0) hide_faq(c);	
	if(t!=w) {
		$("#faq"+w).slideDown("fast");
		c = w;	
	} 	
	document.getElementById("faqlink"+w).style.backgroundColor = "#f9d5b4";
}
function hide_faq(which) {
	$("#faq"+which).slideUp("fast");
	c = 0;
	document.getElementById("faqlink"+which).style.backgroundColor = "#f6f6f6";
}
function showTelefon() {
	if(document.getElementById("telefonlayer")) document.getElementById("telefonlayer").style.display = "block";
} 
function hideTelefon() {
	if(document.getElementById("telefonlayer")) document.getElementById("telefonlayer").style.display = "none";
} 
function checkkaufdatum(kaufdatum,heute) {
	if(document.getElementById("versbeginntxt")) {
		if(kaufdatum==heute) {
			document.getElementById("versbeginntxt").innerHTML = "Der Versicherungs-Schutz beginnt sofort mit Zusendung des Versicherungsscheins.";
		} else {
			document.getElementById("versbeginntxt").innerHTML = "Der Versicherungs-Schutz beginnt - nach einer Wartezeit von einem Monat - im Folgemonat nach Zusendung des Versicherungs-Scheins.";
		}
	}
}
