/* legacy.js */

if(typeof (window.console)=="undefined"){window.console={log:function(){}};}var $=function(A){if(typeof (A)=="string"){A="#"+A;}if($J(A).length>0){return $J(A)[0];}else{return false;}};var $$=$J;var $F=function(A){if(typeof (A)=="string"){A="#"+A;}if($J(A).length>0){return $J(A).val();}else{return false;}};console.error=console.log;Function.prototype.bind=function(){if(arguments.length<2&&arguments[0]===undefined){return this;}var C=this,A=Array.prototype.slice.call(arguments),B=A.shift();return function(){return C.apply(B,A.concat(Array.prototype.slice.call(arguments)));
};};Function.bind=function(){var A=Array.prototype.slice.call(arguments);return Function.prototype.bind.apply(A.shift(),A);};var Template=function(A,B){this.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;this.template=A.toString();this.pattern=B||Template.Pattern;};Template.prototype={evaluate:function(A){return this.template.match(this.pattern,function(B){var C=B[1];if(C=="\\"){return B[2];}return C+String.interpret(A[B[3]]);});}};function showroll(E,A,B){var D="auto";var C="";if(E.indexOf("submenu")>-1){D="210px";
}if(E.indexOf("roll")>-1){idp="dt"+E.substring(4,30);if(document.getElementById(idp)){D=(document.getElementById(idp).offsetLeft-2)+"px";}}if(A){if((E=="rollhelp"||E=="rollcompte"||E=="rollcafe")&&$$(".regions")){}if((E=="rollcountrie"||E=="rollinfo"||E=="rollhelp"||E=="rollcompte")){$(E+"_click").className="topmenu_hover";}if(E=="rollcompte"&&observing_rollcompte==false&&VIVASTREET.isLogged()==false){$J(document).bind("click",function(G){var F=Event.element(G);if(F.up(2)&&F.up(2).id!="rollcompte"&&F.up(3)&&F.up(3).id!="rollcompte"||!F.up(2)&&!F.up(3)){maskroll(E,B);
}});observing_rollcompte=true;}if(document.getElementById(E)&&E!="rollover_search"){document.getElementById(E).style.left=D;document.getElementById(E).style.display=C;if(E.indexOf("_tab_menu")>-1&&$(E+"_div")){$(E+"_div").addClassName("vs-nav-tab-selected");}}else{if(document.getElementById(E)&&E=="rollover_search"){document.getElementById(E).style.left="auto";document.getElementById(E).style.display="";}}if(!B){ROLLOVER.renderIframe(E,true);}if(to_last_id!="undefined"&&E==to_last_id){clearTimeout(to);
}else{if(to_last_id!="undefined"){maskroll(to_last_id,B);}}}else{if((E=="rollhelp"||E=="rollcompte"||E=="rollcafe")&&$$(".regions")){}if(E.indexOf("submenu")>-1){}else{if(E!="rollcompte"||E=="rollcompte"&&VIVASTREET.isLogged()!=false){to=setTimeout("maskroll('"+E+"')",300);}}to_last_id=E;}if(A){if(E=="rollcafe"&&document.getElementById("region")){document.getElementById("region").style.visibility="hidden";}}else{if(E=="rollcafe"&&document.getElementById("region")){document.getElementById("region").style.visibility="visible";
}}}function maskroll(B,A){if(B){document.getElementById(B).style.left="-5000px";document.getElementById(B).style.display="none";if(!A){ROLLOVER.renderIframe(B,false);}if((B=="rollcountrie"||B=="rollinfo"||B=="rollhelp"||B=="rollcompte")){$(B+"_click").className="topmenu";}else{if(B.indexOf("_tab_menu")>-1&&$(B+"_div")&&B!=selected_tab){$(B+"_div").removeClassName("vs-nav-tab-selected");}}}}function maskrollclick(A){}function setsub(A,B){document.getElementById(A).onmouseover=function(){for(i=1;i<12;
i++){document.getElementById("menu"+i).style.width="190px";document.getElementById("submenu"+i).style.left="-5000px";document.getElementById("submenu"+i).style.display="none";}document.getElementById(A).style.width="207px";showroll(B,true);};document.getElementById(A).onmouseout=function(){};document.getElementById(B).onmouseover=function(){document.getElementById(A).style.width="217px";showroll(B,true);};document.getElementById(B).onmouseout=function(){showroll(B,false);for(i=1;i<12;i++){document.getElementById("menu"+i).style.width="206px";
}};}function setroll(B,E,A,D){var C=D?"onclick":"onmouseover";var F=D?"onblur":"onmouseout";if(document.getElementById(B)){document.getElementById(B)[C]=function(){if(D&&SEARCH.openSelects[B]){showroll(E,false,A);SEARCH.openSelects[B]=false;}else{showroll(E,true,A);if(D&&SEARCH.openSelects[B]){SEARCH.openSelects[B]=false;}else{if(D){SEARCH.openSelects[B]=true;}}}};document.getElementById(B)[F]=function(){showroll(E,false,A);};}if(document.getElementById(E)){document.getElementById(E)[C]=function(){showroll(E,true,A);
};document.getElementById(E)[F]=function(){showroll(E,false,A);};}}function unsetroll(A){if(document.getElementById(A)){document.getElementById(A).onmouseover=null;document.getElementById(A).onmouseout=null;}}function masksub(C,B){for(var A=1;A<=11;A++){document.getElementById("submenu"+A).style.left="-5000px";document.getElementById("submenu"+A).style.display="none";}}if(!Array.indexOf){Array.prototype.indexOf=function(B){for(var A=0;A<this.length;A++){if(this[A]==B){return A;}}return -1;};}

/* cookie.js */

var Cookie={set:function(D,E,C,A){var B="";if(C!=undefined){var F=new Date();F.setTime(F.getTime()+(86400000*parseFloat(C)));B="; expires="+F.toGMTString();}if(A){A="; path=/; domain="+A;}return(document.cookie=escape(D)+"="+escape(E||"")+B+(A||""));},get:function(A){var B=document.cookie.match(new RegExp("(^|;)\\s*"+escape(A)+"=([^;\\s]*)"));return(B?unescape(B[2]):null);},erase:function(A){var B=Cookie.get(A)||true;Cookie.set(A,"",-1);return B;},accept:function(){if(typeof navigator.cookieEnabled=="boolean"){return navigator.cookieEnabled;
}Cookie.set("_test","1");return(Cookie.erase("_test")==="1");}};

/* vivastreet.js */

