function ShowLoadingScreen() { $find("LoadingMPE").show() } function HideLoadingScreen() { $find("LoadingMPE").hide() } function ShowSurveyScreen() { $find("SurveyMPEBehavior").show() } function HideSurveyScreen() { $find("SurveyMPEBehavior").hide() } function onSurveyOk() { window.location = "/Survey.aspx" } var HeartBeatTimer; function StartHeartBeat() { if (HeartBeatTimer == null) { HeartBeatTimer = setInterval("HeartBeat()", 600000) } } function HeartBeat() { UI.Session.StayAlive() } function addDatePicker() { $(".datepicker").datepicker({ changeMonth: true, changeYear: true, duration: "fast", minDate: new Date(1753, 1 - 1, 1), yearRange: "1753:2010", showAnim: "slideDown" }) } function patchMicrosoftAjax() { Sys.Browser = {}; Sys.Browser.InternetExplorer = {}; Sys.Browser.Firefox = {}; Sys.Browser.WebKit = {}; Sys.Browser.Safari = {}; Sys.Browser.Opera = {}; Sys.Browser.agent = null; Sys.Browser.hasDebuggerStatement = false; Sys.Browser.name = navigator.appName; Sys.Browser.version = parseFloat(navigator.appVersion); if (navigator.userAgent.indexOf(" MSIE ") > -1) { Sys.Browser.agent = Sys.Browser.InternetExplorer; Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]); Sys.Browser.hasDebuggerStatement = true } else { if (navigator.userAgent.indexOf(" Firefox/") > -1) { Sys.Browser.agent = Sys.Browser.Firefox; Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]); Sys.Browser.name = "Firefox"; Sys.Browser.hasDebuggerStatement = true } else { if (navigator.userAgent.indexOf("WebKit/") > -1) { Sys.Browser.agent = Sys.Browser.WebKit; Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]); Sys.Browser.name = "WebKit" } else { if (navigator.userAgent.indexOf(" Safari/") > -1) { Sys.Browser.agent = Sys.Browser.Safari; Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Safari\/(\d+(\.\d+)?)/)[1]); Sys.Browser.name = "Safari" } else { if (navigator.userAgent.indexOf("Opera/") > -1) { Sys.Browser.agent = Sys.Browser.Opera } } } } } } function mailto() { $("a.mailto").each(function() { var a = $(this).attr("href").replace(/[a-zA-Z]/g, function(d) { return String.fromCharCode((d <= "Z" ? 90 : 122) >= (d = d.charCodeAt(0) + 13) ? d : d - 26) }); var b = $(this).html().replace(/[a-zA-Z]/g, function(d) { return String.fromCharCode((d <= "Z" ? 90 : 122) >= (d = d.charCodeAt(0) + 13) ? d : d - 26) }); $(this).attr("href", a).html(b) }) } function ViewRecord() { this.collapsedHeight = null; this.setHeight = function() { $("#ViewRecordLeft1").css("height", ""); h1 = document.getElementById("ViewRecordLeft1").offsetHeight; h2 = document.getElementById("ViewRecordRight1").offsetHeight; if (h1 > h2) { document.getElementById("ViewRecordRight1").style.height = h1 + "px"; document.getElementById("ViewRecordLeft1").style.height = h1 + "px" } else { document.getElementById("ViewRecordRight1").style.height = h2 + "px"; document.getElementById("ViewRecordLeft1").style.height = h2 + "px" } }; this.resizeHeight = function() { var a = $("#ViewRecordLeft1").height(); if (this.collapsedHeight == null || (a < this.collapsedHeight)) { this.collapsedHeight = a } $("#ViewRecordLeft1").css("height", this.collapsedHeight); $("#ViewRecordRight1").css("height", this.collapsedHeight); this.setHeight() } } (function(a) { a.fn.wTooltip = function(f, s) { f = a.extend({ content: null, ajax: null, follow: true, auto: true, fadeIn: 0, fadeOut: 0, appendTip: "body", degrade: false, offsetY: 10, offsetX: 1, style: {}, className: null, id: null, callBefore: function(u, p, o) { }, callAfter: function(u, p, o) { }, clickAction: function(p, o) { a(p).hide() }, delay: 0, timeout: 0, cloneable: false }, f || {}); if (!f.style && typeof f.style != "object") { f.style = {}; f.style.zIndex = "1000" } else { f.style = a.extend({ border: "1px solid gray", background: "#edeef0", color: "#000", padding: "10px", zIndex: "1000", textAlign: "left" }, f.style || {}) } if (typeof s == "function") { f.callAfter = s || f.callAfter } f.style.display = "none", f.style.position = "absolute"; var n, m, r, c, l = {}, b = true, e = false, q = false, t = document.createElement("div"), i = document.getElementsByTagName("html")[0], g = (typeof document.body.style.maxWidth == "undefined") ? true : false, k = (typeof a.talk == "function" && typeof a.listen == "function") ? true : false; if (f.id) { t.id = f.id } if (f.className) { t.className = f.className } f.degrade = (f.degrade && g) ? true : false; for (var d in f.style) { t.style[d] = f.style[d] } function j(o) { if (o) { if (f.degrade) { a(t).html(f.content.replace(/<\/?[^>]+>/gi, "")) } else { a(t).html(f.content) } } } if (f.ajax) { a.get(f.ajax, function(o) { if (o) { f.content = o } j(f.content) }) } function h(p) { function u(v) { if (n && !f.content) { v.title = n; n = null } } function o() { if (!e && f.auto) { clearInterval(c); if (f.fadeOut) { a(t).fadeOut(f.fadeOut, function() { u(p) }) } else { u(p); t.style.display = "none" } } if (typeof f.callAfter == "function") { f.callAfter(t, p, f) } if (k) { f = a.listen(f) } } if (f.timeout > 0) { r = setTimeout(function() { o() }, f.timeout) } else { o() } } a(t).hover(function() { e = true }, function() { e = false; h(l) }); if (k) { f.key = t; f.plugin = "wTooltip"; f.channel = "wayfarer"; a.talk(f) } j(f.content && !f.ajax); a(t).appendTo(f.appendTip); return this.each(function() { this.onmouseover = function(u) { var p = this; clearTimeout(r); if (this.title && !f.degrade && !f.content) { n = this.title; this.title = "" } if (f.content && f.degrade) { this.title = t.innerHTML } function o() { if (typeof f.callBefore == "function") { f.callBefore(t, p, f) } if (k) { f = a.listen(f) } if (f.auto) { var v; if (f.content) { if (!f.degrade) { v = "block" } } else { if (n && !f.degrade) { a(t).html(n); v = "block" } else { v = "none" } } if (v == "block" && f.fadeIn) { a(t).fadeIn(f.fadeIn) } else { t.style.display = v } } } if (f.delay > 0) { m = setTimeout(function() { o() }, f.delay) } else { o() } }; this.onmousemove = function(y) { var w = (y) ? y : window.event, v = this; l = this; if (f.follow || b) { var z = i.scrollTop; var A = i.scrollLeft; var x = w.clientY + z + f.offsetY; var p = w.clientX + A + f.offsetX; var o = a(window).width() + A - a(t).outerWidth(); var u = a(window).height() + z - a(t).outerHeight(); q = (x > u || p > o) ? true : false; if (p - A <= 0 && f.offsetX < 0) { p = A } else { if (p > o) { p = o } } if (x - z <= 0 && f.offsetY < 0) { x = z } else { if (x > u) { x = u } } t.style.top = x + "px"; t.style.left = p + "px"; b = false } }; this.onmouseout = function() { clearTimeout(m); var o = this; b = true; if (!f.follow || q || (f.offsetX < 0 && f.offsetY < 0)) { setTimeout(function() { c = setInterval(function() { h(o) }, 1) }, 1) } else { h(this) } }; if (typeof f.clickAction == "function") { this.onclick = function() { f.clickAction(t, this) } } }) } })(jQuery); (function(g) { var j, u, s, r, m, p, i, q, f, t, n, a, c, o, h, l, e; g(function() { g("body").append(g([m = g('<div id="modalBackgroundOverlay" />')[0], r = g('<div id="colorbox" />')[0]]).hide()); g(r).append(g([t = g('<div id="borderTopLeft" />')[0], n = g('<div id="borderTopCenter" />')[0], a = g('<div id="borderTopRight" />')[0], c = g('<div id="borderMiddleLeft" />')[0], o = g('<div id="borderMiddleRight" />')[0], h = g('<div id="borderBottomLeft" />')[0], l = g('<div id="borderBottomCenter" />')[0], e = g('<div id="borderBottomRight" />')[0], i = g('<div id="modalContent" />')[0]])); g(i).append(g([q = g('<div id="modalLoadedContent"><a id="contentPrevious" href="#"></a><a id="contentNext" href="#"></a><span id="contentCurrent"></span><br id="modalInfoBr"/><span id="contentTitle"></span><div id="preloadPrevious"></div><div id="preloadNext"></div><div id="preloadClose"></div></div>')[0], modalLoadingOverlay = g('<div id="modalLoadingOverlay" />')[0], f = g('<a id="modalClose" href="#"></a>')[0]])); g(f).click(function() { k(); return false }) }); function b() { g([m]).css({ position: "absolute", width: g(window).width(), height: g(window).height(), top: g(window).scrollTop(), left: g(window).scrollLeft() }) } function d(v) { if (v.keyCode == 27) { k(); return false } else { if (v.keyCode == 37) { g("a#contentPrevious").click(); return false } else { if (v.keyCode == 39) { g("a#contentNext").click(); return false } } } } function k() { g(r).removeData("open"); g([m, r]).fadeOut("fast", function() { g(q).empty(); g([m, r]).hide() }); if (s) { g(s).remove() } g(document).unbind("keydown", d); g(window).unbind("resize scroll", b) } g.fn.colorbox = function(A) { A = g.extend({}, g.fn.colorbox.settings, A); function v(J, I, G, K) { var C; (typeof (window.innerHeight) == "number") ? C = window.innerHeight : C = document.documentElement.clientHeight; var F = I + g(t).height() + g(h).height(); var D = J + g(t).width() + g(h).width(); var H = C / 2 - F / 2 + g(window).scrollTop(); var E = g(window).width() / 2 - D / 2 + g(window).scrollLeft(); if (F > C) { H -= (F - C) } if (H < 0) { H = 0 } if (E < 0) { E = 0 } g(r).animate({ height: F, top: H, left: E, width: D }, G); g(c).animate({ top: g(t).height(), left: 0, height: I }, G); g(o).animate({ top: g(a).height(), left: D - g(o).width(), height: I }, G); g(t).animate({ top: 0, left: 0 }, G); g(n).animate({ top: 0, left: g(t).width(), width: J }, G); g(a).animate({ top: 0, left: D - g(a).width() }, G); g(h).animate({ top: F - g(h).height(), left: 0 }, G); g(l).animate({ top: F - g(h).height(), left: g(h).width(), width: J }, G); g(e).animate({ top: F - g(h).height(), left: D - g(e).width() }, G); g(i).animate({ height: I, width: J, top: g(t).height(), left: g(t).width() }, G, function() { if (K) { K() } if (g.browser.msie && g.browser.version < 7) { b() } }) } var z = []; function w() { if (A.preloading == true && u.length > 1) { var D, C; j > 0 ? D = u[j - 1].href : D = u[u.length - 1].href; j < u.length - 1 ? C = u[j + 1].href : C = u[0].href; return [g(new Image()).attr("src", C), g(new Image()).attr("src", D)] } } function y(E, C) { g(q).hide().html(E).append(C); if (A.contentWidth) { g(q).css({ width: A.contentWidth }) } if (A.contentHeight) { g(q).css({ height: A.contentHeight }) } if (A.transition == "elastic") { v(g(q).outerWidth(true), g(q).outerHeight(true), A.transitionSpeed, function() { g(q).show(); g(modalLoadingOverlay).hide() }) } else { g(r).animate({ opacity: 0 }, A.transitionSpeed, function() { v(g(q).outerWidth(true), g(q).outerHeight(true), 0, function() { g(q).show(); g(modalLoadingOverlay).hide(); g(r).animate({ opacity: 1 }, A.transitionSpeed) }) }) } var D = w() } function x() { g(modalLoadingOverlay).show(); if (g(this).attr("id") == "contentPrevious") { j > 0 ? j-- : j = u.length - 1 } else { j < u.length - 1 ? j++ : j = 0 } B(u[j]); return false } function B(E) { var D = "<br id='modalInfoBr'/><span id='contentTitle'>" + E.title + "</span>"; if (u.length > 1) { D += "<span id='contentCurrent'> " + A.contentCurrent + "</span>"; D = D.replace(/{current}/, j + 1).replace(/{total}/, u.length); D += "<a id='contentPrevious' href='#'>" + A.contentPrevious + "</a> "; D += "<a id='contentNext' href='#'>" + A.contentNext + "</a> " } if (A.contentInline) { var C = E.toString().lastIndexOf("/"); var F = E.toString().substring(C + 1, E.toString().length) + "-inline"; y(g(F).html(), D) } else { if (A.contentIframe) { y("<iframe src =" + E.href + "></iframe>", D) } else { if (E.href.match(/.(gif|png|jpg|jpeg|bmp|tif)$/i) && !A.contentAjax) { s = g(new Image()).load(function() { y("<img src='" + E.href + "' alt=''/>", D) }).attr("src", E.href) } else { s = g("<div></div>").load(((A.contentAjax) ? A.contentAjax : E.href), function(G, H) { if (H == "success") { y(g(this).html(), D) } else { y("<p>Ajax request unsuccessful</p>") } }) } } } } g(this).bind("click.colorbox", function() { if (g(r).data("open") != true) { g(r).data("open", true); g(q).empty().css({ height: "auto", width: "auto" }); g(f).html(A.modalClose); g(m).css({ opacity: A.bgOpacity }); g([m, r, modalLoadingOverlay]).show(); g(i).css({ width: A.initialWidth, height: A.initialHeight }); v(g(i).width(), g(i).height(), 0); if (this.rel) { u = g("a[rel='" + this.rel + "']"); j = g(u).index(this) } else { u = g(this); j = 0 } B(u[j]); g("a#contentPrevious, a#contentNext").die().live("click", x); g(document).bind("keydown", d); if (g.browser.msie && g.browser.version < 7) { g(window).bind("resize scroll", b) } } return false }); if (A.open == true && g(r).data("open") != true) { g(this).triggerHandler("click.colorbox") } return this.each(function() { }) }; g.fn.colorbox.settings = { transition: "elastic", transitionSpeed: 350, initialWidth: 300, initialHeight: 100, contentWidth: false, contentHeight: false, contentAjax: false, contentInline: false, contentIframe: false, bgOpacity: 0.85, preloading: true, contentCurrent: "{current} of {total}", contentPrevious: "previous", contentNext: "next", modalClose: "close", open: false} })(jQuery); jQuery.fn.moreLess = function(c) { var f = this; var d = $.extend({}, $.fn.moreLess.defaults, c); if ($(f).text().length < d.minimumTextLength) { return $(this) } if (!d.startExpanded) { g(true, $(f)) } b(); $("span.moreLessControls").click(e); return $(this); function e() { var i = $(this).prev(".moreLessContent"); var j = i.length > 0; if (j && i[0].style.display == "none") { i.slideDown(d.speed, function() { $(this).before(i.html()).remove(); if (typeof d.callback == "function") { d.callback.call() } }); a(j, $(this)) } else { var h = $(this).parent(); $(this).remove(); g(false, h); h.append($(this)); a(j, $(this)); $(this).prev(".moreLessContent").slideUp(d.speed, function() { if (typeof d.callback == "function") { d.callback.call() } }); $(this).click(e) } } function a(i, h) { h.html(i ? d.expandedText : d.collapsedText) } function g(l, j) { var h = d.truncateIndex; var k = j.text(); var i = j.html(); if (d.truncateChar != null) { h = j.text().indexOf(d.truncateChar, h); if (h < 0 || h > d.maximumTruncateIndex) { h = d.truncateIndex } } j.html(i.substring(0, h) + "<span class='moreLessContent' " + (l ? "style='display:none;'" : "") + ">" + i.substring(h, i.length) + "</span>") } function b(h) { $(f).append("<span class='moreLessControls'>" + (d.startExpanded ? d.expandedText : d.collapsedText) + "</span>") } }; $.fn.moreLess.defaults = { startExpanded: false, collapsedText: '... <span class="moreLessControl">More</span>', expandedText: ' <span class="moreLessControl">Less...</span>', truncateIndex: 150, maximumTruncateIndex: 200, truncateChar: " ", minimumTextLength: 300, speed: "fast", callback: null };
