iamiphone = 0;
window.onresize = dosizer;


function csschanges(x,y) {
    $('#footer').css({"top": (y-60)+"px" });
    var m = $("#header div.spacer.boldspacer").offset();
    $('#content_fullscroll').css({"paddingTop": (m.top+20) + "px" });
}


function dosizer(bwidth,bheight) {
    if (iamiphone!=1) {
        var ymax=screen.availHeight;
        var xmax=screen.availWidth;
        //self.moveTo(0,0);
        //window.resizeTo(xmax,ymax);
    //
        var x,y;
        if (self.innerHeight) // all except Explorer
        {
            x = self.innerWidth;
            y = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
            // Explorer 6 Strict Mode
        {
            x = document.documentElement.clientWidth;
            y = document.documentElement.clientHeight;
        }
        else if (document.body) // other Explorers
        {
            x = document.body.clientWidth;
            y = document.body.clientHeight;
        }
        
        ymaxdiff=ymax-y;
        xmaxdiff=xmax-x;
        globaly = y;
        globalx = x;
    } else {
 //       alert("iphone");
        globalx = 891;
        globaly = 480;
    }
	csschanges(x,y);
    //dothis(1, "first");
}
function check_iphone () {
	if(navigator.userAgent.match(/iPhone/i)){
		iamiphone = 1;
	} else {
		iamiphone = 0;
	}
		iamiphone = 0;

}

//
//
// REPLACE MENUE WITH PICS
function replaceMenue() {
	$("#navi a").html("&nbsp;");
}



function init() {
	// Innenkasten ausmessen und hšhe nachregeln fŸr kopierschutz
	// **************************************************** Innenkasten
    // **************************************************** check auf iPhone
    //alert("init is called");
	check_iphone();
	dosizer();
//	$("<div><p>Check das aus </p></div>").appendTo("li.page-item-42");
//	$('<li>' + menuetext + '</li>').appendTo( $("li.page-item-42").parent() );
//	doMenuelink();
	replaceMenue();
}

		

$(document).ready( function () {
    init();
});