var viewportwidth;
var viewportheight;

function getVPheight(){
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined'){
		viewportwidth = window.innerWidth;
		viewportheight = window.innerHeight;
	} else if (typeof document.documentElement != 'undefined'
		 && typeof document.documentElement.clientWidth !=
		 'undefined' && document.documentElement.clientWidth != 0){
		viewportwidth = document.documentElement.clientWidth;
		viewportheight = document.documentElement.clientHeight;
	} else {
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
		viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	}
	return viewportheight;
}

$(document).ready(function(){
	switchCSS();
	$("#lang li.active a").bind("mouseover", function(){
		$("#lang li.off").show("normal");
	});	
	$("#lang").bind("mouseleave", function(){
		$("#lang li.off").hide("normal");
	});	
	// Href wird hier gesetzt, da wir bei Noscript href auf die andere Sprache:
	$("#lang a.de").attr("href", "/de/");
	$("#lang a.en").attr("href", "/en/");
	
}); 

$(window).wresize(switchCSS);
//$(window).bind("resize", function(){ switchCSS(); });

function switchCSS(){
	viewportheight = getVPheight();
	
    if($(window).width() < 1160 || viewportheight < 670) {
        $('#css_screen_resolution').attr('href','/css/screen-1024.css');
    } else {
		$('#css_screen_resolution').attr('href','/css/screen-1280.css');
    }
}