﻿$(document).ready(function() { tooltip(); faviconize(); watermark(); bookmark(); $(".date").mask("99/99/9999"); $(".phone").mask("99 99 99 99 99"); $(".restrict").each(function() { var a = $(this); a.click(function(b) { b.preventDefault(); if ($.browser.msie && $.browser.version == "6.0") { if (confirm("Si vous changez de restaurant votre panier actuel sera vidé. \n Êtes-vous sûr de vouloir continuer ?")) { window.location.replace(a.attr("href")) } } else { jConfirmAlt("<p>Si vous changez de restaurant votre panier actuel sera vidé.<p>Souhaitez vous ?</p>", "Attention !", function(c) { if (c) { window.location.replace(a.attr("href")) } }) } }) }); $(".deleteadr").each(function() { var a = $(this); a.click(function(d) { d.preventDefault(); if ($.browser.msie && $.browser.version == "6.0") { if (confirm("Cette adresse va être supprimé. \n Êtes-vous sûr de vouloir continuer ?")) { var c = "ID=" + a.next(".deleteid").attr("value"); loadData("GET", "/Services/AjaxWebService.svc/delAdrLiv", c, function b() { }, function f(e) { a.closest("tr").slideUp("normal", function() { $(this).remove() }) }) } } else { jConfirm("<p>Cette adresse va être supprimé.<p></p>Etes-vous sûr de vouloir continuer ?", "Attention !", function(h) { var g = "ID=" + a.next(".deleteid").attr("value"); loadData("GET", "/Services/AjaxWebService.svc/delAdrLiv", g, function e() { }, function i(j) { a.closest("tr").slideUp("normal", function() { $(this).remove() }) }) }) } }) }); $("a.anchor").anchorAnimate(); if ($("#Master").length > 0 && top.location != self.location) { top.location = self.location } $(".indispo").css("opacity", 0.7) }); function loadData(e, a, c, b, d) { $.ajax({ type: e, contentType: "application/json; charset=utf-8", dataType: "json", url: (root != "/" ? root + a : a), data: c, beforeSend: b, success: d }) } $(function() { $(".t").each(function(b) { var a = $(this); var c = a.next(".p"); c.hide(); a.toggle(function() { a.addClass("active"); c.slideDown("slow").fadeIn("fast") }, function() { a.removeClass("active"); c.slideUp("slow").fadeOut("fast") }) }) }); this.watermark = function() { swapValues = []; $(".watermark").each(function(a) { swapValues[a] = $(this).val(); $(this).focus(function() { if ($(this).val() == swapValues[a]) { $(this).val("") } }).blur(function() { if ($.trim($(this).val()) == "") { $(this).val(swapValues[a]) } }) }) }; jQuery.fn.anchorAnimate = function(a) { a = jQuery.extend({ speed: 1100 }, a); return this.each(function() { var b = this; $(b).click(function(e) { e.preventDefault(); var d = window.location.href; var f = $(b).attr("href"); var c = $(f).offset().top; $("html:not(:animated),body:not(:animated)").animate({ scrollTop: c }, a.speed, function() { window.location.hash = f }); return false }) }) }; var images = ["/images/slideshow/01.jpg", "/images/slideshow/02.jpg", "/images/slideshow/03.jpg", "/images/slideshow/04.jpg", "/images/slideshow/05.jpg", "/images/slideshow/06.jpg", "/images/slideshow/07.jpg", "/images/slideshow/08.jpg", "/images/slideshow/09.jpg", "/images/slideshow/10.jpg"]; var active = 0; var smode = $("#slideshow-mode"); var mode = smode.length > 0 ? smode.attr("value") : ""; var sdelai = $("#slideshow-delai"); var delai = sdelai.length > 0 ? sdelai.attr("value") > 7000 ? sdelai.attr("value") : 7000 : 7000; function slide() { var a = $(".slideshow"); var b = a.find("img"); if (a.length > 0 && b.length > 0) { switch (mode) { case "fade": b.fadeTo("fast", 0, function() { b.attr("src", images[active]).fadeTo("normal", 1) }); break; case "": b.attr("src", images[active]); break } active = active + 1 == images.length ? 0 : active + 1 } } $(function() { setInterval("slide()", delai) }); this.faviconize = function() { this.xOffset = -50; this.yOffset = -80; $(".fav-on").unbind("click").click(function(a) { if ($("#iPanel").is(":visible")) { cancelAction() } this.t = this.title; this.title = ""; this.top = (a.pageY + yOffset); this.left = (a.pageX + xOffset); $("body").append('<div id="iPanel"><label id="iPanel-label" for="iPanel-input">J\'ajoute cette commande à mes favoris et je lui donne un nom :</label><input id="iPanel-input" type="text" value="Ex: sushi pour 4" class="watermark" /><input type="button" value="annuler" id="iPanel-cancel" onclick="cancelAction();" /><input type="button" value="valider" id="iPanel-cancel" onclick="sendActionOn(\'' + this.id + "');\" /></div>"); $("div#iPanel").css("top", this.top + "px").css("left", this.left + "px").css("opacity", "0.9").fadeIn("slow"); watermark(); return false }); $(".fav-off").unbind("click").click(function(a) { if ($("#iPanel").is(":visible")) { cancelAction() } this.top = (a.pageY + yOffset); this.left = (a.pageX + xOffset); $("body").append('<div id="iPanel"><label id="iPanel-label" for="favoritename">Souhaitez vous retirer cette commande de vos favoris ?</label><input type="button" value="annuler" id="iPanel-cancel" onclick="cancelAction();" /><input type="button" value="valider" id="iPanel-cancel" onclick="sendActionOff(\'' + this.id + "');\" /></div>"); $("div#iPanel").css("top", this.top + "px").css("left", this.left + "px").css("opacity", "0.9").fadeIn("normal"); return false }) }; function cancelAction() { $("div#iPanel").fadeOut("normal", function() { $(this).remove() }); tooltip(); faviconize(); watermark() } function sendActionOn(b) { var a = $("#iPanel-input").val(); var d = "id=" + b + "&name=" + a; loadData("GET", "/Services/AjaxWebService.svc/addOrderToFav", d, function c() { $("#iPanel").empty().append('<label id="iPanel-label">chargement en cours...</label>') }, function e(f) { $("#iPanel").empty().append('<label id="iPanel-label">Cette commande a été ajouté à vos favoris</label>'); $("#" + b).attr("class", "fav-off tooltip").attr("title", a); $("#" + b).find("img").attr("src", $("#" + b).find("img").attr("src").replace("-gris.gif", ".gif")); setTimeout("cancelAction();", 1000) }) } function sendActionOff(a) { var b = "id=" + a; loadData("GET", "/Services/AjaxWebService.svc/remOrderToFav", b, function c(d) { $("#iPanel").empty().append('<label id="iPanel-label">Cette commande a été supprimé de vos favoris</label>'); $("#" + a).attr("class", "fav-on").removeAttr("title"); $("#" + a).find("img").attr("src", $("#" + a).find("img").attr("src").replace(".gif", "-gris.gif")); setTimeout("cancelAction();", 1000) }) } (function(c) { var a = (c.browser.msie ? "paste" : "input") + ".mask"; var b = (window.orientation != undefined); c.mask = { definitions: { "9": "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]"} }; c.fn.extend({ caret: function(f, d) { if (this.length == 0) { return } if (typeof f == "number") { d = (typeof d == "number") ? d : f; return this.each(function() { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(f, d) } else { if (this.createTextRange) { var g = this.createTextRange(); g.collapse(true); g.moveEnd("character", d); g.moveStart("character", f); g.select() } } }) } else { if (this[0].setSelectionRange) { f = this[0].selectionStart; d = this[0].selectionEnd } else { if (document.selection && document.selection.createRange) { var e = document.selection.createRange(); f = 0 - e.duplicate().moveStart("character", -100000); d = f + e.text.length } } return { begin: f, end: d} } }, unmask: function() { return this.trigger("unmask") }, mask: function(f, j) { if (!f && this.length > 0) { var g = c(this[0]); var i = g.data("tests"); return c.map(g.data("buffer"), function(m, l) { return i[l] ? m : null }).join("") } j = c.extend({ placeholder: "_", completed: null }, j); var e = c.mask.definitions; var i = []; var k = f.length; var h = null; var d = f.length; c.each(f.split(""), function(l, m) { if (m == "?") { d--; k = l } else { if (e[m]) { i.push(new RegExp(e[m])); if (h == null) { h = i.length - 1 } } else { i.push(null) } } }); return this.each(function() { var u = c(this); var p = c.map(f.split(""), function(y, x) { if (y != "?") { return e[y] ? j.placeholder : y } }); var s = false; var w = u.val(); u.data("buffer", p).data("tests", i); function t(x) { while (++x <= d && !i[x]) { } return x } function o(z) { while (!i[z] && --z >= 0) { } for (var y = z; y < d; y++) { if (i[y]) { p[y] = j.placeholder; var x = t(y); if (x < d && i[y].test(p[x])) { p[y] = p[x] } else { break } } } r(); u.caret(Math.max(h, z)) } function l(B) { for (var z = B, A = j.placeholder; z < d; z++) { if (i[z]) { var x = t(z); var y = p[z]; p[z] = A; if (x < d && i[x].test(y)) { A = y } else { break } } } } function q(y) { var z = c(this).caret(); var x = y.keyCode; s = (x < 16 || (x > 16 && x < 32) || (x > 32 && x < 41)); if ((z.begin - z.end) != 0 && (!s || x == 8 || x == 46)) { m(z.begin, z.end) } if (x == 8 || x == 46 || (b && x == 127)) { o(z.begin + (x == 46 ? 0 : -1)); return false } else { if (x == 27) { u.val(w); u.caret(0, n()); return false } } } function v(A) { if (s) { s = false; return (A.keyCode == 8) ? false : null } A = A || window.event; var x = A.charCode || A.keyCode || A.which; var C = c(this).caret(); if (A.ctrlKey || A.altKey || A.metaKey) { return true } else { if ((x >= 32 && x <= 125) || x > 186) { var z = t(C.begin - 1); if (z < d) { var B = String.fromCharCode(x); if (i[z].test(B)) { l(z); p[z] = B; r(); var y = t(z); c(this).caret(y); if (j.completed && y == d) { j.completed.call(u) } } } } } return false } function m(z, x) { for (var y = z; y < x && y < d; y++) { if (i[y]) { p[y] = j.placeholder } } } function r() { return u.val(p.join("")).val() } function n(y) { var C = u.val(); var B = -1; for (var x = 0, A = 0; x < d; x++) { if (i[x]) { p[x] = j.placeholder; while (A++ < C.length) { var z = C.charAt(A - 1); if (i[x].test(z)) { p[x] = z; B = x; break } } if (A > C.length) { break } } else { if (p[x] == C[A] && x != k) { A++; B = x } } } if (!y && B + 1 < k) { u.val(""); m(0, d) } else { if (y || B + 1 >= k) { r(); if (!y) { u.val(u.val().substring(0, B + 1)) } } } return (k ? x : h) } if (!u.attr("readonly")) { u.one("unmask", function() { u.unbind(".mask").removeData("buffer").removeData("tests") }).bind("focus.mask", function() { w = u.val(); var x = n(); r(); setTimeout(function() { if (x == f.length) { u.caret(0, x) } else { u.caret(x) } }, 0) }).bind("blur.mask", function() { n(); if (u.val() != w) { u.change() } }).bind("keydown.mask", q).bind("keypress.mask", v).bind(a, function() { setTimeout(function() { u.caret(n(true)) }, 0) }) } n() }) } }) })(jQuery); $(function() { var keys = { UP: 38, DOWN: 40, DEL: 46, RETURN: 13, ESC: 27, BACKSPACE: 8, TAB: 9 }; var limit = 15; var xhr; var inputs = $(".autocomplete"); inputs.each(function(i) { var input = $(this); var results = input.next($(".results")).length > 0 ? input.next($(".results")) : input.parent().next($(".results")); input.attr("autocomplete", "off"); input.keyup(function(e) { var keyCode = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; switch (keyCode) { case keys.ESC: results.fadeOut("fast"); input.val(results.find(".item:first").text()); break; case keys.BACKSPACE: if (input.val().length > 1) { results.find(".default").hide(); results.find(".alt").hide() } else { results.find(".item").remove(); results.find(".default").show(); results.find(".alt").hide() } break; case keys.UP: if (results.find(".hover").length != 0) { results.find(".hover").removeClass("hover").prev("li").addClass("hover") } break; case keys.DOWN: if (results.find(".hover").length != 0) { results.find(".hover").removeClass("hover").next("li").addClass("hover") } else { results.find(".item:first").addClass("hover") } break; default: if (input.val().length >= 2) { var name = input.val(); var uid = $("#canal").val(); var request = "canal=" + uid + "&keyword=" + name; var service = "/Services/AjaxWebService.svc/getVilles"; if (xhr) { xhr.abort() } xhr = $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", dataType: "json", url: (root != "/" ? root + service : service), data: request, success: function(data) { results.find(".item").remove(); result = (typeof data.d) == "string" ? eval("(" + data.d + ")") : data.d; for (var i = 0; i < limit; i++) { var item = result[i]; if (item != null) { var feed = $("<li class='item' id='" + item.UidVille + "'>" + item.NomClean + " <span>" + item.CodePostal + "</span></li>"); results.append(feed) } } results.find(".alt").hide(); results.find(".default").hide(); results.find(".item").each(function(i) { var entry = result[i].NomClean + " " + result[i].CodePostal; $(this).click(function() { input.val(entry); results.fadeOut("fast") }).mouseenter(function() { $(this).addClass("hover") }).mouseleave(function() { $(this).removeClass("hover") }) }); if (result.length == 0) { results.find(".alt").show() } results.fadeIn("fast") } }) } else { results.find(".alt").hide(); results.fadeIn("fast"); results.find(".item").remove(); results.find(".default").show().each(function(i) { if (!$(this).hasClass("static")) { $(this).click(function() { input.val($(this).text()); results.hide() }).mouseenter(function() { $(this).addClass("hover") }).mouseleave(function() { $(this).removeClass("hover") }) } }) } break } }).keydown(function(e) { var keyCode = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; if (keyCode == keys.TAB) { if ($(results.find(".hover")).length == 0 & input.val().length >= 2) { input.val(results.find(".item:first").text()) } else { input.val(results.find(".hover:first").text()) } } if (keyCode == keys.RETURN) { if ($(results.find(".hover")).length == 0 & input.val().length >= 2) { input.val(results.find(".item:first").text()); if (input.hasClass("modal")) { var request = "ID=" + results.find(".item:first").attr("id"); loadData("GET", "/Services/AjaxWebService.svc/getUrl", request, function onLoad() { }, function onSuccess(data) { parent.location = data.d }) } else { if (input.hasClass("inline") && !input.hasClass("modal")) { e.preventDefault(); return false } else { results.next($(".dftButton")).click() } } } else { input.val(results.find(".hover:first").text()); return false } } }).focus(function() { results.fadeIn("fast"); results.find(".default").each(function(i) { if (!$(this).hasClass("static")) { $(this).click(function() { input.val($(this).text()); results.fadeOut("fast") }).mouseenter(function() { $(this).addClass("hover") }).mouseleave(function() { $(this).removeClass("hover") }) } }) }).blur(function() { results.fadeOut("fast") }) }) }); $(function() { $(".flip").each(function(a) { var b = $(this); b.hover(function() { b.find("img").animate({ top: "-10px" }, 200).animate({ top: "-4px" }, 200).animate({ top: "-7px" }, 100).animate({ top: "-4px" }, 100).animate({ top: "-6px" }, 100).animate({ top: "-4px" }, 100) }) }) }); (function(a) { a.alerts = { verticalOffset: -75, horizontalOffset: 0, repositionOnResize: true, overlayOpacity: 0.4, overlayColor: "#fff", okButton: "Oui", cancelButton: "Non", dialogClass: null, alert: function(b, c, d, e) { if (d == null) { d = "Alert" } a.alerts._show(d, c, null, b, function(f) { if (e) { e(f) } }) }, confirm: function(b, c, d) { if (c == null) { c = "Confirm" } a.alerts._show(c, b, null, "confirm", function(e) { if (d) { d(e) } }) }, confirmAlt: function(b, c, d) { if (c == null) { c = "Confirm" } a.alerts._show(c, b, null, "confirmAlt", function(e) { if (d) { d(e) } }) }, prompt: function(b, c, d, e) { if (d == null) { d = "Prompt" } a.alerts._show(d, b, c, "prompt", function(f) { if (e) { e(f) } }) }, _show: function(e, d, c, b, g) { a.alerts._hide(); a.alerts._overlay("show"); a("body").append('<div id="popup_container"><h4 id="popup_title"></h4><div id="popup_content"><div id="popup_message"></div></div></div>'); if (a.alerts.dialogClass) { a("#popup_container").addClass(a.alerts.dialogClass) } var f = (a.browser.msie && parseInt(a.browser.version) <= 6) ? "absolute" : "fixed"; a("#popup_container").css({ position: f, zIndex: 99999, padding: 0, margin: 0 }); a("#popup_title").text(e); a("#popup_content").addClass(b); a("#popup_message").text(d); a("#popup_message").html(a("#popup_message").text().replace(/\n/g, "<br />")); a("#popup_container").css({ minWidth: a("#popup_container").outerWidth(), maxWidth: a("#popup_container").outerWidth() }); a.alerts._reposition(); a.alerts._maintainPosition(true); switch (b) { case "info": case "warning": case "success": case "error": a("#popup_message").after('<div id="popup_panel"><a class="Button1-A" id="popup_ok"><span>' + a.alerts.okButton + "</span></a></div>"); a("#popup_ok").click(function() { a.alerts._hide(); g(true) }); a("#popup_ok").focus().keypress(function(h) { if (h.keyCode == 13 || h.keyCode == 27) { a("#popup_ok").trigger("click") } }); break; case "confirm": a("#popup_message").after('<div id="popup_panel"><a id="popup_ok">' + a.alerts.okButton + '</a> <a id="popup_cancel">' + a.alerts.cancelButton + "</a></div>"); a("#popup_ok").click(function() { a.alerts._hide(); if (g) { g(true) } }); a("#popup_cancel").click(function() { a.alerts._hide() }); a("#popup_ok").focus(); a("#popup_ok, #popup_cancel").keypress(function(h) { if (h.keyCode == 13) { a("#popup_ok").trigger("click") } if (h.keyCode == 27) { a("#popup_cancel").trigger("click") } }); break; case "confirmAlt": a("#popup_message").after('<div id="popup_panel"><a id="popup_ok_s">Changer de restaurant</a> <a id="popup_cancel_s">Retourner à votre panier</a></div>'); a("#popup_ok_s").click(function() { a.alerts._hide(); if (g) { g(true) } }); a("#popup_cancel_s").click(function() { window.location = a("#return").attr("href"); a.alerts._hide() }); a("#popup_ok_s").focus(); a("#popup_ok_s, #popup_cancel_s").keypress(function(h) { if (h.keyCode == 13) { a("#popup_ok_s").trigger("click") } if (h.keyCode == 27) { a("#popup_cancel_s").trigger("click") } }); break; case "prompt": a("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><a id="popup_ok">' + a.alerts.okButton + '</a> <a id="popup_cancel">' + a.alerts.cancelButton + "</a></div>"); a("#popup_prompt").width(a("#popup_message").width()); a("#popup_ok").click(function() { var h = a("#popup_prompt").val(); a.alerts._hide(); if (g) { g(h) } }); a("#popup_cancel").click(function() { a.alerts._hide(); if (g) { g(null) } }); a("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(h) { if (h.keyCode == 13) { a("#popup_ok").trigger("click") } if (h.keyCode == 27) { a("#popup_cancel").trigger("click") } }); if (c) { a("#popup_prompt").val(c) } a("#popup_prompt").focus().select(); break } }, _hide: function() { a("#popup_container").remove(); a.alerts._overlay("hide"); a.alerts._maintainPosition(false) }, _overlay: function(b) { switch (b) { case "show": a.alerts._overlay("hide"); a("body").append('<div id="popup_overlay"></div>'); a("#popup_overlay").css({ position: "absolute", zIndex: 99998, top: "0px", left: "0px", width: "100%", height: a(window).height() + "px", opacity: a.alerts.overlayOpacity }); break; case "hide": a("#popup_overlay").remove(); break } }, _reposition: function() { var c = ((a(window).height() / 2) - (a("#popup_container").outerHeight() / 2)) + a.alerts.verticalOffset; var b = ((a(window).width() / 2) - (a("#popup_container").outerWidth() / 2)) + a.alerts.horizontalOffset; if (c < 0) { c = 0 } if (b < 0) { b = 0 } if (a.browser.msie && parseInt(a.browser.version) <= 6) { c = c + a(window).scrollTop() } a("#popup_container").css({ top: c + "px", left: b + "px" }); a("#popup_overlay").height(a(document).height()) }, _maintainPosition: function(b) { if (a.alerts.repositionOnResize) { switch (b) { case true: a(window).bind("resize", function() { a.alerts._reposition() }); break; case false: a(window).unbind("resize"); break } } } }; jAlert = function(b, c, d, e) { a.alerts.alert(b, c, d, e) }; jConfirm = function(b, c, d) { a.alerts.confirm(b, c, d) }; jConfirmAlt = function(b, c, d) { a.alerts.confirmAlt(b, c, d) }; jPrompt = function(b, c, d, e) { a.alerts.prompt(b, c, d, e) } })(jQuery); (function(b) { var a = { width: 620, height: 620, overlayOpacity: 0.45, id: "modal", src: function(c) { return jQuery(c).attr("href") + "?i=1" }, fadeInSpeed: 400, fadeOutSpeed: 500 }; b.modal = function(c) { return _modal(this, c) }; b.modal.open = function() { _modal.open() }; b.modal.close = function() { _modal.close() }; b.fn.modal = function(c) { return _modal(this, c) }; _modal = function(c, d) { this.options = { parent: null, overlayOpacity: null, id: null, content: null, width: null, height: null, modalClassName: null, imageClassName: null, closeClassName: null, overlayClassName: null, src: null }; this.options = b.extend({}, options, _defaults); this.options = b.extend({}, options, a); this.options = b.extend({}, options, d); this.close = function() { jQuery("." + options.modalClassName + ", ." + options.overlayClassName).fadeOut(a.fadeOutSpeed, function() { jQuery(this).unbind().remove() }) }; this.open = function() { if (typeof options.src == "function") { options.src = options.src(c) } else { options.src = options.src || _defaults.src(c) } var e = /^.+\.((jpg)|(gif)|(jpeg)|(png)|(jpg))$/i; var f = ""; if (e.test(options.src)) { f = '<div class="' + options.imageClassName + '"><img src="' + options.src + '"/></div>' } else { f = '<iframe width="' + options.width + '" height="' + options.height + '" frameborder="0" scrolling="no" allowtransparency="true" src="' + options.src + '"></iframe>' } options.content = options.content || f; if (jQuery("." + options.modalClassName).length && jQuery("." + options.overlayClassName).length) { jQuery("." + options.modalClassName).html(options.content) } else { $overlay = jQuery((_isIE6()) ? '<iframe src="BLOCKED SCRIPT\'<html></html>\';" scrolling="no" frameborder="0" class="' + options.overlayClassName + '"></iframe><div class="' + options.overlayClassName + '"></div>' : '<div class="' + options.overlayClassName + '"></div>'); $overlay.hide().appendTo(options.parent); $modal = jQuery('<div id="' + options.id + '" class="' + options.modalClassName + '" style="width:' + options.width + "px; height:" + options.height + "px; margin-top:-" + (options.height / 2) + "px; margin-left:-" + (options.width / 2) + 'px;">' + options.content + "</div>"); $modal.hide().appendTo(options.parent); $close = jQuery('<a class="' + options.closeClassName + '"></a>'); $close.appendTo($modal); var g = _getOpacity($overlay.not("iframe")) || options.overlayOpacity; $overlay.fadeTo(0, 0).show().not("iframe").fadeTo(a.fadeInSpeed, g); $modal.fadeIn(a.fadeInSpeed); $close.click(function() { jQuery.modal().close() }); $overlay.click(function() { jQuery.modal().close() }) } }; return this }; _isIE6 = function() { if (document.all && document.getElementById) { if (document.compatMode && !window.XMLHttpRequest) { return true } } return false }; _getOpacity = function(c) { $sender = jQuery(c); opacity = $sender.css("opacity"); filter = $sender.css("filter"); if (filter.indexOf("opacity=") >= 0) { return parseFloat(filter.match(/opacity=([^)]*)/)[1]) / 100 } else { if (opacity != "") { return opacity } } return "" }; _defaults = { parent: "body", overlayOpacity: 45, id: "modal", content: null, width: 620, height: 620, modalClassName: "modal-window", imageClassName: "modal-image", closeClassName: "close-window", overlayClassName: "modal-overlay", src: function(c) { return jQuery(c).attr("href") } } })(jQuery); function jsSelectedVille(c, a) { var d = "ID=" + c; loadData("GET", "/Services/AjaxWebService.svc/getUrl", d, function b() { }, function e(f) { parent.location = f.d }) } function jsRollOverVille(a) { } function jsRollOutVille(a) { } function jsSelectedResto(a) { } function jsRollOverResto(a) { } function jsRollOutResto(a) { } this.tooltip = function() { this.xOffsetTip = -10; this.yOffsetTip = 10; $(".tooltip").unbind().hover(function(a) { this.t = this.title; this.title = ""; this.top = (a.pageY + yOffsetTip); this.left = (a.pageX + xOffsetTip); if (this.t != "") { $("body").append('<p id="tooltip">' + this.t + "</p>"); $("p#tooltip").css("top", this.top + "px").css("left", this.left + "px").css("opacity", "0.9").fadeIn("slow") } }, function() { this.title = this.t; $("p#tooltip").fadeOut("fast").remove() }).mousemove(function(a) { this.top = (a.pageY + yOffsetTip); this.left = (a.pageX + xOffsetTip); $("p#tooltip").css("top", this.top + "px").css("left", this.left + "px") }) }; this.bookmark = function() { $('a[rel="bookmark"]').click(function(b) { b.preventDefault(); var a = this.href; var c = this.title; if (window.sidebar) { window.sidebar.addPanel(c, a, "") } else { if (window.external) { window.external.AddFavorite(a, c) } else { if (window.opera) { this.rel = "sidebar" } } } }) };