function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function win_size() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return {w: myWidth, h:myHeight};
}   


function activateOptimizedCSS() { 
   if ((win_size()).w < 1024) {
      setActiveStyleSheet('small_screen');
   }
}
activateOptimizedCSS();

$(document).ready(function(){
var bg = $('#bg');
if (bg) {
   bg.css('left',parseInt($('#wrap').width() / 2) - parseInt(bg.width() / 2) + 40);
}






	var $inner = $('#inner');
	var windowHeight = $(window).height();
	var $innerHeight = windowHeight-80;
	$inner.height($innerHeight+'px');
	$("#index").css('top', $innerHeight-210);
	$("#langen, #langcz").css('top', $innerHeight/2-69);
});

