	//*****************************************************************//
	//**  SCRIPT GENERAL  DE CALL  AJAX (JSON) POUR LISTE MAISON     **//
	//*****************************************************************//
	//** PAR MARC-ANDRÉ GIROUX BÉCHARD                               **//
	//** DATE : 2:09 PM 6/23/2011                                    **//
	//** POUR : EGP TECHNOVIRTUEL INC                                **//
	//*****************************************************************//

        //------------------------------------------------
        //-- AFFICHER UNE ERREUR EN AU USER : Liste des maisons
        //------------------------------------------------
        function BindErrorHouseList() {
            $("#propertiesContainer").empty();
            $("#pager").empty();
			
            //Affichage de l'erreur dans la bonne langue
            if (ParamObj.langue == "en") {
                $("#propertiesContainer").append("<div>Data Error !!!<div>");
            } else {
                $("#propertiesContainer").append("<div>Aucune propri&eacute;t&eacute; disponible<div>");
            }
        }
		
		//------------------------------------------------
        //-- AFFICHER UNE ERREUR EN AU USER : Liste des maisons (VILLE)
        //------------------------------------------------
		function BindErrorCheckBoxListCity() {
				alert("Il y  a pas de liste de ville");
        }
		
		
		//------------------------------------------------
        //-- AFFICHER UNE ERREUR EN AU USER : Liste des maisons (TYPE)
        //------------------------------------------------
		function BindErrorCheckBoxListType() {
				alert("Il y  a pas de liste de type");
        }
		
		//------------------------------------------------
        //-- AFFICHER UNE ERREUR EN AU USER : Liste des maisons (GENRE)
        //------------------------------------------------
		function BindErrorCheckBoxListGenre() {
				alert("Il y  a pas de liste de genre");
        }
		

		//********************************************************************
		// BIND LA LISTE DES MAISON
		//********************************************************************
		function BindHouseList(){
		
                //COMPTEUR DE RÉSULTAT ET DE PAGES.
                var pageTotalToGenerate = GlobalDataListing[0].PageCount;

                //CRÉTION DU PAGER
                $("#pager").empty();
                $("#pager").append("<");

                //AJOUTE AU PAGER
                for (var i = 0; i < pageTotalToGenerate; i++) {
					if(i == ParamObj.currpage){
						    $("#pager").append("<a class='active' onclick='ChangeCurrentPage(" + i + ");'>" + (i + 1) + "</a>");
					}else{
						    $("#pager").append("<a class='unactivepage'  onclick='ChangeCurrentPage(" + i + ");'>" + (i + 1) + "</a>");
					}

                }
                $("#pager").append(">");

                //empty out the div that will hold the generated content
                $("#propertiesContainer").empty();
                //call the tmpl function, pass in the data and have it append to artistsContainer
				
				if(ParamObj.typeList == "artistsTemplate"){
                	$("#artistsTemplate").tmpl(GlobalDataListing).appendTo("#propertiesContainer");
				}else if(ParamObj.typeList == "artistsTemplate4"){
					$("#artistsTemplate4").tmpl(GlobalDataListing).appendTo("#propertiesContainer");
					applyBG();
				}
		}
		
		
		//********************************************************************
		// BIND LA LISTE DES VILLES
		//********************************************************************
		function BindCity(){
		           //empty out the div that will hold the generated content
                  $("#wrapperGroupCheckboxVille").empty();
                  //call the tmpl function, pass in the GlobalDataVille and have it append to artistsContainer
                  $("#artistsTemplate2").tmpl(GlobalDataVille).appendTo("#wrapperGroupCheckboxVille");
				  
		}
		
		
		//********************************************************************
		// BIND LA LISTE DES GENRE DE MAISON
		//********************************************************************
		function BindGenre(){
		          //empty out the div that will hold the generated content
                 $("#wrapperGroupCheckboxType").empty();

                 //call the tmpl function, pass in the datax and have it append to artistsContainer
                 $("#artistsTemplate3").tmpl(GlobalDataGenre).appendTo("#wrapperGroupCheckboxType");
			
		}

		//********************************************************************
		// BIND LA LISTE DES GENRE DE PRIX
		//********************************************************************
        	function BindPrice(){

						 
			$(function() {
			
					var miPri = parseInt(ParamObj.minprice);
					var maPri = parseInt( ParamObj.maxprice);

					
				$( "#slider-range" ).slider({
					range: true,
					min: miPri,
					max: maPri,
					step: 1000,
					values: [ miPri, maPri],
					slide: function( event, ui ) {
						var val1x =  ui.values[ 0 ];
						var val2x =  ui.values[ 1 ];
						
						if(val2x == "4000000"){
							$( "#amount" ).val( "$" + ui.values[ 0 ] + " - " + " infinite" );
						} else{
							$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
						}
						
					},	
					change: function( event, ui ) {
						//DONC ON VA CALLER UNE SOUS FONCTION QUI VA SETTER LA RECHERCHE
							//DONC ON VA CALLER UNE SOUS FONCTION QUI VA SETTER LA RECHERCHE
						
						if(ParamObj.isDataPostBack == "1")
						{
						
							if(ParamObj.prixMax != ui.values[ 1 ])
							{
								ChangeMoneyFinderClick( ui.values[ 0 ] , ui.values[ 1 ]);	
							} else{
								if(ParamObj.prixMin !=  ui.values[ 0 ])
								{
									ChangeMoneyFinderClick( ui.values[ 0 ] , ui.values[ 1 ]);	
								} 
							}
					
						}
					}

				});

				var varDataMax  = $( "#slider-range" ).slider( "values", 1 );
				
						if(varDataMax   == "4000000"){
					
							$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - " + " infinite");
						} else{
							
							$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) );
						}

			});
        }
		
