    jQuery.noConflict();
    
    jQuery(document).ready(function(){
    
    	//*** FUNCTIONS ****
    	
	    function HideBottom()
	    {
	        // handle bottom div
	        jQuery("#footer").css("visibility", "hidden");        
	    }
	    
	    function HideArticle(docid)
	    {
	    	HideBottom();
		    jQuery("#brut_" + docid).css("display", "block");
	        jQuery("#plain_" + docid).css("display", "none");        
	        jQuery("#btn_" + docid).html("<img src='/sites/templates/images/bt_toggle_article_show.gif' title='Cliquez pour voir la description complète' />");
	        ResizeSiteHeight();    
	    }
    	
        ResizeSiteHeight();
        
        
        // site effects
        
        jQuery("#cgv_div .cgv_title").click(function(){      
        
	        jQuery("#footer").css("visibility", "hidden");
	        
	        if (jQuery(this).parent().css("height") == "1500px")
	        {
	            jQuery(this).parent().animate({ height: "200px" }, 1000, function() {
                    ResizeSiteHeight();
                    jQuery("#footer").css("visibility", "visible");
                });
	        }
	        else
	        {
		        jQuery(this).parent().animate({ height: "1500px" }, 1000, function() {
				    ResizeSiteHeight();
				    jQuery("#footer").css("visibility", "visible");
				});
			}	        
	    });
        
        
        
        // initialize LightBox  
        SexyLightbox.initialize({
		    find          : 'sexylightbox', // rel="sexylightbox"
		    color         : 'orange',
		    dir           : '/sites/templates/images/lightBox_images/',
		    imagesdir     : '/sites/templates/images/lightBox_images/',
		    emergefrom    : 'top',
		    OverlayStyles : {
		      'background-color': '#000',
		      'opacity' : 0.5
		    }
		});
		
		
		//*** LOAD MENU ****        
        LoadMenu();
        
        //*** LOAD LAST SUBSCRIBERS ****
        LoadLastSubscribers();
        
        //*** LOAD JOB OFFERS ****
        LoadJobOffers();
        
        
        // checkboxes
        //jQuery('#form_recherche input:checkbox').checkbox({cls:'jquery-dark-checkbox'});
        //jQuery('#form_recherche input:radio').checkbox({cls:'jquery-dark-checkbox'});  
        
        
	    jQuery('.calendar').datepicker({ 
	        buttonImage: '/sites/module/img/ico_cal.png',
	        dateFormat: 'dd/mm/yy', 
	        dayNamesMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 
	        showOn: 'both',
	        changeMonth: true,
	        changeYear: true,
	        firstDay: 1,
	        yearRange: '-50:1',
	        buttonImageOnly: true,
	        monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin','Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],
	        monthNamesShort: [ 'Janv','Fév','Mars','Avril','Mai','Juin','Juil','Aout','Sept','Oct','Nov','Déc']
	    });
	    //jQuery('.calendar_heure').datetimepicker();
	   /* jQuery('.calendar_heure').datetimepicker({ 
	        buttonImage: '/sites/module/img/ico_cal.png',
	        dateFormat: 'dd/mm/yy hh:mm:ss', 
	        dayNamesMin: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 
	        showOn: 'both',
	        changeMonth: true,
	        changeYear: true,
	        firstDay: 1,
	        yearRange: '-50:1',
	        buttonImageOnly: true,
	        monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin','Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],
	        monthNamesShort: [ 'Janv','Fév','Mars','Avril','Mai','Juin','Juil','Aout','Sept','Oct','Nov','Déc']
	    });*/
        
        
        
    
	    /* PLACEMENT DU DIV DE LOCALISATION VILLE ET PAYS*/
	    /*var inputNomLocalisationTop = jQuery("#input_nom_pays").offset().top + 18;
	    jQuery("#div_sel_pays").css("top", inputNomLocalisationTop + "px");
	    var inputNomLocalisationLeft = jQuery("#input_nom_pays").offset().left - 3;
	    jQuery("#div_sel_pays").css("left", inputNomLocalisationLeft + "px");
	    
	    inputNomLocalisationTop = jQuery("#input_nom_ville").offset().top + 18;
	    jQuery("#div_sel_villes").css("top", inputNomLocalisationTop + "px");
	    inputNomLocalisationLeft = jQuery("#input_nom_ville").offset().left - 3;
	    jQuery("#div_sel_villes").css("left", inputNomLocalisationLeft + "px");*/
	    
	    
	    jQuery('.user_exp_zone').each(function (index) {
	        var divHeight = jQuery(this).height();
	        var divWidth = jQuery(this).width();	        
	        if (divHeight > 90)
	        {
	           jQuery(this).attr("title", "Cliquez pour voir la description complète");
	           jQuery(this).css("height", "110px");
	           jQuery(".desc", this).css("height", "90px");
	           jQuery(".desc", this).css("overflow", "hidden");
	           jQuery(this).css("cursor", "pointer");
	           jQuery(".link_fulldesc", this).css("display", "block");
	           jQuery(".link_fulldesc", this).css("width", divWidth + "px");
	           ResizeSiteHeight();
	           
	           jQuery(this).click(function (i) {
	               if (jQuery(this).css("height") == divHeight + "px")
	               {		               
		               jQuery(this).animate({ height: "110px" }, 1000, function() {                
			                jQuery(".desc", this).css("height", "90px");
			                jQuery(".link_fulldesc", this).css("display", "block");
			                jQuery(this).attr("title", "Cliquez pour voir la description complète");
			                ResizeSiteHeight();
			           });
			       }
			       else
			       {
			           jQuery(".link_fulldesc", this).css("display", "none");
			           jQuery(".desc", this).css("height", divHeight + "px");
			           jQuery(this).attr("title", "Cliquez pour réduire la description complète");
			           jQuery(this).animate({ height: divHeight + "px" }, 1000, function() {                
                            ResizeSiteHeight();        
                       });
			       }	               
	           });
	        }
	    });
	    
	    
	    /* FOND DES LIGNES DU TABLEAU PROFIL */
	    jQuery('.rounded_tables tr').each(function (i) {
	        var colorBG = "#FEFFEC";
	    	if (i%2 != 0) {
	    		colorBG = "#f9fccd";
	    		jQuery("td", this).css("background-color", colorBG);
	        }
	        jQuery(this).mouseenter(function() {
	        	jQuery("td", this).css("background-color", "#c0ebf2");
	        }).mouseleave(function() {
	        	jQuery("td", this).css("background-color", colorBG);
	        });
	    });
		
		
		/*
		*
		* ARTICLES
		*
		*
		*/
        
        jQuery(".summaryPost .title, .summaryPost .bt_fulldesc").click(function () {
        	var docid = jQuery(this).parent().attr("article");
        	if (jQuery("#brut_" + docid).css("display") == "block") 	
        		jQuery("#brut_" + docid).click();
        	else
        		HideArticle(docid);
        });
        
        jQuery(".summaryPost .contentPostBrut").each(function (i) {
        	jQuery(this).html(jQuery(this).text());
        	
        	var docid = jQuery(this).parent().attr("article");
        	
        	var divHeight = jQuery(this).height();
	        var divWidth = jQuery(this).width();	        
	        
           jQuery(this).attr("title", "Cliquez pour voir la description complète");
           jQuery(this).css("height", "55px");
           jQuery(this).css("overflow", "hidden");
           jQuery(this).css("cursor", "pointer");
           ResizeSiteHeight();
           
           jQuery(this).click(function () {               
               HideBottom();               
               if (jQuery(this).css("height") !== divHeight + "px")               
		       {
		           jQuery(this).css("display", "none");
		           jQuery("#plain_" + docid).css("display", "block");
		           jQuery("#plain_" + docid).attr("title", "Cliquez pour réduire la description");
		           
		           jQuery("#btn_" + docid).html("<img src='/sites/templates/images/bt_toggle_article_hide.gif' title='Réduire la description complète' />");
		           
		           ResizeSiteHeight();
		       }	               
           });
           
           jQuery("#plain_" + docid).click(function () {
           	   if (jQuery(this).hasClass("offre_fulldesc"))
           		   return;
           	   HideArticle(docid);
           });
	        
        	
        });		
		
		
    });
    
    
