var s = navigator.userAgent.toLowerCase(); String.prototype.Trim = function (a) { if (typeof a != "undefined" && a != "") { var b = "/(^" + a + "|" + a + "+$)/g"; return this.replace(b, "") } else return this.replace(/(^\s+|\s+$)/g, "") }; String.prototype.Contains = function (a) { return this.indexOf(a) > -1 }; if (typeof Ms == "undefined") Ms = {}; if (typeof Ms.BrowserInfo == "undefined") { Ms.BrowserInfo = { IsIE: /*@cc_on!@*/false, IsLessThanIE6: /*@cc_on!@*/false && parseInt(s.match(/msie (\d+)/)[1], 10) < 6, IsLessThanIE8: /*@cc_on!@*/false && parseInt(s.match(/msie (\d+)/)[1], 10) < 8, IsIE6: /*@cc_on!@*/false && parseInt(s.match(/msie (\d+)/)[1], 10) >= 6, IsIE7: /*@cc_on!@*/false && parseInt(s.match(/msie (\d+)/)[1], 10) >= 7, IsIE8: /*@cc_on!@*/false && parseInt(s.match(/msie (\d+)/)[1], 10) >= 8, IsGecko: s.Contains("gecko/"), IsSafari: s.Contains(" applewebkit/"), IsOpera: !!window.opera, IsMac: s.Contains("macintosh"), IsFirefox: s.Contains("firefox/"), IsAIR: s.Contains(" adobeair/"), IsChrome: s.Contains(" chrome/"), UserAgent: s }; (function (a) { a.IsGecko = navigator.product == "Gecko" && !a.IsSafari && !a.IsOpera; a.IsGeckoLike = a.IsGecko || a.IsSafari || a.IsOpera; if (a.IsGecko) { var c = s.match(/rv:(\d+\.\d+)/), b = c && parseFloat(c[1]); if (b) { a.IsGecko10 = b < 1.8; a.IsGecko19 = b > 1.8 } } })(Ms.BrowserInfo); Ms.BrowserInfo.IsStrictMode = function (b) { var a = "CSS1Compat"; return a == (b.compatMode || (this.IsSafari ? a : null)) } } if (typeof Ms.Tools == "undefined") Ms.Tools = { WindowLoaded: false }; Ms.Tools.IsArray = function (a) { return a == null ? false : a instanceof Array }; Ms.Tools.SetObjectOpacity = function (a, b) { a.style.opacity = b / 100; a.style["-moz-opacity"] = b / 100; if (a.filters && a.filters.alpha) a.filters.alpha.opacity = b }; Ms.Tools.GetWindowScrollSize = function (a) { if (!a) a = window; var b = 0, c = 0; if (typeof a.scrollMaxX == "number") { c = a.innerHeight + a.scrollMaxY; b = a.innerWidth + a.scrollMaxX } else if (a.document.body && (a.document.body.scrollHeight || a.document.body.scrollWidth)) { c = a.document.body.scrollHeight; b = a.document.body.scrollWidth } else if (a.document.documentElement && (a.document.documentElement.scrollHeight || a.document.documentElement.scrollWidth)) { c = a.document.documentElement.scrollHeight; b = a.document.documentElement.scrollWidth } return { Height: c, Width: b} }; Ms.Tools.GetWindowScroll = function (a) { if (!a) a = window; var b = 0, c = 0; if (typeof a.pageYOffset == "number") { c = a.pageYOffset; b = a.pageXOffset } else if (a.document.body && (a.document.body.scrollLeft || a.document.body.scrollTop)) { c = a.document.body.scrollTop; b = a.document.body.scrollLeft } else if (a.document.documentElement && (a.document.documentElement.scrollLeft || a.document.documentElement.scrollTop)) { c = a.document.documentElement.scrollTop; b = a.document.documentElement.scrollLeft } return [b, c] }; Ms.Tools.GetWindowScrollX = function (a) { return this.GetWindowScroll(a)[0] }; Ms.Tools.GetWindowScrollY = function (a) { return this.GetWindowScroll(a)[1] }; Ms.Tools.GetViewPaneSize = function (a) { if (Ms.BrowserInfo.IsIE) { var b, c = a.document.documentElement; if (c && c.clientWidth) { b = c; if (a.document.body.clientWidth && a.document.body.clientWidth > c.clientWidth) b = a.document.body } else b = a.document.body; var d = {}; if (b) d = { Width: b.clientWidth, Height: b.clientHeight }; else d = { Width: 0, Height: 0 }; return d } else return { Width: a.innerWidth, Height: a.innerHeight} }; Ms.Tools.GetWindowDimensions = function (a) { if (!a) a = window; var c = 0, b = 0; if (typeof a.innerWidth == "number") { c = a.innerWidth; b = a.innerHeight } else if (a.document.documentElement && (a.document.documentElement.clientWidth || a.document.documentElement.clientHeight)) { c = a.document.documentElement.clientWidth; b = a.document.documentElement.clientHeight } else if (a.document.body && (a.document.body.clientWidth || a.document.body.clientHeight)) { c = a.document.body.clientWidth; b = a.document.body.clientHeight } return [c, b] }; Ms.Tools.GetWindowWidth = function (a) { return this.GetWindowDimensions(a)[0] }; Ms.Tools.GetWindowHeight = function (a) { return this.GetWindowDimensions(a)[1] }; Ms.Tools.GetTopWindow = function (c) { if (!c) c = window; var a = c.parent, b = a; while (a.parent && a.parent != a) { try { if (a.parent.document.domain != document.domain) break; if (a.parent.document.getElementsByTagName("frameset").length > 0) { a = a.parent; continue } } catch (d) { break } a = a.parent; b = a } if (b != a) a = b; return a }; Ms.Tools.GetObjectPosition = function (a) { var b = l = 0; if (!a.offsetParent) return [l, b]; b = a.offsetTop; l = a.offsetLeft; while (a = a.offsetParent) { b += a.offsetTop; l += a.offsetLeft } return [l, b] }; Ms.Tools.GetObjectPositionX = function (a) { return this.GetObjectPosition(a)[0] }; Ms.Tools.GetObjectPositionY = function (a) { return this.GetObjectPosition(a)[1] }; Ms.Tools.GetObjectBoundaries = function (e) { var b, f, d, c, a = { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0 }; if (e) { f = e.ownerDocument; d = f.body; c = f.documentElement; b = e.getBoundingClientRect(); a.left = b.left; a.top = b.top; a.right = b.right; a.bottom = b.bottom; if (b.width) { a.width = b.width; a.height = b.height } else { a.width = a.right - a.left; a.height = a.bottom - a.top } if (d.scrollTop) { a.top += d.scrollTop; a.left += d.scrollLeft } else if (c && c.scrollTop) { a.top += c.scrollTop; a.left += c.scrollLeft } } return a }; Ms.Tools.RegisterScript = function (c) { var b = document.createElement("SCRIPT"); b.setAttribute("type", "text/javascript"); b.setAttribute("src", c); var a = document.getElementsByTagName("HEAD"); if (a != null && a.length > 0) a = a[0]; else a = document.body; a.appendChild(b) }; Ms.Tools.RegisterCss = function () { var b = document.createElement("LINK"); b.setAttribute("type", "text/css"); b.setAttribute("rel", "stylesheet"); b.setAttribute("href", url); var a = document.getElementsByTagName("HEAD"); if (a != null && a.length > 0) a = a[0]; else a = document.body; a.appendChild(b) }; Ms.Tools.RunFunction = function (a, d, b, c) { a && this.SetTimeout(a, 0, d, b, c) }; Ms.Tools.SetTimeout = function (a, d, c, b, e) { if (typeof a != "function") { a = arguments[1]; try { d = arguments[2]; c = arguments[3]; b = arguments[4]; e = arguments[5] } catch (f) { } } return (e || window).setTimeout(function () { if (b) a.apply(c, [].concat(b)); else a.apply(c) }, d) }; Ms.Tools.SetInterval = function (c, d, b, a, e) { return (e || window).setInterval(function () { if (a) c.apply(b, [].concat(a)); else c.apply(b) }, d) }; Ms.Tools.getChildElementById = function (e, a) { var b = null, c, f = a.childNodes.length; if (f == 0) return b; for (var d = 0; d < f; d++) { if (d == 0) a = a.firstChild; else a = a.nextSibling; if (a == b) return b; if (a.nodeType == 3 || a.nodeType == 8) continue; if (a.id.toLowerCase() == e.toLowerCase()) return a; else if (a.childNodes.length > 0) c = this.getChildElementById(e, a); if (c) return c } return b }; Ms.Tools.IsChildOf = function (a, b) { if (!a) return false; if (a == b) return true; while ((a = a.parentNode) != null) if (a == b) return true; else if (a.nodeName == "BODY") return false; return false }; Ms.Tools.DisableSelection = function (a) { if (Ms.BrowserInfo.IsIE) { a.unselectable = "on"; var b, c = 0; while (b = a.all[c++]) switch (b.tagName) { case "IFRAME": case "TEXTAREA": case "INPUT": case "SELECT": break; default: b.unselectable = "on" } } else if (Ms.BrowserInfo.IsGecko) a.style.MozUserSelect = "none"; else a.style.userSelect = "none" }; Ms.Tools.EnableSelection = function (a) { if (Ms.BrowserInfo.IsIE) { a.unselectable = "off"; var b, c = 0; while (b = a.all[c++]) switch (b.tagName) { case "IFRAME": case "TEXTAREA": case "INPUT": case "SELECT": break; default: b.unselectable = "off" } } else if (Ms.BrowserInfo.IsGecko) a.style.MozUserSelect = "text"; else a.style.userSelect = "text" }; Ms.Tools.AddEventListener = function (a, c, e, d, f) { if (Ms.BrowserInfo.IsIE) { var b = {}; b.Source = f || a; if (typeof a == "string") a = document.getElementById(a); b.Params = d || []; if (c == "load" && a == window) b.Listener = function (a) { Ms.Tools.WindowLoaded = true; return e.apply(b.Source, [a].concat(b.Params)) }; else b.Listener = function (a) { return e.apply(b.Source, [a].concat(b.Params)) }; a.attachEvent("on" + c, b.Listener); a = null; d = null } else if (c == "load" && a == window) a.addEventListener(c, function (b) { Ms.Tools.WindowLoaded = true; e.apply(f || a, [b].concat(d || [])) }, false); else a.addEventListener(c, function (b) { e.apply(f || a, [b].concat(d || [])) }, false) }; Ms.Tools.FixPngs = function () { var i = navigator.appVersion.split("MSIE"), g = parseFloat(i[1]), a, d, h, c, b, e, f; if (g >= 5.5 && g < 7 && document.body.filters) for (e = 0, f = document.images.length; e < f; e++) { a = document.images[e]; d = a.src.toUpperCase(); if (d.substring(d.length - 3, d.length) == "PNG") { h = a.src; c = a.getAttribute("width"); b = a.getAttribute("height"); if (c == null || c == "" || c == "0") c = a.clientWidth; if (b == null || b == "" || b == "0") b = a.clientHeight; c != "100%" && c != "0" && a.setAttribute("width", c); b != "100%" && b != "0" && a.setAttribute("height", b); a.src = "/images/spacer.gif"; a.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + h + "',sizingMethod='scale')" } } }; Ms.Tools.Print = function (a) { if (!a) a = window; a.print() }; Ms.Tools.ToggleVisibility = function (a) { if (typeof a == "string") a = document.getElementById(a); if (a) if (a.style.display == "none") a.style.display = "block"; else a.style.display = "none" }; Ms.Tools.IsDate = function (b, a) { if (typeof a == "undefined" || a == null || a == "") a = "./-"; var c = new RegExp("^\\s*?([0]?[1-9]|[1][0-2])[" + a + "]([0]?[1-9]|[1|2][0-9]|[3][0|1])[" + a + "]([0-9]{4}|[0-9]{2})\\s*?$", "gi"); return c.test(b) }; Ms.Request = { HttpHost: document.location.host, Hash: document.location.hash.substring(1) }; (function () { var b = document.location, e = {}; b = b.search.substr(1); a_qstring = b.split("&"); for (var c = "", a = "", d = 0; d < a_qstring.length; d++) { a = a_qstring[d].split("="); if (a.length > 0) { c = a.splice(0, 1)[0]; a = a.join("=") } else continue; if (c == "") continue; e[c.toLowerCase()] = a } Ms.Request.qstring = b; Ms.Request.QueryStringItems = e })(); Ms.Request.QueryString = function (a) { return typeof a == "undefined" || a == null ? "?" + this.qstring : this.QueryStringItems[a.toLowerCase()] ? this.QueryStringItems[a.toLowerCase()] : "" }; Ms.Request.HashString = function (d) { var f = "undefined", b = this; if (typeof d == f || d == null) return b.Hash; if (typeof b.HashStringItems == f) { var g = b.Hash.split("&"), c, a; b.HashStringItems = {}; for (var e = 0; e < g.length; e++) { a = g[e].split("="); if (a.length > 0) { c = a.splice(0, 1)[0]; a = a.join("=") } else continue; if (c == "") continue; qstringItems[c.toLowerCase()] = a } } return b.HashStringItems[d] || "" }; Ms.Request.Exclude = function (a) { var d = false, c = "", b; if (!Ms.Tools.IsArray(a)) a = a.split(","); for (var b in this.QueryStringItems) { d = false; if (!b || !this.QueryStringItems[b]) continue; for (var e = 0; e < a.length; e++) if (b == a[e].toLowerCase()) { d = true; break } if (!d) c += "&" + b + "=" + this.QueryStringItems[b] } c = "?" + c.substring(1); return c }; Ms.Request.Append = function (a, c) { var b = this.Exclude(a); if (b == "?") b = ""; var e = "&", f = "="; if (Ms.Tools.IsArray(a) || a.indexOf(",") != -1) { if (!Ms.Tools.IsArray(a)) { a = a.split(","); c = c.split(",") } for (var d = 0; d < a.length; d++) b += e + a[d] + f + encodeURIComponent(c[d]) } else b += e + a + f + c; b = "?" + b.substring(1); return b }; Ms.Request.ScriptName = function () { return document.location.pathname }; Ms.Request.Https = function () { return document.location.protocol == "https:" } (); Ms.Request.ServerName = function () { return (this.Https ? "https://" : "http://") + document.location.hostname || document.location.host } (); Ms.Tools.CookiesEnabled = function () { }; Ms.Tools.FormatDate = function (b, c) { if (typeof c == "undefined" || c == null) c = "MM/dd/yyyy"; var a = c; a = a.replace(/ddd(d?)/gi, "{0}"); a = a.replace(/d(d?)/gi, "{1}"); a = a.replace(/yyy(y?)/gi, "{2}"); var d = b.getFullYear().toString(); a = a.replace(/y(y?)/gi, "{3}"); a = a.replace(/MMMM/g, "{5}"); a = a.replace(/MMM/g, "{4}"); a = a.replace(/MM/g, "{6}"); var g = this, e = ["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], f = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; a = a.replace(/\{([0-9])\}/g, function (c, a) { switch (a) { case "0": return f[b.getDay()]; case "1": return b.getDate(); case "2": return b.getFullYear(); case "3": return d.substr(d.length - 2); case "4": return e[b.getMonth() + 1].substring(0, 3); case "5": return e[b.getMonth() + 1]; case "6": return b.getMonth() } }); return a }; Ms.Events = function (a) { this.SourceObject = a; this.Listeners = {} }; Ms.Events.Block = function (a) { a = window.event || a; a.stopPropagation && a.stopPropagation(); if (a.preventDefault) return a.preventDefault(); a.returnValue = false; a.cancelBubble = true; return false }; Ms.Events.prototype.AddListener = function (a, d, e, c, b) { a = a.toLowerCase(); if (typeof this.Listeners[a] == "undefined") this.Listeners[a] = []; this.Listeners[a].push({ callback: d, thisObj: e, params: c, removeAfterFirstUse: b || false }) }; Ms.Events.prototype.Fire = function (c, f) { var d = this; c = c.toLowerCase(); var b; if (typeof (b = d.Listeners[c]) == "undefined") return; for (var e, a = 0; a < b.length; a++) { e = d.Dispatch(b[a].callback, b[a].thisObj || d.SourceObject, b[a].params, f); if (typeof e == "object" && e["break"] === true) break } for (var a = b.length - 1; a >= 0; a--) b[a].removeAfterFirstUse && d.Listeners[c].splice(a, 1) }; Ms.Events.prototype.RemoveListener = function (a, d, e) { var b = this; a = a.toLowerCase(); if (typeof b.Listeners[a] == "undefined") return; for (var c = 0; c < b.Listeners.length; c++) b.Listeners[a][c].callback == d && b.Listeners[a][c].thisObj == e && b.Listeners[a].splice(c, 1) }; Ms.Events.prototype.HasListener = function (a) { a = a.toLowerCase(); return typeof this.Listeners[a] != "undefined" }; Ms.Events.prototype.Dispatch = function (b, c, a, d) { if (a) b.apply(c, [d].concat(a)); else b.apply(c, [d]) }; Ms.Events.Global = new Ms.Events; Ms.DomEvents = { EventNames: [], Handlers: {}, ListenerObjects: [], AddListener: function (a, b, j, h, i, g) { var d = "undefined", c = this; if (typeof a.Listeners == d) { a.Listeners = {}; c.ListenerObjects.push(a) } var e = false; b = b.toLowerCase(); if (typeof a.Listeners[b] == d) { e = true; a.Listeners[b] = [] } var f = { callback: j, targetObj: i, params: h, removeAfterFirstUse: g || false }; a.Listeners[b].push(f); if (e) if (b == "domload") c.OnDomLoad(); else Ms.Tools.AddEventListener(a, b, c.Fire, [a, b], c); return f }, RemoveListener: function (b, a, f) { var d = "undefined"; if (typeof b.Listeners == d) return false; a = a.toLowerCase(); if (typeof b.Listeners[a] == d) return false; for (var e, c = 0; c < b.Listeners[a].length; c++) { e = b.Listeners[a][c]; if (e == f) { b.Listeners[a].splice(c, 1); return true } } return false }, RemoveListenerAt: function (b, a, d) { var c = "undefined"; if (typeof b.Listeners == c) return false; a = a.toLowerCase(); if (typeof b.Listeners[a] == c) return false; b.Listeners[a].splice(d, 1); return true }, RemoveAllListeners: function (b, a) { var c = "undefined"; if (typeof b.Listeners == c) return false; a = a.toLowerCase(); if (typeof b.Listeners[a] == c) return false; b.Listeners[a] = [] }, Fire: function (f, b, c) { var e = "undefined"; if (typeof b.Listeners == e) return false; c = c.toLowerCase(); if (typeof b.Listeners[c] == e) return false; for (var g, d = b.Listeners[c], a = 0; a < d.length; a++) this.Dispatch(d[a].callback, d[a].targetObj || b, d[a].params, f); return true }, Dispatch: function (b, c, a, d) { if (a) b.apply(c, [d].concat(a)); else b.apply(c, [d]) }, Initialize: function (a) { this.Done = true; clearInterval(Ms.DomEvents.safari_timer); Ms.DomEvents.Fire(a, window, "domLoad"); if (Ms.DomEvents.script) Ms.DomEvents.script.onreadystatechange = "" }, OnDomLoad: function () { var a = [], b, d, e, c; return function (b) { if (Ms.DomEvents.Done) return Ms.DomEvents.Initialize(); if (!a[0]) { document.addEventListener && document.addEventListener("DOMContentLoaded", Ms.DomEvents.Initialize, false); if (/WebKit/i.test(navigator.userAgent)) Ms.DomEvents.safari_timer = setInterval(function () { /loaded|complete/.test(document.readyState) && Ms.DomEvents.Initialize() }, 10); this.AddListener(window, "load", function (a) { Ms.DomEvents.Initialize(a || window.event) }) } a.push(b) } } () }; Ms.DomEvents.AddListener(window, "domload", function () { Ms.Tools.WindowLoaded = true }); Ms.Ajax = { obj: null, obj_list: [], Queue: [], busy: false, form: null, AllowMultiple: true, DisablePage: true, Mode: "release", Current: {}, headers: [{ Name: "User-Agent", Value: "Mozilla/5.0 (Windows; co_ajax) co_ajax/1.2"}], EnableCaching: false, HttpStatusCodes: { OK: "200 OK", Created: "201 Created", Accepted: "202 Accepted", No_Content: "204 No Content", Bad_Request: "400 Bad Request", Unauthorized: "401 Unauthorized", Forbidden: "403 Forbidden", Not_Found: "404 Not Found", Not_Allowed: "405 Method Not Allowed", Unknown: "500 Internal Server Error", Custom: "600 Bad Request"} }; Ms.Ajax.Events = new Ms.Events(Ms.Ajax); if (Ms.Ajax.Mode == "debug") { var co_debugger = null; Ms.DomEvents.AddListener(window, "load", function () { co_debugger = document.createElement("DIV"); co_debugger = document.body.appendChild(co_debugger); co_debugger.style.cssText = "position:absolute;top:0px;left:0px;background-color:#ffffff;border:1px solid #abcdef;height:200px;width:400px;overflow:auto;"; co_debugger.innerHTML = '<b>AJAX DEBUGGER:</b>(<a href="javascript:void(0);" onclick="Ms.Ajax.ClearDebugger();">clear</a>)</a><br />' }) } Ms.Ajax.Init = function () { var a; try { a = new ActiveXObject("Msxml2.XMLHTTP") } catch (c) { try { a = new ActiveXObject("Microsoft.XMLHTTP") } catch (b) { a = null } } if (!a && typeof XMLHttpRequest != "undefined") a = new XMLHttpRequest; if (a == null) { this.Debug("Could not create connection object."); this.Events.Fire("Error", { Text: "Ajax Not Supported" }) } return a }; Ms.Ajax.GetFirstAvailable = function () { if (!this.AllowMultiple) return 0; for (var a = 0; a < this.obj_list.length; a++) if (this.obj_list[a] == null) return a; return a }; Ms.Ajax.Submit = function (form, ajaxAction) { var action = ajaxAction || form.action, responseFunction = eval(form.getAttribute("oncallback")), request = new Ms.Ajax.RequestObject(action); request.Callback = responseFunction; request.Method = form.method; request.CallbackParameters = [form, action]; for (var i = 0; i < form.length; i++) request[form[i].name] = form[i].value; return !this.Request(request) }; Ms.Ajax.Request = function (b) { var g = "GET", a = this; if (a.busy && !a.AllowMultiple) { a.Queue.push(b); return } a.Events.Fire("beginRequest", { State: "BeginRequest" }); a.busy = true; a.Current = b; if (!b.EnableCaching) b.Parameters.rcbgn = +new Date + "." + Math.random() * 99999999; var d = b.GetRequestParameters(), c = b.Uri, e = b.Method || "POST"; if (e.toUpperCase() != g || c.indexOf("?") == -1) if (e.toUpperCase() == g) d = "?" + d.substr(1); else d = d.substr(1); var k = new RegExp("(http(?:s?))://?((.*?)/)?((.*)/)?(.*)?(" + document.domain + ")", "gi"); if (!k.test(c) && /http/gi.test(c)) { var i = c, j = i.match("(http(?:s?))")[0]; c = i.replace(/(http(?:s?):\/\/)/gi, ""); c = "/scripts/remoteAjax.asp?protocol=" + j + "&uri=" + encodeURIComponent(c) } var f = a.GetFirstAvailable(); a.obj_list[f] = {}; a.obj_list[f].request = b; a.obj = a.obj_list[f].obj = a.Init(); if (!a.obj) { a.Debug("Ajax not supported"); return false } a.Debug(c + (e.toUpperCase() == g ? d : "")); a.obj.open(e, c + (e.toUpperCase() == g ? d : ""), b.Async); a.obj.onreadystatechange = function () { Ms.Ajax.ReadyStateChanged(f) }; for (var h = 0; h < b.Headers.length; h++) a.obj.setRequestHeader(b.Headers[h].Name, b.Headers[h].Value); if (e == "POST") { a.obj.setRequestHeader("Method", "POST " + c + " HTTP/1.1"); a.obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } if (typeof Ms.PageControl != "undefined") if (b.DisablePage) Ms.PageControl.GetDefault().disable(); else b.DisableFragments != null && Ms.Tools.IsArray(b.DisableFragments) && Ms.PageControl.GetDefault().disableFragments(b.DisableFragments); a.obj.send(d); return !b.Async ? a.Response(a.obj_list[f]) : true }; Ms.Ajax.Abort = function (b) { var c = null, a = this; if (typeof b == "undefined" || b == c) b = -1; if (b == -1) for (var d = 0; d < a.obj_list.length; d++) { if (a.obj_list[d] == c || a.obj_list[d].obj == c) continue; try { a.obj_list[d].obj.abort() } catch (e) { throw e; } } else { if (a.obj_list.length <= b) return false; try { if (a.obj_list[b] == c || a.obj_list[b].obj == c) return false; a.obj_list[b].obj.abort() } catch (e) { throw e; } } }; Ms.Ajax.Response = function (c) { var j = "application/json", i = "text/html", d = null, g = this, e = c.request.Callback || d, a = {}, b = c.obj; a.readyState = b.readyState; a.responseXML = b.responseXML; a.responseText = b.responseText; a.status = b.status; a.statusText = b.statusText; a.RequestParameters = c.request.Parameters; a.request = c.request; a.http = b; if (a.status > 200 && a.status < 300) a.contentType = i; else a.contentType = b.getResponseHeader("content-type") || i; if (a.contentType.Contains(j) || a.contentType.Contains("text/x-json") || a.contentType.Contains("text/json")) { a.contentType = j; a.responseJson = Ms.Tools.Json.parse(b.responseText) } if (e) { var h = c.request.SourceObject || d, f = c.request.CallbackParameters || d; if (h) if (f) e.apply(h, [a].concat(f)); else e.apply(h, [a].concat()); else if (f) e.apply(d, [a].concat(f)); else e.apply(d, [a].concat()) } g.RequestComplete(a); g.Queue.length > 0 && g.Request(g.Queue.shift()); return a }; Ms.Ajax.RequestComplete = function (a) { var b = "requestComplete"; if (typeof Ms.PageControl != "undefined") if (a.request.DisablePage) Ms.PageControl.GetDefault().enable(); else a.request.DisableFragments != null && Ms.Tools.IsArray(a.request.DisableFragments) && Ms.PageControl.GetDefault().enableFragments(); this.busy = false; this.Events.Fire(b, { target: this, type: b, Response: a }) }; Ms.Ajax.Debug = function (a) { if (this.Mode == "debug" && typeof co_debugger != "undefined") co_debugger.innerHTML += a + "<br />" }; Ms.Ajax.ClearDebugger = function () { if (this.Mode == "debug" && typeof co_debugger != "undefined") co_debugger.innerHTML = '<b>AJAX DEBUGGER:</b>(<a href="javascript:void(0);" onclick="Ms.Ajax.ClearDebugger();">clear</a>)</a><br />' }; Ms.Ajax.ReadyStateChanged = function (c) { var b = this, a = b.obj_list[c]; if (!a.request.Async) return; b.Events.Fire("readyStateChange", { State: a.obj.readyState, target: a }); if (a.obj.readyState != 4) return; Ms.Ajax.Response(a); if (parseInt(a.obj.status) >= 400) b.Events.Fire("Error", { Status: a.obj.status, Text: "" }); else b.Events.Fire("complete", { target: a.obj, type: "Complete" }); if (b.obj_list[c].readyState == 4) b.obj_list[c] = null; a = a.obj = null }; Ms.Ajax.ActivateJavascript = function (Container) { if (Ms.BrowserInfo.IsIE) { this.ActivateJavascriptIExplore(Container); return } if (Ms.BrowserInfo.IsFirefox) return; for (var script_tags = Container.getElementsByTagName("script"), new_script, head_tag = document.getElementsByTagName("head")[0], i = 0; script_tags.length > i; i++) if (script_tags[i].getAttribute("src")) { new_script = document.createElement("script"); new_script.id = script_tags[i].getAttribute("id") || "ajax_script_" + i; new_script.type = script_tags[i].getAttribute("type") || "text/javascript"; new_script.language = script_tags[i].getAttribute("language") || "javascript"; new_script.src = script_tags[i].getAttribute("src"); head_tag.appendChild(new_script) } else eval(script_tags[i].innerHTML) }; Ms.Ajax.ActivateJavascriptIExplore = function (c) { if (!Ms.BrowserInfo.IsIE) return; for (var b = c.getElementsByTagName("script"), a = 0; b.length > a; a++) if (b[a].getAttribute("src")) b[a].src = b[a].getAttribute("src"); else b[a].text = b[a].innerHTML }; Ms.Ajax.RequestObject = function (e) { var d = "rand_cache", c = false, b = null, a = this; a.Parameters = {}; a.Method = "GET"; a.Callback = b; a.SourceObject = b; a.CallbackParameters = []; a.EnableCaching = c; a.EnableAnchor = c; a.DisablePage = c; a.DisableFragments = b; a.Uri = e; a.AnchorParameters = []; a.Async = true; a.Headers = []; a.GetAnchorString = function () { var a = this; for (var c = a.SourceObject ? a.SourceObject.Name || a.SourceObject.Id || "" : "", f, e, g = 0; g < a.AnchorParameters.length; g++) { f = a.AnchorParameters[g]; if (f.toLowerCase() == d) continue; e = a.Parameters[f]; if (typeof e != "undefined" && e != b && e != "") c += "/" + f + "/" + e } if (c.substr(0, 1) == "/") c = c.substr(1); return c }; a.GetRequestParameters = function () { var b = ""; for (var a in this.Parameters) { if (a.toLowerCase() == d) continue; b += "&" + a + "=" + escape(this.Parameters[a]) } return b }; a.ReplaceHeader = function (e, d) { var a = this; for (var b = 0; b < a.Headers.length; b++) if (a.Headers[b].Name == e) { a.Headers[b].Value = d; return true } a.AddHeader(e, d); return c }; a.AddHeader = function (b, a) { this.Headers.push({ Name: b, Value: a }) }; a.RemoveHeader = function (b) { for (var a = 0; a < this.Headers.length; a++) this.Headers[a].Name == b && this.RemoveHeaderAt(a) }; a.RemoveHeaderAt = function (a) { this.Headers.splice(a, 1) } }; Ms.Tools.Json = typeof JSON == "undefined" ? {} : JSON; (function () { var n = "number", m = "object", l = "string", k = "function"; function f(a) { return a < 10 ? "0" + a : a } if (typeof Date.prototype.toJSON !== k) { Date.prototype.toJSON = function () { var a = this; return isFinite(a.valueOf()) ? a.getUTCFullYear() + "-" + f(a.getUTCMonth() + 1) + "-" + f(a.getUTCDate()) + "T" + f(a.getUTCHours()) + ":" + f(a.getUTCMinutes()) + ":" + f(a.getUTCSeconds()) + "Z" : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () { return this.valueOf() } } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, rep; function quote(a) { escapable.lastIndex = 0; return escapable.test(a) ? '"' + a.replace(escapable, function (a) { var b = meta[a]; return typeof b === l ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + a + '"' } function str(i, j) { var f = "null", d, e, c, g, h = gap, b, a = j[i]; if (a && typeof a === m && typeof a.toJSON === k) a = a.toJSON(i); if (typeof rep === k) a = rep.call(j, i, a); switch (typeof a) { case l: return quote(a); case n: return isFinite(a) ? String(a) : f; case "boolean": case f: return String(a); case m: if (!a) return f; gap += indent; b = []; if (Object.prototype.toString.apply(a) === "[object Array]") { g = a.length; for (d = 0; d < g; d += 1) b[d] = str(d, a) || f; c = b.length === 0 ? "[]" : gap ? "[\n" + gap + b.join(",\n" + gap) + "\n" + h + "]" : "[" + b.join(",") + "]"; gap = h; return c } if (rep && typeof rep === m) { g = rep.length; for (d = 0; d < g; d += 1) { e = rep[d]; if (typeof e === l) { c = str(e, a); c && b.push(quote(e) + (gap ? ": " : ":") + c) } } } else for (e in a) if (Object.hasOwnProperty.call(a, e)) { c = str(e, a); c && b.push(quote(e) + (gap ? ": " : ":") + c) } c = b.length === 0 ? "{}" : gap ? "{\n" + gap + b.join(",\n" + gap) + "\n" + h + "}" : "{" + b.join(",") + "}"; gap = h; return c } } if (typeof Ms.Tools.Json.stringify !== k) Ms.Tools.Json.stringify = function (d, a, b) { var c; gap = ""; indent = ""; if (typeof b === n) for (c = 0; c < b; c += 1) indent += " "; else if (typeof b === l) indent = b; rep = a; if (a && typeof a !== k && (typeof a !== m || typeof a.length !== n)) throw new Error("Ms.Tools.Json.stringify"); return str("", { "": d }) }; if (typeof Ms.Tools.Json.parse !== k) Ms.Tools.Json.parse = function (text, reviver) { var j; function walk(d, e) { var b, c, a = d[e]; if (a && typeof a === m) for (b in a) if (Object.hasOwnProperty.call(a, b)) { c = walk(a, b); if (c !== undefined) a[b] = c; else delete a[b] } return reviver.call(d, e, a) } cx.lastIndex = 0; if (cx.test(text)) text = text.replace(cx, function (a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) }); if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { j = eval("(" + text + ")"); return typeof reviver === "function" ? walk({ "": j }, "") : j } throw new SyntaxError("Ms.Tools.Json.parse"); } })(); Ms.AutoSuggest = function (c, f, e, d, b) { var a = this; a.Index = Ms.AutoSuggest.Instances.length; Ms.AutoSuggest.Instances.push(a); a.Events = new Ms.Events(a); a.AjaxPath = e; a.TargetObjectName = typeof c == "string" ? c : c.id; a.Field = f; a.Form = a.Field.form; a.Name = a.Field.name; a.Settings = b; if (b.Name) { if (a.TargetObjectName == a.Name) a.TargetObjectName = b.Name; a.Name = b.Name } if (b.MaxVisibleItems) a.MaxVisibleItems = b.MaxVisibleItems; if (b.ShowLoading) a.ShowLoading = b.ShowLoading; if (b.MaxLength) a.MaxLength = b.MaxLength; a.ClassNamePrefix = d; if (b.direction) a.Direction = b.direction; if (typeof a.Field != "object") return; a.Field.AutoSuggestIndex = a.Index; a.Field.AutoSuggest = a; a.Field.setAttribute("autocomplete", "off"); if (!Ms.Tools.WindowLoaded) Ms.DomEvents.AddListener(window, "load", a.Init, null, a); else a.Init(); a.DocumentClickListener = null }; Ms.AutoSuggest.Instances = []; var proto = Ms.AutoSuggest.prototype; proto.Name = ""; proto.ShowNoItems = false; proto.ShowLoading = false; proto.NoItemsError = "No items matched your search."; proto.MaxVisibleItems = 10; proto.MaxLength = 10; proto.Container = null; proto.Layer = null; proto.Field = null; proto.Form = null; proto.Visible = false; proto.Suggestions = []; proto.AjaxPath = null; proto.Direction = "ltr"; proto.Loaded = false; proto.LimitToList = false; proto.SelectedItem = null; proto.ActiveItem = null; proto.CurrentSuggestion = -1; proto.PageCount = 0; proto.Page = 0; proto.Length = 0; proto.Init = function () { var c = "relative", a = this; if (a.Loaded) return; var b = document.createElement("DIV"); b.id = "Tl_Auto_Suggest_" + a.Name + "_Container"; b.style.position = c; a.Wrapper = document.getElementById(a.TargetObjectName + "_wrapper"); a.Container = document.getElementById(a.TargetObjectName + "_container") || document.getElementById(a.TargetObjectName); a.Container.style.position = c; a.Layer = a.Container.appendChild(b); if (a.Wrapper == null) a.Wrapper = a.Layer; if (a.ShowLoading) { var b = document.createElement("DIV"); b.id = "Auto_Suggest_Loader_" + a.Name; b.className = "Auto_Suggest_Loader"; b.style.display = "none"; b.innerHTML = '<img src="/images/loaders/indicator_000000_trans_16_16.gif" width="16" height="16" border="0" />'; a.Layer.appendChild(b) } Ms.Tools.FixPngs(); Ms.DomEvents.AddListener(a.Field, "keyup", a.GetSuggestions, [], a); Ms.DomEvents.AddListener(a.Field, "keydown", a.Field_OnKeyDown, [], a); a.Loaded = true }; proto.GetSuggestions = function (h) { var e = false, d = true, a = this; !a.Loaded && a.Init(); a.Reposition(); var c = h.keyCode || h.which, f, j, i, g; if (c > 13 && c < 41 || c > 112 && c < 124) return d; if (c == 13 || c == 3) { if (!a.visible && !a.LimitToList) return d; if (a.LimitToList) return e } else if (!(c == 37 || c == 39)) { a.CurrentSuggestion = -1; f = d; if (a.inputValue == a.Field.value) f = e; else if (a.inputLength < a.Field.value.length && a.inputLength > 0 && a.Length == 0 && a.Field.value.substr(0, a.inputLength) == a.inputValue) f = e; a.inputValue = a.Field.value; a.inputLength = a.Field.value.length; if (a.Field.value.length > 0) { if (f) { a.Length = -1; if (a.ShowLoading) { if (g = document.getElementById("Tl_Auto_Suggest_Loader_" + a.Name)) g.style.display = "block"; !a.Visible && a.ToggleDisplay(d) } var b = new Ms.Ajax.RequestObject(a.AjaxPath); b.EnableCaching = d; b.DisablePage = e; b.Method = "GET"; b.Callback = a.SetSuggestions; b.SourceObject = a; b.CallbackParameters = [a.inputValue]; b.Parameters = {}; b.Parameters[a.Field.name] = a.Field.value; Ms.Ajax.Abort(-1); Ms.Ajax.Request(b) } } else a.ToggleDisplay(e) } }; proto.SetSuggestions = function (f, c) { var a = this; if (c != a.inputValue) return; var e = f; if (a.ShowLoading) if (obj = document.getElementById("Tl_Auto_Suggest_Loader_" + a.Name)) obj.style.display = "none"; a.SelectedItem = null; a.Events.Fire("change", { target: a, type: "change" }); a.html = ""; var d = e.responseJson, h = "", b = "", g = 0, j, i; a.Suggestions = d.Suggestions; if (a.ClassNamePrefix == "") a.ClassNamePrefix = "Tl_"; if (Ms.Tools.IsArray(a.Suggestions) && a.Suggestions.length > 0) { a.PageCount = Math.ceil(a.Suggestions.length / a.MaxVisibleItems); a.Page = 1; a.Length = a.Suggestions.length; a.RealItemsLength = d.ResultCount || a.Length; b = a.Populate(c) } else if (a.ShowNoItems) b = '<div id="Auto_Suggest_' + a.Name + '_NoneFound" class="' + a.className_prefix + 'Suggestions_NoneFound">' + a.NoItemsError + "</div>"; if (b != "") { b = '<div class="' + a.ClassNamePrefix + "AutoSuggestContainer" + (Ms.BrowserInfo.IsIE ? " ContainerSize_ie" : " ContainerSize_ff") + '">' + b + "</div>"; a.html = b; if (a.Visible) a.SetContent(a.html); else a.ToggleDisplay(true) } else a.ToggleDisplay(false) }; proto.ClearSuggestions = function () { var a = this; a.Length = 0; a.CurrentSuggestion = -1; a.SelectedItem = null; a.Html = ""; a.SetContent(""); a.ToggleDisplay(false) }; proto.SetContent = function (b) { var a = this; if (a.ShowLoading) if (a.html != "") { a.Layer.style.height = ""; if (Ms.BrowserInfo.IsIE) { a.Layer.style.marginTop = "0px"; a.Layer.style.marginBottom = "0px" } } else { a.Layer.style.height = "25px"; if (Ms.BrowserInfo.IsIE) { a.Layer.style.marginTop = "10px"; a.Layer.style.marginBottom = "10px" } } a.Layer.innerHTML = b || "" }; proto.Populate = function (j) { var e = "undefined", a = this; for (var g = "", c = "", b, d = (a.Page - 1) * a.MaxVisibleItems, f = 0; d < a.Length; d++) { c = ""; if (!a.Suggestions[d] || a.Suggestions[d] == "" || typeof a.Suggestions[d].Title == e && typeof a.Suggestions[d].Value == e) continue; b = a.Suggestions[d]; c += "<div"; for (var h in b) c += " " + h + '="' + b[h] + '"'; var i = new RegExp("", "gi"); try { i = new RegExp("(" + j + ")", "gi") } catch (k) { } c += ' title="' + (b.Value || b.Title) + '"'; if (typeof b.RecordType != e && b.RecordType == 0) { c += ' class="' + a.ClassNamePrefix + 'SuggestionsHeader">'; c += b.Value; f-- } else { c += ' onmouseover="Ms.AutoSuggest.ItemOver(this,' + a.Index + ', 1);" onmouseout="Ms.AutoSuggest.ItemOut(this,' + a.Index + ', 1);" id="Tl_Auto_Suggest_' + a.Name + "_" + f + '" class="' + a.ClassNamePrefix + 'Suggestions" RecordType="' + b.RecordType + '" onclick="Ms.AutoSuggest.ItemClick(this, ' + a.Index + ');">'; if (a.Settings.Highlight) c += (b.Value || b.Title).replace(i, "<b>$1</b>"); else c += b.Value || b.Title } c += "</div>"; g += c; f++ } return g }; proto.ToggleDisplay = function (b) { var c = "none", a = this; if (b == "" || b == null) b = false; if (!b && a.Wrapper.style.display == c) return; if (a.Wrapper.style.display != c && !b) { a.Container.style.display = a.Wrapper.style.display = c; a.Visible = false; if (Ms.DomEvents.RemoveListener(document, "click", a.DocumentClickListener)) a.DocumentClickListener = null } else { a.Container.style.display = a.Wrapper.style.display = "block"; a.SetContent(a.html); a.height = a.Layer.clientHeight; a.width = a.Layer.clientWidth; a.Visible = true; if (a.DocumentClickListener == null) a.DocumentClickListener = Ms.DomEvents.AddListener(document, "click", a.Document_OnClick, [], a) } }; proto.Reposition = function () { }; proto.SetValue = function (b) { var a = this; a.Field.value = b; a.Events.Fire("change", { target: a, selectedItem: a.SelectedItem, type: "change" }) }; proto.GetValue = function () { return this.Field.value }; proto.Submit = function () { var a = "beforeSubmit"; this.Events.Fire(a, { target: this, type: a }); this.Form.submit() }; proto.SetValueAndSubmit = function (a) { this.SetValue(a); this.Submit() }; proto.AttemptSubmit = function () { var a = this, b = a.SelectedItem; if (!(b && b.parentNode && b.parentNode.parentNode)) b = null; if (b) a.SelectedItem.onclick.apply(a.SelectedItem, [].concat(a)); else if (a.LimitToList && a.Length > 0) a.SelectItem(document.getElementById("Auto_Suggest_" + a.Name + "_0")); else Ms.Tools.RunFunction(a.Events.Fire, a.Events, ["select", { target: a, type: "select", item: a.SelectedItem}]) }; proto.Select = function (a) { this.SelectItem(document.getElementById("Tl_Auto_Suggest_" + this.Name + "_" + a)) }; proto.SelectItem = function (b) { var a = this; a.SelectedItem = b; a.ToggleDisplay(false); a.SetValue(b.title); Ms.Tools.RunFunction(a.Events.Fire, a.Events, ["select", { target: a, type: "select", item: a.SelectedItem}]) }; proto.ItemOver = function (b, c) { var a = this; a.ActiveItem && a.ItemOut(a.ActiveItem, c); b.className = b.className.replace(/(\s?hover)*/gi, ""); b.className += " hover"; a.CurrentSuggestion = parseInt(b.id.replace("Tl_Auto_Suggest_" + a.Name + "_", "")); a.ActiveItem = b }; proto.ItemOut = function (a) { a.className = a.className.replace(/(\s?hover)*/gi, "") }; proto.ItemClick = function (a) { this.SelectItem(a) }; proto.Field_OnKeyDown = function (b) { var c = true, a = this; if (!a.Visible && !a.LimitToList) return c; var d = b.keyCode || b.which; switch (d) { case 38: case 40: if (!a.Visible) return c; a.ActiveItem && a.ItemOut(a.ActiveItem); if (d == 40) a.CurrentSuggestion++; else if (d == 38) a.CurrentSuggestion--; if (a.CurrentSuggestion < 0) a.CurrentSuggestion = a.RealItemsLength - 1; if (a.CurrentSuggestion >= a.RealItemsLength) a.CurrentSuggestion = 0; a.SelectedItem = a.ActiveItem = document.getElementById("Tl_Auto_Suggest_" + a.Name + "_" + a.CurrentSuggestion); if (a.SelectedItem) { a.ItemOver(a.SelectedItem); a.SetValue(a.SelectedItem.title) } return c; case 13: if (a.Visible) { a.AttemptSubmit(); a.ToggleDisplay(false); if (!a.Settings.AutoSubmit) { b.stopPropagation && b.stopPropagation(); if (b.preventDefault) return b.preventDefault(); b.returnValue = false; b.cancelBubble = c; return false } } } return c }; proto.OnScrollUpClick = function () { this.PreviousPage() }; proto.OnScrollDownClick = function () { this.NextPage() }; proto.OnScrollUpHover = function () { if (this.Scrollers.Up.disabled) return true; this.Scrollers.Up.className += " hover" }; proto.OnScrollDownHover = function () { if (this.Scrollers.Down.disabled) return true; this.Scrollers.Down.className += " hover" }; proto.OnScrollUpMouseOut = function () { this.Scrollers.Up.className = this.Scrollers.Up.className.replace(/\s?hover/gi, "") }; proto.OnScrollDownMouseOut = function () { this.Scrollers.Down.className = this.Scrollers.Down.className.replace(/\s?hover/gi, "") }; proto.Document_OnClick = function (c) { var a = c.srcElement || c.target, b = false; if (a == this.Field) return; while (a = a.parentNode) { if (a.nodeName.toLowerCase() == "body") break; if (a == this.Wrapper) { b = true; break } } !b && this.ToggleDisplay(false) }; Ms.AutoSuggest.ItemOver = function (b, a, c) { this.Instances[a].ItemOver(b, c) }; Ms.AutoSuggest.ItemOut = function (b, a, c) { this.Instances[a].ItemOut(b, c) }; Ms.AutoSuggest.ItemClick = function (b, a, c) { this.Instances[a].ItemClick(b, c) }; Ms.PageControl = function (g) { var f = "string", d = false, b = "px", c = null, e = true, a = this; a.cover = "page_disable"; a.Document = g || document; a.Width = a.Document.body.clientWidth; a.Height = a.Document.body.clientHeight; a.Enabled = e; a.fragments = c; a.OnResize = function () { !this.Enabled && this.resize() }; a.disable = function () { var a = this; a.getElement().style.width = Ms.Tools.GetWindowWidth() + b; a.cover.style.height = Ms.Tools.GetWindowHeight() + b; a.cover.style.display = ""; a.hide_select(e); a.Enabled = d }; a.enable = function () { this.getElement().style.display = "none"; this.hide_select(d); this.Enabled = e }; a.enableFragments = function () { if (this.fragments == c) return; var b = this.fragments, a; while (obj = b.shift()) { if (typeof obj == f) obj = document.getElementById(obj); a = obj.cover; a != c && a.parentNode.removeChild(a); a = obj.cover = c } this.fragments = b }; a.disableFragments = function (e, m, i, k) { var j = "undefined", h = this; if (typeof e == j) return; if (typeof i == j || i == "") i = h.getDefaultHtml(m); var g = [], d, a; if (typeof e == f) g.push(document.getElementById(e)); else if (Ms.Tools.IsArray(e)) g = e; else g.push(e); for (var l = 0; d = g[l]; l++) { if (typeof d == f) d = document.getElementById(d); if (!d.cover) { bounds = Ms.Tools.GetObjectBoundaries(d); a = d.cover = d.ownerDocument.createElement("DIV"); a.className = "fragmentCover"; a.style.top = bounds.top + b; a.style.left = bounds.left + b; a.style.width = bounds.width + b; a.style.height = bounds.height + b; if (typeof k != j) a.style.zIndex = k; a.innerHTML = i; d.ownerDocument.body.appendChild(a) } } if (h.fragments == c) h.fragments = []; h.fragments.push.apply(h.fragments, [].concat(g)) }; a.getElement = function () { var a = this; if (typeof a.cover == f) a.cover = a.Document.getElementById(a.cover); if (!a.cover) a.cover = a.create_element(); return a.cover }; a.create_element = function () { var b = this; if (b.cover) return b.cover; var a = b.Document.createElement("DIV"); b.Document.body.appendChild(a); a.className = "pageCover"; a.style.cssText = "position:fixed;_position:absolute;top: 0px;left: 0px;background-color:#666666;z-index:97;filter: alpha(opacity=50);-moz-opacity: 0.5;opacity:0.5;"; a.style.display = "none"; return a }; a.disable_actions = function () { var a = this; a.onclick = document.onclick; a.onmousemove = document.onmousemove; a.oncontextmenu = document.oncontextmenu; a.ondblclick = document.ondblclick; a.onkeydown = document.onkeydown; document.onclick = a.block_action; document.onmousemove = a.block_action; document.oncontextmenu = a.block_action; document.ondblclick = a.block_action; document.onkeydown = a.keypress }; a.enable_actions = function () { var a = this; document.onclick = a.onclick; document.onmousemove = a.onmousemove; document.oncontextmenu = a.oncontextmenu; document.ondblclick = a.ondblclick; document.onkeydown = a.onkeydown }; a.resize = function () { this.get_dimensions(); this.getElement().style.width = Ms.Tools.GetWindowWidth() + b; this.cover.style.height = Ms.Tools.GetWindowHeight() + b }; a.block_action = function () { return d }; a.keypress = function (a) { if (!a) a = window.event; var c = a.ctrlKey || a.metaKey, f = a.shiftKey, g = a.altKey, b = a.keyCode || a.which; if ((b == 65 || b == 97) && c) { if (a.preventDefault) return a.preventDefault(); a.returnValue = d; a.cancelBubble = e; return d } }; a.get_dimensions = function () { var a = this, c = 0, b = 0, d = a.Document.parentWindow || a.Document.defaultView; if (typeof d.innerWidth == "number") { c = d.innerWidth; b = d.innerHeight } else if (a.Document.documentElement && (a.Document.documentElement.clientWidth || a.Document.documentElement.clientHeight)) { c = a.Document.documentElement.clientWidth; b = a.Document.documentElement.clientHeight } else if (a.Document.body && (a.Document.body.clientWidth || a.Document.body.clientHeight)) { c = a.Document.body.clientWidth; b = a.Document.body.clientHeight } a.Width = c; a.Height = b }; a.hide_select = function (c) { c = c ? "hidden" : "visible"; if (Ms.BrowserInfo.IsIE) for (var b = this.Document.getElementsByTagName("SELECT"), a = b.length - 1; a >= 0; a--) if (!b[a].co_popup_donothide) b[a].style.visibility = c; for (var b = this.Document.getElementsByTagName("OBJECT"), a = b.length - 1; a >= 0; a--) b[a].style.visibility = c; for (var b = this.Document.getElementsByTagName("EMBED"), a = b.length - 1; a >= 0; a--) b[a].style.visibility = c }; a.get_dimensions(); Ms.DomEvents.AddListener(window, "resize", a.OnResize, c, a) }; Ms.PageControl.GetDefault = function () { if (typeof Ms.DefaultPageControl == "undefined") Ms.DefaultPageControl = new Ms.PageControl(document); return Ms.DefaultPageControl }; Ms.Tools.ActiveContent = {}; Ms.Tools.ActiveContent.GetObject = function (c) { for (var b = document.getElementsByName(c), a = 0; a < b.length; a++) { if (b[a].nodeName.toLowerCase() == "object" && document.all) return b[a]; if (b[a].nodeName == "EMBED") return b[a] } return null }; Ms.Tools.ActiveContent.InsertFlash = function (c, b, d) { var a = this.GetProperties(c, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash"); return this.Generate(a.objectAttributes, a.params, a.embedAttributes, b, d) }; Ms.Tools.ActiveContent.GetProperties = function (c, d, g, h, e) { var b = {}; b.embedAttributes = {}; b.params = {}; b.objectAttributes = {}; var f = document.location.protocol; for (var a in c) switch (a.toLowerCase()) { case "classid": break; case "pluginspage": b.embedAttributes[a] = c[a]; break; case "src": case "movie": c[a] = c[a].replace("http://", f + "//").replace("https://", f + "//"); if (c[a].indexOf(d) == -1) c[a] = this.AddExtension(c[a], d); b.embedAttributes.src = c[a]; b.params[g] = c[a]; break; case "onafterupdate": case "onbeforeupdate": case "onblur": case "oncellchange": case "onclick": case "ondblClick": case "ondrag": case "ondragend": case "ondragenter": case "ondragleave": case "ondragover": case "ondrop": case "onfinish": case "onfocus": case "onhelp": case "onmousedown": case "onmouseup": case "onmouseover": case "onmousemove": case "onmouseout": case "onkeypress": case "onkeydown": case "onkeyup": case "onload": case "onlosecapture": case "onpropertychange": case "onreadystatechange": case "onrowsdelete": case "onrowenter": case "onrowexit": case "onrowsinserted": case "onstart": case "onscroll": case "onbeforeeditfocus": case "onactivate": case "onbeforedeactivate": case "ondeactivate": case "type": case "codebase": b.objectAttributes[a] = c[a]; break; case "width": case "height": case "align": case "vspace": case "hspace": case "class": case "title": case "accesskey": case "id": case "tabindex": b.embedAttributes[a] = b.objectAttributes[a] = c[a]; break; case "name": b.embedAttributes[a] = c[a]; break; default: b.embedAttributes[a] = b.params[a] = c[a] } b.objectAttributes.classid = h; if (e) b.embedAttributes.type = e; return b }; Ms.Tools.ActiveContent.Generate = function (d, f, c, e, g) { var a = "<object "; for (var b in d) a += b + '="' + d[b] + '" '; a += ">"; for (var b in f) a += '<param name="' + b + '" value="' + f[b] + '" /> '; if (c) { a += "<embed "; for (var b in c) a += b + '="' + c[b] + '" '; a += " ></embed>" } a += "</object>"; if (g) return a; if (e) e.innerHTML = a; else document.writeln(a) }; Ms.Tools.ActiveContent.AddExtension = function (a, b) { return typeof b == "undefined" ? a : a.indexOf("?") != -1 ? a.replace(/\?/, b + "?") : a + b }; Ms.Tools.ActiveContent.GetFlashVersion = function () { var a = new Ms.Tools.ActiveContent.FlashVersion([0, 0, 0]); if (navigator.plugins && navigator.mimeTypes.length) { var d = navigator.plugins["Shockwave Flash"]; if (d && d.description) a = new Ms.Tools.ActiveContent.FlashVersion(d.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")) } else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) { var b = 1, c = 3; while (b) try { c++; b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + c); a = new Ms.Tools.ActiveContent.FlashVersion([c, 0, 0]) } catch (e) { b = null } } else { try { var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7") } catch (e) { try { var b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); a = new Ms.Tools.ActiveContent.FlashVersion([6, 0, 21]); b.AllowScriptAccess = "always" } catch (e) { if (a.major == 6) return a } try { b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash") } catch (e) { } } if (b != null) a = new Ms.Tools.ActiveContent.FlashVersion(b.GetVariable("$version").split(" ")[1].split(",")) } return a }; Ms.Tools.ActiveContent.FlashVersion = function (a) { this.major = a[0] != null ? parseInt(a[0]) : 0; this.minor = a[1] != null ? parseInt(a[1]) : 0; this.rev = a[2] != null ? parseInt(a[2]) : 0 }; Ms.Tools.ActiveContent.FlashVersion.prototype.ToString = function () { return this.major + "," + this.minor + "," + this.rev + ",0" }; Ms.Tools.ActiveContent.FlashVersion.prototype.Validate = function (a) { var b = this; return b.major < a.major ? false : b.major > a.major ? true : b.minor < a.minor ? false : b.minor > a.minor ? true : b.rev < a.rev ? false : true }; if (typeof Ms.Forms == "undefined") Ms.Forms = {}; if (typeof Ms.Forms == "undefined") Ms.Forms = {}; Ms.Forms.AddHandledField = function (a) { var c = "infoValue", b = this; if (!a.infoValue) try { if (a.attributes.infoValue) a.infoValue = a.attributes.infoValue.value; else if (a.getAttribute(c) != "") a.infoValue = a.getAttribute(c) } catch (d) { if (a.getAttribute(c) != "") a.infoValue = a.getAttribute(c) } if (!a.infoValue) return; Ms.DomEvents.AddListener(a, "blur", b.OnFieldBlur, [a], b); Ms.DomEvents.AddListener(a, "focus", b.OnFieldFocus, [a], b); a.className += " active"; b.OnFieldBlur(null, a) }; Ms.Forms.OnFieldFocus = function (b, a) { if (a.value == a.infoValue) { a.value = ""; a.className += " active" } }; Ms.Forms.OnDateFieldFocus = function (b, a) { this.OnFieldFocus(b, a) }; Ms.Forms.OnFieldBlur = function (b, a) { if (a.value == "") { a.value = a.infoValue; a.className = a.className.replace(/\s?active/gi, "") } }; Ms.Forms.OnLabelClick = function (d, c) { if (c.form) for (var b = c.form[c.name], a = 0; a < b.length; a++) if (b[a].parentNode.nodeName.toUpperCase() == "LABEL") if (b[a].checked) b[a].parentNode.className += " selected"; else b[a].parentNode.className = b[a].parentNode.className.replace(/\s?selected/gi, "") }; Ms.Forms.ShowOptions = function (a) { if (typeof a == "string") a = document.getElementById(a + "_options") || document.getElementById(a); if (!a) return; var b = a.id.replace(/_options/gi, ""), c = document.getElementById(b + "_wrapper"), d = document.getElementById(b + "_container"); d.style.display = "none"; Ms.Tools.RunFunction(function (a, b) { if (a) a.style.display = "block"; else b.style.display = "block" }, null, [c, a]) }; Ms.Forms.OnPageLoad = function (ev, doc) { var g = "ajax_action", f = "onautosuggestselect", e = "onautosuggestchange", d = "autoSuggestUrl", c = null, b = "undefined", a = this; if (typeof doc == b || doc == c) doc = document; for (var inputs = doc.getElementsByTagName("INPUT"), field, i = 0; i < inputs.length; i++) { field = inputs[i]; if (field.type == "text") { a.AddHandledField(field); if ((field.getAttribute(d) || "") != "" && typeof Ms.AutoSuggest != b) { field.AutoSuggest = new Ms.AutoSuggest(field.name, field, field.getAttribute(d), "auto", Ms.Tools.Json.parse("{" + field.getAttribute("autoSuggestProperties") + "}")); field.getAttribute(e) != c && field.AutoSuggest.Events.AddListener("change", function (b, a) { a = new Function("ev", a); return a.apply(this, [].concat(b)) }, field, [field.getAttribute(e)]); field.getAttribute(f) != c && field.AutoSuggest.Events.AddListener("select", function (b, a) { a = new Function("ev", a); return a.apply(this, [].concat(b)) }, field, [field.getAttribute(f)]) } } else if (field.type == "checkbox" || field.type == "radio") field.parentNode.nodeName.toUpperCase() == "LABEL" && Ms.DomEvents.AddListener(field.parentNode, "click", a.OnLabelClick, [field], a) } inputs = doc.getElementsByTagName("TEXTAREA"); for (i = 0; i < inputs.length; i++) a.AddHandledField(inputs[i]); inputs = doc.getElementsByTagName("SELECT"); for (i = 0; i < inputs.length; i++) if (inputs[i].getAttribute("auto") == "true" && typeof Ms.Forms.DropList != b) var dropList = Ms.Forms.DropList.Create(inputs[i]); var forms = document.forms; for (i = 0; i < forms.length; i++) { forms[i].onsubmit != c && forms[i].setAttribute("novalidate", "true"); if (forms[i].getAttribute(g) != c) { if (forms[i].onsubmit != c) forms[i].CoOnsubmit = forms[i].onsubmit; forms[i].onsubmit = function () { var ajaxAction = this.getAttribute(g); if (ajaxAction == c || ajaxAction == "") { var func = forms[i].CoOnsubmit; if (typeof func != b) { var returnValue = func(); if (typeof returnValue != b) return returnValue } } else { if (ajaxAction != c && ajaxAction != "") { for (var matches = ajaxAction.match(/(this\.[^&?=]*)/gi), i = 0; i < matches.length; i++) ajaxAction = ajaxAction.replace(matches[i], eval(matches[i])); action = ajaxAction } return Ms.Ajax.Submit(this, ajaxAction) } } } } }; Ms.Forms.GetSelectedIndex = function (c) { var a; if (typeof c == "string") a = document.getElementById(c); else a = c; if (typeof a.length == "undefined") return a.checked ? 0 : -1; var b, d; for (b = 0, d = a.length; b < d; b++) if (a[b].checked) return b; return -1 }; Ms.Forms.GetSelectedItem = function (a) { var c = this.GetSelectedIndex(a); if (c == -1) return null; var b; if (typeof a == "string") b = document.getElementById(a); else if (a.length) b = a; else b = document.getElementById(a.name); return typeof b.length == "undefined" ? b : b[c] }; Ms.DomEvents.AddListener(window, "load", Ms.Forms.OnPageLoad, null, Ms.Forms); if (typeof Ms.Forms == "undefined") Ms.Forms = {}; Ms.Forms.DropList = function (b) { var e = "div", a = this; if (b == null) return; if (!b.nodeName || b.nodeName.toUpperCase() != "SELECT") return; a.Events = new Ms.Events(a); a.SelectedItem = null; a.Visible = false; a.Source = b; a.Document = b.document || b.ownerDocument; a.ParentNode = b.parentNode; a.Container = a.ParentNode.appendChild(a.Document.createElement(e)); a.Container.className = "drop_list"; if (b.options.length == 0) return; a.VisibleValue = a.Container.appendChild(a.Document.createElement(e)); if (b.selectedIndex <= -1) b.selectedIndex = 0; a.VisibleValue.innerHTML = b[b.selectedIndex].text; a.VisibleValue.setAttribute("value", b.value); Ms.DomEvents.AddListener(a.VisibleValue, "click", a.ListClick, [], a); a.List = a.Container.appendChild(a.Document.createElement(e)); a.List.className = "list"; Ms.DomEvents.AddListener(a.List, "mouseover", a.ItemOver, [a.List], a); Ms.DomEvents.AddListener(a.List, "mouseout", a.ItemOut, [a.List], a); Ms.DomEvents.AddListener(a.List, "click", a.ItemClick, [a.List], a); a.Items = []; for (var d = 0; d < b.options.length; d++) { if (d == 0 && (b[d].value || "") == "") continue; var c = a.List.appendChild(a.Document.createElement(e)); c.setAttribute("value", b[d].value); c.innerHTML = b[d].text; c.relatedObject = b[d]; if (c.selected) { a.SelectedItem = c; a.VisibleValue.innerHTML = c.innerHTML } a.Items.push(c) } b.style.display = "none" }; Ms.Forms.DropList.Create = function (a) { return new Ms.Forms.DropList(a) }; Ms.Forms.DropList.prototype.Close = function () { var a = this; a.Visible = false; a.List.style.display = "none"; a.DocumentClickHandler != null && Ms.DomEvents.RemoveListener(a.DocumentClickHandler); a.DocumentClickHandler = null }; Ms.Forms.DropList.prototype.OnDocumentClick = function (a) { var b = a.target || a.srcElement; !Ms.Tools.IsChildOf(b, this.Container) && Ms.Tools.RunFunction(this.ListClick, this, [a, true]) }; Ms.Forms.DropList.prototype.ListClick = function (c, b) { var a = this; if (a.Visible || b) a.Close(true); else { a.Visible = true; a.List.style.display = "block"; a.DocumentClickHandler = Ms.DomEvents.AddListener(document, "click", a.OnDocumentClick, [], a) } }; Ms.Forms.DropList.prototype.ItemOver = function (a, c) { a = a || window.event; var b = a.target || a.srcElement; if (b == c) return; b.className += " hover" }; Ms.Forms.DropList.prototype.ItemOut = function (a, c) { a = a || window.event; var b = a.target || a.srcElement; if (b == c) return; b.className = b.className.replace(/\s?hover/gi, "") }; Ms.Forms.DropList.prototype.ItemClick = function (c, d) { var a = this; c = c || window.event; var b = c.target || c.srcElement; if (b == d) return; a.Source.value = b.getAttribute("value"); a.VisibleValue.innerHTML = b.innerHTML; a.Events.Fire("change", { target: a, selectedItem: b, type: "change" }); typeof a.Source.onchange != "undefined" && a.Source.onchange.apply(a.Source, [].concat(c)); a.SelectedItem = b; a.Close() }; Ms.FormValidation = { Form: null, Errors: [], ShowErrors: true, Error_Title: "An error has occured.", ErrorTypes: { Default: "", Web: "The web address you supplied in <<field_name>> is invalid.", Email: "The email address you supplied in <<field_name>> is invalid.", Date: "The date you suppplied in <<field_name>> is invalid.", CreditCard: "Please enter a valid credit card number in <<field_name>>.", Number: "The value you entered in <<field_name>> is not a number.", Checkbox: "Please select at-least one value for <<field_name>>.", Select: "Please select a value for <<field_name>>.", Radio: "Please select a value for <<field_name>>.", TooLong: "The text you entered is in <<field_name>> too long, the maximum allowed characters is <<max_length>>.", TooShort: "The text you entered in <<field_name>> is too short, the minimum allowed characters is <<min_length>>."} }; if (typeof Co_Translations) Co_Translations = {}; Ms.FormValidation.Validate = function (n, q, i) { var r = "function", d = "", f = false, j = true, m = "undefined", a = this; if (typeof n == "string") a.Form = document.forms[n]; else a.Form = n; a.Errors = []; if (typeof i != "object") i = {}; if (typeof a.Form.button_clicked != m) if (a.Form.button_clicked == 2) return j; var e, h = f, b, k, c = f, l, g, t = i.group || d, p = typeof i.mark_as_submitted == m || i.mark_as_submitted == null ? j : i.mark_as_submitted; if (typeof a.Form.Submitted != m) if (a.Form.Submitted) return f; for (var o = 0; o < a.Form.length; o++) { b = a.Form[o]; if (b.disabled) continue; if (t != d && (b.getAttribute("group") || d) != t) continue; c = f; e = b.getAttribute("required"); h = f; l = b.getAttribute("data_type") || d; if (e == null) e = f; switch (e.toString()) { case "false": e = f; break; case "optional": e = f; h = j; break; default: if (l == d && typeof e == "string") l = e; e = j } g = a.ErrorTypes.Default; switch (l.toLowerCase()) { case "web": case "link": case "url": if (a.IsUri(b.value) || !e && b.value == d) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Web; break; case "email": if (a.IsEmail(b.value) || !e && b.value == d) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Email; break; case "date": if (a.IsDate(b.value, b.getAttribute("date_delimiter")) || !e && b.value == d) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Date; break; case "number": case "int": if (!isNaN(b.value.replace(/,/gi, d)) && b.value != d || !e && b.value == d) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Number; break; case "credit_card": case "creditcard": if (a.IsCreditCard(b.value) || !e && b.value == d) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.CreditCard; break; default: switch (e) { case f: if (!h) continue; default: switch (b.type.toLowerCase()) { case "hidden": if (b.value != d && b.getAttribute("vmessage") != d || h) c = a.ValidateFieldCondition(b); break; case "radio": if (a.GetSelectedIndex(a.Form[b.name]) >= 0 || h) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Radio; break; case "checkbox": if (a.GetSelectedIndex(a.Form[b.name]) >= 0 || h) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Checkbox; break; case "select-one": case "select": if (b.selectedIndex > 0 || h) c = a.ValidateFieldCondition(b); if (b.selectedIndex == 0 && b[0].value != d || h) c = a.ValidateFieldCondition(b); if (!c) g = a.ErrorTypes.Select; break; default: max_length = b.getAttribute("max_length") || -1; min_length = b.getAttribute("min_length") || -1; try { min_length = parseInt(min_length) } catch (u) { if (isNaN(min_length)) min_length = -1 } try { max_length = parseInt(max_length) } catch (u) { if (isNaN(max_length)) max_length = -1 } if (min_length > max_length && max_length > -1) min_length = -1; if (b.value != d || max_length == 0 && b.value == d || h) { c = a.ValidateFieldCondition(b); if (min_length > 0 && c) if (b.value.length < min_length) { c = f; g = a.ErrorTypes.TooShort } if (max_length > -1 && c) if (b.value.length > max_length) { c = f; g = a.ErrorTypes.TooLong } } } } } if (!c) { k = k || b; a.Errors.push({ Message: a.GetFieldMessage(b, g), Field: b }) } } if (a.Errors.length > 0) { if (a.ShowErrors) if (typeof Alert == r) Alert(a.GetError(), { title: a.Error_Title }); else alert(a.GetError()); try { k.focus(); k.select() } catch (u) { } return f } if (typeof q == r) { var s = q(a.Form); a.Form.Submitted = s && p; return s } a.Form.Submitted = p; return j }; Ms.FormValidation.ValidateFieldCondition = function (fld) { if (!fld.getAttribute("condition")) return true; fld.Validate = function () { return eval(this.getAttribute("condition")) }; return fld.Validate() }; Ms.FormValidation.GetSelectedIndex = function (c) { var a; if (typeof c == "string") a = document.getElementById(c); else a = c; if (typeof a.length == "undefined") return a.checked ? 0 : -1; var b, d; for (b = 0, d = a.length; b < d; b++) if (a[b].checked) return b; return -1 }; Ms.FormValidation.GetSelectedItem = function (b) { var c = this.GetSelectedIndex(b); if (c == -1) return null; var a; if (typeof b == "string") a = document.getElementById(b); else a = b; return typeof a.length == "undefined" ? a : a[c] }; Ms.FormValidation.IsUri = function (a) { return a.match(/^(?:http(?:s?)\:\/\/|~\/|\/)?(?:(?:[-\w]+\.)+(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2,4}))(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$/gi) != null }; Ms.FormValidation.IsEmail = function (a) { return a.match(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/gi) != null }; Ms.FormValidation.IsDate = function (b, a) { if (typeof a == "undefined" || a == null || a == "") a = "./-"; var c = new RegExp("^\\s*?([0]?[1-9]|[1][0-2])[" + a + "]([0]?[1-9]|[1|2][0-9]|[3][0|1])[" + a + "]([0-9]{4}|[0-9]{2})\\s*?$", "gi"); return c.test(b) }; Ms.FormValidation.IsCreditCard = function (a) { a = a.replace(/[\s\-]/gi, ""); return a.match(/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/g) != null }; Ms.FormValidation.GetFieldMessage = function (b, a) { var g = "display_name", f = b.getAttribute("vmessage") || "", i = b.getAttribute("max_length") || -1, j = b.getAttribute("min_length") || -1, h = b.value, c; if (b.getAttribute(g)) c = b.getAttribute(g); else if (b.id) c = b.id; else c = b.name; if (f != "" && f.indexOf(" ") != -1) a = f; if (a == this.ErrorTypes.Default) a = "Please enter a value in <<field_name>>."; a = a.replace(/<<field_name>>/gi, c); a = a.replace(/<<field_value>>/gi, h); a = a.replace(/<<max_length>>/gi, i); a = a.replace(/<<min_length>>/gi, j); var d = a.match(/<<[^>]*>>/g); if (d != null) for (var e = 0; e < d.length; e++) a = a.replace(d[e], b.getAttribute(d[e].replace(/[<>]/g, ""))); return a }; Ms.FormValidation.GetError = function () { if (this.Errors.length == 0) return ""; for (var a = "The following errors occured:\r\n", b = 0; b < this.Errors.length; b++) a += "\r\n - " + this.Errors[b].Message; a += "\r\n\r\nPlease correct these errors and try again."; return a }; Ms.Dialog = function (b) { var a = this; a.IsPrompt = false; a.IsMessageBox = false; a.Obj = null; a.Properties = b || {}; if (a.IsMessageBox) if (typeof a.Properties.Width == "undefined") a.Properties.Width = 400; a.Document = document; a.Name = "dialog_" + Ms.Dialog.Count++; Ms.Dialog.Instances[a.Name] = a; a.Events = new Ms.Events(a); a.Loaded = a.ContentLoaded = false; a.WindowSize = Ms.Tools.GetViewPaneSize(window); a.ResizeListener = null }; Ms.Dialog.Count = 0; Ms.Dialog.Instances = {}; Ms.Dialog.OnLoad = function (a, b) { this.Instances[a].DialogLoaded(b); return this.Instances[a] }; Ms.Dialog.prototype.Create = function () { var b = "div", a = this; if (a.Obj != null) return; var d = a.Obj = a.CreateElement(b, { "class": "info_layer rounded", id: a.Name }); a.CreateElement(b, { "class": "border" }, d); var c = a.CreateElement(b, { "class": "content" }, d); if (!a.IsMessageBox) { a.CloseButton = a.CreateElement(b, { "class": "close_button" }, c); Ms.DomEvents.AddListener(a.CloseButton, "click", a.Hide, [], a) } a.TitleBar = a.CreateElement(b, { "class": "title_bar" }, c); a.ContentContainer = a.CreateElement(b, { "class": "content_area" }, c); a.Obj.style.display = "none" }; Ms.Dialog.prototype.CreateElement = function (e, c, d) { var b = this.Document.createElement(e); if (typeof d == "undefined") d = this.Document.body; for (var a in c) switch (a.toLowerCase()) { case "class": b.className = c[a]; break; case "style": b.style.cssText = c[a]; break; default: b.setAttribute(a, c[a]) } d.appendChild(b); return b }; Ms.Dialog.prototype.ShowLoading = function (a) { this.Show('<div class="loading">' + (a || "Loading...") + "</div>") }; Ms.Dialog.prototype.Show = function (c) { var b = "undefined", a = this; if (!a.Loaded) { !a.Obj && a.Create(); if (a.Properties.Title) a.TitleBar.innerHTML = a.Properties.Title; else a.TitleBar.innerHTML = ""; if (a.Properties.Width && typeof a.Properties.Width != b) a.Obj.style.width = a.Properties.Width + "px"; if (a.Properties.Height && typeof a.Properties.Height != b) a.Obj.style.height = a.Properties.Height + "px"; a.Obj.style.zIndex = 9999999; a.Obj.style.position = Ms.BrowserInfo.IsIE ? "absolute" : "fixed"; a.SetPosition(); a.ContentContainer.innerHTML = c; a.Obj.style.width = (a.Properties.Width || 400) + "px"; a.Obj.style.display = "block"; a.Loaded = true } Ms.PageControl.GetDefault().disable(); if (!a.Properties.EnableSelection) { Ms.Tools.DisableSelection(a.Obj); Ms.Tools.DisableSelection(a.Document.body); }; a.Obj.style.display = "block"; if (a.ResizeListener == null) a.ResizeListener = Ms.DomEvents.AddListener(window, "resize", a.OnWindowResize, [], a) }; Ms.Dialog.prototype.SetPosition = function () { var b = "none", a = this.Obj, c = a.style.display; if (c == b) a.style.display = "block"; a.style.left = (this.WindowSize.Width - a.clientWidth) / 2 + "px"; a.style.top = (this.WindowSize.Height - a.clientHeight) / 2 + "px"; if (c == b) a.style.display = b }; Ms.Dialog.prototype.Close = Ms.Dialog.prototype.Hide = function () { var a = this, b = new Ms.Tween(a.Obj, ["opacity"], Ms.Tween.Easing.strongEaseOut, [100], [0], .5, []); b.Events.AddListener("motionFinished", function () { Ms.PageControl.GetDefault().enable(); if (!this.Properties.EnableSelection) { Ms.Tools.EnableSelection(this.Obj); Ms.Tools.EnableSelection(document.body); }; this.Obj.style.display = "none"; Ms.Tools.SetObjectOpacity(this.Obj, 100) }, a); b.start(); if (a.ResizeListener != null) if (Ms.DomEvents.RemoveListener(window, "resize", a.ResizeListener)) a.ResizeListener = null }; Ms.Dialog.prototype.OnWindowResize = function () { var b = this; b.WindowSize = Ms.Tools.GetViewPaneSize(window); var a = b.Obj, c = a.style.display; if (c == "none") a.style.display = "block"; var e = (b.WindowSize.Width - a.clientWidth) / 2, f = (b.WindowSize.Height - a.clientHeight) / 2, d = new Ms.Tween(a, ["left", "top"], Ms.Tween.Easing.strongEaseOut, [parseInt(a.style.left || 0), parseInt(a.style.top || 0)], [e, f], .5, ["px", "px"]); d.start() }; Ms.Dialog.prototype.DialogLoaded = function (h) { var g = "motionChanged", d = "auto", c = "px", e = "dialogLoaded", b = "undefined", a = this; a.ContentContainer.style.display = "block"; a.ContentLoadingContainer.style.display = "none"; a.ContentWindow = h; a.ContentDocument = a.ContentWindow.document; if (typeof a.Properties.Title == b || a.Properties.Title == "") a.TitleBar.innerHTML = a.ContentDocument.title; if (a.ContentLoaded) { a.SetPosition(); Ms.Forms.OnPageLoad(null, a.ContentDocument); a.Events.FireEvent(e, { target: a, type: e }); return a } a.ContentLoaded = true; var i = a.ContentContainer.style.height; a.ContentContainer.style.height = "200px"; paneSize = Ms.Tools.GetWindowScrollSize(h); if (typeof a.Properties.MaxWidth != b) paneSize.Width = a.Properties.MaxWidth; if (typeof a.Properties.MaxHeight != b) paneSize.Height = a.Properties.MaxHeight; if (paneSize.Height > a.WindowSize.Height - 100) paneSize.Height = a.WindowSize.Height - 100; if (Ms.BrowserInfo.IsIE && Ms.BrowserInfo.IsLessThanIE8) { if (typeof a.Properties.Width != b) a.ContentContainer.style.width = a.Properties.Width + c; if (typeof a.Properties.Height != b) a.ContentContainer.style.height = a.Properties.Height + c } else if (Ms.BrowserInfo.IsIE) { if (typeof a.Properties.Width != b) a.ContentContainer.style.width = a.Properties.Width + c; else a.ContentContainer.style.width = d; a.Obj.style.width = d; if (typeof a.Properties.Height != b) a.ContentContainer.style.height = a.Properties.Height + c; else a.ContentContainer.style.height = d; a.Obj.style.height = d } else { if (typeof a.Properties.Width != b) a.ContentContainer.style.width = a.Properties.Width + c; else a.ContentContainer.style.width = d; a.Obj.style.width = d; if (typeof a.Properties.Height != b) a.ContentContainer.style.height = a.Properties.Height + c; else a.ContentContainer.style.height = a.ContentContainer.clientHeight + c; a.Obj.style.height = d } var f = new Ms.Tween(a.ContentContainer, ["width", "height"], Ms.Tween.Easing.regularEaseIn, [a.ContentContainer.clientWidth, a.ContentContainer.clientHeight], [paneSize.Width, paneSize.Height], .5, [c, c]); f.Events.AddEventListener(g, a.SetPosition, a); Ms.BrowserInfo.IsIE && Ms.BrowserInfo.IsLessThanIE8 && f.Events.AddListener(g, function () { this.Obj.style.width = this.ContentContainer.style.width }, a); f.start(); Ms.Forms.OnPageLoad(null, a.ContentDocument); a.Events.FireEvent(e, { target: a, type: e }); return a }; Ms.Dialog.Alert = function (c, b) { var a = new Ms.Dialog; a.IsPrompt = false; a.IsMessageBox = true; a.Properties = b; a.Show(c); return a }; Ms.Dialog.Confirm = function (c, b) { var a = new Ms.Dialog; a.IsPrompt = true; a.IsMessageBox = true; a.Properties = b; a.Show(c); return a }; Ms.Dialog.OpenWindow = function (c, a) { var d = "undefined"; if (typeof a == d) if (typeof c == "object") a = c; else a = {}; if (typeof a.Page == d) a.Page = c; var b = new Ms.Dialog(a); b.IsPrompt = true; b.IsMessageBox = false; b.Show(); return b }; Ms.Tween = function (g, d, b, c, e, h, f) { var a = this; a.Events = new Ms.Events; a.easingFunction = b || Ms.Tween.Easing.DefaultEase; if (!arguments.length) return; if (!Ms.Tools.IsArray(d)) throw "Tween properties must be of type array"; if (f) a.suffixes = f; a.targetObject = g; a.properties = d; a.startValues = c; a.positions = c; a.setDuration(h); if (b != null && b != "") a.easingFunction = b; a.endValues = e; a.setEndValues(e) }; var proto = Ms.Tween.prototype; proto.targetObject = {}; proto.properties = []; proto.startValues = []; proto.differences = []; proto.previousTime = 0; proto.direction = "f"; proto.previousPositions = []; proto.looping = false; proto.duration = 0; proto.time = 0; proto.positions = []; proto.startTime = 0; proto.endValues = []; proto.Name = ""; proto.suffixes = []; proto.setTime = function (c) { var d = "motionFinished", b = "motionLooped", a = this; a.previousTime = a.time; if (c > a.getDuration()) if (a.looping) { a.rewind(c - a.duration); a.update(); a.Events.Fire(b, { target: a, type: b }) } else { a.time = a.duration; a.update(); a.stop(); a.Events.Fire(d, { target: a, type: d }) } else if (c < 0) { a.rewind(); a.update() } else { a.time = c; a.update(); a.Events.Fire(b, { target: a, type: b }) } }; proto.getTime = function () { return this.time }; proto.setDuration = function (a) { this.duration = a == null || a <= 0 ? 1e5 : a }; proto.getDuration = function () { return this.duration }; proto.setPositions = function (g) { var k = "motionChanged", i = "rect(", c = " ", j = "auto", b = this; b.previousPositions = b.positions; for (var f = "", l = "", d = 0; d < b.properties.length; d++) { try { f = b.suffixes[d] || "" } catch (m) { f = "" } l = b.properties[d].toLowerCase(); var h = b.targetObject.currentStyle || window.getComputedStyle(b.targetObject, null), a = {}; if (h.clipTop) a = { Top: h.clipTop, Bottom: h.clipBottom, Left: h.clipLeft, Right: h.clipRight }; else { var e = h.clip.replace(/rect|\(|\)/gi, ""); if (Ms.BrowserInfo.IsChrome || Ms.BrowserInfo.IsSafari) e = e.replace(/0px/gi, j); if (e == j) a.Top = a.Right = a.Bottom = a.Left = j; else { e = e.split(c); a.Top = e[0]; a.Right = e[1]; a.Bottom = e[2]; a.Left = e[3] } } switch (l) { case "opacity": Ms.Tools.SetObjectOpacity(b.targetObject, Math.round(g[d])); break; case "clipright": b.targetObject.style.clip = i + a.Top + c + Math.round(g[d]) + f + c + a.Bottom + c + a.Left + ")"; break; case "clipleft": b.targetObject.style.clip = i + a.Top + c + a.Right + c + a.Bottom + c + Math.round(g[d]) + f + ")"; break; case "cliptop": b.targetObject.style.clip = i + Math.round(g[d]) + f + c + a.Right + c + a.Bottom + c + a.Left + ")"; break; case "clipbottom": b.targetObject.style.clip = i + a.Top + c + a.Right + c + Math.round(g[d]) + f + c + a.Left + ")"; break; default: b.targetObject.style[b.properties[d]] = Math.round(g[d]) + f } } b.positions = g; b.Events.Fire(k, { target: b, type: k }) }; proto.getPositions = function (c) { var a = this; if (c == undefined) c = a.time; for (var d = [], b = 0; b < a.startValues.length; b++) d.push(a.easingFunction(c, a.startValues[b], a.differences[b], a.duration)); return d }; proto.setEndValues = function (c) { for (var b = [], a = 0; a < this.startValues.length; a++) b.push(c[a] - this.startValues[a]); this.differences = b }; proto.getEndValues = function () { for (var b = [], a = 0; a < this.startValues.length; a++) b.push(this.startValues[a] + this.differences[a]); return b }; proto.start = function () { var a = this; a.rewind(); a.startEnterFrame(); a.Events.Fire("motionStarted", { target: a, type: "onMotionStarted" }) }; proto.reverse = function () { var a = this; a.rewind(); a.direction = "r"; a.realStartValues = a.startValues; a.realDifferences = a.differences; a.realEndValues = a.endValues; a.startValues = a.endValues; a.setEndValues(a.startValues); a.isPlaying = true; a.onEnterFrame(); a.Events.Fire("motionStarted", { target: a, type: "onMotionStarted" }) }; proto.opposite = function () { var a = this; a.rewind(); a.direction = "o"; a.realStartValues = a.startValues; a.realDifferences = a.differences; a.realEndValues = a.endValues; for (var c = [], b = 0; b < a.endValues.length; b++) if (/(?:left|right|top|bottom|width|height|backgroundPosition)/gi.test(a.properties[b])) c.push(a.endValues[b] > 0 ? -a.endValues[b] : Math.abs(a.endValues[b])); else if (a.properties[b] != "opacity") c.push(a.startValues[b]); else c.push(a.endValues[b]); a.setEndValues(c); a.isPlaying = true; a.onEnterFrame(); a.Events.Fire("motionStarted", { target: a, type: "onMotionStarted" }) }; proto.rewind = function (b) { var a = this; a.stop(); a.time = typeof b == "undefined" ? 0 : b; a.fixTime(); a.update() }; proto.fastForward = function () { var a = this; a.time = a.duration; a.fixTime(); a.update() }; proto.update = function () { this.setPositions(this.getPositions(this.time)) }; proto.startEnterFrame = function () { this.stopEnterFrame(); this.isPlaying = true; this.onEnterFrame() }; proto.onEnterFrame = function () { var a = this; if (a.isPlaying) { a.nextFrame(); a.isPlaying && Ms.Tools.SetTimeout(a.onEnterFrame, 0, a) } }; proto.nextFrame = function () { this.setTime((this.getTimer() - this.startTime) / 1e3) }; proto.stop = function () { var a = "motionStopped"; this.stopEnterFrame(); this.Events.Fire(a, { target: this, type: a }) }; proto.stopEnterFrame = function () { var b = "undefined", a = this; a.direction = "f"; if (typeof a.realStartValues != b) a.startValues = a.realStartValues; if (typeof a.realDifferences != b) a.differences = a.realDifferences; if (typeof a.realEndValues != b) a.endValues = a.realEndValues; a.isPlaying = false }; proto.continueTo = function (b, c) { var a = this; a.startValues = a.positions; a.setEndValues(b); a.duration != undefined && a.setDuration(c); a.start() }; proto.resume = function () { var b = "motionResumed", a = this; a.fixTime(); a.startEnterFrame(); a.Events.Fire(b, { target: a, type: b }) }; proto.yoyo = function () { this.continueTo(this.startValues, this.time) }; proto.fixTime = function () { this.startTime = this.getTimer() - this.time * 1e3 }; proto.getTimer = function () { return +new Date - this.time }; Ms.Tween.Easing = {}; Ms.Tween.Easing.DefaultEase = function (d, a, b, c) { return b * d / c + a }; Ms.Tween.Easing.easeNone = function (d, a, b, c) { return a + b * (d /= c) }; Ms.Tween.Easing.backEaseIn = function (b, c, d, e) { if (a == undefined) var a = 1.70158; return d * (b /= e) * b * ((a + 1) * b - a) + c }; Ms.Tween.Easing.backEaseOut = function (a, c, d, e) { if (b == undefined) var b = 1.70158; return d * ((a = a / e - 1) * a * ((b + 1) * a + b) + 1) + c }; Ms.Tween.Easing.backEaseInOut = function (a, c, d, e) { if (b == undefined) var b = 1.70158; return (a /= e / 2) < 1 ? d / 2 * a * a * (((b *= 1.525) + 1) * a - b) + c : d / 2 * ((a -= 2) * a * (((b *= 1.525) + 1) * a + b) + 2) + c }; Ms.Tween.Easing.elasticEaseIn = function (d, e, c, f, a, b) { if (d == 0) return e; if ((d /= f) == 1) return e + c; if (!b) b = f * .3; if (!a || a < Math.abs(c)) { a = c; var g = b / 4 } else var g = b / (2 * Math.PI) * Math.asin(c / a); return -(a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d * f - g) * 2 * Math.PI / b)) + e }; Ms.Tween.Easing.elasticEaseOut = function (d, e, b, f, a, c) { if (d == 0) return e; if ((d /= f) == 1) return e + b; if (!c) c = f * .3; if (!a || a < Math.abs(b)) { a = b; var g = c / 4 } else var g = c / (2 * Math.PI) * Math.asin(b / a); return a * Math.pow(2, -10 * d) * Math.sin((d * f - g) * 2 * Math.PI / c) + b + e }; Ms.Tween.Easing.elasticEaseInOut = function (a, e, c, f, b, d) { if (a == 0) return e; if ((a /= f / 2) == 2) return e + c; if (!d) var d = f * .3 * 1.5; if (!b || b < Math.abs(c)) var b = c, g = d / 4; else var g = d / (2 * Math.PI) * Math.asin(c / b); return a < 1 ? -.5 * b * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * f - g) * 2 * Math.PI / d) + e : b * Math.pow(2, -10 * (a -= 1)) * Math.sin((a * f - g) * 2 * Math.PI / d) * .5 + c + e }; Ms.Tween.Easing.bounceEaseOut = function (a, d, e, f) { var c = 7.5625, b = 2.75; return (a /= f) < 1 / b ? e * c * a * a + d : a < 2 / b ? e * (c * (a -= 1.5 / b) * a + .75) + d : a < 2.5 / b ? e * (c * (a -= 2.25 / b) * a + .9375) + d : e * (c * (a -= 2.625 / b) * a + .984375) + d }; Ms.Tween.Easing.bounceEaseIn = function (d, c, a, b) { return a - Ms.Tween.Easing.bounceEaseOut(b - d, 0, a, b) + c }; Ms.Tween.Easing.bounceEaseInOut = function (c, d, b, a) { return c < a / 2 ? Ms.Tween.Easing.bounceEaseIn(c * 2, 0, b, a) * .5 + d : Ms.Tween.Easing.bounceEaseOut(c * 2 - a, 0, b, a) * .5 + b * .5 + d }; Ms.Tween.Easing.regularEaseIn = function (a, b, c, d) { return c * (a /= d) * a + b }; Ms.Tween.Easing.regularEaseOut = function (a, b, c, d) { return -c * (a /= d) * (a - 2) + b }; Ms.Tween.Easing.regularEaseInOut = function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b }; Ms.Tween.Easing.strongEaseIn = function (a, b, c, d) { return c * (a /= d) * a * a * a * a + b }; Ms.Tween.Easing.strongEaseOut = function (a, b, c, d) { return c * ((a = a / d - 1) * a * a * a * a + 1) + b }; Ms.Tween.Easing.strongEaseInOut = function (a, b, c, d) { return (a /= d / 2) < 1 ? c / 2 * a * a * a * a * a + b : c / 2 * ((a -= 2) * a * a * a * a + 2) + b };
/*@cc_on@*/ 
/*@if (@_win32) 
	var proto = "src='javascript:void(0)'";
if (location.protocol == "https:") 
	proto = "src=//0";
document.write("<scr" + "ipt id=__ie_onload defer " + proto + "><\/scr" + "ipt>");
Ms.DomEvents.script = document.getElementById("__ie_onload");
Ms.DomEvents.script.onreadystatechange = function ()
{
if (this.readyState == "complete")
{
	Ms.DomEvents.Initialize(); 
}
}; 
/*@end@*/
