jQuery.fn.equalCols = function(){
	//Array Sorter
	var sortNumber = function(a,b){return b - a;};
	var heights = [];
	//Push each height into an array
	$(this).each(function(){
		heights.push($(this).height());
	});
	heights.sort(sortNumber);
	var maxHeight = heights[0];
	return this.each(function(){
		//Set each column to the max height
		$(this).css({'height': maxHeight});
	});
};

$(document).ready(function() {	

	$("#menu > li").hover(
		function () {
			$(this).addClass('hover');
			$(this).find('.dropmenu').toggle();					   
			$(this).find('.col').equalCols();
		}, 
		function () {
			$(this).removeClass('hover');
			$(this).find('.dropmenu').toggle();		   
			$(this).find('.col').removeAttr('style');
		}
	);
	
	
	$('#menu > li .innerMenu').hover(	function() 
								{
									$(this).parents('.dropmenu').css('visibility','visible');
								},
								function() 
								{
									$(this).parents('.dropmenu').css('visibility','hidden');
								});
		$('#menu > li').each( function()
								{
									if ( $(this).find('div').hasClass('dropmenu') )
										{
											var heightShadow = $(this).find('.innerMenu').height();
											var widchShadow = $(this).find('.innerMenu').width();
											$(this).find('.leftShadow').css('height', heightShadow+28);
											$(this).find('.rightShadow').css('height', heightShadow+28);
											$(this).find('.bottomShadow').css('width', widchShadow+25);
											$(this).find('.border').css('height', heightShadow);
										}										
								});
		$('.categoeies > li > span > a').click( function()
							  {
								  if( $(this).parents('li.cat').hasClass('current') )
								  	{
									  	$(this).parents('li.cat').removeClass('current');
									}
									else
									{
										$('.categoeies > li').removeClass('current');
										$(this).parents('li.cat').addClass('current');
									}							  	
								return false;
							  });
		$('#liginNow').toggle(function()
							{
								$(this).addClass('show');
								$(this).parent().find('.login').show();
								return false;
							},
							function()
							{
								$(this).removeClass('show');
								$(this).parent().find('.login').hide();
								return false;
							});
		$('a.lightBox').fancybox(); 
		$('.yes').click( function()
						{
							$('.yes_choise').show();
							$('.no_choise').hide();
                            $('.no_choise_done').hide();
							return false;
						});
		$('.no').click( function()
						{
							$('.yes_choise').hide();
							$('.no_choise').show();
                            $('.no_choise_done').hide();
							return false;
						});

});
