$(function(){ 
  matchHeight();
  function matchHeight() {  
    var mainHeight = $(window).height() - $("#header").outerHeight() - $("#global_header").outerHeight() - $("#menu").outerHeight() - $("#push").outerHeight() - $("#footer").outerHeight();
    $('#content').height(mainHeight);
  }
  $(window).resize(matchHeight);

});

function menuHandle(){
	$('#menu .sel').parent().find('UL').css('display','block');
	$('#menu .sel').attr('id','actual');
	
	$('#menu .main-item').parent().hover(function(){
		$('#menu .sel').removeClass('sel');
		
		if ($(this).find('.main-item').attr('id') != 'actual') {
			$('#actual').parent().find('UL').css('display','none');
		}
		
		$(this).find('.main-item').addClass('sel');
	}, function(){
		if ($(this).find('.main-item').attr('id') != 'actual') {
			$('#actual').parent().find('UL').css('display','block');
			$('#actual').addClass('sel');
			$(this).find('.main-item').removeClass('sel');
		}
	});
}

$(function() {
	
	menuHandle();

});

function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".column"));
});

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
function popup_window(url,w,h)
{
var width=w;
var height=h;
var from_top=350;
var from_left=500;
var toolbar='no';
var location='no';
var directories='no';
var status='no';
var menubar='no';
var scrollbars='no';
var resizable='no';
var atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';
atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;
atts+=',location='+location+',directories='+directories+',status='+status;
atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
window.open(url,'win_name',atts);
}

//a basic example external module to control scroll from outside
//NOT required for fleXcroll to run, and user do NOT need to
//know what this is for standard operation.
function fleXcrollTo(id,x,y,relative) {
	var scrollDiv = document.getElementById(id);
	//Return if the target is null
	if (scrollDiv == null) return;
	//Do the scroll by using custom method attached by fleXcroll
	//but first check if the method exists.
	if(scrollDiv.contentScroll) scrollDiv.contentScroll(x,y,relative);
	/*
	Following is the method to commit a scroll by defining
	relative or absolute values:
		element.contentScroll(x,y,relative);
	*x and y values are horizontal and vertical
	positions of content and can be set to false if we don't
	require any one of them to be scrolled.
	*x and y should be sent as string, between quotation marks.
	*x and y can take three different units:
	px, s, p
	where px is pixels, s is a single step, p is a page scroll.
	*relative can be either true or false. If true,
	x and y is used as relative scrolling.
	*x and y refer to content position
	*e.g. To scroll one page down, you can:
	element.contentScroll(false,"1p",true);
	*e.g. To scroll 3 steps to left, you can:
	element.contentScroll("-3s",false,true);
	*e.g. To set the content at 30px right, and 20px down:
	element.contentScroll("30px","20px",false);
	*e.g. To scroll down 100px relatively,
	element.contentScroll(false,"100px",true);
	*/
}

