this.imagePreview = function(){ 
        /* CONFIG */
               
                xOffset = 10;
                yOffset = 30;
               
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
               
        /* END CONFIG */
        $("a.preview").hover(function(e){
                this.t = this.title;
                this.title = "";       
                var c = (this.t != "") ? "<br/>" + this.t : "";
                $("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");                                                                
                $("#preview")
                        .css("top",(e.pageY - xOffset) + "px")
                        .css("left",(e.pageX + yOffset) + "px")
                        .fadeIn("fast");                                               
    },
        function(){
                this.title = this.t;   
                $("#preview").remove();
    }); 
        $("a.preview").mousemove(function(e){
                $("#preview")
                        .css("top",(e.pageY - xOffset) + "px")
                        .css("left",(e.pageX + yOffset) + "px");
        });                    
};
this.tooltip = function(){     
        /* CONFIG */           
                xOffset = 10;
                yOffset = 20;          
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result            
        /* END CONFIG */               
        $("a.tooltip").hover(function(e){                                                                                        
                this.t = this.title;
                this.title = "";                                                                         
                $("body").append("<p id='tooltip'>"+ this.t +"</p>");
                $("#tooltip")
                        .css("top",(e.pageY - xOffset) + "px")
                        .css("left",(e.pageX + yOffset) + "px")
                        .fadeIn("fast");               
    },
        function(){
                this.title = this.t;           
                $("#tooltip").remove();
    }); 
        $("a.tooltip").mousemove(function(e){
                $("#tooltip")
                        .css("top",(e.pageY - xOffset) + "px")
                        .css("left",(e.pageX + yOffset) + "px");
        });                    
};


$.fn.replaceUrl = function() {
    var regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
    this.each(function() {
        $(this).html(
            $(this).html().replace(regexp,'<a href="$1">$1</a>')
        );
    });
    return $(this);
}


$(function() {
			$.prettyLoader();

                          $("#infos").toggle( function() { $("#infos_btn").animate( {"left" : "+=180px"}, "slow" );
											   $("#infos_txt").animate( {"width" : "+=180px"}, "slow" );
											   $("#infos").animate( {"width" : "+=180px"}, "slow" );},
								  function() { $("#infos_btn").animate( {"left" : "-=180px"}, "slow" );
											   $("#infos_txt").animate( {"width" : "-=180px"}, "slow" );
											   $("#infos").animate( {"width" : "-=180px"}, "slow" );
								});
			   
			   /*$('#infos').hover(function() {
												 $(this).css('cursor','pointer');
												 }, function() {
												 $(this).css('cursor','auto');
											});
			   */
			   $('.menu_item').hover(function() {
											  originalCssBckImg = $(this).css('background-image');
											  $(this).css('background-image', originalCssBckImg.split('_out.png')[0] + '_in.png');
											  },
										function() {$(this).css('background-image', originalCssBckImg);
											  });
			   
			   $("#new").hover( function() { $("#new_texte").animate( {"height" : "+=20px", "top" : "-=20px"}, "fast" );},
								  function() { $("#new_texte").animate( {"height" : "-=20px", "top" : "+=20px"}, "fast" );
								});
			   $("#ventesprivees").hover( function() { $("#ventesprivees_texte").animate( {"height" : "+=20px", "top" : "-=20px"}, "fast" );},
										  function() { $("#ventesprivees_texte").animate( {"height" : "-=20px", "top" : "+=20px"}, "fast" );
										});
			   //$("#infos_txt").mouseout( function() { $("#infos_txt").animate( {"width" : "-=50px"}, "slow"); } );

$(".defaultText").focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            $(this).removeClass("defaultTextActive");
            $(this).val("");
        }
    });

    $(".defaultText").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).addClass("defaultTextActive");
            $(this).val($(this)[0].title);
        }
    });

    $(".defaultText").blur();


		   });


