function getWindowHeight() {
var windowHeight=0;
if (typeof(window.innerHeight)=='number') {
windowHeight=window.innerHeight;
}
else {
if (document.documentElement&&
document.documentElement.clientHeight) {
windowHeight=document.documentElement.clientHeight;
}
else {
if (document.body&&document.body.clientHeight) {
windowHeight=document.body.clientHeight;
}
}
}
return windowHeight;
}


function getWindowWidth() {
var windowWidth=0;
if (typeof(window.innerWidth)=='number') {
windowWidth=window.innerWidth;
}
else {
if (document.documentElement&&
document.documentElement.clientWidth) {
windowWidth=document.documentElement.clientWidth;
}
else {
if (document.body&&document.body.clientWidth) {
windowWidth=document.body.clientWidth;
}
}
}
return windowWidth;
}



function windowResize() {

if (document.getElementById) {

var windowHeight=getWindowHeight();

var windowWidth=getWindowWidth();

//var outHeight=window.outerHeight;
// gibt es nicht im IE...

// stattdessen:

var outHeight=screen.availHeight;
var outWidth=screen.availWidth;

//var browserBalken=outHeight-windowHeight;

if (typeof(window.outerHeight)=='number') {
var browserBalken=outerHeight-windowHeight-30;
}
else {
var browserBalken=70;
}

var proportion=windowWidth/windowHeight;

var proportionInvers=windowHeight/windowWidth;

//alert ('proportion' + proportion  );

//alert ('browserBalken' + browserBalken );

//alert ('windowWidth: ' + windowWidth  + 'windowHeight: ' +  windowHeight + 'proportion' + proportion + 'newWidth: ' + newWidth  + 'newHeight: ' +  newHeight  );

//if (proportion > 1.33) {
	if (proportion > 1.6) {
//	var newWidth=(windowHeight*1.33)+(browserBalken*proportionInvers);

var newWidth=(outHeight-browserBalken)*1.33;


		var newHeight=(newWidth/1.33)+browserBalken;
		if (newHeight > outHeight) {
		newHeight=outHeight;
		} 
	
    window.resizeTo (newWidth, newHeight);	 
}

//if (proportion < 1.33) {
if (proportion < 1.3) {

	var newHeight=outWidth/1.33;	
	if (newHeight > outHeight) {
	newHeight=outHeight;
	} 	
	var newWidth=(newHeight-browserBalken)*1.33	
	if (newWidth > outWidth) {
	newWidth=outWidth;
	} 
	
	
	//var newHeight=windowWidth/1.33;
//	var newWidth=windowWidth;
	
//alert ('outWidth' + outWidth + 'newWidth' + newWidth +  'outHeight' + outHeight + 'newHeight' + newHeight );
	
     window.resizeTo (newWidth, newHeight);	 
}

}

}

        
		
		
		
				 
				 
function butover(x)
	{
	//if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"1."+nfound[1];
	}
	
function butout(x)
	{
	//if (is_nav4) return;
	url=x.src;
	found=url.split("/");
	nfound=found[found.length-1].split(".");
	nlength=nfound[0].length-1;
	folder=url.replace(found[found.length-1],"");
	name=nfound[0].substr(0,nlength);
	x.src = folder+name+"0."+nfound[1];
	}
	   
