	


function buildLayer(layer){



	layer = "#"+layer;

	var docHeight = $(document).height();

   $("body").append('<div id="overlay"></div>');

	

   $("#overlay")
      .height(docHeight)
      .css({
         'opacity' : 0.32,
         'position': 'absolute',
         'top': 0,
         'left': 0,
         'background-color': '#a57373',
         'width': '100%',
         'z-index' : '500',
         'display' : 'none'
      })
      .fadeIn("normal", function(){
      
      		if ($.browser.msie){
      		
      			$(layer)
      				.css({
      				'position' : 'absolute',
 					'top' : '-4px',
      				'left' : '38%',
      				'margin-left':'0px'
      			})
      			.show();
      			$(".closebut").show();
					$(".morebut").show();
      		
      		}else{
      		
      			$(layer)
      				.css({
      				'position' : 'absolute',
 					'top' : '-4px',
      				'left' : '38%',
      				'margin-left':'0px'
      			})
      			.fadeIn("slow");
				
				$(".closebut").fadeIn("slow");
					$(".morebut").fadeIn("slow");
      			
      			
      		
      		}
        
      		
      	
      		$(".closebut")
      		.hover(
      			function () {
    			$(this).addClass("closebut_hover");
 				 }, 
 				 function () {
  				  $(this).removeClass("closebut_hover");
  				}
			);
			
			
			$(".morebut")
      		.hover(
      			function () {
    			$(this).addClass("morebut_hover");
 				 }, 
 				 function () {
  				  $(this).removeClass("morebut_hover");
  				}
			);
			
			
			
			
      });




	 $("#overlay, .closebut").click(function (){
	 
	 		if ($.browser.msie){
	 			$(layer).hide();

	 			$("#overlay").fadeOut("slow", function(){
	 				$(this).remove();
	 	 		});

	 		}else{
	 			$(layer).fadeOut("slow", function(){
	 			$("#overlay").fadeOut("slow", function(){
	 				$(this).remove();
	 	 		});
	 		});

	 		}

	 	});
}




$(document).ready( function(){
	
	if($("#overlay1").length > 0){
		buildLayer("overlay1");
	}
	

});