$(document).ready(function(){
	//resizeBody();
	$("#mainNav > li.active").css('background-position', '0px -28px');
	$("div.subNavhover").hide();
	$("div.subNavhover li:last").css('border-bottom', '0');
	$("#mainNav > li").hover(function () {
		$(this).css('background-position', '0px -28px');
		$('.vili').css('background-position', '0px 0px');
		$("#mainNav > li.active").css('background-position', '0px 0px');
    	$("div.subNavhover",this).show("fast");
  	},function () {
		$(this).css('background-position', '0px 0px');
		$("#mainNav > li.active").css('background-position', '0px -28px');
    	$("div.subNavhover",this).hide("fast");
  	});
});

//detects the current internal windows size
function detectWindowSize() {
  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 {Width: myWidth, Height: myHeight};
}

//fix sizing of centerContainer
/*function resizeBody(){
	var detectArr = detectWindowSize();
	var subtractTop = 135;
	var subtractLeft = 300;
	var pageWidth = detectArr['Width'];
	//var pageWidth = $("#mainContainer").width();
	pageWidth = (pageWidth-subtractLeft)+'px';
	$("#body").css('width', pageWidth);
}*/


/*$(window).scroll(function(){
	resizeBody();
});*/

//Run code on window resize
/*$(window).resize(function(){
	resizeBody();
});*/