// JavaScript Document

$(document).ready(function(){ 		 
if  ($.browser.msie) {						   
	$("#contener").css("overflow","visible");
	$(".programmes").css("overflow","visible");
	$(".ombre_bas").css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='http://www.libre-de-construire.com/fileadmin/templates/img/bas.png')").css("background-image","none").css("left","0px").css("width","536px");
	$(".ombre_droite").css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='http://www.libre-de-construire.com/fileadmin/templates/img/droite.png')").css("background-image", "none");	

	var pos = $("#contener").get(0).offsetLeft;
	$("body").css("background-position", pos+"px top");
}					   
    setSize();
    
    $("#finance").resize( function() { 
        setSize(); 
    } );						   
						   
    $("#menu > ul > li > a").click( 
        function() { 
            
            $('..',this).each(function() {
                    $(this).siblings().children('ul').hide();
    	       }
    	    )
            
            if ($('../ul',this).css("display") == 'block') {
                $('../ul',this).hide();
            }
            else {
                $('../ul',this).show();
            }
        } 
   );
       
	
	$('#moduleJs').flash({
		src: 'img/demo_maison.swf',
		width: 534,
		height: 300
	});
	
	$('#maisonJs').flash({
		src: 'img/masque_maison.swf',
		width: 180,
		height: 121,
		wmode:"transparent"
	});
	
	



});


function setSize() {
        var pageHeight_finance = $('#finance').attr('scrollHeight');
		var pageHeight_temoins = $('#temoins').attr('scrollHeight');
		var pageHeight_flash = $('#module_flash').attr('scrollHeight');
		var pageHeight_contact = $('#contact').attr('scrollHeight');
		    
        $('#finance .ombre_droite').css('height', pageHeight_finance);
		$('#temoins .ombre_droite').css('height', pageHeight_temoins);		
		$('#module_flash .ombre_droite').css('height', pageHeight_flash);
		$('#contact .ombre_droite').css('height', pageHeight_contact);
		
				
		$('.biens .ombre_droite').each( function(){
			var pageHeight_biens = jQuery(this).parent().attr('scrollHeight'); 								
			jQuery(this).css('height', pageHeight_biens);
		 });
		
		$('.programmes .ombre_droite').each( function(){
			var pageHeight_prog = jQuery(this).parent().attr('scrollHeight'); 								
			jQuery(this).css('height', pageHeight_prog);
		 });
}