jQuery.fn.extend({ initSlider: function() { return this.each(function() { var a = { v1: 0, v2: 0, step: 0 }, b = $(this).prev("table").find("td"); a.step = b.length - 1; var c = 0; b.each(function(d) { if ($(b[d]).hasClass("evid") && c == 0) { a.v1 = d; c = 1 } else if ($(b[d]).hasClass("evid") && c == 1) { a.v2 = d; c = 2 } }); $(this).slider({ min: 0, max: a.step, animate: true, values: [a.v1, a.v2], range: true, change: function(d, i) { $(this).prev("table").find("td").removeClass("evid"); for (var e in i.values) $(this).prev("table").find("td").eq(i.values[e]).addClass("evid"); var g = $(this).prev("table").find("td.evid:eq(0) span").text(), h = $(this).prev("table").find("td.evid:eq(1) span").text(), f = $(this).prev("table").find("td.evid:eq(0)").text(), j = $(this).prev("table").find("td.evid:eq(1)").text(); f = f.substring(0, f.length - g.length); j = j.substring(0, j.length - h.length); e = $(this).attr("id").substring($(this).attr("id").indexOf("slider_") + 7); $(this).next("h4").find("span:eq(0)").text(f); $(this).next("h4").find("span:eq(1)").text(j); f = $(this).next("h4").find("span:eq(2)").text(); try { if (h == null || h == "") h = g } catch (k) { } g = e + "-" + replaceUrlPart(g) + "," + replaceUrlPart(h); e = RegExp(e + "-[0-9]+,[0-9]+", "g"); if (e.test(f)) f = f.replace(e, g); else f += g; if (document.location.search.indexOf("vt=gallery") != -1) f += "/?vt=gallery"; document.location = f } }) }) }, initShowcase: function() { return this.each(function() { $(this).easySlider({ auto: false, continuous: false, orientation: "horizontal", speed: 100, numericId: "sc-ctrls", numeric: true }); $(this).children("ul").children("li").each(function() { $(this).find(".sc-category:last").css({ "border-right": "0" }) }) }) } }); $(function() { try { $(".slider").initSlider(); $(".showcase").initShowcase(); if ($.browser.msie && $.browser.version.substr(0, 1) < 7) { $(".tab-block, .header, .tab-detail, .bsu-channels").pngFix(); $(".tab-block a, .header a, .tab-detail a, .bsu-channels a").css({ cursor: "pointer" }); $("a.bsu-channel-fp").css({ "padding-top": "15px" }) } $(".pwd-area").css({ visibility: "visible" }).hide(); $(".pwd-area a:first").click(function() { $(".pwd-area").fadeOut("fast") }); $(".note a:eq(1)").click(function() { $("#resetPwdResult").hide(); $("#resetPwdForm").show(); $(".pwd-area").fadeIn("fast") }); $("form[name=formSearch] #st").autocomplete("/ajax/Autocomplete", { dataType: "json", selectFirst: false }); $(".box-tab-alert-quit").click(function() { $(this).parent().fadeOut(); return false }); $(".paget ul li a").hover(function() { $(this).children("img").attr("src", $(this).children("img").attr("src").replace("-off", "-on")) }, function() { $(this).children("img").attr("src", $(this).children("img").attr("src").replace("-on", "-off")) }).click(function() { imgs = $(this).parent().parent().find("img"); for (var b in imgs) try { $(imgs[b]).attr("src", $(imgs[b]).attr("src").replace("-act", "-off")) } catch (c) { } $(this).children("img").attr("src", $(this).children("img").attr("src").replace("-on", "-act")); return true }); $(".bsu-answer-mark").css({ display: "none" }); $(".bsu-question-mark").click(function() { $(this).next(".bsu-answer-mark").show(); return false }); $(".bsu-answer-mark a").click(function() { $(this).parent().hide(); return false }); $(".headerScheda").click(function() { $(this).parent().hasClass("sm-close") ? open_sm($(this).parent()) : close_sm($(this).parent()) }); $(".headerScheda").next("img.form-expand").css({ cursor: "pointer" }).click(function() { $(this).parent().hasClass("sm-close") ? open_sm($(this).parent()) : close_sm($(this).parent()) }); $(".schedaMedium.red .headerScheda, .schedaMedium.nobg .headerScheda, .schedaMedium.nojs .headerScheda").unbind("click").css({ cursor: "default" }); $.datepicker.regional.it = { clearText: "Cancella", clearStatus: "", closeText: "Chiudi", closeStatus: "Chiudi senza modificare", prevText: "&lt;&lt; Prec", prevStatus: "Visualizza i precedenti", nextText: "Succ &gt;&gt;", nextStatus: "Visualizza i successivi", currentText: "Corrente", currentStatus: "Visualizza i pi\u00f9 recenti", monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], monthStatus: "Visualizza un altro mese", yearStatus: "Visualizza un altro anno", weekHeader: "", weekStatus: "", dayNames: ["Domenica", "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato"], dayNamesShort: ["D0m", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"], dayNamesMin: ["D0", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"], dayStatus: "Utilizza DD come primo giorno della settimana", dateStatus: "Scegli il DD, MM d", dateFormat: "dd/mm/yy", firstDay: 0, initStatus: "Seleziona la data", isRTL: false }; $.datepicker.setDefaults($.datepicker.regional.it); $(".datepicker").datepicker({ showOn: "button", buttonImage: "/Images/ico-calendar.gif", buttonImageOnly: true, changeYear: true, yearRange: "1900:2010", changeMonth: true }); $(".filter").each(function(b) { $($(".filter")[b]).css("z-index", 20 - b) }); $ofr = $(".id-offers:eq(0)"); $annADV = $ofr.find(".annADV"); $annTGO = $ofr.find(".annTGO"); $offers = $annTGO.children(".offers"); $annTGO.hide(); $annTGO.children("a.btn_search").hide(); $(".paged .btn_confronta").click(function() { $annADV.hide(); $annTGO.show(); if ($offers.find("input[value=" + $(this).siblings("input[type=hidden]").attr("value") + "]").length == 0) if ($offers.find(".offer").length < 3) { var b = $("#currentCompareAdt").val(), c = $(this).siblings("#adtCompareId").attr("value"); if (b == "") $("#currentCompareAdt").val(c); else if (b != c) { alert("Non si possono confrontare annunci di categorie diverse"); return false } this.name == "gallery" ? $offers.append('<div class="offer"><input type="hidden" value="' + $(this).siblings("input[type=hidden]").attr("value") + '" /><a class="close-offer" href="#" title="Togli annuncio" onclick="remove_this($(this)); return false;"><img class="right" src="/Images/x.gif" alt="x" style="width:11px;height:11px;" /></a><br/>' + $(this).siblings(".baloon-quad").find("a").html() + "<p>" + $(this).parent().find("p.desc").text().substring(0, 17) + " ...</p></div>") : $offers.append('<div class="offer"><input type="hidden" value="' + $(this).siblings("input[type=hidden]").attr("value") + '" /><a class="close-offer" href="#" title="Togli annuncio" onclick="remove_this($(this)); return false;"><img class="right" src="/Images/x.gif" alt="x" style="width:11px;height:11px;" /></a><br/>' + $(this).siblings(".baloon-quad").html() + "<p>" + $(this).parent().find("p.desc").text().substring(0, 17) + " ...</p></div>"); $(".offer").length > 1 && $annTGO.children("a.btn_search").show() } else alert("Non puoi inserire pi\u00f9 di 3 elementi!"); else alert("elemento gi\u00e0 presente!"); return false }); $(".imageForm").click(function() { $(this).siblings().removeClass("selected"); $(this).addClass("selected"); $subt = $(this).parent().children("span.subt"); $subt.length && $subt.text($(this).children("label").text() + " \u00e8 stata selezionata come immagine di copertina!") }); $(".gallery .gal-prev").click(function() { $galmain = $(this).parent().children("img.gal-main"); $imgprev = $(this).parent().children("ul.thumbs").children("li.thumb-active").children("img").attr("src") == $(this).parent().children("ul.thumbs").children("li:first").children("img").attr("src") ? $(this).parent().children("ul.thumbs").children("li:last") : $(this).parent().children("ul.thumbs").children("li.thumb-active").prev(); $galmain.attr("src", $imgprev.children("img").attr("src")); $imgprev.parent().children("li").removeClass("thumb-active"); $imgprev.addClass("thumb-active") }); $(".gallery .gal-next").click(function() { $galmain = $(this).parent().children("img.gal-main"); $imgnext = $(this).parent().children("ul.thumbs").children("li.thumb-active").children("img").attr("src") == $(this).parent().children("ul.thumbs").children("li:last").children("img").attr("src") ? $(this).parent().children("ul.thumbs").children("li:first") : $(this).parent().children("ul.thumbs").children("li.thumb-active").next(); $galmain.attr("src", $imgnext.children("img").attr("src")); $imgnext.parent().children("li").removeClass("thumb-active"); $imgnext.addClass("thumb-active") }); $(".gallery ul.thumbs li").click(function() { $(this).parent().parent().children("img.gal-main").attr("src", $(this).children("img").attr("src")); $(this).parent().children("li").removeClass("thumb-active"); $(this).addClass("thumb-active") }); $(".filter-area").css({ visibility: "visible" }).hide(); $(".piu").click(function() { $(this).siblings(".filter-area").fadeIn("fast"); return false }); $(".ics").click(function() { $(this).parent().hide(); return false }); $(".fa-div").click(function() { $(this).hasClass("fa-evid") ? $(this).removeClass("fa-evid") : $(this).addClass("fa-evid"); update_selezionati($(this).parent().parent().parent()) }); $(".filter-area").find(".fa-voice:first").click(function() { $fads = $(this).siblings(".fa-divs").children(".fa-div"); $fads.each(function(b) { $($fads[b]).hasClass("fa-evid") || $($fads[b]).hide() }); $(".filter-area a.fa-voice").css("text-decoration", "none"); $(this).css("text-decoration", "underline"); return false }); $(".filter-area").find(".fa-voice:eq(1)").click(function() { $(this).siblings(".fa-divs").children(".fa-div").show(); $(".filter-area a.fa-voice").css("text-decoration", "none"); $(this).css("text-decoration", "underline"); return false }); $(".filter-area").find("a.btn_login2:eq(0)").click(function() { $(this).parent().parent().fadeOut("fast"); return false }); $(".filter-area").find("a.btn_login2:eq(1)").attr("href", document.location.href); $(".filter-area input[type=text]").keyup(function() { var b = $(this).val(), c = $(".filter-area").find(".fa-voice:eq(1)").css("text-decoration") == "underline"; $fads = $(this).siblings(".fa-divs").children(".fa-div"); $fads.each(function(d) { if ($.trim($($fads[d]).find("div").text()).indexOf(b, 0) != 0) $($fads[d]).hide(); else if (c) $($fads[d]).show(); else $($fads[d]).hasClass("fa-evid") && $($fads[d]).show() }) }) } catch (a) { } }); open_sm = function(a) { a.removeClass("sm-close"); a.children("img").attr("src", "/Images/form-expand-top.gif"); a.children(".schedaContent").fadeIn("fast") }; close_sm = function(a) { a.addClass("sm-close"); a.children("img").attr("src", "/Images/form-expand-bottom.gif"); a.children(".schedaContent").fadeOut("fast") }; update_selezionati = function(a) { var b = 0, c = ""; $span = a.find(".fa-voice:first span"); $sels = a.find(".fa-evid"); $sels.each(function(i) { b += parseInt($($sels[i]).children("span:first").text()); c += "," + replaceUrlPart($($sels[i]).children("span:eq(1)").text()) }); c = c.replace("[[.]]", "[.]"); $span.html(b.toString()); a = a.find("a.btn_login2:eq(1)"); if (c.length > 1) { var d = a.siblings("span").text().split("?"); d.length > 1 ? a.attr("href", d[0] + c.substr(1, c.length - 1) + "?" + d[1]) : a.attr("href", a.siblings("span").text() + c.substr(1, c.length - 1)) } else a.attr("href", document.location.href) }; remove_this = function(a) { $ofr = a.parent().parent().parent().parent().parent(); $annADV = $ofr.find(".annADV"); $annTGO = $ofr.find(".annTGO"); lng = a.parent().siblings(".offer").length; lng == 1 && $annTGO.children("a.btn_search").fadeOut("fast"); if (lng == 0) { $("#currentCompareAdt").val(""); $annADV.fadeIn("fast"); $annTGO.fadeOut("fast") } a.parent().remove() }; parse = function() { }; init_slider = function(a) { try { var b = { v1: 0, v2: 0, step: 0 }, c = $(a).prev("table").find("td"); b.step = c.length - 1; var d = 0; c.each(function(e) { if ($(c[e]).hasClass("evid") && d == 0) { b.v1 = e; d = 1 } else if ($(c[e]).hasClass("evid") && d == 1) { b.v2 = e; d = 2 } }); $(a).slider({ min: 0, max: b.step, animate: true, values: [b.v1, b.v2], range: true, change: function(e, g) { $(this).prev("table").find("td").removeClass("evid"); for (var h in g.values) $(this).prev("table").find("td").eq(g.values[h]).addClass("evid"); $(this).next("h4").find("span:eq(0)").text($(this).prev("table").find("td.evid:eq(0)").text()); $(this).next("h4").find("span:eq(1)").text($(this).prev("table").find("td.evid:eq(1)").text()) } }) } catch (i) { } }; init_showcase = function(a) { try { $(a).easySlider({ auto: false, continuous: false, orientation: "horizontal", speed: 100, numericId: "sc-ctrls", numeric: true }); $(a + " ul li").each(function() { $(this).find(".sc-category:last").css({ "border-right": "0" }) }) } catch (b) { } }; open_sm = function(a) { a.removeClass("sm-close"); a.children("img").attr("src", "/Images/form-expand-top.gif"); a.children(".schedaContent").show() }; close_sm = function(a) { a.addClass("sm-close"); a.children("img").attr("src", "/Images/form-expand-bottom.gif"); a.children(".schedaContent").hide() }; init_pager = function() { }; var all = { homes: [], autos: [], works: [], utils: [] }, home = {}, auto = {}, work = {}, util = {}; $.validator.addMethod("regex", function(a, b, c) { if (c.constructor != RegExp) c = RegExp(c); else if (c.global) c.lastIndex = 0; return this.optional(b) || c.test(a) }, "Input field is not in a right format."); $.validator.addMethod("selectRequired", function(a, b) { return b.value == "" || b.value == "-1" || b.value == "none" ? false : true }, "Please select an option."); $.validator.addMethod("selectMin", function(a, b) { return b.options.length > 0 }, "Please select an option"); $.validator.addMethod("atLeastOne", function(a, b, c) { selector = c; a = $(selector, b.form).filter(function() { return $(this).val() }).length >= 1; if (!$(b).data("being_validated")) { b = $(selector, b.form); b.data("being_validated", true).valid(); b.data("being_validated", false) } return a }, "Please fill out at least one of these fields."); function submitLogin() { $("#loginForm").submit() } function changeRows(a) { var b = location.href; b = b.split("?")[0]; b += "?s=" + a.options[a.selectedIndex].value; location.href = b };

//filtro per parola chiave su navigator
function goKeySearch(el) {


    var newTxt = $("#txtKeySearchNav").val()
    var oldUrl = document.location.href;
    
}