Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; Date.abbrDayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; Date.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; Date.abbrMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; Date.firstDayOfWeek = 1; Date.format = "dd/mm/yyyy"; Date.fullYearStart = "20"; (function () { function add(name, method) { if (!Date.prototype[name]) { Date.prototype[name] = method; } } add("isLeapYear", function () { var y = this.getFullYear(); return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; }); add("isWeekend", function () { return this.getDay() == 0 || this.getDay() == 6; }); add("isWeekDay", function () { return !this.isWeekend(); }); add("getDaysInMonth", function () { return [31, (this.isLeapYear() ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][this.getMonth()]; }); add("getDayName", function (abbreviated) { return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()]; }); add("getMonthName", function (abbreviated) { return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()]; }); add("getDayOfYear", function () { var tmpdtm = new Date("1/1/" + this.getFullYear()); return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000); }); add("getWeekOfYear", function () { return Math.ceil(this.getDayOfYear() / 7); }); add("setDayOfYear", function (day) { this.setMonth(0); this.setDate(day); return this; }); add("addYears", function (num) { this.setFullYear(this.getFullYear() + num); return this; }); add("addMonths", function (num) { var tmpdtm = this.getDate(); this.setMonth(this.getMonth() + num); if (tmpdtm > this.getDate()) { this.addDays(-this.getDate()); } return this; }); add("addDays", function (num) { this.setTime(this.getTime() + (num * 86400000)); return this; }); add("addHours", function (num) { this.setHours(this.getHours() + num); return this; }); add("addMinutes", function (num) { this.setMinutes(this.getMinutes() + num); return this; }); add("addSeconds", function (num) { this.setSeconds(this.getSeconds() + num); return this; }); add("zeroTime", function () { this.setMilliseconds(0); this.setSeconds(0); this.setMinutes(0); this.setHours(0); return this; }); add("asString", function (format) { var r = format || Date.format; return r.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear() + "").substring(2)).split("mmmm").join(this.getMonthName(false)).split("mmm").join(this.getMonthName(true)).split("mm").join(_zeroPad(this.getMonth() + 1)).split("dd").join(_zeroPad(this.getDate())); }); Date.fromString = function (s) { var f = Date.format; var d = new Date("01/01/1977"); var mLength = 0; var iM = f.indexOf("mmmm"); if (iM > -1) { for (var i = 0; i < Date.monthNames.length; i++) { var mStr = s.substr(iM, Date.monthNames[i].length); if (Date.monthNames[i] == mStr) { mLength = Date.monthNames[i].length - 4; break; } } d.setMonth(i); } else { iM = f.indexOf("mmm"); if (iM > -1) { var mStr = s.substr(iM, 3); for (var i = 0; i < Date.abbrMonthNames.length; i++) { if (Date.abbrMonthNames[i] == mStr) { break; } } d.setMonth(i); } else { d.setMonth(Number(s.substr(f.indexOf("mm"), 2)) - 1); } } var iY = f.indexOf("yyyy"); if (iY > -1) { if (iM < iY) { iY += mLength; } d.setFullYear(Number(s.substr(iY, 4))); } else { if (iM < iY) { iY += mLength; } d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf("yy"), 2))); } var iD = f.indexOf("dd"); if (iM < iD) { iD += mLength; } d.setDate(Number(s.substr(iD, 2))); if (isNaN(d.getTime())) { return false; } return d; }; var _zeroPad = function (num) { var s = "0" + num; return s.substring(s.length - 2); }; })(); jQuery(document).ready(function () { screenshotPreview(); jQuery(".date-pick").datePicker().bind("click", function () { jQuery(this).dpDisplay(); this.blur(); return false; }).bind("dateSelected", function (e, selectedDate, $td) { jQuery(".date-fields").next(".controls").css("display", "block"); }); var fromDateId = jQuery(".date-fields .from input").attr("id"); var toDateId = jQuery(".date-fields .to input").attr("id"); jQuery("#" + fromDateId).bind("dpClosed", function (e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); jQuery("#" + toDateId).dpSetStartDate(d.addDays(1).asString()); } }); jQuery("#" + toDateId).bind("dpClosed", function (e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); jQuery("#" + fromDateId).dpSetEndDate(d.addDays(-1).asString()); } }); jQuery(".date-fields input:text").dpSetPosition(jQuery.dpConst.POS_TOP, jQuery.dpConst.POS_RIGHT).dpSetOffset(22, 0); jQuery(".result .show-hide, .blog-teaser .show-hide").hover(function () { jQuery(this).css({ color: "black", "text-decoration": "underline" }); }, function () { jQuery(this).css({ color: "#007692", "text-decoration": "none" }); }).css({ cursor: "pointer" }).click(function () { jQuery(this).next().animate({ height: "toggle", opacity: "toggle" }, "slow", function () { if (jQuery(this).css("display") == "block") { jQuery(this).prev().removeClass("closed").text("Hide tags"); } else { jQuery(this).prev().removeClass("open"); jQuery(this).prev().addClass("closed").text("Show tags"); } }); }); jQuery(".show-tags a").css("cursor", "pointer").click(function () { jQuery(".tags-group .row").not(".first").animate({ height: "toggle", opacity: "toggle" }, "slow", function () { if (jQuery(this).css("display") == "block") { jQuery(".right .show-tags a").removeClass("closed").text("Hide all tags"); } else { jQuery(".right .show-tags a").addClass("closed").text("Show all tags"); } }); return false; }); jQuery(".tags-group .row").not(".first").css("display", "none"); jQuery(".is-show-tags").prepend('<a class="all" href="#">Show all tags</a>'); jQuery(".is-tags-group").hide(); jQuery(".is-show-tags a").click(function () { jQuery(this).text(jQuery(this).text() == "Show all tags" ? "Hide tags" : "Show all tags"); jQuery(this).toggleClass("closed"); jQuery(".is-tags-group").slideToggle("slow"); return false; }); jQuery(".col-right .show-hide").css("cursor", "pointer").click(function () { jQuery(this).next().animate({ height: "toggle", opacity: "toggle" }, "medium", function () { if (jQuery(this).css("display") == "block") { jQuery(this).prev().parent().removeClass("closed"); } else { jQuery(this).prev().parent().addClass("closed"); } }); }); jQuery(".col-right .show-hide").hover(function () { jQuery(this).addClass("hover"); }, function () { jQuery(this).removeClass("hover"); }); jQuery(".with-abstract").hover(function () { jQuery(this).css({ color: "black", "text-decoration": "underline" }); }, function () { jQuery(this).css({ color: "#007692", "text-decoration": "none" }); }).click(function () { jQuery(".abstract .toggle").animate({ height: "toggle", opacity: "toggle" }, "slow", function () { if (jQuery(this).css("display") == "block") { jQuery(".with-abstract").text("without summary"); } else { jQuery(".with-abstract").text("with summary"); } }); jQuery(".result img").toggle(); }); jQuery("#hiddenViewTopics").css("display", "none"); jQuery("#viewtopics .heading").after('<span class="close" onclick="tb_remove()" >Close</span>'); jQuery("a.tooltip").tooltip({ bodyHandler: function () { return jQuery(jQuery(this).attr("href")).html(); }, showURL: false }); /*jQuery(".events .col-right .pad").parent().css("display", "none");*/jQuery(".pad input, .pad select").click(function () { jQuery(this).parents(".pad").find(".button").css("display", "block"); jQuery(this).parents(".pad").find(".reset").parent().css("display", "block"); }); jQuery(".pad .uk-location, .pad .country").css("display", "none"); jQuery(".pad #region").change(function () { if (jQuery(this).val() == "United Kingdom") { jQuery(".pad .country").css("display", "none"); jQuery(".pad .uk-location").css("display", "block"); } else { jQuery(".pad .uk-location").css("display", "none"); jQuery(".pad .country").css("display", "block"); } }); jQuery(".pad .reset").click(function () { jQuery(this).parents(".pad").find('.uk-postcode input').attr("value", ""); jQuery(this).parents(".pad").find('input[type="checkbox"]').attr("checked", ""); /*jQuery(this).parents(".pad").find(".controls").css("display", "none");*/jQuery(this).parents(".pad").find("select").find("option:first").attr("selected", "selected"); jQuery(this).parents(".pad").find(".country, .uk-location").css("display", "none"); return false; }); jQuery(".pad .all input").click(function () { if (jQuery(this).is(":checked")) { jQuery(this).parents(".pad").find('input[type="checkbox"]').not(".all input").attr("checked", ""); } jQuery(".pad .controls-new").slideDown("fast"); }); jQuery(".pad .controls-new").css({ display: "none" }); jQuery(".pad input").not(".all input").click(function () { if (jQuery(this).not(".all").is(":checked")) { jQuery(".pad .all input").not(".all").attr("checked", ""); } jQuery(".pad .controls-new").slideDown("fast"); }); jQuery(".pad .filters-note").click(function () { jQuery(this).parents(".pad").find('input[type="checkbox"]').attr("checked", ""); jQuery(this).parents(".pad").find("li .tooltip").siblings("input").attr("checked", "checked"); jQuery(this).parents(".pad").find(".controls").css({ display: "block" }); return false; }); jQuery(".new").click(function () { jQuery(this).parents(".pad").find(".hidden").toggle(); return false; }); }); jQuery(document).ready(function () { jQuery("h1 span").vAlign(); jQuery(".primary-nav > li a.primary1").css("background-position", "0 0"); jQuery(".primary-nav > li.active a.primary1").css("background-position", "0 45px"); jQuery(".primary-nav > li .mega-drop").removeClass("alt"); var config = { sensitivity: 7, interval: 80, over: function () { jQuery("a", this).filter(".primary1").stop().animate({ backgroundPosition: "(0 45)" }, 150, "easeOutQuint", function () { jQuery(this).parent().addClass("highlight").find(".mega-drop").fadeIn("fast"); }); }, timeout: 50, out: function () { if (jQuery(this).attr("class").match("active")) { jQuery("a.primary1", this).stop().animate({ backgroundPosition: "(0 45px)" }, 100, "easeInQuint", function () { jQuery(this).parent().removeClass("highlight").find(".mega-drop").fadeOut("fast"); }); } else { jQuery("a.primary1", this).stop().animate({ backgroundPosition: "(0 0)" }, 100, "easeInQuint", function () { jQuery(this).parent().removeClass("highlight").find(".mega-drop").fadeOut("fast"); }); } } }; jQuery(".primary-nav > li").hoverIntent(config); jQuery("a.scroll[href*=#]").click(function () { if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname) { var $target = jQuery(this.hash); $target = $target.length && $target || jQuery("[name=" + this.hash.slice(1) + "]"); if ($target.length) { var targetOffset = $target.offset().top; jQuery("html,body").animate({ scrollTop: targetOffset }, 1000); return false; } } }); jQuery("a.external").attr("title", "This link will open in a new window").click(function (e) { window.open(this.href); e.preventDefault(); }); jQuery(".page-tabs.dynamic li a").click(function () { var target_item = jQuery(this).attr("href"); jQuery(".tab-content").css("display", "none"); jQuery(".page-tabs.dynamic li.active").removeClass("active"); jQuery(this).parent().addClass("active").removeClass("hover"); jQuery(target_item).css("display", "block"); return false; }); jQuery(".press-tabs.dynamic li a").click(function () { var target_item = jQuery(this).attr("href"); jQuery(".press-tab-content").css("display", "none"); jQuery(".press-tabs.dynamic li.active").removeClass("active"); jQuery(this).parent().addClass("active").removeClass("hover"); jQuery(target_item).css("display", "block"); return false; }); jQuery(".page-tabs.dynamic li a, .press-tabs.dynamic li a").each(function () { if (document.location.hash != "") { jQuery(this).parent().removeClass("active"); new_target_item = jQuery("a[href='" + document.location.hash + "']"); new_target_item.parent().addClass("active"); } if (jQuery(this).parent().attr("class").indexOf("active") < 0) { jQuery(jQuery(this).attr("href")).css("display", "none"); } }); jQuery(".print").click(function () { window.print(); return false; }); jQuery("a.signin").click(function () { jQuery(".signup").css("display", "none"); jQuery("#signup-active").css("display", "block"); return false; }); jQuery("a.close").click(function () { jQuery("#signup-active").css("display", "none"); jQuery(".signup").css("display", "block"); return false; }); jQuery(".hidden-note").css("display", "none"); jQuery(".events-home .go-button, .pad input.button, .events .go-button, .event-detail .go-button, #plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_btnLogon").hover(function () { jQuery(this).css({ "background-color": "black" }); }, function () { jQuery(this).css("background-color", "#007692"); }); if (jQuery(".col-middle").find(".result").length < 1) { jQuery(".col-middle .filter1").hide(); } if (jQuery(".#content .tags-group").find(".row").length < 2) { jQuery(".show-tags").hide(); } bc = jQuery(".topics-all #breadcrumb, .regions-map #breadcrumb"); bc.addClass("moved"); jQuery(".topics-all #secondary-nav2-container, .regions-map #secondary-nav2-container").after(bc); bc2 = jQuery("body.content-full-width #content #breadcrumb"); bc2.addClass("moved"); jQuery("body.content-full-width #secondary-nav2-container").after(bc2); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_pnlUpdate").wrap("<fieldset></fieldset>"); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_UserName").wrap('<div class="row"></div>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_UserName").before('<label for="plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_UserName">Username:</label>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_Password").wrap('<div class="row"></div>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_Password").before('<label for="plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_Password">Password:</label>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_rfvUserNameRequired").remove(); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_btnLogon").wrap('<div class="row forgotten"></div>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_btnLogon").before('<a href="#">Forgotten your password?</a>'); jQuery("#plcRoot_Layout_zoneTmpSignIn_logonminiform_loginElem_FailureText").wrap('<div class="row"></div>'); jQuery(".featured-books-home .col:first").addClass("first"); jQuery(".member-panel-one .top div h2").each(function () { if (jQuery.myheight < jQuery(this).height() || !jQuery.myheight) { jQuery.myheight = jQuery(this).height(); } }); jQuery(".member-panel-one .top div h2").css({ height: jQuery.myheight }); jQuery(".elements.closed").hide(); jQuery(".myice-interests .attention").hide(); jQuery(".standard-row input").live("click", function () { jQuery(".myice-interests .attention").slideDown(); jQuery(this).parents(".standard-row").addClass("changed"); }); jQuery(".standard-row .top .left input").click(function () { var group = jQuery(this).parents(".standard-row"); if (jQuery(this).is(":checked")) { jQuery(".elements", group).slideDown(); jQuery(".left", group).removeClass("closed").addClass("open"); } else { jQuery(".elements", group).slideUp(); jQuery(".left", group).removeClass("open").addClass("closed"); } }); jQuery.each(jQuery(".standard-row .elements input"), function () { if (jQuery(this).is(":checked")) { jQuery(this).parents(".elements").removeClass("closed").css("display", "block"); } }); jQuery(".standard-row .top .right input").click(function () { group = jQuery(this).parents(".standard-row"); if (jQuery(this).is(":checked")) { jQuery(".elements input", group).attr("checked", "checked"); } else { jQuery(".elements input", group).attr("checked", ""); } }); jQuery.each(jQuery(".standard-row .elements ul, ul.arrows"), function () { var items = jQuery("li", this).length; var first_col = parseFloat(items) / 2 - 1; var first_col = Math.round(first_col); orphanLis = jQuery("li:gt(" + first_col + ")", this).clone(); jQuery("li:gt(" + first_col + ")", this).remove(); newUl = jQuery(document.createElement("ul")); for (i = 0; i <= orphanLis.length; i++) { jQuery(newUl).append(orphanLis[i]); } jQuery(newUl).addClass("second"); if (jQuery(this).hasClass("arrows")) { jQuery(newUl).addClass("arrows"); } jQuery(this).addClass("first").after(newUl); }); jQuery(".myice-membership-profile .element h2").append('<div class="show-hide closed">Show details</div>'); jQuery(".myice-membership-profile .element h2 .show-hide").hover(function () { jQuery(this).addClass("over"); }, function () { jQuery(this).removeClass("over"); }); jQuery(".myice-membership-profile .element h2 .show-hide").click(function () { var group = jQuery(this).parents(".element"); if (jQuery(".toggle", group).is(":hidden")) { jQuery(".toggle", group).slideDown().removeClass("closed"); jQuery(this).html("Hide details").removeClass("closed"); } else { jQuery(".toggle", group).slideUp().addClass("closed"); jQuery(this).html("Show details").addClass("closed"); } }); jQuery(".home-splash ul").addClass("hover-on1"); jQuery(".home-splash li:nth-child(1) a").css("color", "#FFFFFF"); jQuery(".home-splash .feature1").show(); jQuery(".home-splash li a").hover(function () { var i = jQuery(".home-splash li a").index(this) + 1; if (i < 4) { jQuery(".home-splash").css("background", "url(/App_Themes/ICETheme/images/bannerimages/carousel-bkg" + i + ".jpg) no-repeat scroll left top #181717"); jQuery(".home-splash div").hide(); jQuery(".home-splash .feature" + i).show(); jQuery(".home-splash ul").removeClass(); jQuery(".home-splash ul").addClass("hover-on" + i); jQuery(".home-splash li a").css("color", "#999999"); jQuery(this).css("color", "#FFFFFF"); jQuery(".home-splash li:nth-child(4) a").css("color", "#FFFFFF"); } }); jQuery(".jqpopup").colorbox({ close: "", iframe: true, opacity: "0.85", overlayClose: false, height: "80%", width: "80%" }); }); jQuery(document).ready(function () { if (jQuery("body").hasClass("regions") == true) { jQuery("#m_ICE_Regions_v6_r2_c2 area").each(function () { thisID = jQuery(this).attr("alt").toLowerCase().replace(/ /g, "-"); jQuery("#map").append('<img src="/App_Themes/ICETheme/images/regions/' + thisID + '.gif" id="map-' + thisID + '" usemap="#m_ICE_Regions_v6_r2_c2" />'); }); if (document.location.hash != "") { jQuery(document.location.hash).fadeIn(); } jQuery("#select-region ul a").hover(function () { thisID = "#map-" + jQuery(this).text().toLowerCase().replace(/ /g, "-"); jQuery(thisID).fadeIn(); }, function () { thisID = "#map-" + jQuery(this).text().toLowerCase().replace(/ /g, "-"); jQuery(thisID).fadeOut("fast"); }); var config2 = { sensitivity: 1, interval: 80, over: function () { thisID = "#map-" + jQuery(this).attr("alt").toLowerCase().replace(/ /g, "-"); jQuery(thisID).show(); theText = jQuery(this).attr("alt").capitalize().replace(/-/g, " ").replace(/Of/g, "of"); jQuery("#select-region ul.arrows a").each(function () { if (jQuery(this).text() == theText) { jQuery(this).trigger("hover"); } }); }, timeout: 50, out: function () { thisID = "#map-" + jQuery(this).attr("alt").toLowerCase().replace(/ /g, "-"); theText = jQuery(this).attr("alt").capitalize().replace(/-/g, " ").replace(/Of/g, "of"); jQuery(thisID).hide(); jQuery("#select-region ul.arrows a").each(function () { if (jQuery(this).text() == theText) { jQuery(this).trigger("hover"); } }); } }; jQuery("#m_ICE_Regions_v6_r2_c2 area").hoverIntent(config2); jQuery("#region-international > ul > li").addClass("closed").find("div").hide(); jQuery("#region-international > ul > li:first").removeClass("closed").find("div").show(); jQuery("#region-international li").click(function () { if (jQuery(this).attr("class") == "closed") { jQuery("#region-international > ul > li").addClass("closed"); jQuery("#region-international li").find("div").slideUp(); jQuery(this).removeClass("closed").find("div").slideDown(); } }); } }); String.prototype.capitalize = function () { return this.replace(/\w+/g, function (a) { return a.charAt(0).toUpperCase() + a.substr(1).toLowerCase(); }); }; this.screenshotPreview = function () { xOffset = 10; yOffset = 30; $("a.screenshot").hover(function (e) { this.t = this.title; this.title = ""; var c = (this.t != "") ? "<br/>" + this.t : ""; $("body").append("<p id='screenshot'><img src='" + this.rel + "' alt='url preview' />" + c + "</p>"); $("#screenshot").css("top", (e.pageY - xOffset) + "px").css("left", (e.pageX + yOffset) + "px").fadeIn("fast"); }, function () { this.title = this.t; $("#screenshot").remove(); }); $("a.screenshot").mousemove(function (e) { $("#screenshot").css("top", (e.pageY - xOffset) + "px").css("left", (e.pageX + yOffset) + "px"); }); }; jQuery(document).ready(function () { screenshotPreview(); }); (function (jQuery) { jQuery.fn.vAlign = function () { return this.each(function (i) { var ah = jQuery(this).height(); var ph = jQuery(this).parent().height(); var mh = (ph - ah) / 2; jQuery(this).css("margin-top", mh); }); }; })(jQuery);
