(function()
{
	GSM_LOADER = ({
	
	show: function(waittext)
	{
		GSM_MSG.hide();
		
		var w = jQuery(document).width();
		var h = (jQuery(document).height() > jQuery(window).height()) ? jQuery(document).height() : jQuery(window).height();
		jQuery("#Gsm_MaskDiv").css({left:0, top:0, width:w, height:h}).css({display:'block'}).show(function()
		{
			GSM_LOADER.loader(waittext);
		});
	},
	
	loader: function(waittext)
	{
		var leftPosition = (jQuery(window).width()/2)-(jQuery("#Gsm_LoaderDiv").width()/2);	
		
		if(waittext!='')
		{		
			jQuery("#Gsm_LoaderText").text(waittext);
		}
		else
		{
			jQuery("#Gsm_LoaderText").text("Please wait");
		}		
		jQuery("#Gsm_LoaderDiv").css({left:leftPosition, opacity:0.94}).css({display:'block'});
	},
	
	hide: function(time)
	{
		if(time == null)
		{
			time = 200;
		}
		setTimeout("jQuery('#Gsm_MaskDiv').css({display:'none'}); jQuery('#Gsm_LoaderDiv').fadeOut(200);", time);
	},
	
	hideWithMsg: function(msg, time)
	{		
		if(time == null)
		{
			time = 200;
		}
		
		setTimeout("jQuery('#Gsm_MaskDiv').css({display:'none'}); jQuery('#Gsm_LoaderDiv').fadeOut(200, function(){	GSM_MSG.show('"+msg+"'); });", time);
	}
	
	});

})(jQuery);


(function()
{
	GSM_MSG = ({
	
	show: function(msg)
	{
		GSM_MSG.msg(msg);
	},
	
	msg: function(msg)
	{
		jQuery("#Gsm_MessageDiv").css({display:'none'}).hide(10,function()
		{		
			var leftPosition = (jQuery(window).width()/2)-(jQuery("#Gsm_MessageDiv").width()/2);
			jQuery("#Gsm_MessageContent").html(msg).show(function()
			{
				jQuery("#Gsm_MessageDiv").css({left:leftPosition, opacity:.94}).fadeIn(500, function()
				{
					jQuery("#Gsm_MessageContent").html(msg).show();
				});
			});
		});
	},
	
	hide: function()
	{
		jQuery("#Gsm_MessageContent").html('');
		jQuery("#Gsm_MessageDiv").css({display:'none'});
	}
	
	});

})(jQuery);


(function()
{
	GSM_MESSAGE = ({
	
	show: function()
	{
		jQuery("#system_message").hide(function()
		{
			var leftPosition = (jQuery(window).width()/2)-(jQuery("#system_message").width()/2);
			jQuery("#system_message").css({left:leftPosition, opacity:1, display:'block'});
			
		});
	},
	
	hide: function()
	{
		jQuery("#system_message").css({display:'none'});
	}
	
	});

})(jQuery);


(function()
{
	GSM_POPUP = ({
	
	show: function(title, content)
	{
		title = (title == null) ? 'Popup' : title;
		content = (content == null) ? '' : content;
		
		var popup = jQuery("#Gsm_PopupDiv");
		var contentdiv = jQuery("#Gsm_PopupContent");
		
		popup.css({display:'none'}).hide(10,function()
		{			
			var leftPosition = (jQuery(window).width()/2)-(popup.width()/2);			
			contentdiv.html(content).show(function()
			{				
				jQuery("#popupHeadTitle").html(title);			
				popup.css({left:leftPosition, opacity:.94}).fadeIn(500);
				
			});
		});
	},
	
	hide: function()
	{
		jQuery("#Gsm_PopupContent").html('');
		jQuery("#Gsm_PopupDiv").css({display:'none'});
	}
	
	});

})(jQuery);