
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);$(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");$("#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");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").children().hasClass(".niceforms"))
{$("#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($){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);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();});