	/*
		*	Window Manager Class
		* 	Author: Ark Rozycki
	*/
	
	
	
	var winMgr = new function(){
		
		// displays a div centered at the screen
		this.center = function(ID, bDontHideOverlay){
			
			// setup the box for animation
			$(ID).css("position","absolute");
		    $(ID).css("top", ( $(window).height() - $(ID).height() ) / 2+$(window).scrollTop() + "px");
			$(ID).css("left", ( $(window).width() - $(ID).width() ) / 2+$(window).scrollLeft() + 200 + "px");
			$(ID).css("opacity", "0.25");
		    // $(ID).css("left", ( $(window).width() - $(ID).width() ) / 2+$(window).scrollLeft() + "px");
			
			// slide the window animation
			$(ID).animate({
				opacity: 1.00,
			    left: [( $(window).width() - $(ID).width() ) / 2+$(window).scrollLeft(), 'swing']
			  }, 750, function() {
			    // Animation complete.
			  });
			
			$(ID).show();
		};
		
		// hides the div passed to it
		this.close = function(ID){
			
			// slide out animation for the window
			$(ID).animate(
				{
					opacity: 0.25,
					left: [0, 'swing']
				}, 
				500, 
				function() {
					$(ID).hide();
				}
			);
		};
		
		this.showOverlay = function(ID){
			// show the large overlay for property details
			$(ID).css("width", $(window).width() + "px");
			$(ID).css("height", $(window).height() + "px");
			$(ID).css("top", "-" + $(window).height() + "px");
			$(ID).css("opacity", 0.25);
			
			// animate the slide in for the property details
			$(ID).animate(
				{
					opacity: 1.00,
					top: [0, 'swing']
				}, 
				500, 
				function() {
				}
			);
			
			$(ID).show();
		};
		
		// hide the main overlay for property details
		this.hideOverlay = function(ID){
			
			// animate the slide in for the property details
			$(ID).animate(
				{
					opacity: 0.25,
					top: [ '-' + $(window).height(), 'swing']
				}, 
				500, 
				function() {
					$(ID).hide();
				}
			);
		};
		
		this.overlayLeft = function(ID){
			// show the large overlay for property details
			$(ID).css("width", ($(window).width()*.35) + "px");
			$(ID).css("height", $(window).height() + "px");
			$(ID).css("left", "-" + ($(window).width()*.35) + "px");
			$(ID).css("opacity", 0.25);
			
			// animate the slide in for the property details
			$(ID).animate(
				{
					opacity: 1.00,
					left: [0, 'swing']
				}, 
				500, 
				function() {
				}
			);
			
			$(ID).show();
		};
		
		this.hideOverlayLeft = function(ID){
			// animate the slide in for the property details
			$(ID).animate(
				{
					opacity: 0.25,
					left: [-$(window).width()*.35, 'swing']
				}, 
				500, 
				function() {
					$(ID).hide();
				}
			);
		}
	};


