<!--	
//return width
function windowWidth () {
	if (window.innerWidth) {
	  return window.innerWidth;
	} else if (document.body && document.body.offsetWidth) {
	  return document.body.offsetWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
	  return document.documentElement.clientWidth;
	} else {
	  return 0;
	}
}

//return height
function windowHeight () {
	if (window.innerHeight) {
	  return window.innerHeight;
	} else if (document.body && document.body.offsetHeight) {
	  return document.body.offsetHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
	  return document.documentElement.clientHeight;
	} else {
	  return 0;
	}
}

//reload
function windowReload () {
	if (my_width != windowWidth() || my_height != windowHeight())
	  location.href = location.href;
}


function prepareXhttp (page) {
	xhttp = false;
	// Überprüfen ob XMLHttpRequest-Klasse vorhanden und erzeugen von Objekte für IE7, Firefox, etc.
	if (typeof XMLHttpRequest != 'undefined') {
	    xhttp = new XMLHttpRequest();
	}
	// Wenn im oberen Block noch kein Objekt erzeugt, dann versuche XMLHTTP-Objekt zu erzeugen
	// Notwendig für IE6 oder IE5
	if (!xhttp) {
	    try {
	        xhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch(e) {
	        try {
	            xhttp = new ActiveXObject("Microsoft.XMLHTTP");
	        }
	    		catch(e) {
	            xhttp = null;
	        }
	    }
	}
	xhttp.open('GET',page,false);
	xhttp.send();
	document.getElementById('main').innerHTML = xhttp.responseText;	
}

function resizeFont() {
	//alert(document.getElementById('main').innerHTML.length);
	if (document.getElementById('main').innerHTML.length > 2500) {
		fontsize = Math.floor(my_width*(26/document.getElementById('main').innerHTML.length));
	} else {
		fontsize = Math.floor(my_width*0.015);
	}
			
	document.body.style.fontSize = fontsize +'px';
	
}

//setzt die texte im main fester
function changeMain(ziel) {
	if ((ziel != 'main') && (ziel.length > 0)) {
		document.cookie = "main="+ziel;
		prepareXhttp(ziel);
		document.getElementById('main_back').style.opacity = 0.5;
	}
	resizeFont();
}

//loads cookie page
function loadLast() {
	document.getElementById('nav_back').style.opacity = 0.5;
	var str = document.cookie;
	if(str.indexOf(';') != -1){
		var cookiewert = str.substring(str.indexOf('=')+1,str.indexOf(';'));
	} else {
		var cookiewert = str.substr(str.indexOf('=')+1,str.length);
	}
	
	changeMain(cookiewert);
	
}
//-->
