function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(window).load(function ()
                        {
equalHeight($(".column"));
});


$(document).ready(function(){

 $("#showGallery").click(function(){
          $(this).hide();
          $("#hideGallery").show();
          $("#galleries").animate({
          marginTop: "0"
          }, 1000 );
          });
          $("#hideGallery").click(function(){
          $("#galleries").animate({
          marginTop: "-501"
          }, 1000, function() {
          $("#hideGallery").hide();
          $("#showGallery").show();
          } );
          });


$("#legepark").hover(
  function () {
    $(this).next().fadeIn().css('visibility','visible');
  }, 
  function () {
    $(this).next().css('visibility','hidden');
  }
);


$("#cisc").hover(
  function () {
    $(this).next().fadeIn().css('visibility','visible');
  }, 
  function () {
     $(this).next().css('visibility','hidden');
  }
);

$('#introCourse').click(function(){$('#courseBox').show();$('#courseBoxTop').show(); });
$('#closer').click(function(){$('#courseBox').hide();$('#courseBoxTop').hide(); });



$('#contact').click(function (){
$('.overlay').fadeIn();
$('.boxHolder').fadeIn();
$('#contactUs').fadeIn();
});
$('#contactUs .wb_close').click(function(){$('.overlay').fadeOut(); $('#contactUs').fadeOut();});

$('.tipFriend').click(function (){
$('.overlay').fadeIn();
$('.boxHolder').fadeIn();
$('#tipAFriend').fadeIn();
});
$('#tipAFriend .wb_close').click(function(){$('.overlay').fadeOut(); $('#tipAFriend').fadeOut();});



var docuHeight = $(document).height();
$('.overlay').height(docuHeight);
}
);


var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function topMenu_open()
{  topMenu_canceltimer();
   topMenu_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function topMenu_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function topMenu_timer()
{  closetimer = window.setTimeout(topMenu_close, timeout);}

function topMenu_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  
$('#topMenu > li').bind('mouseover', topMenu_open)
   $('#topMenu > li').bind('mouseout',  topMenu_timer)});

document.onclick = topMenu_close;

