﻿(function (a) { a.fn.extend({ buttonize: function (b) { var c = { type: "orange", cornerWidth: 22, barHeight: 35, picUrl: "", yAxis: "70" }; var b = a.extend(c, b); return this.each(function () { var h = b; var f = a(this); var i = ""; var e = false; var g = 0; if (h.type !== "orange") { h.yAxis = "105" } if (typeof h.extraClass !== "undefined") { i = " " + h.extraClass } var d = jQuery.trim(f.parents("html").attr("class")); if (d.substr(0, 2) == "ie") { e = true } if (e) { i += " isIE" } if (f.parent().hasClass("buttonize")) { return } f.wrap('<div class="buttonize' + i + " " + h.type + '" />'); f.css({ background: "transparent url(" + h.picUrl + ") no-repeat -" + h.cornerWidth + "px -" + h.yAxis + "px", height: h.barHeight }); f.parent("div").prepend('<div class="buttonizeLeftCorner" style="width:' + h.cornerWidth + "px; height:" + h.barHeight + "px; background:transparent url(" + h.picUrl + ") no-repeat 0px -" + h.yAxis + 'px"></div>'); if (e) { f.parent("div").append('<span class="isIE" style="left:' + (parseInt(h.cornerWidth) - 1) + 'px;" title="' + f.val() + '">' + f.val() + "</span>"); g = f.next("span.isIE").width(); if (g == 0) { g = 130 } f.css({ cssText: f.css("cssText") + "; width:" + g + "px !important" }); f.next("span.isIE").click(function () { f.trigger("click") }) } f.parent("div").append('<div class="buttonizeRightCorner" style="width:' + h.cornerWidth + "px; height:" + h.barHeight + "px; background:transparent url(" + h.picUrl + ") no-repeat -233px -" + h.yAxis + 'px"></div>'); f.hover(function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }) }, function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis)) + "px" }) }); f.next("span.isIE").hover(function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }) }, function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis)) + "px" }) }); f.nextAll("div.buttonizeRightCorner").hover(function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }) }, function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis)) + "px" }) }); f.prev("div").hover(function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis) - parseInt(h.barHeight * 2)) + "px" }) }, function () { f.css({ backgroundPosition: "-" + h.cornerWidth + "px -" + (parseInt(h.yAxis)) + "px" }); f.prev("div").css({ backgroundPosition: "0px -" + (parseInt(h.yAxis)) + "px" }); f.nextAll("div.buttonizeRightCorner").css({ backgroundPosition: "-233px -" + (parseInt(h.yAxis)) + "px" }) }) }) } }) })(jQuery); (function (a) { a.fn.extend({ barrize: function (b, c) { var d = { type: "light", cornerWidth: 30, barHeight: 39, width: 0, status: "closed", panelName: "", picUrl: "", yAxis: 0, yOffset: 0 }; var b = a.extend(d, b); return this.each(function () { var g = b; var k = a(this); var i = ""; var l = false; var h = false; var j = 0; if (g.type !== "light") { g.yAxis = "39" } if (typeof g.extraClass !== "undefined") { i = " " + g.extraClass } if (typeof g.isHotelBar !== "undefined") { l = true } var p = jQuery.trim(k.parents("html").attr("class")); if (p.substr(0, 2) == "ie") { h = true } if (h) { i += " isIE" } k.append('<div class="barrizeRightCorner" style="width:' + g.cornerWidth + "px; height:" + g.barHeight + "px; background:transparent url(" + g.picUrl + ") no-repeat -724px -" + parseInt(g.yAxis) + 'px"></div>'); k.css({ background: "transparent url(" + g.picUrl + ") no-repeat 0px -" + parseInt(g.yAxis) + "px" }); if (g.width > 0) { k.css({ width: parseInt(g.width) + "px" }) } k.find("label").removeAttr("for"); k.hover(function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }) }, function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }) }); var m = ""; var f = ""; var n = "Panel"; if (k.find("input:checkbox").length > 0) { if (k.find("input:checkbox").attr("id").lastIndexOf("_") > -1) { f = k.find("input:checkbox").attr("id"); m = f.substr(f.lastIndexOf("_") + 1) + n } else { m = k.find("input:checkbox").attr("id") + n } var e = k.find("input:checkbox"); if (e.is(":checked")) { a("#" + m).show(); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.unbind("mouseenter mouseleave") } else { a("#" + m).hide() } } else { if (a("#" + k.attr("id") + n).hasClass("openedPanel")) { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.unbind("mouseenter mouseleave") } } if (!l) { k.click(function (u, q, s) { if (k.find("input:checkbox").length > 0) { var o = k.find("input:checkbox"); o.attr("checked", !o.attr("checked")); if (o.is(":checked")) { a("#" + m).show(); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.unbind("mouseenter mouseleave") } else { a("#" + m).hide(); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }); k.hover(function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }) }, function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }) }) } var t = null; if (typeof o.data("events") !== "undefined") { var r = o.data("events"); for (var v in r) { if (r.hasOwnProperty(v)) { t = v; if (t !== null && t !== "click") { break } } } if (t !== null && t !== "click") { o.triggerHandler(t) } } } else { if (!a("#" + k.attr("id") + n).hasClass("openedPanel")) { a("#" + k.attr("id") + n).removeClass("closedPanel").addClass("openedPanel"); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.unbind("mouseenter mouseleave") } else { a("#" + k.attr("id") + n).removeClass("openedPanel").addClass("closedPanel"); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }); k.hover(function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }) }, function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }) }) } } k.blur(); k.find("input:checkbox").blur(); k.find("label").blur() }) } else { k.find(".barrizeRightCorner").click(function (r, o, q) { if (!a("#" + k.attr("id") + n).hasClass("openedPanel")) { a("#" + k.attr("id") + n).removeClass("closedPanel").addClass("openedPanel"); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 4)) + "px" }); k.unbind("mouseenter mouseleave") } else { a("#" + k.attr("id") + n).removeClass("openedPanel").addClass("closedPanel"); k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }); k.hover(function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis) + parseInt(g.barHeight * 2)) + "px" }) }, function () { k.css({ backgroundPosition: "0px -" + (parseInt(g.yAxis)) + "px" }); k.find(".barrizeRightCorner").css({ backgroundPosition: "-724px -" + (parseInt(g.yAxis)) + "px" }) }) } k.blur(); k.find("input:checkbox").blur(); k.find("label").blur() }) } k.find("input:checkbox").click(function () { k.trigger("click") }) }) } }) })(jQuery);
