
if(jQuery)(function($){$.extend($.fn,{multiSelect:function(o,callback){if(!o)var o={};if(o.selectAll==undefined)o.selectAll=true;if(o.selectAllText==undefined)o.selectAllText="Select All";if(o.noneSelected==undefined)o.noneSelected='Select options';if(o.oneOrMoreSelected==undefined)o.oneOrMoreSelected='% selected';$(this).each(function(){var select=$(this);var html='<input type="text" readonly="readonly" class="multiSelect" value="" style="cursor: pointer;" />';html+='<div class="multiSelectOptions" style="position: absolute; z-index: 99999; display: none;">';if(o.selectAll)html+='<label class="selectAll"><input type="checkbox" class="selectAll" />'+o.selectAllText+'</label>';$(select).find('OPTION').each(function(){if($(this).val()!=''){html+='<label><input type="checkbox" name="'+$(select).attr('name')+'['+$(this).val()+']" value="on"';if($(this).attr('selected'))html+=' checked="checked"';html+=' />'+$(this).html()+'</label>';}});html+='</div>';$(select).after(html);$(select).next('.multiSelect').mouseover(function(){$(this).addClass('hover');}).mouseout(function(){$(this).removeClass('hover');}).click(function(){if($(this).hasClass('active')){$(this).multiSelectOptionsHide();}else{$(this).multiSelectOptionsShow();}
return false;}).focus(function(){$(this).addClass('focus');}).blur(function(){$(this).removeClass('focus');});if(o.selectAll){var sa=true;$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT:checkbox').not('.selectAll').each(function(){if(!$(this).attr('checked'))sa=false;});if(sa)$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT.selectAll').attr('checked',true).parent().addClass('checked');}
$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT.selectAll').click(function(){if($(this).attr('checked')==true)$(this).parent().parent().find('INPUT:checkbox').attr('checked',true).parent().addClass('checked');else $(this).parent().parent().find('INPUT:checkbox').attr('checked',false).parent().removeClass('checked');});$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT:checkbox').click(function(){$(this).parent().parent().multiSelectUpdateSelected(o);$(this).parent().parent().find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');$(this).parent().parent().prev('.multiSelect').focus();if(!$(this).attr('checked'))$(this).parent().parent().find('INPUT:checkbox.selectAll').attr('checked',false).parent().removeClass('checked');if(callback)callback($(this));});$(select).next('.multiSelect').next('.multiSelectOptions').each(function(){$(this).multiSelectUpdateSelected(o);$(this).find('INPUT:checked').parent().addClass('checked');});$(select).next('.multiSelect').next('.multiSelectOptions').find('LABEL').mouseover(function(){$(this).parent().find('LABEL').removeClass('hover');$(this).addClass('hover');}).mouseout(function(){$(this).parent().find('LABEL').removeClass('hover');});$(select).next('.multiSelect').keydown(function(e){if($(this).next('.multiSelectOptions').is(':visible')){if(e.keyCode==9){$(this).addClass('focus').trigger('click');$(this).focus().next(':input').focus();return true;}
if(e.keyCode==27||e.keyCode==37||e.keyCode==39){$(this).addClass('focus').trigger('click');}
if(e.keyCode==40){if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}else{$(this).next('.multiSelectOptions').find('LABEL.hover').removeClass('hover').next('LABEL').addClass('hover');if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}}
return false;}
if(e.keyCode==38){if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}else{$(this).next('.multiSelectOptions').find('LABEL.hover').removeClass('hover').prev('LABEL').addClass('hover');if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:last').addClass('hover');}}
return false;}
if(e.keyCode==13||e.keyCode==32){if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').hasClass('selectAll')){if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked')){$(this).next('.multiSelectOptions').find('INPUT:checkbox').attr('checked',false).parent().removeClass('checked');}else{$(this).next('.multiSelectOptions').find('INPUT:checkbox').attr('checked',true).parent().addClass('checked');}
$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);if(callback)callback($(this));return false;}
if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked')){$(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked',false);$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);$(this).next('.multiSelectOptions').find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');$(this).next('.multiSelectOptions').find('INPUT:checkbox.selectAll').attr('checked',false).parent().removeClass('checked');if(callback)callback($(this));}else{$(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked',true);$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);$(this).next('.multiSelectOptions').find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');if(callback)callback($(this));}}
return false;}else{if(e.keyCode==38||e.keyCode==40||e.keyCode==13||e.keyCode==32){$(this).removeClass('focus').trigger('click');$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');return false;}
if(e.keyCode==9){$(this).focus().next(':input').focus();return true;}}
if(e.keyCode==13)return false;});$(select).remove();});},multiSelectOptionsHide:function(){$(this).removeClass('active').next('.multiSelectOptions').hide();},multiSelectOptionsShow:function(){$('.multiSelect').multiSelectOptionsHide();$(this).next('.multiSelectOptions').find('LABEL').removeClass('hover');$(this).addClass('active').next('.multiSelectOptions').show();var offset=$(this).offset();$(this).next('.multiSelectOptions').css({top:offset.top+$(this).outerHeight()+'px'});$(this).next('.multiSelectOptions').css({left:offset.left+'px'});multiSelectCurrent=$(this);var timer='';$(this).next('.multiSelectOptions').hover(function(){clearTimeout(timer);},function(){timer=setTimeout('$(multiSelectCurrent).multiSelectOptionsHide(); $(multiSelectCurrent).unbind("hover");',250);});},multiSelectUpdateSelected:function(o){var i=0,s='';$(this).find('INPUT:checkbox:checked').not('.selectAll').each(function(){i++;})
if(i==0){$(this).prev('INPUT.multiSelect').val(o.noneSelected);}else{if(o.oneOrMoreSelected=='*'){var display='';$(this).find('INPUT:checkbox:checked').each(function(){if($(this).parent().text()!=o.selectAllText)display=display+$(this).parent().text()+', ';});display=display.substr(0,display.length-2);$(this).prev('INPUT.multiSelect').val(display);}else{$(this).prev('INPUT.multiSelect').val(o.oneOrMoreSelected.replace('%',i));}}}});})(jQuery);(function($){jQuery.fn.pngFix=function(settings){settings=jQuery.extend({blankgif:'blank.gif'},settings);var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(jQuery.browser.msie&&(ie55||ie6)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr('width',jQuery(this).width());jQuery(this).attr('height',jQuery(this).height());var prevStyle='';var strNewHTML='';var imgId=(jQuery(this).attr('id'))?'id="'+jQuery(this).attr('id')+'" ':'';var imgClass=(jQuery(this).attr('class'))?'class="'+jQuery(this).attr('class')+'" ':'';var imgTitle=(jQuery(this).attr('title'))?'title="'+jQuery(this).attr('title')+'" ':'';var imgAlt=(jQuery(this).attr('alt'))?'alt="'+jQuery(this).attr('alt')+'" ':'';var imgAlign=(jQuery(this).attr('align'))?'float:'+jQuery(this).attr('align')+';':'';var imgHand=(jQuery(this).parent().attr('href'))?'cursor:hand;':'';if(this.style.border){prevStyle+='border:'+this.style.border+';';this.style.border='';}
if(this.style.padding){prevStyle+='padding:'+this.style.padding+';';this.style.padding='';}
if(this.style.margin){prevStyle+='margin:'+this.style.margin+';';this.style.margin='';}
var imgStyle=(this.style.cssText);strNewHTML+='<span '+imgId+imgClass+imgTitle+imgAlt;strNewHTML+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;strNewHTML+='width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;';strNewHTML+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+jQuery(this).attr('src')+'\', sizingMethod=\'scale\');';strNewHTML+=imgStyle+'"></span>';if(prevStyle!=''){strNewHTML='<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;'+'">'+strNewHTML+'</span>';}
jQuery(this).hide();jQuery(this).after(strNewHTML);});jQuery(this).find("*").each(function(){var bgIMG=jQuery(this).css('background-image');if((bgIMG.indexOf("bg_ombre_blanc.png")!=-1)||(bgIMG.indexOf("bg_ombre.png")!=-1)){var iebg=bgIMG.split('url("')[1].split('")')[0];jQuery(this).css('background-image','none');jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')";}});}
return jQuery;};})(jQuery);$.fn.jForms=function(options)
{var lastKeypress=0;var keyBuffer='';var self=this;var defaults={imagePath:'/extension/smiledesign/design/foncia/images/css/',listSize:20}
if($.browser.safari){return false;}
var opts=$.extend(defaults,options);var imagePath=opts.imagePath
var images=[imagePath+"button_left_xon.gif",imagePath+"button_right_xon.gif",imagePath+"input_left_xon.gif",imagePath+"input_right_xon.gif",imagePath+"txtarea_bl_xon.gif",imagePath+"txtarea_br_xon.gif",imagePath+"txtarea_cntr_xon.gif",imagePath+"txtarea_l_xon.gif",imagePath+"txtarea_tl_xon.gif",imagePath+"txtarea_tr_xon.gif"]
var imgs=new Array();for(var i=0;i<images.length;i++)
{imgs[i]=$("<img>").attr("src",images[i]);}
$(self).attr('autocomplete','off').addClass('niceforms');$('select',self).each(function()
{$('body').append('<ul id = "'+this.id+'_fake_list" class="fake_list"></ul>');$(this).children().each(function()
{$('#'+$(this).parent().attr('id')+'_fake_list').append('<li>'+$(this).text()+'</li>');});$('#'+this.id+'_fake_list').css('height',($('#'+this.id+'_fake_list li:first').height())*($('#'+this.id+'_fake_list li').size()<opts.listSize?$('#'+this.id+'_fake_list li').size():opts.listSize)).toggle();$('#'+this.id+'_fake_list > li').hover(function(){$(this).addClass('selected')},function(){$(this).removeClass('selected');}).each(function(i)
{$(this).click(function(){var id=$(this).parent().attr('id');$('#'+id).toggle();$('#'+id.replace('_list','')).attr('value',$(this).text());$('#'+id.replace('_fake_list','')).attr('selectedIndex',i).change();$('#'+id+' >  li').removeClass('selected');$(this).addClass('selected');});});$(this).before('<div class="selectArea"><div class="left"></div><div class="right"><a class="selectButton" href="javascript:;" onclick="$(\'#'+this.id+'_fake\').focus().click()"></a></div><input type = "text" class="center" id="'+this.id+'_fake"  value="'+this[this.selectedIndex].text+'"  /></div>').css('position','absolute').css('left','-6000px');$('#'+this.id+'_fake').click(function(){$('#'+this.id+'_list').focus();$('#'+this.id+'_list').css('left',$(this).offset().left-8);if(($('#'+this.id+'_list').height()+$(this).offset().top-document.documentElement.scrollTop)>$(window).height())
{$('#'+this.id+'_list').css('top',$(this).offset().top-$('#'+this.id+'_list').height()-4);}
else
{$('#'+this.id+'_list').css('top',$(this).offset().top+$(this).height()+4);}
$('#'+this.id+'_list > li').removeClass('selected');$('#'+this.id+'_list > li').get($('#'+this.id.replace('_fake','')).attr('selectedIndex')).className='selected';$('.fake_list:visible:not(#'+this.id+'_list)').toggle();$list=$('#'+this.id+'_list');$list.toggle();var offSet=(($('.selected',$list).length>0?$('.selected',$list).offset().top:0)-$list.offset().top);$list.animate({scrollTop:offSet});}).css('padding','0').keyup(function(e)
{var pressedKey=e.charCode||e.keyCode||-1;var $dd=$('#'+this.id.replace('_fake',''));$('#'+this.id+'_list > li').removeClass('selected');switch(pressedKey)
{case 40:var curr=($dd.attr('selectedIndex')+1>=$('option',$dd).length?0:$dd.attr('selectedIndex')+1);break;case 38:var curr=($dd.attr('selectedIndex')-1<0?$('option',$dd).length-1:$dd.attr('selectedIndex')-1);break;case 13:$('#'+this.id+'_list').toggle();return false;break;default:var t=new Date();if(t.getTime()-lastKeypress>1000)
{lastKeypress=t.getTime();keyBuffer='';}
keyBuffer+=String.fromCharCode(pressedKey).toLowerCase();curr=-1;$('#'+this.id+'_list > li').each(function(i)
{if($(this).text().toLowerCase().indexOf(keyBuffer)==0&&curr==-1)
{curr=i;return;}});break;}
if(curr==-1)
{curr=0;}
$($('#'+this.id+'_list > li').get(curr)).addClass('selected').focus();$list=$('#'+this.id+'_list');var offSet=(($('.selected',$list).length>0?$('.selected',$list).offset().top:0)-$list.offset().top);$list.attr('scrollTop',offSet);$dd.attr('selectedIndex',curr).change();$(this).attr('value',$($('#'+this.id+'_list > li').get(curr)).text());return false;}).focus(function()
{$(document).keypress(function(e)
{var pressedKey=e.charCode||e.keyCode||-1;if(pressedKey==13)
{return false;}});}).blur(function()
{$(document).unbind('keypress').unbind('click');});});$(':radio',self).each(function()
{$(this).after('<div style="margin: 1px;" id="'+this.id+'_fake"></div>').addClass('outtaHere');this.checked?$('label[for='+this.id+']').addClass('chosen'):'';$('#'+this.id+'_fake').addClass(this.checked?'radioAreaChecked':'radioArea').click(function()
{$(':radio[name='+$('#'+this.id.replace('_fake','')).attr('name')+']').each(function()
{this.checked=false;});$('#'+this.id.replace('_fake','')).attr('checked','checked');$('label[for='+this.id.replace('_fake','')+']').click();});$('label[for='+this.id+']').click(function()
{$(':radio[name='+$('#'+$(this).attr('for')).attr('name')+']').each(function()
{$('label[for='+this.id+']').removeClass('chosen');$('#'+this.id+'_fake').addClass('radioArea').removeClass('radioAreaChecked');$('label[for='+this.id.replace('_fake','')+']').removeClass('chosen');});$(this).addClass('chosen');$('#'+$(this).attr('for')+'_fake').addClass('radioAreaChecked');})});$(':button,:submit',self).each(function()
{$(this).before('<img class="buttonImg" src="'+imagePath+'button_left.gif">').after('<img class="buttonImg" src="'+imagePath+'button_right.gif">').addClass('buttonSubmit').hover(function()
{$(this).prev().attr('src',imagePath+'button_left_xon.gif');$(this).next().attr('src',imagePath+'button_right_xon.gif');$(this).addClass('buttonSubmitHovered').removeClass('buttonSubmit');},function()
{$(this).prev().attr('src',imagePath+'button_left.gif');$(this).next().attr('src',imagePath+'button_right.gif');$(this).removeClass('buttonSubmitHovered').addClass('buttonSubmit');});});return self;}
$(document).ready(function(){$(".main-menu li.service > a.item").hover(function(){if($(this).siblings(".subservice").length!=0)
{$(this).siblings(".subservice").show();}
if(!$(this).hasClass("selected"))
{$(this).css("background-position","bottom left");}},function(){if($(this).siblings(".subservice").length!=0)
{$(this).siblings(".subservice").hide();}
if(!$(this).hasClass("selected"))
{$(this).css("background-position","top left");}});$(".main-menu .subservice").hover(function(){$(this).show();if(!$(this).prev().hasClass("selected"))
{$(this).prev().css("background-position","bottom left");}},function(){if(!$(this).prev().hasClass("selected"))
{$(this).prev().css("background-position","top left");}
$(this).hide();});$(".service").eq(0).addClass("firstItem");$(".firstItem .submenu").animate({height:"show",opacity:"1"});$("#colonneA .firstItem .headlines a.item").css("background-position","bottom left").addClass("triggerClick").parent().next().addClass("showSubmenu");$("#colonneA .submenu").css('opacity',0);$(".vous_souhaitez .service .headlines a.item").hover(function(){$(this).addClass("mouseover");$(this).css("background-position","bottom left");if($(this).parent(".headlines").next().css("display")=="block")
{$(this).css("background-position","bottom left");}},function(){if($(this).hasClass("triggerClick")==false)
{$(this).removeClass("mouseover");$(this).css("background-position","top left");}
if($(this).parent(".headlines").next().css("display")=="block")
{$(this).css("background-position","bottom left");}});$(".vous_souhaitez .service .headlines a.item").click(function(){if($(this).hasClass("triggerClick"))
{$(".triggerClick").removeClass("triggerClick");$(".showSubmenu").removeClass("showSubmenu");$(this).parent().next().animate({height:"hide",opacity:"0"});$(this).css("background-position","bottom left");return false;}
$(".triggerClick").removeClass("triggerClick");$(".showSubmenu").removeClass("showSubmenu");$(this).addClass("triggerClick");$(this).parent().next().addClass("showSubmenu");menu_item=this;if(($(this).parent(".headlines").next().length!=0)&&($.trim($(this).parent(".headlines").next().text()).length!=0))
{if($(menu_item).parent().siblings(".submenu").length!=0)
{$(menu_item).parent().siblings(".submenu").animate({height:"show",opacity:"1"});}
$(menu_item).css("background-position","bottom left");if($(this).parent().siblings(".submenu").find(".niceforms").length)
{$("#colonneA .submenu").not(".showSubmenu").animate({height:"hide",opacity:"0"}).parent(".service").find('a.item').css("background-position","top left");;}
$(".vous_souhaitez .service .headlines a.item").each(function(){if($(this).parent(".headlines").next(".submenu:hidden").length>0)
{$(this).css("background-position","top left");}});return false;}
else
{window.location=$(menu_item).attr('href');}});$(".form1 input.text, form#search_agence input, #login .txt").focus(function(){if($(this).attr('title')==$(this).val())
{$(this).val('');}});$(".form1 input.text, form#search_agence input, #login .txt").blur(function(){if($(this).val()=='')
{$(this).val($(this).attr('title'));}});$("form.form-franchise").submit(function(){var i=0;$(this).find('input.text').each(function(){if($(this).attr('title')==$(this).val())
{$(this).val('');}})});});var jsCst_RS_value_localites="DÃ©partement, ville ou code postal";var jsCst_RS_Indifferent="IndiffÃ©rent";var jsCst_RS_value_sms="RÃ©fÃ©rence bien / SMS";var jsCst_RS_Min="Min";var jsCst_RS_Max="Max";function verifVirgule(texte){String.prototype.trim=function(){return this.replace(/(?:^\s+|\s+$)/g,"");}
texte=texte.trim();valRight=Right(texte,1);if(valRight!=","){document.getElementById("txtRecherche").value=texte+", ";}else{document.getElementById("txtRecherche").value=texte;}}
function Right(str,n){if(n<=0){return"";}else if(n>String(str).length){return str;}else{var iLen=String(str).length;return String(str).substring(iLen,iLen-n);}}
function fisherYates(myArray){var i=myArray.length;if(i==0)return false;while(--i){var j=Math.floor(Math.random()*(i+1));var tempi=myArray[i];var tempj=myArray[j];myArray[i]=tempj;myArray[j]=tempi;}};function randomProducts(){var i=0;var contant_tab=new Array();$("#colonneD").children().each(function(){if($(this).hasClass("online_editor")){contant_tab[i]=$(this).clone();i=i+1;}
$(this).remove();});contant_tab.sort(function(){return 0.5-Math.random()});for(var j=0;j<contant_tab.length;j++){$("#colonneD").append(contant_tab[j]);$("#colonneD").append('<div class="breaker"></div><div class="separateur"></div>');}};function effacerCriteres(origine){jQuery.ajax({type:"POST",url:"http://fr.foncia.com/agence-immobiliere/ajax_effacerCriteres.php",data:"origine="+origine,success:function(msg){}});switch(origine){case"agence":document.getElementById("txtRecherche").value=jsCst_RS_value_localites;document.getElementById("etendreRecherche").checked=false;var listeActivites=new Array();listeActivites=document.getElementsByName("activites[]");if(listeActivites!=null&&listeActivites.length>0){for(i=0;i<listeActivites.length;i++){listeActivites[i].checked=false;}}
if(document.getElementById("activites")){document.getElementById("activites").value=jsCst_RS_Indifferent;}
break;case"louer":$("form#louer #location_type_loge_label + input").replaceWith(formlocation);$("#location_type_loge").multiSelect({selectAllText:'Tout sÃ©lectionner',oneOrMoreSelected:'*',noneSelected:'IndiffÃ©rent'});for(i=0;i<=5;i++){if(document.getElementById("nbPieces"+i)){document.getElementById("nbPieces"+i).checked=false;}}
for(i=0;i<=90;i=i+30){if(document.getElementById("dispo"+i)){document.getElementById("dispo"+i).checked=false;}}
if(document.getElementById("loyerMin")){document.getElementById("loyerMin").value="";jQuery('#loyerMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("loyerMax")){document.getElementById("loyerMax").value="";jQuery('#loyerMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("txtRecherche")){document.getElementById("txtRecherche").value="";jQuery('#txtRecherche').DefaultValue(jsCst_RS_value_localites);}
if(document.getElementById("location_nbre_piece1_fake")){document.getElementById("location_nbre_piece1_fake").value="";jQuery('#location_nbre_piece1_fake').DefaultValue(jsCst_RS_Indifferent);}
var o=document.getElementById("location_nbre_piece1").options;for(var i=0;i<o.length;i++){o[i].selected=false;}
if(document.getElementById("location_localisation")){document.getElementById("location_localisation").value="";jQuery('#location_localisation').DefaultValue(jsCst_RS_value_localites);}
if(document.getElementById("etendreRecherche")){document.getElementById("etendreRecherche").checked=false;}
if(document.getElementById("prixMin")){document.getElementById("prixMin").value="";jQuery('#prixMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("prixMax")){document.getElementById("prixMax").value="";jQuery('#prixMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("critereparkingGarageBox")){document.getElementById("critereparkingGarageBox").checked=false;}
if(document.getElementById("criteremobiliteReduite")){document.getElementById("criteremobiliteReduite").checked=false;}
if(document.getElementById("critereascenseur")){document.getElementById("critereascenseur").checked=false;}
if(document.getElementById("criterepiscine")){document.getElementById("criterepiscine").checked=false;}
if(document.getElementById("criteresousSol")){document.getElementById("criteresousSol").checked=false;}
if(document.getElementById("trier_par_jaune")){jQuery("#trier_par_jaune > option[value='']").attr("selected","selected");}
if(document.getElementById("foncia_smsRef")){document.getElementById("foncia_smsRef").value="";jQuery('#foncia_smsRef').DefaultValue(jsCst_RS_value_sms);}
updateLocationForm();break;case"transaction":$("form#achat #achat_type_loge_label + input").replaceWith(formachat);$("#achat_type_loge").multiSelect({selectAllText:'Tout sÃ©lectionner',oneOrMoreSelected:'*',noneSelected:'IndiffÃ©rent'});if(document.getElementById("achat_nbre_piece1_fake")){document.getElementById("achat_nbre_piece1_fake").value="";jQuery('#achat_nbre_piece1_fake').DefaultValue(jsCst_RS_Indifferent);}
var o=document.getElementById("achat_nbre_piece1").options;for(var i=0;i<o.length;i++){o[i].selected=false;}
if(document.getElementById("achat_nbre_chambre_fake")){document.getElementById("achat_nbre_chambre_fake").value="";jQuery('#achat_nbre_chambre_fake').DefaultValue(jsCst_RS_Indifferent);}
var o=document.getElementById("achat_nbre_chambre").options;for(var i=0;i<o.length;i++){o[i].selected=false;}
for(i=0;i<=90;i=i+30){if(document.getElementById("dispo"+i)){document.getElementById("dispo"+i).checked=false;}}
if(document.getElementById("surfaceMin")){document.getElementById("surfaceMin").value="";jQuery('#surfaceMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("surfaceMax")){document.getElementById("surfaceMax").value="";jQuery('#surfaceMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("prixMin")){document.getElementById("prixMin").value="";jQuery('#prixMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("prixMax")){document.getElementById("prixMax").value="";jQuery('#prixMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("surfaceTerrainMin")){document.getElementById("surfaceTerrainMin").value="";jQuery('#surfaceTerrainMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("surfaceTerrainMax")){document.getElementById("surfaceTerrainMax").value="";jQuery('#surfaceTerrainMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("txtRecherche")){document.getElementById("txtRecherche").value="";jQuery('#txtRecherche').DefaultValue(jsCst_RS_value_localites);}
if(document.getElementById("achat_localisation")){document.getElementById("achat_localisation").value="";jQuery('#achat_localisation').DefaultValue(jsCst_RS_value_localites);}
if(document.getElementById("etendreRecherche")){document.getElementById("etendreRecherche").checked=false;}
if(document.getElementById("prixMin")){document.getElementById("prixMin").value="";jQuery('#prixMin').DefaultValue(jsCst_RS_Min);}
if(document.getElementById("prixMax")){document.getElementById("prixMax").value="";jQuery('#prixMax').DefaultValue(jsCst_RS_Max);}
if(document.getElementById("critereterrainJardin")){document.getElementById("critereterrainJardin").checked=false;}
if(document.getElementById("critereparkingGarageBox")){document.getElementById("critereparkingGarageBox").checked=false;}
if(document.getElementById("criteremobiliteReduite")){document.getElementById("criteremobiliteReduite").checked=false;}
if(document.getElementById("critereascenseur")){document.getElementById("critereascenseur").checked=false;}
if(document.getElementById("criterebalcon")){document.getElementById("criterebalcon").checked=false;}
if(document.getElementById("criterepiscine")){document.getElementById("criterepiscine").checked=false;}
if(document.getElementById("criteresousSol")){document.getElementById("criteresousSol").checked=false;}
if(document.getElementById("trier_par_orange")){jQuery("#trier_par_jaune > option[value='']").attr("selected","selected");}
if(document.getElementById("foncia_smsRef")){document.getElementById("foncia_smsRef").value="";jQuery('#foncia_smsRef').DefaultValue(jsCst_RS_value_sms);}
updateTransactionForm();break;}}
jQuery.fn.DefaultValue=function(text){return this.each(function(){if(this.type!='text'&&this.type!='password'&&this.type!='textarea')
return;var fld_current=this;if(this.value==''){this.value=text;}else{return;}
$(this).focus(function(){if(this.value==text||this.value=='')
this.value='';});$(this).blur(function(){if(this.value==text||this.value=='')
this.value=text;});$(this).parents("form").each(function(){$(this).submit(function(){if(fld_current.value==text){fld_current.value='';}});});});};function updateTransactionForm(){if(!jQuery('#typeDeBien1').attr("checked")&&!jQuery('#typeDeBien2').attr("checked")&&!jQuery('#typeDeBien0').attr("checked")){jQuery('#foncia_nbpieces input').attr("checked","");jQuery('#foncia_nbpieces input').attr("disabled","disabled");jQuery('#foncia_nbchambres input').attr("checked","");jQuery('#foncia_nbchambres input').attr("disabled","disabled");jQuery('#foncia_nbpieces').addClass("foncia_opacity");jQuery('#foncia_nbchambres').addClass("foncia_opacity");}else{jQuery('#foncia_nbpieces input').removeAttr("disabled");jQuery('#foncia_nbchambres input').removeAttr("disabled");jQuery('#foncia_nbpieces').removeClass("foncia_opacity");jQuery('#foncia_nbchambres').removeClass("foncia_opacity");}}
function updateLocationForm(){if(!jQuery('#typeDeBien1').attr("checked")&&!jQuery('#typeDeBien2').attr("checked")&&!jQuery('#typeDeBien4').attr("checked")&&!jQuery('#typeDeBien5').attr("checked")&&!jQuery('#typeDeBien6').attr("checked")&&!jQuery('#typeDeBien0').attr("checked")){jQuery('#foncia_nbpieces :input').attr("checked","");jQuery('#foncia_nbpieces :input').attr("disabled",true);jQuery('#foncia_nbpieces').addClass("foncia_opacity");}else{jQuery('#foncia_nbpieces :input').removeAttr("disabled");jQuery('#foncia_nbpieces').removeClass("foncia_opacity");}}
function updateIndifferent(input){doIt=true;switch(input.attr("id")){case'typeDeBien0':fieldset="types_biens";break;case'nbPieces0':fieldset="foncia_nbpieces";break;case'nbChambres0':fieldset="foncia_nbchambres";break;default:doIt=false;}
if(doIt==true){if(input.attr("checked")){jQuery('#'+fieldset+' input:not(#'+input.attr("id")+')').attr("checked","");jQuery('#'+fieldset+' input:not(#'+input.attr("id")+')').attr("disabled","disabled");}else{jQuery('#'+fieldset+' input:not(#'+input.attr("id")+')').removeAttr("disabled");}}}
jQuery(document).ready(function(){if(jQuery('.foncia_location').length>0){updateLocationForm();if(jQuery('#typeDeBien1').attr("checked")||jQuery('#typeDeBien2').attr("checked")||jQuery('#typeDeBien4').attr("checked")||jQuery('#typeDeBien5').attr("checked")||jQuery('#typeDeBien6').attr("checked")||jQuery('#typeDeBien0').attr("checked")){updateIndifferent(jQuery('#nbPieces0'));}}
if(jQuery('.foncia_transaction').length>0){updateTransactionForm();if(jQuery('#typeDeBien1').attr("checked")||jQuery('#typeDeBien2').attr("checked")||jQuery('#typeDeBien0').attr("checked")){jQuery('#nbPieces0, #nbChambres0').each(function(){updateIndifferent(jQuery(this));});}}
updateIndifferent(jQuery('#typeDeBien0'));jQuery('#typeDeBien0, #nbPieces0, #nbChambres0').click(function(){updateIndifferent(jQuery(this));});jQuery('.foncia_transaction #typeDeBien1,.foncia_transaction #typeDeBien2,.foncia_transaction #typeDeBien0').click(function(){updateTransactionForm();});jQuery('.foncia_location #typeDeBien1, .foncia_location #typeDeBien2, .foncia_location #typeDeBien4, .foncia_location #typeDeBien5, .foncia_location #typeDeBien6, .foncia_location #typeDeBien0').click(function(){updateLocationForm();});jQuery('#nbPieces1,#nbPieces2,#nbPieces3,#nbPieces4,').click(function(){if(jQuery(this).attr("checked"))
{var num=parseInt(jQuery(this).attr("id").substr(8,1));for(i=num+1;i<6;i++){jQuery('#nbPieces'+i).attr("checked","checked");}}});jQuery('.foncia_transaction #nbChambres1,.foncia_transaction #nbChambres2,.foncia_transaction #nbChambres3,.foncia_transaction #nbChambres4,').click(function(){if(jQuery(this).attr("checked"))
{var num=parseInt(jQuery(this).attr("id").substr(10,1));for(i=num+1;i<6;i++){jQuery('#nbChambres'+i).attr("checked","checked");}}});jQuery('#surfaceMin, #surfaceTerrainMin, #prixMin').DefaultValue('Min');jQuery('#surfaceMax, #surfaceTerrainMax, #prixMax').DefaultValue('Max');jQuery('#txtRecherche').DefaultValue('Département, ville ou code postal');jQuery('#foncia_smsRef').DefaultValue('Référence bien / SMS');jQuery('#dispo input').click(function(){if(jQuery(this).attr("checked")){jQuery("#dispo input:checked:not(#"+jQuery(this).attr("id")+")").removeAttr("checked");}});jQuery("#conteneur_tri").jForms();});
