
/* Klappmechanismus für Infoboxen, z.B. Winterreifenpflicht.*/


function setInfobox() {
	var q_cont = document.getElementById('klappcontainer');
	if (q_cont) {
		var dt = q_cont.getElementsByTagName('dt');
		var dd = q_cont.getElementsByTagName('dd');
		
		for (var i = 0; i < dt.length; i++) {
			
			if (dd[i].className == 'close') { 
			  dt[i].dd = dd[i];  
				dt[i].onclick = function () { 
					if (this.dd.className == 'open') { 
						this.dd.className = 'close'; 
						this.className = 'close'; 
						openBox = null; 
						return; 
					}
					this.dd.className = 'open'; 
					this.className = 'open';  
					if (openBox) { 
					   openBox.className = 'close';
						 openBox.dd.className = 'close';
						}			 
					openBox = this;  
					
				}
			
			}

		}
	}
}

/* Sprungmenü im Footer*/
function footerNavSelectHandler(selectElementID){
	var selectedIndex = document.getElementById(selectElementID).selectedIndex;
	var URL = document.getElementById(selectElementID).options[selectedIndex].value;
	if (selectedIndex!=0) { 
		pointer = window.open();
		pointer.location.href = URL;	
	}
}

/* Popups öffnen. angepasst */
function openPopupWindow(theURL,w,h) {
	var strWidth, strHeight;

	if (w == 0) {
		strWidth = screen.availWidth;
	} else {
		strWidth = w;
	}

	if (h == 0) {
		strHeight = screen.availHeight;
	} else {
		strHeight = h;
	}

	theWindow = window.open(theURL,"_blank","alwaysRaised=yes,directories=no,left=0,top=0,height=" + strHeight + ",width=" + strWidth + ",location=no,menubar=no,resizable=yes,scrollbars=yes,titlebar=no,toolbar=no");
	theWindow.focus();
	
	return false;
}


function highlightListItem() {

 var urlstring = window.location.href.split("#") ;
 ID = urlstring[1];
 //alert (ID);
 document.getElementById(ID).style.backgroundColor = "#EFF2F2";
 
 
}

/* jQuery: Checklist mit Funktion versehen */

$(document).ready(function () {
	$("ul.checklist li").css("cursor","pointer").click(function () {
		if ($(this).is(".checked")) {
			$(this).removeClass("checked");
		} else {
			$(this).addClass("checked");
		}
	})
});


function init(){
	if(document.getElementById){
		obj = document.getElementById("boxDiv");
		obj.style.right = - 50 + "px";
		obj.style.top = - 10 + "px";
	}
}

function slideLeft(){
	if(obj){
	   if(parseInt(obj.style.right) < strecke ){
				obj.style.right = parseInt(obj.style.right) + 1 + "px";
				setTimeout("slideLeft()",20);
		}
		else{
			slideDown();
		}
	}
}

function slideDown(){
	if(obj){
		if(parseInt(obj.style.top) < 10){
				obj.style.top = parseInt(obj.style.top) + 1 + "px";
				setTimeout("slideDown()",100);
		}
		else{
			slideUp();
		}
	}
}

function slideUp(){
	if(obj){
		if(i < 20){
			i++;
			j++;
			obj.style.top = parseInt(obj.style.top) - 1 + "px";
			setTimeout("slideUp()",100);
		}
		else{
			if(j < 10000){
				i = 0;
				slideDown();
			}
			else{
				obj.style.visibility = "hidden";
			}
		}
	}
}

function startBlimp() {
	window.onload = function(){
		init();
		slideLeft();
	}
}