function changeleiste(){
	
	var leisteleft  = document.getElementById("dragger").style.left;
	var leistetop 	= document.getElementById("dragger").style.top;
	setzeCookie("test", "Hallo");
	setzeCookie("leistexpos", leisteleft);
	setzeCookie("leisteypos", leistetop)
	//alert("Leiste verschoben. Neue Position: left: " + holeCookie("leistexpos") + " top: " + holeCookie("leisteypos"));
}

function setzeCookie(name, wert){
	document.cookie = name + "=" + encodeURIComponent(wert);  
}

function holeCookie(name){
	name += "=";
	var laenge = name.length;
	var cookie_laenge = document.cookie.length;
	var i = 0;
	while (i < cookie_laenge) {
		var j = i + laenge;
		if(document.cookie.substring(i, j) == name)
			return holeCookieWert(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if(i == 0)
			break;
	}
	return null;
}

function holeCookieWert(position){
	var ende = document.cookie.indexOf(";", position);
	if(ende == -1)
		ende = document.cookie.length;
	return decodeURIComponent(document.cookie.substring(position, ende));
} 

function checkpositionleiste(){
	document.getElementById("dragger").style.visibility = "hidden";
	//ist der cookie gesetzt? dann leiste dorthin verschieben
	if (holeCookie("leistexpos") != null){
		links = holeCookie("leistexpos");
		oben = holeCookie("leisteypos");
		//alert("cookie existiert!");
		document.getElementById("dragger").style.left = links;
		document.getElementById("dragger").style.top = oben;
	} else {
		//alert("cookie existiert nicht!");
	}
	document.getElementById("dragger").style.visibility = "visible";
}

function changeBG(image_path){
		document.getElementById("menubild").innerHTML = "<img style='height:106px;width:248px;' src=" + image_path + ">";
}


function printImage(){
	var i = document.getElementById("floor").href;
//	alert(i);
//	var l = (i.length) -5;
//	var m = i.substr(4,l);
	window.open(i,'popup','height=700,width=700');
	this.print();
}




function getPageSize(){
	   var xScroll, yScroll;
	   if (window.innerHeight && window.scrollMaxY) { 

             xScroll = window.innerWidth + window.scrollMaxX;

             yScroll = window.innerHeight + window.scrollMaxY;

       } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac

             xScroll = document.body.scrollWidth;

             yScroll = document.body.scrollHeight;

       } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari

             xScroll = document.body.offsetWidth;

             yScroll = document.body.offsetHeight;

       }

       

       var windowWidth, windowHeight;

       

//     console.log(self.innerWidth);

//     console.log(document.documentElement.clientWidth);

 

       if (self.innerHeight) {    // all except Explorer

             if(document.documentElement.clientWidth){

                    windowWidth = document.documentElement.clientWidth; 

             } else {

                    windowWidth = self.innerWidth;

             }

             windowHeight = self.innerHeight;

       } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode

             windowWidth = document.documentElement.clientWidth;

             windowHeight = document.documentElement.clientHeight;

       } else if (document.body) { // other Explorers

             windowWidth = document.body.clientWidth;

             windowHeight = document.body.clientHeight;

       }      

       

       // for small pages with total height less then height of the viewport

       if(yScroll < windowHeight){

             pageHeight = windowHeight;

       } else { 

             pageHeight = yScroll;

       }

 

//     console.log("xScroll " + xScroll)

//     console.log("windowWidth " + windowWidth)

 

       // for small pages with total width less then width of the viewport

       if(xScroll < windowWidth){ 

             pageWidth = xScroll;              

       } else {

             pageWidth = windowWidth;

       }

//     console.log("pageWidth " + pageWidth)

 

       arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 

       return arrayPageSize;

}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}