//Create our overlay object
var overlay = $("<div id='loader-overlay'></div>");
//Create our modal window
var modalWindow = $('<div id="whirlyGig"><h1>Processing - Please Wait.</h1><br /><img src="modules/RedLimeLoans/resources/style/whirlyGig.gif" /></div>');
			
var Loader = {
	show: function() {
		if (typeof document.body.style.maxHeight === "undefined") { //if IE 6
			$("body","html").css({height: "100%", width: "100%"});
		}
		
		//Append the overlay to the document body
		$("body").append(overlay.click(function() {}));
		
		//Set the css and fade in our overlay
		overlay.css("opacity", 0.5);
		overlay.show();
		
		$("body").append(modalWindow);
		var winH = $(window).height();  
        var winW = $(window).width();  
                
        //Set the popup window to center  
        modalWindow.css('top',  winH/2 - (modalWindow.height() +20) /2);  
        modalWindow.css('left', winW/2 - (modalWindow.width() + 10) /2);  
		modalWindow.fadeIn(50);
	},	
	hide: function() {
	    overlay.hide();
	    modalWindow.hide();
	}
}

