$(window).bind("resize load", function(){
	setPahelHeight();
});

function setPahelHeight() {
	$(".splitSide").height("auto");

	var yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
	}
	var windowHeight;
	
	if (self.innerHeight) {	// all except Explorer
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowHeight = document.body.clientHeight;
	}	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	$(".splitSide").height(pageHeight - $(".topArea").height()- $(".footerSpace").height());
};

(function($) {
	$.fn.splitterClick = function() { 
			$(this).click(function() {
				if( $(this).hasClass("splitBtnOpened")){
					$(this).removeClass("splitBtnOpened");
					$(this).addClass("splitBtnClosed");
					$(this).next().css("display","none");
					$(this).parent().width(14);
					$(this).parent().next().width(986);
				}
				else{
					$(this).removeClass("splitBtnClosed");
					$(this).addClass("splitBtnOpened");
					$(this).parent().next().width(794);
					$(this).parent().width(206);
					$(this).next().css("display","block");
				}
			});
	};
})
(jQuery);
$(function(){$('.splitBtn').splitterClick();});


(function($) {
	$.fn.menuHover = function() { 
			$(this).mouseover(function() {
				$(this).addClass("curr");
			});
			$(this).mouseout(function() {
				$(this).removeClass("curr");
			});
	};
})
(jQuery);
$(function(){$('.mainNav li').menuHover();});