var VIVASTREET=new Object();VIVASTREET={_geo_initialized:false,_cookie_name:"vivastreet",_ajax_dir:"/ajax/",_url_affiliate_code:"",_url_partners:false,_external_referrer:false,_media_pics_path:"",_gpc_domain:"",_gpc_root:"",_gpc_url_path:"",_gpc_page_type:"",_gpc_page_mode:"",_gpc_detail:{},_url_geo:[],_country_geo:"",_parent_geo:{},_geo_tree:[],_forever:null,_session_id:0,_template_width:1000,_header_message:{element:"",message:"",numads:[],location:"",category:"",spec_hp:false},_spec_hp:false,_map_ready:false,_map_region_path:false,_map_preload_list:[],username:"",email:"",session_id:"",counters:{emails:0,classifieds:0,saved:0,alerts:0,photos:0},geo:{id:0,code:"",domain:"",title:"",haschilds:"",level:"0",summary_mode:"t",from_cookie:false},country_geo:{id:0,code:"",title:"",haschilds:"",level:"0",from_cookie:false},updateGFVivaCookie:function(B){var A=-1;
if(window.console){console.log("updateGFVivaCookie: >>"+B+"<<");}if(B!=null){if(B.length<10){B=null;}else{A=180;}}if(window.console){console.log("cookie >>"+VIVASTREET._cookie_name+"<< data: >>"+B+"<< ttl: >>"+A+"<<");}Cookie.set(VIVASTREET._cookie_name,B,A,VIVASTREET._gpc_domain);},getGFVivaCookie:function(){var A=Cookie.get(VIVASTREET._cookie_name);if(window.console){console.log("getGFVivaCookie: >>"+A+"<<");}if(A=="undefined"){A=null;}if(A!=null){if(A.length<10){console.log("getGFVivaCookie: removing session cookie");
this.updateGFVivaCookie(null);A=null;}}return A;},validateSearchbox:function(C){for(var B in C.elements){try{var A=$J(C.elements[B]);if(A.val()==A.attr("title")){A.val("");}}catch(D){if(window.console){console.log(D);}}}if(C.elements["cat_1"].value==""||C.elements["cat_1"].value==0){$J(C.elements["cat_1"]).bt(__("form_search_category_empty"),{positions:["left","bottom"],padding:20,width:200,spikeLength:20,spikeGirth:20,cornerRadius:5,fill:"rgba(0, 0, 0, .8)",strokeWidth:2,strokeStyle:"#CC0",cssStyles:{color:"#FFF",fontWeight:"bold",fontSize:"0.9em"}});
$J(C.elements["cat_1"]).btOn();return false;}else{return true;}},sanityCheck:function(){var B=this.getGFVivaCookie();if(B==null){var A=Cookie.get("session");if(A!=null&&A!="undefined"&&A!=""){if(A.indexOf("status:ENGAGED")!=(-1)){VIVASTREET.updateGFVivaCookie(null);Cookie.set("session",null,-1);Cookie.set("session",null,-1,VIVASTREET._gpc_domain);window.location="/authorize.php?authorize_refer="+encodeURI(window.location.href);return false;}}}return true;},init:function(F,H,A,D,G,E,B,I,C){if(!this.sanityCheck()){return false;
}this.login();this.session_id=D;this._ajax_dir=F;this._url_affiliate_info=C||{code:"",duration:30,domain:false};this._gpc_root=A;this._gpc_page_type=B;this._gpc_page_mode=I;this._gpc_domain=H||location.host;this._url_geo=G||[];this._country_geo=E||[];this.initHeader();UTILS.parseQuery();this.trackAffiliate();this.geo.id=this._country_geo[0];this.geo.code=this._country_geo[1];this.geo.title=this._country_geo[2];this.country_geo.id=this._country_geo[0];this.country_geo.code=this._country_geo[1];this.country_geo.title=this._country_geo[2];
this.country_geo.haschilds=this._country_geo[3];this.country_geo.from_cookie=false;if(0&&this._country_geo[1]!="FR"){this._map_ready=true;}FAV.init();if("affiliate"==this._gpc_page_type){return ;}if(this._gpc_page_type=="summary_text"||this._gpc_page_type=="summary_gallery"||this._gpc_page_type=="summary_category"||this._gpc_page_type=="summary_type_list"||this._gpc_page_type=="summary_landing_page"||this._gpc_page_type=="home"||this._gpc_page_type=="detail_normal"){this._geo_initialized=false;}else{}this.initGeo();
if(this.geo.id==this._country_geo[0]&&this._gpc_page_type!="detail_normal"){this.setHeaderMessage({"location":(this._country_geo[2]),"hide_num_ads":(this.geo.id>0||this.geo.from_cookie)});}if(VIVASTREET._url_xtal_referrer==true){if(window.console){console.log("External referrer, erasing cookie");}Cookie.set("kiwii_search","",-1,VIVASTREET._gpc_domain);}else{if(VIVASTREET._gpc_page_type=="summary_text"||VIVASTREET._gpc_page_type=="summary_gallery"){Cookie.set("kiwii_search",document.location.href,30,VIVASTREET._gpc_domain);
}else{if(this._gpc_page_type!="detail_normal"){Cookie.set("kiwii_search","",-1,VIVASTREET._gpc_domain);}}}},initLightboxes:function(C,E,D,G){if(!D&&!G){return false;}if(!D){var D=false;}if(!G){var G=false;}$J.get("/ajax/static.php",{category_meta:C},function(H,I,J){$J("#vs_lb_disclaimer_content").html(H);},"html");var F={};F[__("disclaimer_agree")]=function(){VIVASTREET.setDisclaimerCookie("<?php echo $category_meta; ?>");$J(this).dialog("close");};F[__("disclaimer_disagree")]=function(){document.location="http://www."+VIVASTREET._gpc_domain+"/";
};var B=$J("#vs_lb_disclaimer");B.dialog({width:500,height:350,resizable:false,autoOpen:false,modal:true,title:__("disclaimer_header"),buttons:F,close:function(){if(!Cookie.get("adult_disclaimer")){}}});if(D==true&&G==true){if(!Cookie.get("adult_disclaimer")){var A=function(){setTimeout(function(){Lightbox.open("detail_search",{script:"detail_search.php",modal:true,params:E});},100);};B.dialog("open");B.bind("dialogclose",function(H,I){A();});}else{Lightbox.open("detail_search",{script:"detail_search.php",modal:true,params:E});
}}else{if(D==true){if(!Cookie.get("adult_disclaimer")){B.dialog("open");}}else{if(G==true){Lightbox.open("detail_search",{script:"detail_search.php",modal:true,params:E});}}}},initHeader:function(){if(VIVASTREET._gpc_page_type=="affiliate"){return ;}var A=null;if(false==VIVASTREET.isLogged()){$J("#vs_account_menu_link").html(__("header_account_menu"));}$J("#vs_posting_button a, div.vs-posting-button a").mouseover(function(){$J(this).parent().addClass("vs-posting-button-active");});$J("#vs_posting_button a, div.vs-posting-button a").mouseout(function(){$J(this).parent().removeClass("vs-posting-button-active");
});},trackAffiliate:function(){if(window.query["aff"]&&window.query["aff"].length>1){if(true===isNaN(parseInt(window.query["aff"].substr(0,1)))&&false===isNaN(parseInt(window.query["aff"].substr(1,1)))){window.query["lt"]=window.query["aff"].substr(0,1);window.query["aff"]=window.query["aff"].substr(1);}}if(!this._url_affiliate_info.code.length){this._url_affiliate_info.code=window.query["aff"]||"";this._url_affiliate_info.domain=false;}if(window.query["lt"]){this._url_affiliate_info.type=window.query["lt"];
}var infos=Cookie.get(this._cookie_name+"_affiliate");var read_from_cookie=true;if(null!=infos){var infos_json=eval("("+infos+")");if("record_referral" in infos_json){this._url_affiliate_info.code=infos_json.aff;this._url_affiliate_info.type=infos_json.type;}else{if(!window.query["aff"]&&!("record_referral" in infos_json)){return ;}}}if((infos_json&&"record_referral" in infos_json)||(this._url_affiliate_info.code.length&&(!infos||infos_json.aff!=this._url_affiliate_info.code))){var record_data=this._url_affiliate_info;
record_data["destination_type"]=VIVASTREET._gpc_page_type;record_data["category"]=VIVASTREET._category_code;record_data["classified_id"]=VIVASTREET._classified_id;record_data["region"]=VIVASTREET._url_geo[1];$J.ajax({async:false,url:this._ajax_dir+"affiliation.php?a=record_referral&process=1",type:"POST",data:record_data,success:function(data){var cookie_settings={aff:VIVASTREET._url_affiliate_info.code,referral:data.referral_id,time:new Date().getTime(),type:VIVASTREET._url_affiliate_info.type,domain:VIVASTREET._url_affiliate_info.domain};
if("undefined"!==typeof (data.referral_id)&&0<data.referral_id){var cookie_duration=(true==cookie_settings.domain)?undefined:VIVASTREET._url_affiliate_info.duration;if("commissionjunctionuk"===VIVASTREET._url_affiliate_info.code){cookie_duration=45;}Cookie.set(VIVASTREET._cookie_name+"_affiliate",$J.toJSON(cookie_settings),cookie_duration,VIVASTREET._gpc_domain);VIVASTREET._url_affiliate_info.referral=data.referral_id;var affiliate_code=VIVASTREET._url_affiliate_info.code;read_from_cookie=false;}else{VIVASTREET._url_affiliate_info.code="";
var affiliate_code="";read_from_cookie=true;}},dataType:"json"});}if(infos||(read_from_cookie&&infos)){this._url_affiliate_info.code=infos_json.aff;this._url_affiliate_info.referral=infos_json.referral;this._url_affiliate_info.domain=infos_json.domain;this._url_affiliate_info.time=infos_json.time;}},setDisclaimerCookie:function(A){Cookie.set("adult_disclaimer",A,30,VIVASTREET._gpc_domain);},checkRegistrationDisclaimers:function(){if("IT"==VIVASTREET._country_geo[1]){var B=$J("#register_disclaimer_1_yes");
var A=$J("#register_disclaimer_2_yes");if(B.is(":checked")==true&&A.is(":checked")){$J("#register_accept_button").button("enable");}else{$J("#register_accept_button").button("disable");}}},checkVivamailDisclaimers:function(){if("IT"==VIVASTREET._country_geo[1]){var B=$J("#register_disclaimer_1_yes");var A=$J("#register_disclaimer_2_yes");if(B.is(":checked")==true&&A.is(":checked")){$J("#disclaimer_accept").button("enable");}else{$J("#disclaimer_accept").button("disable");}}},getGeoFromUrl:function(){if(this._url_geo[0]>0){this.geo.id=this._url_geo[0];
this.geo.code=this._url_geo[1];this.geo.domain=this._url_geo[4];this.geo.title=this._url_geo[2];this.geo.haschilds=this._url_geo[3];this.geo.level=this._url_geo[5];this.geo.from_cookie=false;data=this.geo;return data;}return false;},getGeoFromCookie:function(B){if(null!=B&&$J.parseJSON(B)[0].id!=0){var C=$J.parseJSON(B);var A=C[1]||[];var C=C[0];this.geo.id=C.id;this.geo.code=C.code;this.geo.domain=C.domain;this.geo.title=C.title;this.geo.haschilds=C.haschilds;this.geo.level=C.level;this.geo.from_cookie=true;
if(A){this._geo_tree=A;}return this.geo;}return false;},initGeo:function(){if(true==this._geo_initialized){return ;}this._geo_initialized=true;try{var A=false;var J=Cookie.get(this._cookie_name+"_geo");var D=(410==this._gpc_http_error_code)?"http_status":this._gpc_page_type;switch(D){case"detail_normal":case"detail_popup":var F=this.getGeoFromUrl();break;case"http_status":var F=this.getGeoFromCookie(J);break;case"summary_text":case"summary_gallery":var F=this.getGeoFromUrl();A=true;break;case"account":var F=this.getGeoFromCookie(J)||this.getGeoFromUrl();
break;default:var F=this.getGeoFromUrl()||this.getGeoFromCookie(J);break;}if(null!=J){var B=$J.parseJSON(J)[0];this.geo.summary_mode=B.summary_mode;}if(F){var C=F;if(this._geo_tree.length>1){var I=this._geo_tree.length;for(var E=1;E<I;E++){var H=this._geo_tree[E];if(H){H.level=H.level||H.depth;}}}else{}if(true===A){this.saveGeo();}if(C.id!=this._country_geo[0]){if("post"==this._gpc_page_type){this.setHeaderMessage({"location":(this._country_geo[2]),"hide_num_ads":true});}else{this.setHeaderMessage({"location":(C.title),"hide_num_ads":(this.geo.from_cookie||0==D.indexOf("summary_"))});
}}}else{this.setGeo(0,"","",false,false,false);this.saveGeo();}}catch(G){if(window.console){console.log(G);}this.setGeo(0,"","",false);}},destroySearchParameters:function(){var B=["vs-search","vs-search-cat","vs-search-keywords","kiwii_search"];var C=new Date();for(var A=0;A<B.length;A++){Cookie.set(B[A],null,1,this._gpc_domain);}},saveSearchParameters:function(){if(window.query.keywords&&window.query.keywords.length>0){Cookie.set("vs-search",location.search.substr(1),1,VIVASTREET._gpc_domain);Cookie.set("vs-search-cat",VIVASTREET._category_code,1,VIVASTREET._gpc_domain);
Cookie.set("vs-search-keywords",window.query.keywords,1,VIVASTREET._gpc_domain);return true;}else{return false;}},loadSearchParameters:function(){if(!window.query.keywords||window.query.keywords.length==0){if((VIVASTREET._gpc_page_type=="summary_text")||(VIVASTREET._gpc_page_type=="summary_gallery")){VIVASTREET.destroySearchParameters();}}if(Cookie.get("vs-search")&&Cookie.get("vs-search-cat")&&Cookie.get("vs-search-keywords")){var B=Cookie.get("vs-search");var E=Cookie.get("vs-search-cat");var A=Cookie.get("vs-search-keywords").gsub(/\+/," ");
var G=UTILS.parseQuery(B);if((VIVASTREET._gpc_page_type=="summary_text")||(VIVASTREET._gpc_page_type=="summary_gallery")){if(false===VIVASTREET.saveSearchParameters()){VIVASTREET.destroySearchParameters();}return true;}else{if(VIVASTREET._gpc_page_type=="home"){VIVASTREET.destroySearchParameters();return true;}else{for(var D in window.query){if(typeof window.query[D]=="string"){if(document.getElementsByName(D).length>0){if(window.query[D]!=""){var F=document.getElementsByName(D)[0];F.value=window.query[D];
}}}else{if(typeof window.query[D]=="object"){if(document.getElementById("ul_"+D)){$J("#ul_"+D+' input[type="checkbox"]').each(function(H){for(k=0;k<window.query[D].length;k++){if(window.query[D][k]==H.value){H.checked=true;}}});}else{for(var C in window.query[D]){if(typeof window.query[D][C]=="string"){if(document.getElementsByName(D+"["+C+"]").length>0){if(window.query[D][C]!=""){var F=document.getElementsByName(D+"["+C+"]")[0];F.value=window.query[D][C];}}}}}}}}}}}else{if((VIVASTREET._gpc_page_type=="summary_text")||(VIVASTREET._gpc_page_type=="summary_gallery")){VIVASTREET.saveSearchParameters();
}}},setMapReady:function(A){this._map_ready=A;},flashmapGoTo:function(A){try{if(this._map_ready){return window.document.flashmap.goTo(A);}}catch(B){if(window.console){console.log(B);}return false;}},flashmapReset:function(){try{if(this._map_ready){return window.document.flashmap.reset();}}catch(A){if(window.console){console.log(A);}return false;}},setFlashGeo:function(B){var B=B||this.geo;if(B.id==0){return ;}if(1||VIVASTREET._country_geo[1]=="FR"){if(0&&false==this.flashmapGoTo(B.code)){for(var A=this._geo_tree.length-1;
A>=0;A--){if(this._geo_tree[A]&&false!=this.flashmapGoTo(this._geo_tree[A].code)){break;}}}}else{if(0){if(document.flashmap&&B.haschilds==true){setTimeout(this.passRegionToFlash.bind(VIVASTREET,B.code),1000);}else{if(false==B.from_cookie&&document.flashmap&&B.haschilds==false){setTimeout(this.passRegionToFlash.bind(VIVASTREET,this._parent_geo.code),1000);setTimeout(this.passCityToFlash.bind(VIVASTREET,B.title),2000);}else{if(true==B.from_cookie&&document.flashmap&&B.haschilds==false){setTimeout(this.passRegionToFlash.bind(VIVASTREET,this._geo_tree[0].code),1000);
setTimeout(this.passCityToFlash.bind(VIVASTREET,B.title),2000);}}}}}},setGeo:function(B,C,L,K,E,J,G,A){return true;this.geo.id=B;this.geo.code=C;this.geo.domain=G;this.geo.title=L;this.geo.haschilds=K;this.geo.level=A;if(this.geo.id!=0){if(A==1){this._geo_tree=[];}var I={"id":B,"code":C,"domain":G,"title":L,"haschilds":K,"level":A};this._geo_tree[(parseInt(A)-1)]=I;if(SEARCH.freeText){var D="searchGeo_1";if(parseInt(A)>1){this._geo_tree=SEARCH.getGeoTree(B,function(N){try{var O=$J("#"+D+" option[value="+N[0].id+"]");
if(O[0]){$J(D).selectedIndex=O[0].index;}if(0&&VIVASTREET._country_geo[1]!="FR"){VIVASTREET.passRegionToFlash(N[0].code);setTimeout(VIVASTREET["pass"+((VIVASTREET._country_geo[1]=="FR")?"County":"City")+"ToFlash"].bind(VIVASTREET,N[1].label),1000);if(N[2]&&VIVASTREET._country_geo[1]=="FR"){setTimeout(VIVASTREET.passCityToFlash.bind(VIVASTREET,N[2]),2000);}}else{if(0&&false==VIVASTREET.flashmapGoTo(C)){for(var M=VIVASTREET._geo_tree.length-2;M>=0;M--){if(VIVASTREET._geo_tree[M]&&false!=VIVASTREET.flashmapGoTo(VIVASTREET._geo_tree[M].code)){break;
}}}}}catch(P){if(window.console){console.log(P);}}});}else{var H=$J("#"+D+" option[value="+B+"]");if(H[0]){$J(D).selectedIndex=H[0].index;}}}}this.saveGeo();if(this.geo.id!=0&&!E){var F=this.geo;}if(B>0){this.rewriteGeo(J);}},setGeoFromFlash:function(F,B,D,A,C,E){if(isNaN(E)){var E=(A?1:2);}var E=parseInt(E);},setSummaryMode:function(A){this.geo.summary_mode=A;this.saveGeo();this.rewriteGeo();},saveGeo:function(){if(this.geo.id>0){Cookie.set(this._cookie_name+"_geo",$J.toJSON([this.geo,this._geo_tree]),null,this._gpc_domain);
}else{Cookie.set(this._cookie_name+"_geo",$J.toJSON([this.geo,this._geo_tree]),-1,this._gpc_domain);}},setHeaderMessage:function(C){return false;if(!C&&(!this._header_message.element||!this._header_message.message)){return false;}var B=function(M,N){if(!N){N=",";}M+="";var I=M.split(".");var L=I[0];var J=I.length>1?"."+I[1]:"";var K=/(\d+)(\d{3})/;while(K.test(L)){L=L.replace(K,"$1"+N+"$2");}return L+J;};var D=$J((C.element&&$J(C.element))?C.element:this._header_message.element);var G=C.message||this._header_message.message;
var H=C.numads||this._header_message.numads;H=B(H," ");var A=C.location||((this.geo.title&&this.geo.title.length>0)?this.geo.title:this._country_geo[2]);var F=C.category||this._header_message.category;A='<br/><span class="green">'+A+"</span>";if(VIVASTREET._category_infos["foreign"]=="yes"){A="";}if(!D){return false;}var E=new Template(G);if(this._spec_hp==true){D.innerHTML=E.evaluate({"numads_offer":(parseInt(H[0])<=0||(C&&C.hide_num_ads))?"":H[0],"numads_seek":(parseInt(H[1])<=0||(C&&C.hide_num_ads))?"":H[1],"location":A,"break":"<br/>"});
}else{D.innerHTML=E.evaluate({"numads":(parseInt(H)<=0||(C&&C.hide_num_ads))?"":H,"location":A,"category":F});}if((parseInt(H)<=0||(C&&C.hide_num_ads))){D.innerHTML=D.innerHTML.strip();D.innerHTML=D.innerHTML.replace(D.innerHTML.substr(0,1),D.innerHTML.substr(0,1).toUpperCase());}},clearGeo:function(){Cookie.set(this._cookie_name+"_geo",null,-1,this._gpc_domain);Cookie.erase(this._cookie_name+"_geo_abroad");this.geo={id:0,code:"",title:"",haschilds:"",level:"",summary_mode:"t"};this._geo_tree=[];
this.rewriteGeo();},changeGeo:function(C,N,H,G){var A=(H&&H.subdomain)||VIVASTREET.geo.domain;var D=(H&&H.code)||VIVASTREET.geo.code;var M=(H&&H.id>=0)?H.id:VIVASTREET.geo.id;var C=C||"";var E="";if(N){C=VIVASTREET._gpc_root;}if(C.indexOf("http")==0){E=C.substr(0,C.indexOf("://")+3);C=C.substr(C.indexOf("://")+3);}if(N){return E+C.replace(/([a-z0-9\-\+]+)([a-z0-9\&\_\-\.]+)(\/?[\S]+)?/i,function(P){return(A?A:"www")+P[2]+(!A&&M>0?"/"+D:P[3]);});}else{var O=new RegExp(/([a-z0-9\-\+]+)([a-z0-9\_\-\.]+)\/([a-z0-9\&\_\-\+]+)(\/[\S]+)?/i);
var K=O.exec(C);var B=K[3];var L=K[3].indexOf("+");if(-1==L){var J=K[3];}else{var J=K[3].substr(0,L);}if(M>0){J+="+"+D;}if(H&&H.fromSearch&&K[4]){var I=K[4].indexOf("+");K[4]=(I!=-1)?K[4].substr(0,I)+"+1":K[4];}if(typeof (G)=="object"&&G.rel&&G.rel.replace(/(nofollow )/,"").length>0){var F=G.rel;}else{var F=(G&&G.attr("rel")||((VIVASTREET._category_infos&&VIVASTREET._category_infos["subdomain"]||(VIVASTREET._category_code.replace("_","-")))||K[1])||"www");}if(H&&H.search){A=false;var F=K[1]||F;}var F=F.replace(/(nofollow )/,"");
return E+C.replace(K[0],(A?A:F)+K[2]+"/"+J+(A&&!M?("search"==A?"":"+"+A):""));}},rewriteGeo:function(F){if(1>this.geo.id){VIVASTREET.geo.title=VIVASTREET._country_geo[2];VIVASTREET.geo.code=VIVASTREET._country_geo[1];VIVASTREET.geo.id=VIVASTREET._country_geo[0];}var A=$J("#.vs_link_summary");var D=A.length;try{for(var B=0;B<D;B++){var C=A[B];if(C["href"]){C.href=VIVASTREET.changeGeo(C.href,false,false,C);}if(C.action){C.action=VIVASTREET.changeGeo(C.action,false,false,C);}}}catch(E){if(window.console){console.log(E,C,B);
}}if(VIVASTREET._url_geo[0]!=this.geo.id){$J("#.vs_counter_classifieds").each(function(G){G.hide();});}},passRegionToFlash:function(A){try{window.document.flashmap.SetVariable("RegionLink",A);}catch(B){if(window.console){console.log(B,A);}}},passCountyToFlash:function(A){try{window.document.flashmap.SetVariable("CountyLink",A);}catch(B){if(window.console){console.log(B,A);}}},passCityToFlash:function(A){try{window.document.flashmap.SetVariable("CityLink",A);}catch(B){if(window.console){console.log(B,A);
}}},passAllStatesToFlash:function(){try{window.document.flashmap.SetVariable("allStates","clicked");}catch(A){if(window.console){console.log(A);}}},clear:function(){this.username="";this.email="";this.session_id="";this.counters={emails:0,classifieds:0,saved:0,alerts:0,photos:0};VIVASTREET.setYourAccountHeader("login");},updateCounters:function(A){},updateCookie:function(parameters){var cookie_pref=VIVASTREET.getGFVivaCookie();if(cookie_pref){var data=cookie_pref.gsub(/\s+/," ");data=eval("("+data+")");
for(var key in parameters){data[0][key]=parameters[key];}VIVASTREET.updateGFVivaCookie(data.toJSON().gsub(/\s+/," "));}},login:function(){try{var B=VIVASTREET.getGFVivaCookie();if(null!=B){var C=B.replace(/\s+/," ");var A=$J.parseJSON(C)[0];console.log("Running checks against user data:",C,A);VIVASTREET.username=A.username;console.log("Set username to",A.username);VIVASTREET.email=(A.email)?A.email:A.username;VIVASTREET.session_id=(A.session_id)?A.session_id:VIVASTREET.session_id;VIVASTREET.counters=A.counters||VIVASTREET.counters;
VIVASTREET.repaint();VIVASTREET.setYourAccountHeader("logged");}else{VIVASTREET.clear();}}catch(D){VIVASTREET.clear();}},logout:function(A){VIVASTREET.updateGFVivaCookie(null);Cookie.set("session",null,-1);Cookie.set("session",null,-1,VIVASTREET._gpc_domain);var B=Cookie.get("vivastreet_auth");if(B=="undefined"||B==""||B==null){if(window.location.href.indexOf("account_reset_password")<0&&window.location.href.indexOf("post.")<0){window.location="/";return false;}}this.clear();if(A==true){setTimeout("VIVASTREET.logoutRefresh();",1000);
}$J("#vs_user_menu_logout_link").hide();$J("#vs_account_menu_link").html(__("header_account_menu"));return false;},loginRefresh:function(A){if(window.console){console.log("Console refresh!");}if(A&&A!=false){window.location=A;}else{if(VIVASTREET._gpc_page_type&&VIVASTREET._gpc_page_type!="post"){VIVASTREET.windowRefresh();}else{if(VIVASTREET._gpc_page_type&&VIVASTREET._gpc_page_type=="post"){VIVASTREET.initHeader();POSTFORM.setLoggedIn();setTimeout(function(){Lightbox.hideLogger();},2000);$J("#vs_user_menu_logout_link").show();
}}}},logoutRefresh:function(){if(this._gpc_page_type=="post"){var A=location.toString();if(A.indexOf("modify")>-1||A.indexOf("repost")>-1){window.location="http://www."+this._gpc_domain;}else{VIVASTREET.initHeader();VIVASTREET.setYourAccountHeader("login");POSTFORM.setLoggedOut("login");$J("#vs_user_menu_logout_link").hide();$J("#vs_account_menu_link").html(__("header_account_menu"));}}else{if(this._gpc_url_path=="/account.php"||this._gpc_url_path=="/account_classifieds.php"||this._ajax_dir.substr(7,8)=="vivamail"){if(this._ajax_dir.substr(7,8)=="vivamail"){window.location="http://www."+this._gpc_domain;
}else{window.location=this._gpc_root;}}else{VIVASTREET.windowRefresh();}}},registerRefresh:function(){if(this._gpc_root.substr(7,4)=="post"){POSTFORM.setLoggedIn();}else{VIVASTREET.windowRefresh();}},setYourAccountHeader:function(A){if(!$J("#rollcompte_click")){return ;}if(!A){A="login";}},logoutForm:function(A){Lightbox.showLogger(__("lb_logout_header"));Lightbox.addLogMessage(__("lb_logout_loading"),"loading");if(A==false){setTimeout(VIVASTREET.logout.bind(VIVASTREET,true),1000);}else{VIVASTREET.logout(true);
}},authorize:function(A){if(!A||A.length<=0){return false;}if(!A.action){A.action="register";}onComplete=A.onComplete||function(B,C){};url=this._ajax_dir+"authorize.php";params="action="+escape(A.action);if(A.email){params+="&email="+escape(A.email);}if(A.password){params+="&password="+escape(A.password);}if(A.username){params+="&username="+(A.username);}if(A.phone){params+="&phone"+escape(A.phone);}if(A.captcha){params+="&captcha="+escape(A.captcha);}if(A.checkDupe&&A.checkDupe==true){params+="&checkdupe=1";
}if(A.country){params+="&country="+escape(A.country);}if(A.fromPostform){params+="&fromPostform="+escape(A.fromPostform);}if(A.vivastreet_optin){params+="&vivastreet_optin="+escape(A.vivastreet_optin);}if(A.partners_optin){params+="&partners_optin="+escape(A.partners_optin);}if("undefined"!==typeof (VIVASTREET._url_affiliate_info)){params+="&affiliate_code="+escape(VIVASTREET._url_affiliate_info.code);}if(!A.domain){A.domain=VIVASTREET._gpc_domain;}params+="&domain="+escape(A.domain);params+="&rand="+Math.random();
$J.post(url,params,function(B,C,D){console.log("Authorized, calling function",onComplete,B);onComplete(B);},"json");},authorizeUserForm:function(A){if(!A||A.length<=0){A=window.location;}window.location="http://www."+VIVASTREET._gpc_domain+"/authorize.php?authorize_refer="+A;},loginForm:function(){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("lb_login_loading"),"loading");VIVASTREET.authorize({action:"login",email:$J("#mail_rollcompte").val(),password:$J("#pass_rollcompte").val(),onComplete:function(A){VIVASTREET.loginResponseHandler(A);
}});},loginResponseHandler:function(C){var A=C;var B="";for(i=0;i<A.length;i++){B=A[i];switch(B.code){case"blocked_user":case"disabled_user":case"invalid_email":case"incorrect_email_password":LIGHTBOX.updateLogMessage(__("lb_login_loading"),"error");LIGHTBOX.hideLogger(3000);break;case"invalid_captcha":case"login_successful":if(VIVASTREET._gpc_page_type&&VIVASTREET._gpc_page_type=="post"){if($J("#civility_posting")&&"undefined"!=typeof (B.civility)&&""!=B.civility){$J("#civility_posting").value=B.civility;
}if($J("#year_posting")&&"undefined"!=typeof (B.year_born)&&0<B.year_born){$J("#year_posting").value=B.year_born;}}LIGHTBOX.updateLogMessage(__("lb_login_loading"),"success");LIGHTBOX.hideLogger(3000);$J("input[name=logged_in]").each(function(D){D.value="1";});VIVASTREET.updateGFVivaCookie($J.toJSON(C));VIVASTREET.login();VIVASTREET.loginRefresh();break;}}},validateLogin:function(A){var B=true;$J("#login_error").hide();$J("table.vs-login-table tr").removeClass("error");LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("login_validate"),"loading");
if(A.elements["email"].value.length<6){LIGHTBOX.updateLogMessage(__("login_validate_email_failed"),"error");$J("#login_error").html(__("login_error_validate_email"));$J(A.elements["email"]).parent().parent().addClass("error");B=false;}else{if(A.elements["password"].value.length<3){LIGHTBOX.updateLogMessage(__("login_error_validate_pass"),"error");$J("#login_error").html(__("login_error_validate_pass"));$J(A.elements["password"]).parent().parent().addClass("error");B=false;}}authorize_refer=false;
if(A.elements["refer"]&&A.elements["refer"].value.length>0){authorize_refer=A.elements["refer"].value;}if(!B){$J("#login_error").show();setTimeout(function(){LIGHTBOX.hideLogger();},3000);return false;}LIGHTBOX.addLogMessage(__("login_popup_logging_in"),"loading");setTimeout(function(){VIVASTREET.authorize({action:"login",email:A.elements["email"].value,password:A.elements["password"].value,onComplete:function(E){var C=E;var D="";for(i=0;i<C.length;i++){D=C[i];switch(D.code){case"blocked_user":case"disabled_user":case"invalid_email":case"incorrect_email_password":LIGHTBOX.updateLogMessage(D.message,"error");
setTimeout(function(){LIGHTBOX.hideLogger();},3000);$J("#login_error").html(__("postform_login_error"));$J("#login_error").show();break;case"invalid_captcha":case"login_successful":LIGHTBOX.updateLogMessage(__("postform_logged_in"),"success");$J("input[name=logged_in]").val(1);VIVASTREET.updateGFVivaCookie($J.toJSON(E));VIVASTREET.login();VIVASTREET.loginRefresh(authorize_refer);break;}}}});},500);},registerForm:function(){},registerResponseHandler:function(E,B){var A=E.responseText.evalJSON();var C="";
for(i=0;i<A.length;i++){C=A[i];switch(C.code){case"incorrect_email_password":break;case"blocked_user":case"disabled_user":case"invalid_email":case"duplicate_email":case"register_failed":case"invalid_captcha":switch(C.code){case"invalid_email":var D=__("postform_register_mail_posting");UTILS.showError($J("#mail_posting").up(1),true);UTILS.showError($J("#mail_posting_confirm").up(1),true);break;case"duplicate_email":var D=__("postform_register_dupe_email");UTILS.showError($J("#mail_posting").up(1),true);
UTILS.showError($J("#mail_posting_confirm").up(1),true);break;default:var D=__("postform_register");break;}$J("#error_msg").innerHTML=D;$J("#error_row").show();LIGHTBOX.addLogMessage(C.message,"error");LIGHTBOX.hideLogger();UTILS.showError($J("#captcha").up(1),true);VIVASTREET.resetCaptcha("register","captcha_image_register","captcha");break;case"register_successful":$J("#error_msg").innerHTML="";$J("#error_row").hide();LIGHTBOX.updateLogMessage(__("register_validate_msg_holder"),"success");LIGHTBOX.close("register");
LIGHTBOX.hideLogger();break;case"login_successful":if($J("#lb_Log_validate")){LIGHTBOX.updateLogMessage(__("register_validate_msg_holder"),"success");}else{LIGHTBOX.updateLogMessage(__("register_validate_msg_holder"),"success");}$J("input[name=logged_in]").each(function(F){F.value="1";});VIVASTREET.updateGFVivaCookie(E.responseText.gsub(/\s+/,""));VIVASTREET.login();if(B){VIVASTREET.loginRefresh("http://www."+this._gpc_domain+"/account.php");}else{LIGHTBOX.hideLogger();}break;}}},validateRegister:function(B,A){var C=true;
var A="undefined"==typeof (A)?true:A;$J("#error_msg").innerHTML="";$J("#error_row").hide();var E=[{"mail_posting":{action:"min",value:6,message:__("register_error_msg_email")}},{"mail_posting":{action:"max",value:255,message:__("register_error_msg_email")}},{"mail_posting_confirm":{action:"min",value:6,message:__("register_error_msg_email")}},{"mail_posting_confirm":{action:"max",value:255,message:__("register_error_msg_email")}},{"pass_posting":{action:"min",value:3,message:__("register_error_msg_pass")}},{"pseudo_posting":{action:"min",value:3,message:__("register_error_msg_username")}},{"captcha":{action:"min",value:3,message:__("register_error_msg_captcha")}}];
C=UTILS.validate("registerForm",E)&&C;if($J("#mail_posting").value!=$J("#mail_posting_confirm").value){var D=__("postform_register_mismatch_email");UTILS.showError($J("#mail_posting").up(1),true);UTILS.showError($J("#mail_posting_confirm").up(1),true);$J("#error_msg").innerHTML=D;$J("#error_row").show();return false;}if($J("#pseudo_posting").value.strip()==""){var D=__("postform_register_pseudo_posting");UTILS.showError($J("#pseudo_posting").up(1),true);$J("#error_msg").innerHTML=D;$J("#error_row").show();
return false;}if(!C){return false;}Lightbox.hide("register");Lightbox.showLogger();Lightbox.addLogMessage(__("register_msg_holder"),"loading");VIVASTREET.authorize({action:"register",email:B.elements["mail_posting"].value.strip(),password:B.elements["pass_posting"].value,username:B.elements["pseudo_posting"].value.strip(),phone:"",vivastreet_optin:B.elements["vivastreet_optin"].checked?"yes":"no",partners_optin:B.elements["partners_optin"].checked?"yes":"no",captcha:B.elements["captcha"].value,country:VIVASTREET.country_geo["code"].toLowerCase(),checkDupe:true,onComplete:function(F){VIVASTREET.registerResponseHandler(F,A);
}});},isLogged:function(){if(!VIVASTREET.username){return false;}else{return(VIVASTREET.username.length>0);}},windowRefresh:function(){window.location.reload(true);},forgotPassword:function(B,A){A=A||function(){};$J.get("/ajax/forgot_password.php",{process:1,forgot_password_email:B,domain:this._gpc_domain,type:VIVASTREET._gpc_page_type,rand:Math.random()},function(C){A(C);},"json");},requestPassword:function(A,B){if(!$J(A)||!$J(B)){return false;}A=$J(A);if(!A.elements["email"]||A.elements["email"].value.length<=0){if(A.id=="register"){$J(B).innerHTML=__("register_error_msg_email");
}else{$J(B).innerHTML=__("login_email_validate_error");}return false;}VIVASTREET.forgotPassword(A.elements["email"].value,function(C){if(C.code=="error"){$J(B).innerHTML=C.message;}else{$J(B).innerHTML=C.message;}});},forgotPasswordForm:function(){},forgotPasswordSend:function(A){VIVASTREET.forgotPassword(A,function(B){Lightbox.showLogger();Lightbox.hide("forgot_password");Lightbox.addLogMessage(__("forgot_password_sending"),"loading");if(B.code=="failed"){Lightbox.updateLogMessage(__("forgot_password_error"),"error");
setTimeout(function(){Lightbox.hideLogger();Lightbox.unhide("forgot_password");},2000);}else{if(B.code=="failed_temporary"){Lightbox.updateLogMessage(__("forgot_password_temporary_error"),"error");setTimeout(function(){Lightbox.hideLogger();Lightbox.unhide("forgot_password");},2000);}else{Lightbox.updateLogMessage(__("forgot_password_success"),"success");setTimeout(function(){Lightbox.hideLogger();Lightbox.close("forgot_password");},2000);}}});},repaint:function(){console.log("Running repaint()...");
var A=this.email;if(A.length>20){A=A.substr(0,20)+"...";}$J("#vs_account_menu_link").html(__("header_your_account").replace("#{username}",A));$J("#vs_user_menu_logout_link").show();},captcha:function(C,B,A){captcha_return="http://captcha."+VIVASTREET._gpc_domain+"/captcha.php?type="+C+"&key="+Math.random()+(B?"_"+B:"");A=true;if(!A){captcha_return+="&session_id="+this.session_id;}return captcha_return;},resetCaptcha:function(C,D,B,A){if(!A||C!="register"&&C!="login"&&C!="comment"){A=false;}if(C=="register"||C=="login"){A=true;
}if(window.console){console.log("In resetCaptcha...");}A=true;$(B).value="";D=$J(D);if(window.console){console.log("Getting captcha string......");}D.attr("src",VIVASTREET.captcha(C,"small",A));D.hide();setTimeout(D.show.bind(D),10);},showSponsors:function(B,D,C,A){$J(B).load(VIVASTREET._ajax_dir+"/sponsors.php?first="+D+"&count="+C+"&z="+A);},initMapRoll:function(){$J("#vs-rollover-regions ul a").each(function(B,A){if(!A.id||A.id.indexOf("vs-")<0){return false;}var C=A.id.substring(3,A.id.length);
console.log("The rollover code is",C);$J(A).mouseover(function(){VIVASTREET.mapRollOver(C);});$J(A).mouseout(function(){VIVASTREET.mapRollOut(C);});});this.preloadMapRoll();},mapRollOver:function(A){if(!A||!VIVASTREET._map_region_path){return false;}$J("#map")[0].style.background="url("+VIVASTREET._map_region_path+A+".gif) no-repeat top center";},mapRollOut:function(A){if(!A){return false;}$J("#map")[0].style.backgroundImage="none";},preloadMapRoll:function(){if(!this._map_preload_list||this._map_preload_list.length<=0){return false;
}this._map_preload_list.each(function(B){var A=new Image();A.src=VIVASTREET._map_region_path+B+".gif";});},resendConfirmation:function(A){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("account_send_confirmation_loading"),"loading");$J.get("/ajax/send_ad_confirmation.php",{classified:A,rand:Math.random()},function(B,C,D){if(B.code=="success"){LIGHTBOX.updateLogMessage(__("account_send_confirmation_loading"),"success");LIGHTBOX.hideLogger(2000);}},"json");}};var ADVERTISING={initAdSense:function(A){if(VIVASTREET._gpc_page_type=="detail_normal"){window.adsense_template='<div onmouseover="$J(this).addClass(\'vs-adsense-ad-hover\');" onmouseout="$J(this).removeClass(\'vs-adsense-ad-hover\');" class="vs-adsense-ad"><a href="{url}" target="_blank" class="vs-adsense-ad-img">'+__("google_adsense")+'</a><a href="{url}" target="_blank" class="vs-adsense-ad-line-1">{line1}</a><br><span class="vs-adsense-ad-line-2">{line2} {line3} <a href="{url}" target="_blank" class="vs-adsense-ad-line-3">{visible_url}</a></span><div style="clear:left;"></div></div>';
}else{if(A=="IT"){window.adsense_template='<div onmouseover="$J(this).addClass(\'vs-adsense-ad-hover\');" onmouseout="$J(this).removeClass(\'vs-adsense-ad-hover\');" class="vs-adsense-ad"><a class="vs-adsense-ad-img">'+__("google_adsense")+'</a><div style="margin-left: 99px;"><a href="{url}" target="_blank" class="vs-adsense-ad-line-1">{line1}</a><br><span class="vs-adsense-ad-line-2">{line2} {line3}</span>&nbsp;&nbsp;<a href="{url}" target="_blank" class="vs-adsense-ad-line-3">{visible_url}</a></div><div style="clear:left;"></div></div>';
}else{window.adsense_template='<div onmouseover="$J(this).addClass(\'vs-adsense-ad-hover\');" onmouseout="$J(this).removeClass(\'vs-adsense-ad-hover\');" class="vs-adsense-ad"><a href="{url}" target="_blank" class="vs-adsense-ad-img">'+__("google_adsense")+'</a><div style="margin-left: 99px;"><a href="{url}" target="_blank" class="vs-adsense-ad-line-1">{line1}</a><br><span class="vs-adsense-ad-line-2">{line2} {line3}</span>&nbsp;&nbsp;<a href="{url}" target="_blank" class="vs-adsense-ad-line-3">{visible_url}</a></div><div style="clear:left;"></div></div>';
}}window.google_ad_request_done=function(G){var C="";if(G.length>0){google_top=C;google_middle=C;google_bottom=C;google_left9=C;}var B=(G.length>0?("summary_category"==VIVASTREET._gpc_page_type?3:G.length):0);for(var F=0;F<B;F++){var D=(0==(F%2)?"odd":"even");var E=adsense_template;E=E.replace(/\{i\}/g,F);E=E.replace(/\{row_classname\}/g,"");E=E.replace(/\{url\}/g,G[F].url);E=E.replace(/\{line1\}/g,G[F].line1);E=E.replace(/\{line2\}/g,G[F].line2);E=E.replace(/\{line3\}/g,("undefined"!==typeof (G[F].line3)?G[F].line3:""));
E=E.replace(/\{visible_url\}/g,G[F].visible_url);E=E.replace(/\{breaker\}/g,"&nbsp;");if(F<3){google_top+=E;google_left9+=E;}else{if(F<6){google_middle+=E;google_left9+=E;}else{if(F<11){google_bottom+=E;google_left9+=E;}else{if(google_right==""){google_right=C;}google_right+=E;}}}}return true;};window.google_afs_request_done=window.google_ad_request_done;},initEPlanning:function(){window.eplCustomVA=function(F){var A="";a1=false;var G="width: 100%;border-collapse:collapse;border-spacing:0px;border:0px;padding:0px;margin:0px;";
var K="vertical-align:middle;line-height:1.5em;padding:5px 0px;";var C=true;var D="font-size:12px;font-weight:bold;";var B="font-size:12px;margin-left:10px; text-decoration:none; color:#575757;";var I="font-size:12px;margin-left:10px; color:#575757;";for(var E=0;E<F.length;E++){var J=F[E];var H="sponsor_"+E;if(!J.shown&&(1==J.t||7==J.t||8==J.t||41==J.t)){if(!a1){A+='<table style="'+G+'">';if(!C){A+='<tr rel="'+J.lU+'"" class="vs-summary-sponsor">';}a1=true;}if(C){A+='<a href="'+J.lU+'" target="_blank"><tr rel="'+J.lU+'" class="vs-summary-sponsor" onmouseover="$J(this).addClass(\'vs-summary-classified-hover\');" onmouseout="$J(this).removeClass(\'vs-summary-classified-hover\');" onclick="window.open(\''+J.lU+"');\">";
}else{A+='<a href="'+J.lU+'" target="_blank">';}A+="<td style=\"cursor:pointer;padding:10px 0px;\" onmouseover=\"$J(this).css('backgroundColor', '#D8E5F5');\" onmouseout=\"$J(this).css('backgroundColor', 'transparent');\">";if(41==J.t){A+='<a target="_blank" href="'+J.lU+'" style="'+D+'" onclick="return false;">'+J.tit+"</h3></a>";if(J.desc){A+='<br/><div style="'+I+'">'+J.desc.replace("<br>","")+"</div>";}if(J.urlv){A+='<a target="_blank" href="'+J.lU+'" style="'+B+'">'+J.urlv+"</a>";}}else{if(J.desc){A+='<div style="float:left;width:90px;margin-right:12px;text-align:center;" rel="'+J.lU+'"><img src="'+J.iurl+'" border=0 /></div>';
A+='<a href="'+J.lU+'" target="_blank" style="'+D+'" onclick="return false;">'+J.tit+"</a>";A+='<div style="'+I+'">'+J.desc.replace("<br>"," ")+"</div>";if(J.urlv){A+="&nbsp;&nbsp;&nbsp;"+J.urlv;}}else{A+='<img src="'+J.iurl+'" border=0 />';}}A+="</td>";if(C){A+="</tr></a>";}else{A+="</a>";}J.shown=true;}}if(a1){A+=C?"</table>":"</tr></table>";}return A;};window.eplDoc=document;window.eplLL=false;window.eplCheckStart=function(){if(document.epl){var D=document.epl;if(D.eplReady()){return true;}else{D.eplInit(eplArgs);
return D.eplReady();}}else{if(eplLL){return false;}if(!document.body){return false;}var E;var F=document.cookie;var I=F.indexOf("EPLSERVER=");if(I!=-1){I+=10;var A=F.indexOf(";",I);if(A==-1){A=F.length;}E=F.substring(I,A);}var C=document.createElement("IFRAME");C.src="about:blank";C.id="epl4iframe";C.name="epl4iframe";C.width=0;C.height=0;C.style.width="0px";C.style.height="0px";C.style.display="none";document.body.appendChild(C);var B=C.contentDocument?C.contentDocument:C.document;B.open();B.write("<html><head><title>e-planning</title></head><body></body></html>");
B.close();var H=B.createElement("SCRIPT");H.src="http://"+(E?E:eS1)+"/layers/epl-41.js";B.body.appendChild(H);if(!E){var G=B.createElement("SCRIPT");G.src="http://ads.us.e-planning.net/egc/4/2aac";B.body.appendChild(G);}eplLL=true;return false;}};window.eplCheckStart();window.eplSetAd=function(A){if(eplCheckStart()){var B=(eplArgs.sOpts&&eplArgs.sOpts[A])?eplArgs.sOpts[A]:{};if(B.custF){document.epl.setCustomAdShow(A,B.custF);}document.epl.setSpace(A,B);}else{setTimeout('eplSetAd("'+A+'");',250);
}};window.eplAD4=function(A,B){document.write('<div id="eplAdDiv'+A+'"></div>');if(!B){B={t:1};}if(!eplArgs.sOpts){eplArgs.sOpts={};}eplArgs.sOpts[A]=B;eplSetAd(A);};}};var affiliate_infos=Cookie.get(VIVASTREET._cookie_name+"_affiliate");if(null!=affiliate_infos){var affiliate_infos_json=$J.toJSON(affiliate_infos);var affiliate_code=affiliate_infos_json.aff;}else{if(!affiliate_code){var affiliate_code="";}}var ROLLOVER={_iFrames:{},_getIframe:function(A){var B=this._iFrames[A];if(null==B){var B=document.createElement("iframe");
B.id="iframe_"+A;B.src="javascript:false;";B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width="100%";B.style.height="100%";B.tabIndex=-1;$J("#"+A).parent().append(B);var B=$J("#"+B.id);this._iFrames[A]=B;}return B;},renderIframe:function(B,A){if(false==/(msie 6)/i.test(navigator.userAgent)){return ;}var B=$J(B);if(null==B){return ;}var C=this._getIframe(B.attr("id"));if(A){C.css("left",B.position().left);C.width(B.outerWidth());C.height(B.height());C.show();}else{C.width(0);
C.height(0);C.hide();}}};var UTILS={toggleCheck:function(D,A){var C=$J(D);for(var B=0;B<C.length;B++){if(C[B].type=="checkbox"){C[B].checked=A;}}},validate:function(H,B,D,A){var C=$J(H);var G=B?B:[];var F=A||true;var E=false;G.each(function(K){var J=Object.keys(K)[0];var I=K[J];if(null!=$J(C.elements[J])){if($J(J).up(1).tagName.toLowerCase()!="tr"){var L=2;}else{var L=1;}switch(I.action){case"compare":if(C.elements[J].value==I.value){if(D){D(I);}E=true;if(F){UTILS.showError($J(J).up(L),true);}}break;
case"min":if(C.elements[J].value.strip().length<I.value){if(D){D(I);}E=true;if(F){UTILS.showError($J(J).up(L),true);}}break;case"max":if(C.elements[J].value.strip().length>I.value){if(D){D(I);}E=true;if(F){UTILS.showError($J(J).up(L),true);}}break;case"email":if(!UTILS.checkEmailFormat(C.elements[J].value)){if(D){D(I);}E=true;if(F){UTILS.showError($J(J).up(L),true);}}else{if(F){UTILS.showError($J(J).up(L),false);}}break;case"default":if(I.value===C.elements[J].value){E=true;if(F){UTILS.showError($J(J).up(L),true);
}}else{if(F){UTILS.showError($J(J).up(L),false);}}}}});return !E;},parseQuery:function(E){window.query={};var A=unescape(E?decodeURIComponent(E):decodeURIComponent(location.search.replace(/\+/gi," "))).substr(1).split("&");var C=A.length;for(var B=0;B<C;B++){var D=(A[B]?A[B].split("="):[]);if(D.length){firstBracket=D[0].indexOf("[");if(firstBracket!=-1&&-1!=(secondBracket=D[0].indexOf("]",firstBracket))){var F=D[0].substr(0,firstBracket);window.query[F]=window.query[F]||[];if(firstBracket+1==secondBracket){window.query[F].push(D[1]);
}else{queryIndex=D[0].substr(firstBracket+1,(secondBracket-(firstBracket+1)));window.query[F][queryIndex]=D[1];}}else{console.log(D);window.query[D[0]]=D[1];}}}window["$_GET"]=window.query;},clearErrors:function(A){$J("#lb_content_"+A+" .vs-validation-error").each(function(B){B.removeClass("vs-validation-error");});},showError:function(E,B,D,C,A){if(true==B){Element.addClass(E,"vs-posting-error");Element.addClass(E,"vs-validation-error");}else{Element.removeClass(E,"vs-posting-error");Element.removeClass(E,"vs-validation-error");
}},formToObj:function(B){var C=[];for(var A=0;A<B.elements.length;A++){if((B.elements[A].type=="checkbox"&&B.elements[A].checked==false)||B.elements[A].disabled){continue;}C.push(encodeURIComponent(B.elements[A].name)+"="+encodeURIComponent(B.elements[A].value));}return(C.join("&"));},checkEmailFormat:function(A){if(/^[\d\w\/\.+!=#|$?%{^&}*`'~-][\d\w\/\.+!=#|$?%{^&}*`'~-]*@[A-Z0-9][A-Z0-9.-]{1,61}\.[A-Z]{2,6}$/i.test(A)){return true;}else{return false;}},maxWidth:28,snipBreadCrumbs:function(){var C=Math.floor(VIVASTREET._template_width/100)/10;
var B=UTILS.maxWidth*C;var A=$J(".vs-breadcrumb-connect > a",".vs-breadcrumb-connect dt > a",".vs-breadcrumb-end > a",".vs-breadcrumb-end dt > a");B+=B*((4-A.length)*0.25);A.each(function(E){var D=E.innerHTML.length;if(D>B){E.innerHTML=E.innerHTML.substr(0,B-2)+"..";}});},showCaption:function(F,E,B,A){var C=$J(F);if(true){C.style.width=C.offsetWidth+"px";C.style.height=(C.offsetHeight-5)+"px";var D=$J(E);if(B+C.offsetWidth>D.offsetWidth){B=D.offsetWidth-C.offsetWidth;}if(B<0){B=0;}var H=Position.positionedOffset(D);
var I=(H[0]+D.offsetWidth+2)+B;var G=(H[1])+A;G-=((C.offsetHeight-5)-D.offsetHeight)/2;C.style.top=G+"px";C.style.left=I+"px";}C.style.visibility="visible";},moveCaption:function(G,F){var F=!F?event:F;var D=$J(G);var B=Event.pointerX(F);var H=Event.pointerY(F);var I=D.up(".vs-lightbox-window")||false;var E=window.pageYOffset||document.body.scrollTop;if(I){var C=Position.cumulativeOffset(I)[0];var A=Position.cumulativeOffset(I)[1];B=B-C;H=H-A-E;}if(null!=D){D.style.top=(H+10)+"px";D.style.left=(B-((false==$J.browser.msie)?140:35))+"px";
D.style.visibility="visible";}},hideCaption:function(A){if($(A)){$(A).style.visibility="hidden";}},removeSymbols:function(D){var A=[/[\xC0-\xC2]/g,/[\xE0-\xE2]/g,/[\xC8-\xCA]/g,/[\xE8-\xEB]/g,/[\xCC-\xCE]/g,/[\xEC-\xEE]/g,/[\xD2-\xD4]/g,/[\xF2-\xF4]/g,/[\xD9-\xDB]/g,/[\xF9-\xFB]/g];var C=["A","a","E","e","I","i","O","o","U","u"];for(var B=0;B<A.length;B++){D=D.replace(A[B],C[B]);}return D;}};var FAV={captions:{},_added:[],_page:1,_per_page:7,init:function(){var added=Cookie.get(VIVASTREET._cookie_name+"_fav");
if(added){FAV._added=FAV._added.concat(eval(added));}FAV.updateFavCount();$J(".vs-fav-star").each(function(index,star){if(-1!==FAV._added.indexOf($J(star).attr("rel"))){$J(star).addClass("vs-fav-checked");FAV.setImage(star,true,true);}$J(star).click(function(){if($J(this).hasClass("vs-fav-star-saved")){FAV.removeFromFav(this);}else{FAV.addToFav(this);}return false;});});FAV._initBar();},_initBar:function(){if("fav"===VIVASTREET._category_code||!FAV._added||FAV._added.length<=0){return false;}var A=VIVASTREET._category_infos.meta_code;
if(A==null){return false;}var B=new Date().getTime();$J.get(VIVASTREET._ajax_dir+"favorites_element.php?cache="+B+"&category_meta="+A,function(D){$J("body").append(D);$J(".vs-fav-action-maximize").click(function(){FAV.maximizeBar();return false;});$J(".vs-fav-action-minimize").click(function(){FAV.minimizeBar();return false;});$J(".vs-fav-action-close").click(function(){FAV.closeBar();return false;});$J(".vs-fav-arrow-left").click(function(){FAV.prevPage();return false;});$J(".vs-fav-arrow-right").click(function(){FAV.nextPage();
return false;});$J(".vs-fav-action-remove").live("click",function(){FAV.removeFromFav(this);return false;});if(FAV._added&&FAV._added.length>0&&$J("ul.vs-fav-bar-list li").length>0){var C=parseInt(Cookie.get(VIVASTREET._cookie_name+"_fav_state"));if(C>=0){FAV.openBar();}if(C==1){FAV.maximizeBar();}$J("ul.vs-fav-bar-list li").each(function(E,F){if(E>=FAV._per_page){$J(F).hide();}});FAV._showHideArrows();}});},_showHideArrows:function(){if($J("ul.vs-fav-bar-list li").length<=FAV._per_page||(FAV._page>1&&FAV._page>=Math.ceil($J("ul.vs-fav-bar-list li").length/FAV._per_page))){$J(".vs-fav-arrow-right a").addClass("vs-circle-arrow-right-disabled");
}else{$J(".vs-fav-arrow-right a").removeClass("vs-circle-arrow-right-disabled");}if(FAV._page<=1){$J(".vs-fav-arrow-left a").addClass("vs-circle-arrow-left-disabled");}else{$J(".vs-fav-arrow-left a").removeClass("vs-circle-arrow-left-disabled");}},addToFav:function(B){if(!B){return false;}var A=$J(B).attr("rel");var C=A.substring(A.lastIndexOf("-")+1);this._added.push(A);this.saveFav();if(window.console){console.log("Setting fav element:",B);}FAV.setImage($J("a[rel="+A+"]"),true,true);if($J(".vs-fav-bar").length<=0){FAV._initBar();
}else{$J.get(VIVASTREET._ajax_dir+"favorites_element.php?id="+C,function(D){if(-1!==FAV._added.indexOf(A)){$J("ul.vs-fav-bar-list").append(D);FAV._showHideArrows();}});}FAV.maximizeBar();FAV.openBar();return false;},removeFromFav:function(B){if(!B){return false;}var A=$J(B).attr("rel");delete (this._added[this._added.indexOf(A)]);this.saveFav();FAV.setImage($J("a[rel="+A+"]"),false,true);$J("ul.vs-fav-bar-list li[rel="+A+"]").remove();if((!FAV._added||FAV._added.length<=0||$J("ul.vs-fav-bar-list li").length<=0)&&"fav"!==VIVASTREET._category_code){FAV.minimizeBar();
FAV.closeBar();}else{if($J("ul.vs-fav-bar-list li").length>=FAV._per_page&&$J("ul.vs-fav-bar-list li").length%FAV._per_page==0&&Math.ceil($J("ul.vs-fav-bar-list li").length/FAV._per_page)<=this._page-1){FAV.prevPage();}else{if($J("ul.vs-fav-bar-list li").length>=FAV._per_page&&$J("ul.vs-fav-bar-list li").length%FAV._per_page>=0&&(this._page<Math.ceil($J("ul.vs-fav-bar-list li").length/FAV._per_page)||this._page==1)){$J($J("ul.vs-fav-bar-list li")[FAV._per_page-1]).fadeIn();}}}FAV._showHideArrows();
return false;},saveFav:function(){var B=[];for(var A=this._added.length,C=0;C<A;C++){if(true===!!this._added[C]){B.push(this._added[C]);}}this._added=B;this.updateFavCount();Cookie.set(VIVASTREET._cookie_name+"_fav",$J.toJSON(this._added),30,VIVASTREET._gpc_domain);},updateFavCount:function(){var A=$J("#vs-fav-num");if(null!==A){$J(A).html("("+this._added.length+")");}},setImage:function(C,A,B){var A=A?"1":"0";if(A=="1"){$J(C).addClass("vs-fav-star-saved");}else{$J(C).removeClass("vs-fav-star-saved");
}if(true===B&&"detail_normal"===VIVASTREET._gpc_page_type){$J(".vs-fav-star").html(__("detail_"+(0==A?"add":"remove")+"_fav"));if(0==A){$J(".vs-fav-star").removeClass("vs-fav-star-saved");}else{$J(".vs-fav-star").addClass("vs-fav-star-saved");}}else{if(true===B){$J(C).attr("title",__("summary_"+(0==A?"save":"remove")+"_classified"));if(!$J(C).hasClass("vs-fav-no-text")){$J(C).html("<div></div>"+__("summary_"+(0==A?"save":"remove")+"_classified"));}}}$J(C).blur();},minimizeBar:function(){$J(".vs-fav-bar").addClass("vs-fav-bar-minimized");
$J(".vs-fav-bar").find(".vs-fav-actions-minimized").show();$J(".vs-fav-bar").find(".vs-fav-bar-list").hide();Cookie.set(VIVASTREET._cookie_name+"_fav_state","0",30,VIVASTREET._gpc_domain);},maximizeBar:function(){$J(".vs-fav-bar").removeClass("vs-fav-bar-minimized");$J(".vs-fav-bar").find(".vs-fav-bar-list").show();$J(".vs-fav-bar").find(".vs-fav-actions-minimized").hide();FAV._showHideArrows();Cookie.set(VIVASTREET._cookie_name+"_fav_state","1",30,VIVASTREET._gpc_domain);},openBar:function(){$J(".vs-fav-bar").show();
},closeBar:function(){$J(".vs-fav-bar").hide();Cookie.set(VIVASTREET._cookie_name+"_fav_state","-1",30,VIVASTREET._gpc_domain);},prevPage:function(){if(this._page>1){var A=$J("ul.vs-fav-bar-list li");var C=(this._page-1)*this._per_page;var B=C+this._per_page;$J(A).each(function(D,E){if(D>=C&&D<=B){$J(E).fadeOut();}});this._page--;C=(this._page-1)*this._per_page;B=B+this._per_page;if(B>=A.length-1){B=A.length-1;}$J(A).each(function(D,E){if(D>=C&&D<=B){$J(E).fadeIn();}});FAV._showHideArrows();}},nextPage:function(){var A=$J("ul.vs-fav-bar-list li");
if(this._page+1<=Math.ceil(A.length/this._per_page)){var C=(this._page-1)*this._per_page;var B=C+this._per_page;$J(A).each(function(D,E){if(D>=C&&D<=B){$J(E).fadeOut();}});this._page++;C=(this._page-1)*this._per_page;B=B+this._per_page;$J(A).each(function(D,E){if(D>=C&&D<=B){$J(E).fadeIn();}});FAV._showHideArrows();}}};var vivalink={_base16:"0A12B34C56D78E9F",encode:function(E){var B="";for(var C=0;C<E.length;C++){var F=E.charCodeAt(C);var D=F>>4;var A=F-(D*16);B+=this._base16[D]+this._base16[A];
}return"Javascript:vivalink('"+B+"');";},decode:function(E){var B="";for(var C=0;C<E.length;C+=2){var D=this._base16.indexOf(E.charAt(C));var A=this._base16.indexOf(E.charAt(C+1));B+=String.fromCharCode((D*16)+A);}return B;},init:function(){var A=document.getElementsByTagName("a");for(var B=0;B<A.length;B++){var E=A[B].href;if(E.substring(0,21).toLowerCase()=="javascript:vivalink('"){var C=E.substring(21);var D=C.indexOf("'");if(D>0){A[B].href=this.decode(C.substring(0,D));}}}var A=document.getElementsByTagName("option");
for(var B=0;B<A.length;B++){var E=A[B].value;if(E.substring(0,21).toLowerCase()=="javascript:vivalink('"){var C=E.substring(21);var D=C.indexOf("'");if(D>0){A[B].value=this.decode(C.substring(0,D));}}}}};$J(document).ready(function(){vivalink.init();});

/* alert.js */

var ALERT=(function(B,A){var C={loaded_category:0,geosearch:null,initialized:false,alert_id:null,step2set:false,step3set:false,_current_search_params:{},init:function(D){if(false==this.initialized){B("#lb_alert_prev_step2").click(function(){ALERT.activateScreen("step1");});B("#lb_alert_prev_step3").click(function(){if(false==ALERT.step2set){ALERT.setupStep2();}ALERT.activateScreen("step2");});B("#lb_alert_prev_step4").click(function(){ALERT.activateScreen("step3");});B("#lb_alert_next_step4").click(function(){ALERT.processAlert("save");
});B("#lb_alert_next_step1").click(function(){if(false==ALERT.step2set){ALERT.setupStep2();}ALERT.activateScreen("step2");});B("#lb_alert_next_step3").click(function(){ALERT.processAlert("summary");});var E=(B("ul.ui-autocomplete").length>0)?1:0;B("#lb_alert_geo_search").autocomplete({source:"/ajax/autocomplete_geo.php",search:function(F,G){B("#lb_alert_geo_search").autocomplete("option","source","/ajax/autocomplete_geo.php?parent_id="+B("#vs_alert_geo_dropdown_1").val());},select:function(F,G){B("#lb_alert_geo_id").val(G.item.id);
B.get("/ajax/regions_tree.php",{geo_id:G.item.id},function(I){for(var H in I){B("#vs_alert_geo_dropdown_"+I[H].depth).val(I[H].id);}},"json");}}).keyup(function(){if(B("#lb_alert_geo_search").val().length<=1){B("#lb_alert_geo_id").val("");}}).data("autocomplete")._renderItem=function(F,G){return B("<li></li>").data("item.autocomplete",G).append('<a rel="'+G.id+'">'+G.label+"</a>").appendTo(F);};B("#lb_alert_category_id").val(0);B("#lb_alert_category_id").change(function(){ALERT.step3set=false;});
B("#lb_alert_geo_search").val("");B("#lb_alert_geo_id").val(0);B("#lb_alert_geo_search").change(function(){if(""===B(this).val()){B("#lb_alert_geo_id").val(B("select[id^=vs_alert_geo_dropdown]:visible:last").val());}});B("#lb_alert_close_success").click(function(){ALERT.closeLightbox();});B("span.ui-icon-closethick").click(function(){ALERT.closeLightbox();});}else{this.activateScreen("step1");B("#lb_alert_category_id").val(0);B("#lb_alert_geo_search").val("");B("#lb_alert_geo_id").val(0);}if(D){this.alert_id=D;
B("#lb_alert_category_id").val(this.loaded_category);this.checkStep1();this.setupForm(null,this._current_search_params);}else{this.loaded_category=0,this.geosearch=null;this.alert_id=null;this.step2set=false;this.step3set=false;this._current_search_params={};this._current_override_geo={};}},openLightbox:function(D){B(".vs-lightbox-container").remove();LIGHTBOX.open("alert","/ajax/lightbox/alert.php?rand="+Math.random(),{alert_id:D},{modal:true,width:625,height:425,open:function(E,F){ALERT.init(D);
ALERT.activateScreen("step1");B(".ui-dialog-titlebar-close").attr("href","#close");}});},activateScreen:function(D){B("span[id^=ui-dialog-title-]").html(B("#vs_lb_create_alert div#lb_alert_screen_"+D+" h3").html());B("#vs_lb_create_alert div#lb_alert_screen_"+D+" h3").hide();B("#vs_lb_create_alert div.vs-lightbox-screen").hide();B("#vs_lb_create_alert div#lb_alert_screen_"+D).show();return false;},checkStep1:function(){var D=B("#lb_alert_category_id").val();if(parseInt(D)>0){B("#lb_alert_next_step1").button({disabled:false});
}else{B("#lb_alert_next_step1").button({disabled:true});}},checkDefault:function(D){},unsetDefault:function(E){var D=B(E);if(D.val()==D.attr("title")){D.val("");D.blur(function(){if(this.value==""){this.value=B(this).attr("title");}});}},stripNonNumerics:function(D){},processAlert:function(H){B(".vs-alert-input-error").removeClass("vs-alert-input-error");var D=B("#lb_alert_form input, #lb_alert_form select");var I=["alert[searchGeo_1]","alert[searchGeo_2]","alert[searchGeo_3]","alert[searchGeo_4]","alert[searchGeo_5]","alert[searchGeo_text]","alert[email]"];
var F=[];for(var J=0;J<D.length;J++){var E=B(D[J]);var G=D[J];if((G.tagName=="INPUT"||G.tagName=="SELECT")&&I.indexOf(G.name)<0){var L=E.val();if(null!=E.attr("name")&&(E.attr("title")!=L)){if(E.hasClass("vs-validate-number")){if(L!=E.attr("title")&&L.replace(/[^0-9]/g,"")!=L){if(window.console){console.log("Error validating element",G.name);}return false;}}else{if(E.hasClass("vs-validate-noempty")){if(L.strip().length==0){if(window.console){console.log("Error: "+G.name+" should not be empty");}return false;
}}}F.push(encodeURIComponent(G.name)+"="+encodeURIComponent(L));}}}if(H=="save"){var M=B("#vs_lb_search_email");if(M.val()==""||M.val()==M.attr("title")){if(window.console){console.log("Invalid email address");}return false;}F.push(encodeURIComponent(M.attr("name"))+"="+encodeURIComponent(M.val()));}var K=B("#lb_alert_category_id").val();if(H=="summary"){F.push("action=generateSummary");F.push("cat_id="+this.loaded_category);F.push("rand="+Math.random());F=F.join("&");B.get("/ajax/alert.php",F,function(N,P,O){B("#lb_alert_summary_container").html(N);
ALERT.activateScreen("step4");},"html");}else{if(H=="save"){F.push("action=saveAlert");F.push("cat_id="+this.loaded_category);F.push("alert_id="+this.alert_id);F.push("rand="+Math.random());F=F.join("&");if(window.console){console.log("Making request with params",F);}B.get("/ajax/alert.php",F,function(N,P,O){if(N.status=="success"){ALERT.activateScreen("step5_success");}else{ALERT.activateScreen("step5_failed");}},"json");}}},setupForm:function(D,G,H){var H=H||function(){};var F=parseInt(B("#lb_alert_category_id").val());
var E={action:G.action,search:this._current_search_params,alert_id:G.alert_id,cat_id:F,rand:Math.random()};if(this.loaded_category!=F){this.loaded_category=F;}B.get("/ajax/alert.php",E,function(I,J,K){B("#lb_alert_form_container").html(I);B("#lb_alert_next_step3").button({diabled:false});H();},"html");},setupStep2:function(){B.get("/ajax/regions.php",{level:1,parent_id:1},function(I,K,M){var H=B("#vs_alert_geo_dropdown_1").val();var L=B("#vs_alert_geo_dropdown_1 option:first").clone();B("#vs_alert_geo_dropdown_1").html(L);
for(var N in I){var J=I[N];B("#vs_alert_geo_dropdown_1").append('<option value="'+N+'">'+J[0]+"</option>");}B("#vs_alert_geo_dropdown_1").val(H);if("undefined"!==typeof (ALERT._current_override_geo)){for(var G in ALERT._current_override_geo){if(1==ALERT._current_override_geo[G]["depth"]){B("#vs_alert_geo_dropdown_1").val(ALERT._current_override_geo[G]["id"]).change();}}}},"json");B("#vs_alert_geo_dropdown_1").change(function(){B("#lb_alert_geo_id").val(B(this).val());});var F="object"===typeof (GEOSEARCH)?GEOSEARCH:{};
B.ajax({async:false,url:"/ajax/geosearch_settings.php",data:{cat:B("#lb_alert_category_id").val()},success:function(G){if(G){F=G;}},dataType:"json"});if(true===F.freeText&&(false==F.multiDrop||1==F.multiDrop)){B("#lb_alert_geo_search").show();if("undefined"!==typeof (ALERT._current_override_geo)){for(var E in ALERT._current_override_geo){B("#lb_alert_geo_search").val(ALERT._current_override_geo[E]["label"]);B("#lb_alert_geo_id").val(ALERT._current_override_geo[E]["id"]);}}}if(true==F.freeText&&false==F.multiDrop){B("select[id^=vs_alert_geo_dropdown]").hide();
B("#lb_alert_geo_search").css({display:"block"});}else{if(true==F.multiDrop&&0<F.dropLevel){for(var D=1;D<F.dropLevel;D++){B("#vs_alert_geo_dropdown_"+D).change(function(){var H=B(this);if(0<H.val()){B("#lb_alert_geo_id").val(H.val());}else{B("#lb_alert_geo_id").val(B("#vs_alert_geo_dropdown_"+(D-2)).val());}var I=parseInt(H.attr("id").substring(H.attr("id").length-1));for(var G=(I+1);G<=5;G++){B("#vs_alert_geo_dropdown_"+G).html('<option value="0"></option>').hide();}if(5>I){B.get("/ajax/regions.php",{level:(I+1),parent_id:H.val()},function(L){if(L.toString().length>0){var K=B("#vs_alert_geo_dropdown_"+(I+1)).val();
var N=B("#vs_alert_geo_dropdown_"+(I+1)+" option:first").clone();B("#vs_alert_geo_dropdown_"+(I+1)).html(N);for(var O in L){var M=L[O];B("#vs_alert_geo_dropdown_"+(I+1)).append('<option value="'+O+'">'+M[0]+"</option");}B("#vs_alert_geo_dropdown_"+(I+1)).val(K);if(0<B("#vs_alert_geo_dropdown_"+(I+1)).children("option[value!=0]").length){B("#vs_alert_geo_dropdown_"+(I+1)).css({display:"block"});}}if("undefined"!==typeof (ALERT._current_override_geo)){for(var J in ALERT._current_override_geo){if((I+1)==ALERT._current_override_geo[J]["depth"]){B("#vs_alert_geo_dropdown_"+(I+1)).val(ALERT._current_override_geo[J]["id"]).change();
B("#lb_alert_geo_id").val(ALERT._current_override_geo[J]["id"]);}}}},"json");}});}B("#vs_alert_geo_dropdown_"+F.dropLevel).change(function(){if(0<B(this).val()){B("#lb_alert_geo_id").val(B(this).val());}else{B("#lb_alert_geo_id").val(B("#vs_alert_geo_dropdown_"+(F.dropLevel-1)).val());}if(0<B(this).val()&&(true===F.freeText||3>F.dropLevel)){if("undefined"!==typeof (ALERT._current_override_geo)){for(var G in ALERT._current_override_geo){if(F.dropLevel==ALERT._current_override_geo[G]["depth"]){B("#lb_alert_geo_id").val(ALERT._current_override_geo[G]["id"]);
}}}B("#lb_alert_geo_search").css({display:"block"});}else{B("#lb_alert_geo_search").hide();}});if(""==B("#lb_alert_geo_search").val()){B("#lb_alert_geo_search").hide();}B("#vs_alert_geo_dropdown_1").css({display:"block"});if("undefined"!==typeof (this._current_override_geo)){for(var E in this._current_override_geo){if(F.dropLevel>=this._current_override_geo[E]["depth"]){B("#vs_alert_geo_dropdown_"+this._current_override_geo[E]["depth"]).change();}else{B("#lb_alert_geo_search").val(this._current_override_geo[E]["label"]);
B("#lb_alert_geo_id").val(this._current_override_geo[E]["id"]);}}}}else{if(true==F.multiDrop){for(D=1;D<=5;D++){B("#vs_alert_geo_dropdown_"+D).change(function(){var H=B(this);if(0<B("#lb_alert_geo_id").val()){B("#lb_alert_geo_id").val(H.val());}else{B("#lb_alert_geo_id").val(B("#vs_alert_geo_dropdown_"+(D-1)).val());}var I=parseInt(H.attr("id").substring(H.attr("id").length-1));for(var G=(I+1);G<=5;G++){B("#vs_alert_geo_dropdown_"+G).html('<option value="0"></option>').hide();}if(5>I){B.ajax({async:false,url:"/ajax/regions.php",data:{level:(I+1),parent_id:H.val()},success:function(K){var J=B("#vs_alert_geo_dropdown_"+(I+1)).val();
var M=B("#vs_alert_geo_dropdown_"+(I+1)+" option:first").clone();B("#vs_alert_geo_dropdown_"+(I+1)).html(M);for(var N in K){var L=K[N];B("#vs_alert_geo_dropdown_"+(I+1)).append('<option value="'+N+'">'+L[0]+"</option");}B("#vs_alert_geo_dropdown_"+(I+1)).val(J);},dataType:"json"});if(B("#vs_alert_geo_dropdown_"+(I+1)).children("option").length>1){B("#vs_alert_geo_dropdown_"+(I+1)).removeAttr("disabled").css({display:"block"});}}});}B("#lb_alert_geo_search").hide();B("#vs_alert_geo_dropdown_1").css({display:"block"});
}}}this.step2set=true;},setupStep3:function(){if(false==this.step3set){this.setupForm(this,{action:"generateForm",alert_id:this.alert_id});this.step3set=true;}this.activateScreen("step3");},closeLightbox:function(D){this.step2set=false;this.step3set=false;LIGHTBOX.close("alert");}};return C;})($J,VIVASTREET);

/* lightbox.js */

var _init=$J.ui.dialog.prototype._init;$J.ui.dialog.prototype._init=function(){var A=this;_init.apply(this,arguments);this.uiDialog.bind("dragstop",function(B,C){if(A.options.sticky){var E=Math.floor(C.position.left)-$J(window).scrollLeft();var D=Math.floor(C.position.top)-$J(window).scrollTop();A.options.position=[E,D];}});if(window.__dialogWindowScrollHandled===undefined){window.__dialogWindowScrollHandled=true;$J(window).scroll(function(B){$J(".ui-dialog-content").each(function(){var D=$J(this).dialog("option","sticky")&&$J(this).dialog("isOpen");
if(D){var C=$J(this).dialog("option","position");$J(this).dialog("option","position",C);}});});}};var LIGHTBOX=(function(B,A){var C={_lightboxes:{},open:function(H,G,E,D){var E=E||{};var D=D||{};var F;F=B("<div></div>");F.addClass("vs-lightbox-container");if(!D.close){D.close=function(I,J){setTimeout(function(){if(window.console){console.log("LIGHTBOX: Closing lightbox, trying to destroy it...");}LIGHTBOX.close(H);},10);};}B.get(G,E,function(I,J,K){F.html(I);B("input[type=button], input[type=submit], input[type=reset]",F).button();
F.dialog(D);LIGHTBOX._lightboxes[H]=F;},"html");},close:function(E,D){var D=D||false;if(E in this._lightboxes){if(D!=false){setTimeout(function(){LIGHTBOX._lightboxes[E].dialog("close");LIGHTBOX._lightboxes[E].dialog("destroy");LIGHTBOX._lightboxes[E].remove();delete LIGHTBOX._lightboxes[E];},D);}else{this._lightboxes[E].dialog("close");this._lightboxes[E].dialog("destroy");this._lightboxes[E].remove();delete this._lightboxes[E];}}},showLogger:function(){var D;D=B("<div></div>");D.addClass("vs-lightbox-container");
D.addClass("vs-lightbox-logger");D.attr("name","vs-lightbox");D.html("<ul></ul>");D.dialog({width:600,resizable:false,modal:true,sticky:true,title:__("lb_status"),closeOnEscape:false,open:function(E,F){B(this).parent().children().children(".ui-dialog-titlebar-close").remove();}});this._lightboxes["logger"]=D;},hideLogger:function(D){var D=D||false;this.close("logger",D);},addLogMessage:function(G,E){if(window.console){console.log("Calling addLogMessage:",G,E);}var E=E||"info";if(!this._lightboxes["logger"]){this.showLogger();
}if(B("ul li:last",this._lightboxes["logger"]).length>0){var D=B("ul li:last",this._lightboxes["logger"]);var F=D.html();if(F==G){this.updateLogMessage(G,E);return true;}}B("ul",this._lightboxes["logger"]).append('<li class="vs-lb-log-message-'+E+'">'+G+"</li>");},updateLogMessage:function(E,D){if(window.console){console.log("Calling updateLogMessage:",E,D);}var D=D||"info";if(!this._lightboxes["logger"]){this.showLogger();this.addLogMessage(E,D);return ;}if(B("ul li:last",this._lightboxes["logger"]).length==1){B("ul li:last",this._lightboxes["logger"]).remove();
B("ul",this._lightboxes["logger"]).append('<li class="vs-lb-log-message-'+D+'">'+E+"</li>");}else{this.addLogMessage(E,D);}},activateScreen:function(E,D){if(this._lightboxes[E]){B(".vs-lightbox-screen",this._lightboxes[E]).hide();B("#lb_"+E+"_screen_"+D,this._lightboxes[E]).show();}}};return C;})($J,VIVASTREET);

/* account.js */

var ACCOUNT=(function(B,A){var C={init:function(){B.validator.addMethod("confirm",function(F,E){var D=B(E).attr("id")+"_confirm";if(F!=B("#"+D).val()){return false;}else{return true;}},__("register_invalid_email_confirm"));B("#vs_account_change_password").validate({rules:{new_pass_account:{required:true,minlength:6,maxlength:255,confirm:true},retype_pass_account:{required:true,minlength:6,maxlength:255}},submitHandler:function(D){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("reset_password_validating"),"loading");
B.post("/ajax/account.php",{code:D.elements["code"].value,email:D.elements["email"].value,new_pass_account:D.elements["new_pass_account"].value,retype_pass_account:D.elements["retype_pass_account"].value,reset_password:D.elements["reset_password"].value,saved:D.elements["saved"].value,user_id:D.elements["user_id"].value},function(E,F,G){if(window.console){console.log("Received reset password response:",E,F);}if(E.length>0){E=E[0];switch(E.code){case"invalid_password":case"invalid_new_password":case"password_mismatch":LIGHTBOX.updateLogMessage(__("reset_password_validating"),"error");
LIGHTBOX.addLogMessage(E.message,"error");LIGHTBOX.hideLogger(3000);D.elements["new_pass_account"].value="";D.elements["retype_pass_account"].value="";break;case"no_changes":case"success":LIGHTBOX.updateLogMessage(__("reset_password_validating"),"success");LIGHTBOX.addLogMessage(__("reset_password_success"),"success");LIGHTBOX.addLogMessage(__("postform_login"),"loading");A.authorize({action:"login",email:D.elements["email"].value,password:D.elements["new_pass_account"].value,onComplete:function(J){var H=J;
var I="";for(i=0;i<H.length;i++){I=H[i];switch(I.code){case"blocked_user":case"disabled_user":case"invalid_email":case"incorrect_email_password":LIGHTBOX.updateLogMessage(__("postform_login"),"error");LIGHTBOX.addLogMessage(I.message,"error");setTimeout(function(){LIGHTBOX.hideLogger();},3000);B("#login_error").html(__("postform_login_error"));B("#login_error").show();break;case"invalid_captcha":case"login_successful":LIGHTBOX.updateLogMessage(__("postform_logged_in"),"success");B("input[name=logged_in]").val(1);
A.updateGFVivaCookie(B.toJSON(J));A.login();A.loginRefresh("http://www."+A._gpc_domain+"/account_classifieds.php");break;}}}});break;}}},"json");}});B("#vs_account_modify").validate({rules:{email:{required:true,email:true},username:{required:true,minlength:3,maxlength:32},new_pass_account:{minlength:3},retype_pass_account:{minlength:3},civility:{required:function(){return("FR"==A._country_geo[1]);}}},submitHandler:function(D){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("account_info_validating"),"loading");
if(D.elements["new_pass_account"].value.length>0){if(D.elements["new_pass_account"].value!=D.elements["retype_pass_account"].value){LIGHTBOX.updateLogMessage(__("Passwords Do Not Match"),"error");setTimeout(function(){LIGHTBOX.hideLogger();},3000);return false;}}LIGHTBOX.updateLogMessage(__("account_info_validating"),"success");B.post("/ajax/account.php",{validate:1,email:D.elements["email"].value,username:D.elements["username"].value,new_pass_account:D.elements["new_pass_account"].value,retype_pass_account:D.elements["retype_pass_account"].value,civility:(D.elements["civility"]?D.elements["civility"].value:""),year:(D.elements["year"]?D.elements["year"].value:""),from_partners:D.elements["from_partners"].checked?"partners":""},function(E,F,G){console.log("Received account update response:",E,F);
E=E[0];if(E.code=="success"||E.code=="no_changes"){LIGHTBOX.addLogMessage(__("account_info_saved"),"success");B(D.elements["new_pass_account"]).val("").parent().parent().hide();B(D.elements["retype_pass_account"]).val("").parent().parent().hide();}else{LIGHTBOX.addLogMessage(__("account_info_not_saved"),"error");}setTimeout(function(){LIGHTBOX.hideLogger();},3000);},"json");return false;}});B(".vs-account-featured-button").click(function(){LIGHTBOX.open("featured_ad_explanation","/ajax/lightbox/featured_ad_explanation.php",{},{modal:true,width:675,resizable:false,title:__("featured_ad_explanation")});
});B("#login_forgot_password_link").click(function(){LIGHTBOX.open("forgot_password","/ajax/lightbox/forgot_password.php",{},{width:500,modal:true});});B("#login_create_account_link").click(function(){LIGHTBOX.open("register","/ajax/lightbox/register.php",{},{width:650,modal:true,title:__("lightbox_register"),open:function(D,E){B("#registerForm").validate({rules:{mail_posting:{required:true,email:true,minlength:6,maxlength:255,confirm:true},mail_posting_confirm:{required:true,email:true,minlength:6,maxlength:255},pass_posting:{required:true,minlength:3},pseudo_posting:{required:true,minlength:3},captcha:{required:true,minlength:5,maxlength:5}},errorPlacement:function(F,G){F.appendTo(G.parent().parent().find("th"));
},highlight:function(H,F,G){B(H).parent().parent("tr").addClass(F).removeClass(G);},unhighlight:function(H,F,G){B(H).parent().parent("tr").removeClass(F).addClass(G);},submitHandler:function(F){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("register_registering_msg"),"loading");A.authorize({action:"register",email:F.elements["mail_posting"].value,password:F.elements["pass_posting"].value,username:F.elements["pseudo_posting"].value,phone:"",vivastreet_optin:F.elements["vivastreet_optin"].checked?"yes":"no",partners_optin:F.elements["partners_optin"].checked?"yes":"no",captcha:F.elements["captcha"].value,country:A.country_geo["code"].toLowerCase(),checkDupe:true,onComplete:function(G){var H=G[0];
switch(H.code){case"blocked_user":case"disabled_user":case"invalid_email":case"duplicate_email":case"register_failed":case"invalid_captcha":if(H.code=="invalid_email"){LIGHTBOX.updateLogMessage(__("register_registering_msg"),"error");LIGHTBOX.addLogMessage(__("postform_register_mail_posting"),"error");A.resetCaptcha("register","#captcha_image_register","captcha");LIGHTBOX.hideLogger(3000);}else{if(H.code=="duplicate_email"){LIGHTBOX.updateLogMessage(__("register_registering_msg"),"error");LIGHTBOX.addLogMessage(__("postform_register_dupe_email"),"error");
A.resetCaptcha("register","#captcha_image_register","captcha");LIGHTBOX.hideLogger(3000);}else{LIGHTBOX.updateLogMessage(__("register_registering_msg"),"error");LIGHTBOX.addLogMessage(__("postform_register"),"error");A.resetCaptcha("register","#captcha_image_register","captcha");LIGHTBOX.hideLogger(3000);}}return false;case"register_successful":case"login_successful":LIGHTBOX.close("register");LIGHTBOX.updateLogMessage(__("register_registering_msg"),"success");LIGHTBOX.addLogMessage(__("postform_login"),"loading");
A.authorize({action:"login",email:F.elements["mail_posting"].value,password:F.elements["pass_posting"].value,onComplete:function(K){var I=K;var J="";for(i=0;i<I.length;i++){J=I[i];switch(J.code){case"blocked_user":case"disabled_user":case"invalid_email":case"incorrect_email_password":LIGHTBOX.updateLogMessage(__("postform_login"),"error");LIGHTBOX.addLogMessage(J.message,"error");setTimeout(function(){LIGHTBOX.hideLogger();},3000);break;case"invalid_captcha":case"login_successful":LIGHTBOX.updateLogMessage(__("postform_logged_in"),"success");
B("input[name=logged_in]").val(1);A.updateGFVivaCookie(B.toJSON(K));A.login();A.loginRefresh("http://www."+A._gpc_domain+"/account.php?account_notify=account_not_confirmed");break;}}}});return false;}}});return false;}});A.resetCaptcha("register","#captcha_image_register","captcha");}});});},reload_captcha:function(F,E,D,G){F.attr("src",A.captcha(E,D));if(G){G.val("");}},sendReply:function(D){LIGHTBOX.open("send_reply","/ajax/lightbox/account_send_reply.php",{mid:D},{modal:true,width:650,height:475,open:function(E,F){B("#vs_lb_send_reply_form").validate({errorClass:"error",rules:{posting_user_email:{required:A.isLogged,email:true},message:{required:true,minlength:15,maxlength:5000},captcha:{required:true,minlength:5,maxlength:5}},messages:{message:{minlength:__("vivamail_message_too_short"),maxlength:__("add_comment_message_long")}},highlight:function(H,G){var I=B(H).parent().parent();
if(I.is("tr")){I.addClass(G);}else{I.parent().addClass(G);}},unhighlight:function(H,G){var I=B(H).parent().parent();if(I.is("tr")){I.removeClass(G);}else{I.parent().removeClass(G);}},submitHandler:function(G){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("send_reply_validation"),"loading");G.submit();}});B("#captcha_image_vivamail").attr("src",A.captcha("vivamail","small"));}});},sendReplyResponse:function(D){console.log("Send reply response:",D);if(D.success==true){LIGHTBOX.updateLogMessage(__("send_reply_validation"),"success");
LIGHTBOX.addLogMessage(D.message,"success");}else{LIGHTBOX.updateLogMessage(__("send_reply_validation"),"error");LIGHTBOX.addLogMessage(D.message,"error");}LIGHTBOX.close("send_reply");setTimeout(function(){LIGHTBOX.hideLogger();},3000);},vivamailAction:function(D,E){B("#extra_action").val(E);D.submit();},forgotPasswordSend:function(D){LIGHTBOX.showLogger();LIGHTBOX.addLogMessage(__("forgot_password_sending"),"loading");B.get("/ajax/forgot_password.php",{process:1,forgot_password_email:D,domain:A._gpc_domain,type:A._gpc_page_type,rand:Math.random()},function(E,F,G){if(E.code=="failed"||E.code=="failed_temporary"){LIGHTBOX.updateLogMessage(__("forgot_password_error"),"error");
LIGHTBOX.addLogMessage(E.message,"error");LIGHTBOX.hideLogger(3000);}else{LIGHTBOX.close("forgot_password");LIGHTBOX.addLogMessage(__("forgot_password_success"),"success");LIGHTBOX.hideLogger(3000);}},"json");},toggleAutoRenew:function(H,G,D){var F=B(H);F.removeClass("saved");if(G=="featured"){if(H.checked==true){var I=1;}else{var I=2;}}else{if(G=="premium"){if(H.checked==true){var I=3;}else{var I=4;}}else{if(G=="repost"){if(H.checked==true){var I=5;}else{var I=6;}}else{if(G=="highlight"){if(H.checked==true){var I=7;
}else{var I=8;}}}}}var E=A._ajax_dir+"set_auto_renew.php?classified_id="+D+"&action="+I;LIGHTBOX.open("posting_auto_renew","/ajax/lightbox/posting_auto_renew.php",{request_url:E,checkbox_id:B(H).attr("id"),disclaimer:(B(H).is(":checked")?"disclaimer_auto_renewal":"disclaimer_auto_renewal_cancel")},{modal:true,width:500,close:function(J,K){if(false==F.hasClass("saved")){if(F.is(":checked")){F.removeAttr("checked");}else{F.attr("checked","checked");}}if(typeof (CONFIRM)!="undefined"){CONFIRM.checkSaveCard();
}}});},saveAutoRenew:function(D){B.get(D,function(E,F,G){LIGHTBOX.close("posting_auto_renew");});},sendConfirmation:function(D){if("undefined"==typeof (D)){D="";}B.get(A._ajax_dir+"/send_confirmation.php",{domain:A._gpc_domain,country:A._country_geo[1],refer:D},function(E){if(E.code=="success"){LIGHTBOX.addLogMessage(E.message,"success");LIGHTBOX.hideLogger(3000);}else{LIGHTBOX.addLogMessage(E.message,"error");LIGHTBOX.hideLogger(3000);}},"json");},resetPassword:function(){B(".vs-account-new-password input[type=password]").attr("disabled",false);
B(".vs-account-new-password").show();B("#vs-accont-reset-password").remove();return false;}};return C;})($J,VIVASTREET);var DATAGRID={initButtonCheck:function(){$J(".vs-table-checkbox").click(function(){DATAGRID.checkButtonStatus();});DATAGRID.checkButtonStatus();},checkButtonStatus:function(){var F=$J("input.vs-table-checkbox");var I=true;var D=true;var H=false;var A=true;var C=0;for(var E=0;E<F.length;E++){var G=F[E];var B=$J(F[E]);if(G.checked==true){H=true;if(window.query["tab"]&&window.query["tab"]=="disabled"){if(!B.parent().parent().hasClass("vs-classified-row-can-republish")){D=false;
}}else{if(!B.parent().parent().hasClass("vs-classified-row-can-repost")){I=false;}}if(!B.parent().parent().hasClass("vs-classified-row-can-deactivate")){A=false;}C++;}}if(C==0){I=false;D=false;A=false;}if(H==false){DATAGRID.setDisabled(".vs-delete-button");}else{DATAGRID.setEnabled(".vs-delete-button");}if(A==false){DATAGRID.setDisabled(".vs-deactivate-button");}else{DATAGRID.setEnabled(".vs-deactivate-button");}if(I==false){DATAGRID.setDisabled(".vs-repost-button");}else{DATAGRID.setEnabled(".vs-repost-button");
}if(D==false){DATAGRID.setDisabled(".vs-republish-button");}else{DATAGRID.setEnabled(".vs-republish-button");}return true;},setDisabled:function(A){A=$J(A);A.attr("disabled","disabled");A.addClass("vs-input-button-disabled");A.button("disable");},setEnabled:function(A){A=$J(A);A.attr("disabled","");A.removeClass("vs-input-button-disabled");A.button("enable");},checkAll:function(B){var C=$J(".vs-table-checkbox");for(var A=0;A<C.length;A++){C[A].checked=B;}return true;}};

