/* lbbw.de Javascript Funktionen - Version 1.4 - brandperfection GmbH 2008 20.05.2008 */
// jump Function mit Target uebergeben
// Cookie Check - LBBW
// Tabellenzeilen ein und ausblenden - showRows(id,anzahl) - 20.05.2008TP




//
// Selectboxen Weiterleitungen
//
function jump_outside(obj){
	var value = obj.ziel.options[obj.ziel.selectedIndex].value
	var objArray = value.split('||');
	var myUrl = objArray[0];
	var myTarget = objArray[1];
	
	if (myUrl != 0){
		if(myTarget=="_blank"){
			// In neuem Fenster oeffnen
			var winWidth = window.outerWidth;
			var winHeight = window.outerHeight;
			if(!window.outerWidth){winWidth=1000;winHeight=730;}
			var winParams = "width="+winWidth+",height="+winHeight+",left=0,top=0,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes";
			window.open(myUrl,"_blank",winParams);
		}else{
			// Im gleichen Fenster oeffnen
			document.location.href = myUrl;
		}
	} 
}


//
// Objekt finden
//
function MM_findObj(n, d) {
  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 && d.getElementById) x=d.getElementById(n); return x;
}

//
// Objekt ein- und ausblenden
//
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


//
// Opera Druckpatch
//
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];}}
}
MM_preloadImages('/imperia/md/content/lbbwde/img/kopf/headerprint.gif');







// JS Disclaimer Cookie-Check
function cookie_set(x){
	var link = window.location.href;
	var lang_id;
	var search_lang = link.search(/en/);
	if (search_lang != -1){lang_id ="en";}
	else {lang_id ="de";}
	var end_date = new Date();
	var number_of_days = end_date.getTime() + (2 * 60 * 60 * 1000);
	end_date.setTime(number_of_days);
	if(x=="0"){
		//	User lehnt ab
		window.location.href = "1000005390-"+lang_id+".html";
	}else{
		if (navigator.cookieEnabled == true) {
			document.cookie = "Name=lbbw_ir; expires=" + end_date.toGMTString();
			//Cookie lesen:
			var keks, i, wert;
			if (document.cookie==""){
				//	bug im IE;
				//	cookies sind nicht erlaubt! IE gibt keinen status zurueck!!
				window.location.href = "1000005389-"+lang_id+".html";
			}else {
				//	URL nach Variable checken
				var search_result = link.search(/\?/);
				if(search_result != -1){
					var filename = link.split("?");
					filename.reverse();
					keks=document.cookie;
					result =  keks.search(/lbbw_ir/);
					if(result != -1){
						window.location.href = filename[0];
					} else {
						window.location.href = "1000000344-"+lang_id+".html";
					}
				} else {
					window.location.href = "1000000344-"+lang_id+".html";
				}	
			}
		} else if (navigator.cookieEnabled == false) {
			//	  document.write("Cookies verboten.");
			window.location.href = "1000005389-"+lang_id+".html";
		} else {
			//	 keine browserangaben erkennbar);
			window.location.href = "1000000200-"+lang_id+".html";
		}
	}
}



	
function cookie_check(){
	var lang_id;
	var link = window.location.href
	var search_lang = link.search(/en/);
	if (search_lang != -1){lang_id ="en";}
	else {lang_id ="de";}
	var filename = link.split("/");
	filename.reverse();
	keks=document.cookie;
	result =  keks.search(/lbbw_ir/);
	if(result != -1){
		
	} else {
		//	zum Disclaimer
		window.location.href = "1000005380-"+lang_id+".html?"+filename[0];
	}
}












//
//Tabellen-Zeilen verstecken
//
function hideRows(id,anzahl){
	for(i=1;i<=anzahl;i++){
		window.setTimeout("rowstatus('"+id+"','"+i+"','none')", 25*i);
	}
	//Buttons ein- und ausblenden:
	if(document.getElementById){ myObj = document.getElementById('hide_'+id);}
	else if(document.all){       myObj = document.all['hide_'+id];}
	if(myObj)myObj.style.display = "none";

	if(document.getElementById){ myObj = document.getElementById('show_'+id);}
	else if(document.all){       myObj = document.all['show_'+id];}
	if(myObj)myObj.style.display = "block";	
}



function showRows(id,anzahl){
	for(i=1;i<=anzahl;i++){
		if(navigator.appName == "Microsoft Internet Explorer"){status = 'block';}
		else {status = 'table-row';}
		window.setTimeout("rowstatus('"+id+"','"+i+"','"+status+"')", 25*i);
	}
	//Buttons ein- und ausblenden:
	if(document.getElementById){ myObj = document.getElementById('hide_'+id);}
	else if(document.all){       myObj = document.all['hide_'+id];}
	if(myObj)myObj.style.display = "block";

	if(document.getElementById){ myObj = document.getElementById('show_'+id);}
	else if(document.all){       myObj = document.all['show_'+id];}
	if(myObj)myObj.style.display = "none";	
}



function rowstatus(id,i,status){
		myId = 'row'+i+"_"+id;
		if(document.getElementById){ myObj = document.getElementById(myId);}
		else if(document.all){       myObj = document.all[myId];}
		myObj.style.display = status;
}



