(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(!$.support.opacity)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(!$.support.opacity)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeTo = function(speed,to,callback) {
		return this.animate({opacity: to}, speed, function() {
			if (to == 1 && jQuery.browser.msie)
				this.style.removeAttribute('filter');
			if (jQuery.isFunction(callback))
				callback();
		});
	};
})(jQuery);

$(document).ready(function(){

	$(".menu-item").mouseover(function(){
		$("#"+$(this).attr("id")+" .sub-menu").show();
	
	});
	
	$(".menu-item").mouseout(function(){
		$("#"+$(this).attr("id")+" .sub-menu").hide();
	
	});
	
	if($("body").hasClass('home'))
	{
		$("#menucontentwrapper").remove();
		$("#homewrapper").show();
	}
	else
	{
		$("#homewrapper").remove();
		$("#menucontentwrapper").show();
	}
});

function showGlassPanel(width,height,topmargin)
{	
	$("#glassPanel").customFadeTo("fast",0,function(){
		$("#glassPanel").show();
		$("#glassPanel").customFadeTo("fast",0.9,function(){
			$("#glassPanelContentBorder").css('width',width);
			$("#glassPanelContentBorder").css('height',height);	
			$("#glassPanelContentBorder").css('margin-top',topmargin);				
			$("#glassPanelContentWrapper").show();	
		});			
	});	
	return false;
}
