﻿///* IE7/IE8.js - copyright 2004-2008, Dean Edwards */
//(function() { IE7 = { toString: function() { return "IE7 version 2.0 (beta3)" } }; var k = IE7.appVersion = navigator.appVersion.match(/MSIE (\d\.\d)/)[1]; if (/ie7_off/.test(top.location.search) || k < 5) return; var Q = bG(); var C = document.compatMode != "CSS1Compat"; var bm = document.documentElement, v, s; var bA = "!"; var G = ":link{ie7-link:link}:visited{ie7-link:visited}"; var cj = /^[\w\.]+[^:]*$/; function W(a, b) { if (cj.test(a)) a = (b || "") + a; return a }; function bn(a, b) { a = W(a, b); return a.slice(0, a.lastIndexOf("/") + 1) }; var bB = document.scripts[document.scripts.length - 1]; var ck = bn(bB.src); try { var H = new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { } var X = {}; function cl(a, b) { try { a = W(a, b); if (!X[a]) { H.open("GET", a, false); H.send(); if (H.status == 0 || H.status == 200) { X[a] = H.responseText } } } catch (e) { } finally { return X[a] || "" } }; if (k < 5.5) { undefined = Q(); bA = "HTML:!"; var cm = /(g|gi)$/; var cn = String.prototype.replace; String.prototype.replace = function(a, b) { if (typeof b == "function") { if (a && a.constructor == RegExp) { var c = a; var d = c.global; if (d == null) d = cm.test(c); if (d) c = new RegExp(c.source) } else { c = new RegExp(bb(a)) } var f, g = this, h = ""; while (g && (f = c.exec(g))) { h += g.slice(0, f.index) + b.apply(this, f); g = g.slice(f.index + f[0].length); if (!d) break } return h + g } return cn.apply(this, arguments) }; Array.prototype.pop = function() { if (this.length) { var a = this[this.length - 1]; this.length--; return a } return undefined }; Array.prototype.push = function() { for (var a = 0; a < arguments.length; a++) { this[this.length] = arguments[a] } return this.length }; var co = this; Function.prototype.apply = function(a, b) { if (a === undefined) a = co; else if (a == null) a = window; else if (typeof a == "string") a = new String(a); else if (typeof a == "number") a = new Number(a); else if (typeof a == "boolean") a = new Boolean(a); if (arguments.length == 1) b = []; else if (b[0] && b[0].writeln) b[0] = b[0].documentElement.document || b[0]; var c = "#ie7_apply", d; a[c] = this; switch (b.length) { case 0: d = a[c](); break; case 1: d = a[c](b[0]); break; case 2: d = a[c](b[0], b[1]); break; case 3: d = a[c](b[0], b[1], b[2]); break; case 4: d = a[c](b[0], b[1], b[2], b[3]); break; case 5: d = a[c](b[0], b[1], b[2], b[3], b[4]); break; default: var f = [], g = b.length - 1; do f[g] = "a[" + g + "]"; while (g--); eval("r=o[$](" + f + ")") } if (typeof a.valueOf == "function") { delete a[c] } else { a[c] = undefined; if (d && d.writeln) d = d.documentElement.document || d } return d }; Function.prototype.call = function(a) { return this.apply(a, bC.apply(arguments, [1])) }; G += "address,blockquote,body,dd,div,dt,fieldset,form," + "frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,p," + "hr,applet,center,dir,menu,pre,dl,li,ol,ul{display:block}" } var bC = Array.prototype.slice; var cJ = /%([1-9])/g; var cp = /^\s\s*/; var cq = /\s\s*$/; var cr = /([\/()[\]{}|*+-.,^$?\\])/g; var bD = /\bbase\b/; var bE = ["constructor", "toString"]; var Y; function z() { }; z.extend = function(a, b) { Y = true; var c = new this; ba(c, a); Y = false; var d = c.constructor; function f() { if (!Y) d.apply(this, arguments) }; c.constructor = f; f.extend = arguments.callee; ba(f, b); f.prototype = c; return f }; z.prototype.extend = function(a) { return ba(this, a) }; var bo = "#"; var Z = "~"; var cs = /\\./g; var ct = /\(\?[:=!]|\[[^\]]+\]/g; var cu = /\(/g; var D = z.extend({ constructor: function(a) { this[Z] = []; this.merge(a) }, exec: function(g) { var h = this, p = this[Z]; return String(g).replace(new RegExp(this, this.ignoreCase ? "gi" : "g"), function() { var a, b = 1, c = 0; while ((a = h[bo + p[c++]])) { var d = b + a.length + 1; if (arguments[b]) { var f = a.replacement; switch (typeof f) { case "function": return f.apply(h, bC.call(arguments, b, d)); case "number": return arguments[b + f]; default: return f } } b = d } }) }, add: function(a, b) { if (a instanceof RegExp) { a = a.source } if (!this[bo + a]) this[Z].push(String(a)); this[bo + a] = new D.Item(a, b) }, merge: function(a) { for (var b in a) this.add(b, a[b]) }, toString: function() { return "(" + this[Z].join(")|(") + ")" } }, { IGNORE: "$0", Item: z.extend({ constructor: function(a, b) { a = a instanceof RegExp ? a.source : String(a); if (typeof b == "number") b = String(b); else if (b == null) b = ""; if (typeof b == "string" && /\$(\d+)/.test(b)) { if (/^\$\d+$/.test(b)) { b = parseInt(b.slice(1)) } else { var c = /'/.test(b.replace(/\\./g, "")) ? '"' : "'"; b = b.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\$(\d+)/g, c + "+(arguments[$1]||" + c + c + ")+" + c); b = new Function("return " + c + b.replace(/(['"])\1\+(.*)\+\1\1$/, "$1") + c) } } this.length = D.count(a); this.replacement = b; this.toString = bG(a) } }), count: function(a) { a = String(a).replace(cs, "").replace(ct, ""); return I(a, cu).length } }); function ba(a, b) { if (a && b) { var c = (typeof b == "function" ? Function : Object).prototype; var d = bE.length, f; if (Y) while (f = bE[--d]) { var g = b[f]; if (g != c[f]) { if (bD.test(g)) { bF(a, f, g) } else { a[f] = g } } } for (f in b) if (c[f] === undefined) { var g = b[f]; if (a[f] && typeof g == "function" && bD.test(g)) { bF(a, f, g) } else { a[f] = g } } } return a }; function bF(c, d, f) { var g = c[d]; c[d] = function() { var a = this.base; this.base = g; var b = f.apply(this, arguments); this.base = a; return b } }; function cv(a, b) { if (!b) b = a; var c = {}; for (var d in a) c[d] = b[d]; return c }; function i(c) { var d = arguments; var f = new RegExp("%([1-" + arguments.length + "])", "g"); return String(c).replace(f, function(a, b) { return b < d.length ? d[b] : a }) }; function I(a, b) { return String(a).match(b) || [] }; function bb(a) { return String(a).replace(cr, "\\$1") }; function cK(a) { return String(a).replace(cp, "").replace(cq, "") }; function bG(a) { return function() { return a } }; var bH = D.extend({ ignoreCase: true }); var cw = /\x01(\d+)/g, cx = /'/g, cy = /^\x01/, cz = /\\([\da-fA-F]{1,4})/g; var bp = []; var cA = new bH({ "<!\\-\\-|\\-\\->": "", "\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/": "", "@(namespace|import)[^;\\n]+[;\\n]": "", "'(\\\\.|[^'\\\\])*'": bJ, '"(\\\\.|[^"\\\\])*"': bJ, "\\s+": " " }); function cB(a) { return cA.exec(a) }; function bI(c) { return c.replace(cw, function(a, b) { return bp[b - 1] }) }; function bJ(c) { return "\x01" + bp.push(c.replace(cz, function(a, b) { return eval("'\\u" + "0000".slice(b.length) + b + "'") }).slice(1, -1).replace(cx, "\\'")) }; function cC(a) { return cy.test(a) ? bp[a.slice(1) - 1] : a }; var cD = new D({ Width: "Height", width: "height", Left: "Top", left: "top", Right: "Bottom", right: "bottom", onX: "onY" }); function A(a) { return cD.exec(a) }; var bK = []; function bq(a) { cF(a); w(window, "onresize", a) }; function w(a, b, c) { a.attachEvent(b, c); bK.push(arguments) }; function cE(a, b, c) { try { a.detachEvent(b, c) } catch (ignore) { } }; w(window, "onunload", function() { var a; while (a = bK.pop()) { cE(a[0], a[1], a[2]) } }); function R(a, b, c) { if (!a.elements) a.elements = {}; if (c) a.elements[b.uniqueID] = b; else delete a.elements[b.uniqueID]; return c }; w(window, "onbeforeprint", function() { if (!IE7.CSS.print) new bw("print"); IE7.CSS.print.recalc() }); var bL = /^\d+(px)?$/i; var J = /^\d+%$/; var E = function(a, b) { if (bL.test(b)) return parseInt(b); var c = a.style.left; var d = a.runtimeStyle.left; a.runtimeStyle.left = a.currentStyle.left; a.style.left = b || 0; b = a.style.pixelLeft; a.style.left = c; a.runtimeStyle.left = d; return b }; var br = "ie7-"; var bM = z.extend({ constructor: function() { this.fixes = []; this.recalcs = [] }, init: Q }); var bs = []; function cF(a) { bs.push(a) }; IE7.recalc = function() { IE7.HTML.recalc(); IE7.CSS.recalc(); for (var a = 0; a < bs.length; a++) bs[a]() }; function bc(a) { return a.currentStyle["ie7-position"] == "fixed" }; function bt(a, b) { return a.currentStyle[br + b] || a.currentStyle[b] }; function K(a, b, c) { if (a.currentStyle[br + b] == null) { a.runtimeStyle[br + b] = a.currentStyle[b] } a.runtimeStyle[b] = c }; function bN(a) { var b = document.createElement(a || "object"); b.style.cssText = "position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999"; b.ie7_anon = true; return b }; function B(a, b, c) { if (!be[a]) { F = []; var d = ""; var f = T.escape(a).split(","); for (var g = 0; g < f.length; g++) { o = m = x = 0; S = f.length > 1 ? 2 : 0; var h = T.exec(f[g]) || "if(0){"; if (o) { h += i("if(e%1.nodeName!='!'){", m) } var p = S > 1 ? bV : ""; h += i(p + bW, m); h += Array(I(h, /\{/g).length + 1).join("}"); d += h } eval(i(bX, F) + T.unescape(d) + "return s?null:r}"); be[a] = _h } return be[a](b || document, c) }; var bd = k < 6; var bO = /^(href|src)$/; var bu = { "class": "className", "for": "htmlFor" }; IE7._5 = 1; IE7._e = function(a, b) { var c = a.all[b] || null; if (!c || c.id == b) return c; for (var d = 0; d < c.length; d++) { if (c[d].id == b) return c[d] } return null }; IE7._f = function(a, b) { if (b == "src" && a.pngSrc) return a.pngSrc; var c = bd ? (a.attributes[b] || a.attributes[bu[b.toLowerCase()]]) : a.getAttributeNode(b); if (c && (c.specified || b == "value")) { if (bO.test(b)) { return a.getAttribute(b, 2) } else if (b == "class") { return a.className.replace(/\sie7_\w+/g, "") } else if (b == "style") { return a.style.cssText } else { return c.nodeValue } } return null }; var bP = "colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc"; ba(bu, cv(bP.toLowerCase().split(","), bP.split(","))); IE7._a = function(a) { while (a && (a = a.nextSibling) && (a.nodeType != 1 || a.nodeName == "!")) continue; return a }; IE7._b = function(a) { while (a && (a = a.previousSibling) && (a.nodeType != 1 || a.nodeName == "!")) continue; return a }; var cG = /([\s>+~,]|[^(]\+|^)([#.:\[])/g, cH = /(^|,)([^\s>+~])/g, cI = /\s*([\s>+~(),]|^|$)\s*/g, bQ = /\s\*\s/g; var bR = D.extend({ constructor: function(a) { this.base(a); this.sorter = new D; this.sorter.add(/:not\([^)]*\)/, D.IGNORE); this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/, "$1$3$6$4") }, ignoreCase: true, escape: function(a) { return this.optimise(this.format(a)) }, format: function(a) { return a.replace(cI, "$1").replace(cH, "$1 $2").replace(cG, "$1*$2") }, optimise: function(a) { return this.sorter.exec(a.replace(bQ, ">* ")) }, unescape: function(a) { return bI(a) } }); var bS = { "": "%1!=null", "=": "%1=='%2'", "~=": /(^| )%1( |$)/, "|=": /^%1(-|$)/, "^=": /^%1/, "$=": /%1$/, "*=": /%1/ }; var bT = { "first-child": "!IE7._b(e%1)", "link": "e%1.currentStyle['ie7-link']=='link'", "visited": "e%1.currentStyle['ie7-link']=='visited'" }; var bv = "var p%2=0,i%2,e%2,n%2=e%1."; var bU = "e%1.sourceIndex"; var bV = "var g=" + bU + ";if(!p[g]){p[g]=1;"; var bW = "r[r.length]=e%1;if(s)return e%1;"; var bX = "var _h=function(e0,s){IE7._5++;var r=[],p={},reg=[%1],d=document;"; var F; var m; var o; var x; var S; var be = {}; var T = new bR({ " (\\*|[\\w-]+)#([\\w-]+)": function(a, b, c) { o = false; var d = "var e%2=IE7._e(d,'%4');if(e%2&&"; if (b != "*") d += "e%2.nodeName=='%3'&&"; d += "(e%1==d||e%1.contains(e%2))){"; if (x) d += i("i%1=n%1.length;", x); return i(d, m++, m, b.toUpperCase(), c) }, " (\\*|[\\w-]+)": function(a, b) { S++; o = b == "*"; var c = bv; c += (o && bd) ? "all" : "getElementsByTagName('%3')"; c += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){"; return i(c, m++, x = m, b.toUpperCase()) }, ">(\\*|[\\w-]+)": function(a, b) { var c = x; o = b == "*"; var d = bv; d += c ? "children" : "childNodes"; if (!o && c) d += ".tags('%3')"; d += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){"; if (o) { d += "if(e%2.nodeType==1){"; o = bd } else { if (!c) d += "if(e%2.nodeName=='%3'){" } return i(d, m++, x = m, b.toUpperCase()) }, "\\+(\\*|[\\w-]+)": function(a, b) { var c = ""; if (o) c += "if(e%1.nodeName!='!'){"; o = false; c += "e%1=IE7._a(e%1);if(e%1"; if (b != "*") c += "&&e%1.nodeName=='%2'"; c += "){"; return i(c, m, b.toUpperCase()) }, "~(\\*|[\\w-]+)": function(a, b) { var c = ""; if (o) c += "if(e%1.nodeName!='!'){"; o = false; S = 2; c += "while(e%1=e%1.nextSibling){if(e%1.ie7_adjacent==IE7._5)break;if("; if (b == "*") { c += "e%1.nodeType==1"; if (bd) c += "&&e%1.nodeName!='!'" } else c += "e%1.nodeName=='%2'"; c += "){e%1.ie7_adjacent=IE7._5;"; return i(c, m, b.toUpperCase()) }, "#([\\w-]+)": function(a, b) { o = false; var c = "if(e%1.id=='%2'){"; if (x) c += i("i%1=n%1.length;", x); return i(c, m, b) }, "\\.([\\w-]+)": function(a, b) { o = false; F.push(new RegExp("(^|\\s)" + bb(b) + "(\\s|$)")); return i("if(e%1.className&&reg[%2].test(e%1.className)){", m, F.length - 1) }, "\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]": function(a, b, c, d) { var f = bu[b] || b; if (c) { var g = "e%1.getAttribute('%2',2)"; if (!bO.test(b)) { g = "e%1.%3||" + g } b = i("(" + g + ")", m, b, f) } else { b = i("IE7._f(e%1,'%2')", m, b) } var h = bS[c || ""] || "0"; if (h && h.source) { F.push(new RegExp(i(h.source, bb(T.unescape(d))))); h = "reg[%2].test(%1)"; d = F.length - 1 } return "if(" + i(h, b, d) + "){" }, ":+([\\w-]+)(\\(([^)]+)\\))?": function(a, b, c, d) { b = bT[b]; return "if(" + (b ? i(b, m, d || "") : "0") + "){" } }); var bY = /a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i; var bZ = /\s*\{\s*/, ca = /\s*\}\s*/, cb = /\s*\,\s*/; var cc = /(.*)(:first-(line|letter))/; var y = document.styleSheets; IE7.CSS = new (bM.extend({ parser: new bH, screen: "", print: "", styles: [], rules: [], pseudoClasses: k < 7 ? "first\\-child" : "", dynamicPseudoClasses: { toString: function() { var a = []; for (var b in this) a.push(b); return a.join("|") } }, init: function() { var a = "^\x01$"; var b = "\\[class=?[^\\]]*\\]"; var c = []; if (this.pseudoClasses) c.push(this.pseudoClasses); var d = this.dynamicPseudoClasses.toString(); if (d) c.push(d); c = c.join("|"); var f = k < 7 ? ["[>+~[(]|([:.])\\w+\\1"] : [b]; if (c) f.push(":(" + c + ")"); this.UNKNOWN = new RegExp(f.join("|") || a, "i"); var g = k < 7 ? ["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"] : [b]; var h = g.concat(); if (c) h.push(":(" + c + ")"); n.COMPLEX = new RegExp(h.join("|") || a, "ig"); if (this.pseudoClasses) g.push(":(" + this.pseudoClasses + ")"); L.COMPLEX = new RegExp(g.join("|") || a, "i"); L.MATCH = new RegExp(d ? "(.*):(" + d + ")(.*)" : a, "i"); this.createStyleSheet(); this.refresh() }, addEventHandler: function() { w.apply(null, arguments) }, addFix: function(a, b) { this.parser.add(a, b) }, addRecalc: function(c, d, f, g) { d = new RegExp("([{;\\s])" + c + "\\s*:\\s*" + d + "[^;}]*"); var h = this.recalcs.length; if (g) g = c + ":" + g; this.addFix(d, function(a, b) { return (g ? b + g : a) + ";ie7-" + a.slice(1) + ";ie7_recalc" + h + ":1" }); this.recalcs.push(arguments); return h }, apply: function() { this.getInlineStyles(); new bw("screen"); this.trash() }, createStyleSheet: function() { this.styleSheet = document.createStyleSheet(); this.styleSheet.ie7 = true; this.styleSheet.owningElement.ie7 = true; this.styleSheet.cssText = G }, getInlineStyles: function() { var a = document.getElementsByTagName("style"), b; for (var c = a.length - 1; (b = a[c]); c--) { if (!b.disabled && !b.ie7) { this.styles.push(b.innerHTML) } } }, getText: function(a, b) { try { var c = a.cssText } catch (e) { c = "" } if (H) c = cl(a.href, b) || c; return c }, recalc: function() { this.screen.recalc(); var a = /ie7_recalc\d+/g; var b = G.match(/[{,]/g).length; var c = b + (this.screen.cssText.match(/\{/g) || "").length; var d = this.styleSheet.rules, f; var g, h, p, t, q, j, u, l; for (q = b; q < c; q++) { f = d[q]; var r = f.style.cssText; if (f && (g = r.match(a))) { p = B(f.selectorText); if (p.length) for (j = 0; j < g.length; j++) { l = g[j]; h = IE7.CSS.recalcs[l.slice(10)][2]; for (u = 0; (t = p[u]); u++) { if (t.currentStyle[l]) h(t, r) } } } } }, refresh: function() { this.styleSheet.cssText = G + this.screen + this.print }, trash: function() { for (var a = 0; a < y.length; a++) { if (!y[a].ie7) { try { var b = y[a].cssText } catch (e) { b = "" } if (b) y[a].cssText = "" } } } })); var bw = z.extend({ constructor: function(a) { this.media = a; this.load(); IE7.CSS[a] = this; IE7.CSS.refresh() }, createRule: function(a, b) { if (IE7.CSS.UNKNOWN.test(a)) { var c; if (bf && (c = a.match(bf.MATCH))) { return new bf(c[1], c[2], b) } else if (c = a.match(L.MATCH)) { if (!bY.test(c[0]) || L.COMPLEX.test(c[0])) { return new L(a, c[1], c[2], c[3], b) } } else return new n(a, b) } return a + " {" + b + "}" }, getText: function() { var h = [].concat(IE7.CSS.styles); var p = /@media\s+([^{]*)\{([^@]+\})\s*\}/gi; var t = /\ball\b|^$/i, q = /\bscreen\b/i, j = /\bprint\b/i; function u(a, b) { l.value = b; return a.replace(p, l) }; function l(a, b, c) { b = r(b); switch (b) { case "screen": case "print": if (b != l.value) return ""; case "all": return c } return "" }; function r(a) { if (t.test(a)) return "all"; else if (q.test(a)) return (j.test(a)) ? "all" : "screen"; else if (j.test(a)) return "print" }; var N = this; function O(a, b, c, d) { var f = ""; if (!d) { c = r(a.media); d = 0 } if (c == "all" || c == N.media) { if (d < 3) { for (var g = 0; g < a.imports.length; g++) { f += O(a.imports[g], bn(a.href, b), c, d + 1) } } f += cB(a.href ? cg(a, b) : h.pop() || ""); f = u(f, N.media) } return f }; var bl = {}; function cg(a, b) { var c = W(a.href, b); if (bl[c]) return ""; bl[c] = (a.disabled) ? "" : ci(IE7.CSS.getText(a, b), bn(a.href, b)); return bl[c] }; var ch = /(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi; function ci(a, b) { return a.replace(ch, "$1" + b.slice(0, b.lastIndexOf("/") + 1) + "$2") }; for (var P = 0; P < y.length; P++) { if (!y[P].disabled && !y[P].ie7) { this.cssText += O(y[P]) } } }, load: function() { this.cssText = ""; this.getText(); this.parse(); this.cssText = bI(this.cssText); X = {} }, parse: function() { this.cssText = IE7.CSS.parser.exec(this.cssText); var a = IE7.CSS.rules.length; var b = this.cssText.split(ca), c; var d, f, g, h; for (g = 0; g < b.length; g++) { c = b[g].split(bZ); d = c[0].split(cb); f = c[1]; for (h = 0; h < d.length; h++) { d[h] = f ? this.createRule(d[h], f) : "" } b[g] = d.join("\n") } this.cssText = b.join("\n"); this.rules = IE7.CSS.rules.slice(a) }, recalc: function() { var a, b; for (b = 0; (a = this.rules[b]); b++) a.recalc() }, toString: function() { return "@media " + this.media + "{" + this.cssText + "}" } }); var bf; var n = IE7.Rule = z.extend({ constructor: function(a, b) { this.id = IE7.CSS.rules.length; this.className = n.PREFIX + this.id; a = a.match(cc) || a || "*"; this.selector = a[1] || a; this.selectorText = this.parse(this.selector) + (a[2] || ""); this.cssText = b; this.MATCH = new RegExp("\\s" + this.className + "(\\s|$)", "g"); IE7.CSS.rules.push(this); this.init() }, init: Q, add: function(a) { a.className += " " + this.className }, recalc: function() { var a = B(this.selector); for (var b = 0; b < a.length; b++) this.add(a[b]) }, parse: function(a) { var b = a.replace(n.CHILD, " ").replace(n.COMPLEX, ""); if (k < 7) b = b.replace(n.MULTI, ""); var c = I(b, n.TAGS).length - I(a, n.TAGS).length; var d = I(b, n.CLASSES).length - I(a, n.CLASSES).length + 1; while (d > 0 && n.CLASS.test(b)) { b = b.replace(n.CLASS, ""); d-- } while (c > 0 && n.TAG.test(b)) { b = b.replace(n.TAG, "$1*"); c-- } b += "." + this.className; d = Math.min(d, 2); c = Math.min(c, 2); var f = -10 * d - c; if (f > 0) { b = b + "," + n.MAP[f] + " " + b } return b }, remove: function(a) { a.className = a.className.replace(this.MATCH, "$1") }, toString: function() { return i("%1 {%2}", this.selectorText, this.cssText) } }, { CHILD: />/g, CLASS: /\.[\w-]+/, CLASSES: /[.:\[]/g, MULTI: /(\.[\w-]+)+/g, PREFIX: "ie7_class", TAG: /^\w+|([\s>+~])\w+/, TAGS: /^\w|[\s>+~]\w/g, MAP: { 1: "html", 2: "html body", 10: ".ie7_html", 11: "html.ie7_html", 12: "html.ie7_html body", 20: ".ie7_html .ie7_body", 21: "html.ie7_html .ie7_body", 22: "html.ie7_html body.ie7_body"} }); var L = n.extend({ constructor: function(a, b, c, d, f) { this.attach = b || "*"; this.dynamicPseudoClass = IE7.CSS.dynamicPseudoClasses[c]; this.target = d; this.base(a, f) }, recalc: function() { var a = B(this.attach), b; for (var c = 0; b = a[c]; c++) { var d = this.target ? B(this.target, b) : [b]; if (d.length) this.dynamicPseudoClass.apply(b, d, this) } } }); var cd = z.extend({ constructor: function(a, b) { this.name = a; this.apply = b; this.instances = {}; IE7.CSS.dynamicPseudoClasses[a] = this }, register: function(a) { var b = a[2]; a.id = b.id + a[0].uniqueID; if (!this.instances[a.id]) { var c = a[1], d; for (d = 0; d < c.length; d++) b.add(c[d]); this.instances[a.id] = a } }, unregister: function(a) { if (this.instances[a.id]) { var b = a[2]; var c = a[1], d; for (d = 0; d < c.length; d++) b.remove(c[d]); delete this.instances[a.id] } } }); if (k < 7) { var U = new cd("hover", function(a) { var b = arguments; IE7.CSS.addEventHandler(a, k < 5.5 ? "onmouseover" : "onmouseenter", function() { U.register(b) }); IE7.CSS.addEventHandler(a, k < 5.5 ? "onmouseout" : "onmouseleave", function() { U.unregister(b) }) }); w(document, "onmouseup", function() { var a = U.instances; for (var b in a) if (!a[b][0].contains(event.srcElement)) U.unregister(a[b]) }) } IE7.CSS.addRecalc("[\\w-]+", "inherit", function(c, d) { var f = d.match(/[\w-]+\s*:\s*inherit/g); for (var g = 0; g < f.length; g++) { var h = f[g].replace(/ie7\-|\s*:\s*inherit/g, "").replace(/\-([a-z])/g, function(a, b) { return b.toUpperCase() }); c.runtimeStyle[h] = c.parentElement.currentStyle[h] } }); IE7.HTML = new (bM.extend({ fixed: {}, init: Q, addFix: function() { this.fixes.push(arguments) }, apply: function() { for (var a = 0; a < this.fixes.length; a++) { var b = B(this.fixes[a][0]); var c = this.fixes[a][1]; for (var d = 0; d < b.length; d++) c(b[d]) } }, addRecalc: function() { this.recalcs.push(arguments) }, recalc: function() { for (var a = 0; a < this.recalcs.length; a++) { var b = B(this.recalcs[a][0]); var c = this.recalcs[a][1], d; var f = Math.pow(2, a); for (var g = 0; (d = b[g]); g++) { var h = d.uniqueID; if ((this.fixed[h] & f) == 0) { d = c(d) || d; this.fixed[h] |= f } } } } })); if (k < 7) { document.createElement("abbr"); IE7.HTML.addRecalc("label", function(a) { if (!a.htmlFor) { var b = B("input,textarea", a, true); if (b) { w(a, "onclick", function() { b.click() }) } } }) } var V = "[.\\d]"; new function(_) { var layout = IE7.Layout = this; G += "*{boxSizing:content-box}"; IE7.hasLayout = k < 5.5 ? function(a) { return a.clientWidth } : function(a) { return a.currentStyle.hasLayout }; layout.boxSizing = function(a) { if (!IE7.hasLayout(a)) { a.style.height = "0cm"; if (a.currentStyle.verticalAlign == "auto") a.runtimeStyle.verticalAlign = "top"; collapseMargins(a) } }; function collapseMargins(a) { if (a != s && a.currentStyle.position != "absolute") { collapseMargin(a, "marginTop"); collapseMargin(a, "marginBottom") } }; function collapseMargin(a, b) { if (!a.runtimeStyle[b]) { var c = a.parentElement; if (c && IE7.hasLayout(c) && !IE7[b == "marginTop" ? "_b" : "_a"](a)) return; var d = B(">*:" + (b == "marginTop" ? "first" : "last") + "-child", a, true); if (d && d.currentStyle.styleFloat == "none" && IE7.hasLayout(d)) { collapseMargin(d, b); margin = _9(a, a.currentStyle[b]); childMargin = _9(d, d.currentStyle[b]); if (margin < 0 || childMargin < 0) { a.runtimeStyle[b] = margin + childMargin } else { a.runtimeStyle[b] = Math.max(childMargin, margin) } d.runtimeStyle[b] = "0px" } } }; function _9(a, b) { return b == "auto" ? 0 : E(a, b) }; var UNIT = /^[.\d][\w%]*$/, AUTO = /^(auto|0cm)$/; var applyWidth, applyHeight; IE7.Layout.borderBox = function(a) { applyWidth(a); applyHeight(a) }; var fixWidth = function(g) { applyWidth = function(a) { if (!J.test(a.currentStyle.width)) h(a); collapseMargins(a) }; function h(a, b) { if (!a.runtimeStyle.fixedWidth) { if (!b) b = a.currentStyle.width; a.runtimeStyle.fixedWidth = (UNIT.test(b)) ? Math.max(0, q(a, b)) : b; K(a, "width", a.runtimeStyle.fixedWidth) } }; function p(a) { if (!bc(a)) { var b = a.offsetParent; while (b && !IE7.hasLayout(b)) b = b.offsetParent } return (b || s).clientWidth }; function t(a, b) { if (J.test(b)) return parseInt(parseFloat(b) / 100 * p(a)); return E(a, b) }; var q = function(a, b) { var c = a.currentStyle["box-sizing"] == "border-box"; var d = 0; if (C && !c) d += j(a) + u(a, "padding"); else if (!C && c) d -= j(a) + u(a, "padding"); return t(a, b) + d }; function j(a) { return a.offsetWidth - a.clientWidth }; function u(a, b) { return t(a, a.currentStyle[b + "Left"]) + t(a, a.currentStyle[b + "Right"]) }; G += "*{minWidth:none;maxWidth:none;min-width:none;max-width:none}"; layout.minWidth = function(a) { if (a.currentStyle["min-width"] != null) { a.style.minWidth = a.currentStyle["min-width"] } if (R(arguments.callee, a, a.currentStyle.minWidth != "none")) { layout.boxSizing(a); h(a); l(a) } }; eval("IE7.Layout.maxWidth=" + String(layout.minWidth).replace(/min/g, "max")); function l(a) { var b = a.getBoundingClientRect(); var c = b.right - b.left; if (a.currentStyle.minWidth != "none" && c <= q(a, a.currentStyle.minWidth)) { a.runtimeStyle.width = a.currentStyle.minWidth } else if (a.currentStyle.maxWidth != "none" && c >= q(a, a.currentStyle.maxWidth)) { a.runtimeStyle.width = a.currentStyle.maxWidth } else { a.runtimeStyle.width = a.runtimeStyle.fixedWidth } }; function r(a) { if (R(r, a, /^(fixed|absolute)$/.test(a.currentStyle.position) && bt(a, "left") != "auto" && bt(a, "right") != "auto" && AUTO.test(bt(a, "width")))) { N(a); IE7.Layout.boxSizing(a) } }; IE7.Layout.fixRight = r; function N(a) { var b = t(a, a.runtimeStyle._c || a.currentStyle.left); var c = p(a) - t(a, a.currentStyle.right) - b - u(a, "margin"); if (parseInt(a.runtimeStyle.width) == c) return; a.runtimeStyle.width = ""; if (bc(a) || g || a.offsetWidth < c) { if (!C) c -= j(a) + u(a, "padding"); if (c < 0) c = 0; a.runtimeStyle.fixedWidth = c; K(a, "width", c) } }; var O = 0; bq(function() { if (!s) return; var a, b = (O < s.clientWidth); O = s.clientWidth; var c = layout.minWidth.elements; for (a in c) { var d = c[a]; var f = (parseInt(d.runtimeStyle.width) == q(d, d.currentStyle.minWidth)); if (b && f) d.runtimeStyle.width = ""; if (b == f) l(d) } var c = layout.maxWidth.elements; for (a in c) { var d = c[a]; var f = (parseInt(d.runtimeStyle.width) == q(d, d.currentStyle.maxWidth)); if (!b && f) d.runtimeStyle.width = ""; if (b != f) l(d) } for (a in r.elements) N(r.elements[a]) }); if (C) { IE7.CSS.addRecalc("width", V, applyWidth) } if (k < 7) { IE7.CSS.addRecalc("min-width", V, layout.minWidth); IE7.CSS.addRecalc("max-width", V, layout.maxWidth); IE7.CSS.addRecalc("right", V, r) } }; eval("var fixHeight=" + A(fixWidth)); fixWidth(); fixHeight(true) }; var bg = W("blank.gif", ck); var bh = "DXImageTransform.Microsoft.AlphaImageLoader"; var bx = "progid:" + bh + "(src='%1',sizingMethod='%2')"; var bi; var M = []; function by(a) { if (bi.test(a.src)) { var b = new Image(a.width, a.height); b.onload = function() { a.width = b.width; a.height = b.height; b = null }; b.src = a.src; a.pngSrc = a.src; bz(a) } }; if (k >= 5.5 && k < 7) { IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, function(a, b, c, d, f) { d = cC(d); return bi.test(d) ? "filter:" + i(bx, d, "crop") + ";zoom:1;background" + (b || "") + ":" + (c || "") + "none" + (f || "") : a }); IE7.HTML.addRecalc("img,input", function(a) { if (a.tagName == "INPUT" && a.type != "image") return; by(a); w(a, "onpropertychange", function() { if (!bj && event.propertyName == "src" && a.src.indexOf(bg) == -1) by(a) }) }); var bj = false; w(window, "onbeforeprint", function() { bj = true; for (var a = 0; a < M.length; a++) ce(M[a]) }); w(window, "onafterprint", function() { for (var a = 0; a < M.length; a++) bz(M[a]); bj = false }) } function bz(a, b) { var c = a.filters[bh]; if (c) { c.src = a.src; c.enabled = true } else { a.runtimeStyle.filter = i(bx, a.src, b || "scale"); M.push(a) } a.src = bg }; function ce(a) { a.src = a.pngSrc; a.filters[bh].enabled = false }; new function(_) { if (k >= 7) return; IE7.CSS.addRecalc("position", "fixed", _6, "absolute"); IE7.CSS.addRecalc("background(-attachment)?", "[^};]*fixed", _2); var $viewport = C ? "body" : "documentElement"; function _3() { if (v.currentStyle.backgroundAttachment != "fixed") { if (v.currentStyle.backgroundImage == "none") { v.runtimeStyle.backgroundRepeat = "no-repeat"; v.runtimeStyle.backgroundImage = "url(" + bg + ")" } v.runtimeStyle.backgroundAttachment = "fixed" } _3 = Q }; var _0 = bN("img"); function _1(a) { return a ? bc(a) || _1(a.parentElement) : false }; function _d(a, b, c) { setTimeout("document.all." + a.uniqueID + ".runtimeStyle.setExpression('" + b + "','" + c + "')", 0) }; function _2(a) { if (R(_2, a, a.currentStyle.backgroundAttachment == "fixed" && !a.contains(v))) { _3(); bgLeft(a); bgTop(a); _8(a) } }; function _8(a) { _0.src = a.currentStyle.backgroundImage.slice(5, -2); var b = a.canHaveChildren ? a : a.parentElement; b.appendChild(_0); setOffsetLeft(a); setOffsetTop(a); b.removeChild(_0) }; function bgLeft(a) { a.style.backgroundPositionX = a.currentStyle.backgroundPositionX; if (!_1(a)) { _d(a, "backgroundPositionX", "(parseInt(runtimeStyle.offsetLeft)+document." + $viewport + ".scrollLeft)||0") } }; eval(A(bgLeft)); function setOffsetLeft(a) { var b = _1(a) ? "backgroundPositionX" : "offsetLeft"; a.runtimeStyle[b] = getOffsetLeft(a, a.style.backgroundPositionX) - a.getBoundingClientRect().left - a.clientLeft + 2 }; eval(A(setOffsetLeft)); function getOffsetLeft(a, b) { switch (b) { case "left": case "top": return 0; case "right": case "bottom": return s.clientWidth - _0.offsetWidth; case "center": return (s.clientWidth - _0.offsetWidth) / 2; default: if (J.test(b)) { return parseInt((s.clientWidth - _0.offsetWidth) * parseFloat(b) / 100) } _0.style.left = b; return _0.offsetLeft } }; eval(A(getOffsetLeft)); function _6(a) { if (R(_6, a, bc(a))) { K(a, "position", "absolute"); K(a, "left", a.currentStyle.left); K(a, "top", a.currentStyle.top); _3(); IE7.Layout.fixRight(a); _4(a) } }; function _4(a, b) { positionTop(a, b); positionLeft(a, b, true); if (!a.runtimeStyle.autoLeft && a.currentStyle.marginLeft == "auto" && a.currentStyle.right != "auto") { var c = s.clientWidth - getPixelWidth(a, a.currentStyle.right) - getPixelWidth(a, a.runtimeStyle._c) - a.clientWidth; if (a.currentStyle.marginRight == "auto") c = parseInt(c / 2); if (_1(a.offsetParent)) a.runtimeStyle.pixelLeft += c; else a.runtimeStyle.shiftLeft = c } clipWidth(a); clipHeight(a) }; function clipWidth(a) { var b = a.runtimeStyle.fixWidth; a.runtimeStyle.borderRightWidth = ""; a.runtimeStyle.width = b ? getPixelWidth(a, b) : ""; if (a.currentStyle.width != "auto") { var c = a.getBoundingClientRect(); var d = a.offsetWidth - s.clientWidth + c.left - 2; if (d >= 0) { a.runtimeStyle.borderRightWidth = "0px"; d = Math.max(E(a, a.currentStyle.width) - d, 0); K(a, "width", d); return d } } }; eval(A(clipWidth)); function positionLeft(a, b) { if (!b && J.test(a.currentStyle.width)) { a.runtimeStyle.fixWidth = a.currentStyle.width } if (a.runtimeStyle.fixWidth) { a.runtimeStyle.width = getPixelWidth(a, a.runtimeStyle.fixWidth) } a.runtimeStyle.shiftLeft = 0; a.runtimeStyle._c = a.currentStyle.left; a.runtimeStyle.autoLeft = a.currentStyle.right != "auto" && a.currentStyle.left == "auto"; a.runtimeStyle.left = ""; a.runtimeStyle.screenLeft = getScreenLeft(a); a.runtimeStyle.pixelLeft = a.runtimeStyle.screenLeft; if (!b && !_1(a.offsetParent)) { _d(a, "pixelLeft", "runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document." + $viewport + ".scrollLeft") } }; eval(A(positionLeft)); function getScreenLeft(a) { var b = a.offsetLeft, c = 1; if (a.runtimeStyle.autoLeft) { b = s.clientWidth - a.offsetWidth - getPixelWidth(a, a.currentStyle.right) } if (a.currentStyle.marginLeft != "auto") { b -= getPixelWidth(a, a.currentStyle.marginLeft) } while (a = a.offsetParent) { if (a.currentStyle.position != "static") c = -1; b += a.offsetLeft * c } return b }; eval(A(getScreenLeft)); function getPixelWidth(a, b) { return J.test(b) ? parseInt(parseFloat(b) / 100 * s.clientWidth) : E(a, b) }; eval(A(getPixelWidth)); function _g() { var a = _2.elements; for (var b in a) _8(a[b]); a = _6.elements; for (b in a) { _4(a[b], true); _4(a[b], true) } _7 = 0 }; var _7; bq(function() { if (!_7) _7 = setTimeout(_g, 0) }) }; var bk = { backgroundColor: "transparent", backgroundImage: "none", backgroundPositionX: null, backgroundPositionY: null, backgroundRepeat: null, borderTopWidth: 0, borderRightWidth: 0, borderBottomWidth: 0, borderLeftStyle: "none", borderTopStyle: "none", borderRightStyle: "none", borderBottomStyle: "none", borderLeftWidth: 0, height: null, marginTop: 0, marginBottom: 0, marginRight: 0, marginLeft: 0, width: "100%" }; IE7.CSS.addRecalc("overflow", "visible", function(a) { if (a.parentNode.ie7_wrapped) return; if (IE7.Layout && a.currentStyle["max-height"] != "auto") { IE7.Layout.maxHeight(a) } if (a.currentStyle.marginLeft == "auto") a.style.marginLeft = 0; if (a.currentStyle.marginRight == "auto") a.style.marginRight = 0; var b = document.createElement(bA); b.ie7_wrapped = a; for (var c in bk) { b.style[c] = a.currentStyle[c]; if (bk[c] != null) { a.runtimeStyle[c] = bk[c] } } b.style.display = "block"; b.style.position = "relative"; a.runtimeStyle.position = "absolute"; a.parentNode.insertBefore(b, a); b.appendChild(a) }); function cf() { var f = "xx-small,x-small,small,medium,large,x-large,xx-large".split(","); for (var g = 0; g < f.length; g++) { f[f[g]] = f[g - 1] || "0.67em" } IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/, function(a, b, c, d) { return b + (f[d] || d) }); if (k < 6) { var h = /^\-/, p = /(em|ex)$/i; var t = /em$/i, q = /ex$/i; E = function(a, b) { if (bL.test(b)) return parseInt(b) || 0; var c = h.test(b) ? -1 : 1; if (p.test(b)) c *= u(a); j.style.width = (c < 0) ? b.slice(1) : b; v.appendChild(j); b = c * j.offsetWidth; j.removeNode(); return parseInt(b) }; var j = bN(); function u(a) { var b = 1; j.style.fontFamily = a.currentStyle.fontFamily; j.style.lineHeight = a.currentStyle.lineHeight; while (a != v) { var c = a.currentStyle["ie7-font-size"]; if (c) { if (t.test(c)) b *= parseFloat(c); else if (J.test(c)) b *= (parseFloat(c) / 100); else if (q.test(c)) b *= (parseFloat(c) / 2); else { j.style.fontSize = c; return 1 } } a = a.parentElement } return b }; IE7.CSS.addFix(/cursor\s*:\s*pointer/, "cursor:hand"); IE7.CSS.addFix(/display\s*:\s*list-item/, "display:block") } function l(a) { if (k < 5.5) IE7.Layout.boxSizing(a.parentElement); var b = a.parentElement; var c = b.offsetWidth - a.offsetWidth - r(b); var d = (a.currentStyle["ie7-margin"] && a.currentStyle.marginRight == "auto") || a.currentStyle["ie7-margin-right"] == "auto"; switch (b.currentStyle.textAlign) { case "right": c = d ? parseInt(c / 2) : 0; a.runtimeStyle.marginRight = c + "px"; break; case "center": if (d) c = 0; default: if (d) c /= 2; a.runtimeStyle.marginLeft = parseInt(c) + "px" } }; function r(a) { return E(a, a.currentStyle.paddingLeft) + E(a, a.currentStyle.paddingRight) }; IE7.CSS.addRecalc("margin(-left|-right)?", "[^};]*auto", function(a) { if (R(l, a, a.parentElement && a.currentStyle.display == "block" && a.currentStyle.marginLeft == "auto" && a.currentStyle.position != "absolute")) { l(a) } }); bq(function() { for (var a in l.elements) { var b = l.elements[a]; b.runtimeStyle.marginLeft = b.runtimeStyle.marginRight = ""; l(b) } }) }; IE7.loaded = true; (function() { try { bm.doScroll("left") } catch (e) { setTimeout(arguments.callee, 1); return } try { eval(bB.innerHTML) } catch (e) { } bi = new RegExp(bb(typeof IE7_PNG_SUFFIX == "string" ? IE7_PNG_SUFFIX : "-trans.png") + "$", "i"); v = document.body; s = C ? v : bm; v.className += " ie7_body"; bm.className += " ie7_html"; if (C) cf(); IE7.CSS.init(); IE7.HTML.init(); IE7.HTML.apply(); IE7.CSS.apply(); IE7.recalc() })() })();

/*
// * Copyright (c)2005-2007 Matt Kruse (javascripttoolbox.com)
// * 
// * Dual licensed under the MIT and GPL licenses. 
// * This basically means you can use this code however you want for
// * free, but don't claim to have written it yourself!
// * Donations always accepted: http://www.JavascriptToolbox.com/donate/
// * 
// * Please do not link to the .js files on javascripttoolbox.com from
// * your site. Copy the files locally to your server instead.
// * 
// */
/*
//Date functions

//These functions are used to parse, format, and manipulate Date objects.
//See documentation and examples at http://www.JavascriptToolbox.com/lib/date/

*/
Date.$VERSION = 1.02;

/*
// Utility function to append a 0 to single-digit numbers
*/
Date.LZ = function(x) { return (x < 0 || x > 9 ? "" : "0") + x };
/*
// Full month names. Change this for local month names
*/
Date.monthNames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
/*
// Month abbreviations. Change this for local month names
*/
Date.monthAbbreviations = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
/*
// Full day names. Change this for local month names
*/
Date.dayNames = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
/*
// Day abbreviations. Change this for local month names
*/
Date.dayAbbreviations = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
/*
// Used for parsing ambiguous dates like 1/2/2000 - default to preferring 'American' format meaning Jan 2.
// Set to false to prefer 'European' format meaning Feb 1
*/
Date.preferAmericanFormat = true;

/*
// If the getFullYear() method is not defined, create it
*/
if (!Date.prototype.getFullYear) {
    Date.prototype.getFullYear = function() { var yy = this.getYear(); return (yy < 1900 ? yy + 1900 : yy); };
}

/*
// Parse a string and convert it to a Date object.
// If no format is passed, try a list of common formats.
// If string cannot be parsed, return null.
// Avoids regular expressions to be more portable.
*/
Date.parseString = function(val, format) {
    /*
    // If no format is specified, try a few common formats
    */
    if (typeof (format) == "undefined" || format == null || format == "") {
        var generalFormats = new Array('y-M-d', 'MMM d, y', 'MMM d,y', 'y-MMM-d', 'd-MMM-y', 'MMM d', 'MMM-d', 'd-MMM');
        var monthFirst = new Array('M/d/y', 'M-d-y', 'M.d.y', 'M/d', 'M-d');
        var dateFirst = new Array('d/M/y', 'd-M-y', 'd.M.y', 'd/M', 'd-M');
        var checkList = new Array(generalFormats, Date.preferAmericanFormat ? monthFirst : dateFirst, Date.preferAmericanFormat ? dateFirst : monthFirst);
        for (var i = 0; i < checkList.length; i++) {
            var l = checkList[i];
            for (var j = 0; j < l.length; j++) {
                var d = Date.parseString(val, l[j]);
                if (d != null) {
                    return d;
                }
            }
        }
        return null;
    };

    this.isInteger = function(val) {
        for (var i = 0; i < val.length; i++) {
            if ("1234567890".indexOf(val.charAt(i)) == -1) {
                return false;
            }
        }
        return true;
    };
    this.getInt = function(str, i, minlength, maxlength) {
        for (var x = maxlength; x >= minlength; x--) {
            var token = str.substring(i, i + x);
            if (token.length < minlength) {
                return null;
            }
            if (this.isInteger(token)) {
                return token;
            }
        }
        return null;
    };
    val = val + "";
    format = format + "";
    var i_val = 0;
    var i_format = 0;
    var c = "";
    var token = "";
    var token2 = "";
    var x, y;
    var year = new Date().getFullYear();
    var month = 1;
    var date = 1;
    var hh = 0;
    var mm = 0;
    var ss = 0;
    var ampm = "";
    while (i_format < format.length) {
        /*
        // Get next token from format string
        */
        c = format.charAt(i_format);
        token = "";
        while ((format.charAt(i_format) == c) && (i_format < format.length)) {
            token += format.charAt(i_format++);
        }
        /*
        // Extract contents of value based on format token
        */
        if (token == "yyyy" || token == "yy" || token == "y") {
            if (token == "yyyy") {
                x = 4; y = 4;
            }
            if (token == "yy") {
                x = 2; y = 2;
            }
            if (token == "y") {
                x = 2; y = 4;
            }
            year = this.getInt(val, i_val, x, y);
            if (year == null) {
                return null;
            }
            i_val += year.length;
            if (year.length == 2) {
                if (year > 70) {
                    year = 1900 + (year - 0);
                }
                else {
                    year = 2000 + (year - 0);
                }
            }
        }
        else if (token == "MMM" || token == "NNN") {
            month = 0;
            var names = (token == "MMM" ? (Date.monthNames.concat(Date.monthAbbreviations)) : Date.monthAbbreviations);
            for (var i = 0; i < names.length; i++) {
                var month_name = names[i];
                if (val.substring(i_val, i_val + month_name.length).toLowerCase() == month_name.toLowerCase()) {
                    month = (i % 12) + 1;
                    i_val += month_name.length;
                    break;
                }
            }
            if ((month < 1) || (month > 12)) {
                return null;
            }
        }
        else if (token == "EE" || token == "E") {
            var names = (token == "EE" ? Date.dayNames : Date.dayAbbreviations);
            for (var i = 0; i < names.length; i++) {
                var day_name = names[i];
                if (val.substring(i_val, i_val + day_name.length).toLowerCase() == day_name.toLowerCase()) {
                    i_val += day_name.length;
                    break;
                }
            }
        }
        else if (token == "MM" || token == "M") {
            month = this.getInt(val, i_val, token.length, 2);
            if (month == null || (month < 1) || (month > 12)) {
                return null;
            }
            i_val += month.length;
        }
        else if (token == "dd" || token == "d") {
            date = this.getInt(val, i_val, token.length, 2);
            if (date == null || (date < 1) || (date > 31)) {
                return null;
            }
            i_val += date.length;
        }
        else if (token == "hh" || token == "h") {
            hh = this.getInt(val, i_val, token.length, 2);
            if (hh == null || (hh < 1) || (hh > 12)) {
                return null;
            }
            i_val += hh.length;
        }
        else if (token == "HH" || token == "H") {
            hh = this.getInt(val, i_val, token.length, 2);
            if (hh == null || (hh < 0) || (hh > 23)) {
                return null;
            }
            i_val += hh.length;
        }
        else if (token == "KK" || token == "K") {
            hh = this.getInt(val, i_val, token.length, 2);
            if (hh == null || (hh < 0) || (hh > 11)) {
                return null;
            }
            i_val += hh.length;
            hh++;
        }
        else if (token == "kk" || token == "k") {
            hh = this.getInt(val, i_val, token.length, 2);
            if (hh == null || (hh < 1) || (hh > 24)) {
                return null;
            }
            i_val += hh.length;
            hh--;
        }
        else if (token == "mm" || token == "m") {
            mm = this.getInt(val, i_val, token.length, 2);
            if (mm == null || (mm < 0) || (mm > 59)) {
                return null;
            }
            i_val += mm.length;
        }
        else if (token == "ss" || token == "s") {
            ss = this.getInt(val, i_val, token.length, 2);
            if (ss == null || (ss < 0) || (ss > 59)) {
                return null;
            }
            i_val += ss.length;
        }
        else if (token == "a") {
            if (val.substring(i_val, i_val + 2).toLowerCase() == "am") {
                ampm = "AM";
            }
            else if (val.substring(i_val, i_val + 2).toLowerCase() == "pm") {
                ampm = "PM";
            }
            else {
                return null;
            }
            i_val += 2;
        }
        else {
            if (val.substring(i_val, i_val + token.length) != token) {
                return null;
            }
            else {
                i_val += token.length;
            }
        }
    }
    /*
    // If there are any trailing characters left in the value, it doesn't match
    */
    if (i_val != val.length) {
        return null;
    }
    /*
    // Is date valid for month?
    */
    if (month == 2) {
        /*
        // Check for leap year
        */
        if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { // leap year
            if (date > 29) {
                return null;
            }
        }
        else {
            if (date > 28) {
                return null;
            }
        }
    }
    if ((month == 4) || (month == 6) || (month == 9) || (month == 11)) {
        if (date > 30) {
            return null;
        }
    }
    /*
    // Correct hours value
    */
    if (hh < 12 && ampm == "PM") {
        hh = hh - 0 + 12;
    }
    else if (hh > 11 && ampm == "AM") {
        hh -= 12;
    }
    return new Date(year, month - 1, date, hh, mm, ss);
};

/*
// Check if a date string is valid
*/
Date.isValid = function(val, format) {
    return (Date.parseString(val, format) != null);
};

/*
// Check if a date object is before another date object
*/
Date.prototype.isBefore = function(date2) {
    if (date2 == null) {
        return false;
    }
    return (this.getTime() < date2.getTime());
};

/*
// Check if a date object is after another date object
*/
Date.prototype.isAfter = function(date2) {
    if (date2 == null) {
        return false;
    }
    return (this.getTime() > date2.getTime());
};

/*
// Check if two date objects have equal dates and times
*/
Date.prototype.equals = function(date2) {
    if (date2 == null) {
        return false;
    }
    return (this.getTime() == date2.getTime());
};

/*
// Check if two date objects have equal dates, disregarding times
*/
Date.prototype.equalsIgnoreTime = function(date2) {
    if (date2 == null) {
        return false;
    }
    var d1 = new Date(this.getTime()).clearTime();
    var d2 = new Date(date2.getTime()).clearTime();
    return (d1.getTime() == d2.getTime());
};

/*
// Format a date into a string using a given format string
*/
Date.prototype.format = function(format) {
    format = format + "";
    var result = "";
    var i_format = 0;
    var c = "";
    var token = "";
    var y = this.getYear() + "";
    var M = this.getMonth() + 1;
    var d = this.getDate();
    var E = this.getDay();
    var H = this.getHours();
    var m = this.getMinutes();
    var s = this.getSeconds();
    var yyyy, yy, MMM, MM, dd, hh, h, mm, ss, ampm, HH, H, KK, K, kk, k;
    /*
    // Convert real date parts into formatted versions
    */
    var value = new Object();
    if (y.length < 4) {
        y = "" + (+y + 1900);
    }
    value["y"] = "" + y;
    value["yyyy"] = y;
    value["yy"] = y.substring(2, 4);
    value["M"] = M;
    value["MM"] = Date.LZ(M);
    value["MMM"] = Date.monthNames[M - 1];
    value["NNN"] = Date.monthAbbreviations[M - 1];
    value["d"] = d;
    value["dd"] = Date.LZ(d);
    value["E"] = Date.dayAbbreviations[E];
    value["EE"] = Date.dayNames[E];
    value["H"] = H;
    value["HH"] = Date.LZ(H);
    if (H == 0) {
        value["h"] = 12;
    }
    else if (H > 12) {
        value["h"] = H - 12;
    }
    else {
        value["h"] = H;
    }
    value["hh"] = Date.LZ(value["h"]);
    value["K"] = value["h"] - 1;
    value["k"] = value["H"] + 1;
    value["KK"] = Date.LZ(value["K"]);
    value["kk"] = Date.LZ(value["k"]);
    if (H > 11) {
        value["a"] = "PM";
    }
    else {
        value["a"] = "AM";
    }
    value["m"] = m;
    value["mm"] = Date.LZ(m);
    value["s"] = s;
    value["ss"] = Date.LZ(s);
    while (i_format < format.length) {
        c = format.charAt(i_format);
        token = "";
        while ((format.charAt(i_format) == c) && (i_format < format.length)) {
            token += format.charAt(i_format++);
        }
        if (typeof (value[token]) != "undefined") {
            result = result + value[token];
        }
        else {
            result = result + token;
        }
    }
    return result;
};

/*
// Get the full name of the day for a date
*/
Date.prototype.getDayName = function() {
    return Date.dayNames[this.getDay()];
};

/*
// Get the abbreviation of the day for a date
*/
Date.prototype.getDayAbbreviation = function() {
    return Date.dayAbbreviations[this.getDay()];
};

/*
// Get the full name of the month for a date
*/
Date.prototype.getMonthName = function() {
    return Date.monthNames[this.getMonth()];
};

/*
// Get the abbreviation of the month for a date
*/
Date.prototype.getMonthAbbreviation = function() {
    return Date.monthAbbreviations[this.getMonth()];
};

/*
// Clear all time information in a date object
*/
Date.prototype.clearTime = function() {
    this.setHours(0);
    this.setMinutes(0);
    this.setSeconds(0);
    this.setMilliseconds(0);
    return this;
};

/*
// Add an amount of time to a date. Negative numbers can be passed to subtract time.
*/
Date.prototype.add = function(interval, number) {
    if (typeof (interval) == "undefined" || interval == null || typeof (number) == "undefined" || number == null) {
        return this;
    }
    number = +number;
    if (interval == 'y') { /* year **/
        this.setFullYear(this.getFullYear() + number);
    }
    else if (interval == 'M') { /* Month **/
        this.setMonth(this.getMonth() + number);
    }
    else if (interval == 'd') { /* Day **/
        this.setDate(this.getDate() + number);
    }
    else if (interval == 'w') { /* Weekday **/
        var step = (number > 0) ? 1 : -1;
        while (number != 0) {
            this.add('d', step);
            while (this.getDay() == 0 || this.getDay() == 6) {
                this.add('d', step);
            }
            number -= step;
        }
    }
    else if (interval == 'h') { /* Hour **/
        this.setHours(this.getHours() + number);
    }
    else if (interval == 'm') { /* Minute **/
        this.setMinutes(this.getMinutes() + number);
    }
    else if (interval == 's') { /* Second **/
        this.setSeconds(this.getSeconds() + number);
    }
    return this;
};

/* Email.js version 5 */
var tld_ = new Array();
tld_[0] = "com";
tld_[1] = "org";
tld_[2] = "net";
tld_[3] = "ws";
tld_[4] = "info";
tld_[10] = "co.uk";
tld_[11] = "org.uk";
tld_[12] = "gov.uk";
tld_[13] = "ac.uk";
var topDom_ = 13;
var m_ = "mailto:";
var a_ = "@";
var d_ = ".";

function mail(name, dom, tl, params) {
    var s = e(name, dom, tl);
    document.write('<a href="' + m_ + s + params + '">' + s + '</a>');
}
function mail2(name, dom, tl, params, display) {
    document.write('<a href="' + m_ + e(name, dom, tl) + params + '">' + display + '</a>');
}
function mail3(name, dom, tl, params, display, title) {
    document.write('<a href="' + m_ + e(name, dom, tl) + params + '" title="' + title + '">' + display + '</a>');
}
function e(name, dom, tl) {
    var s = name + a_;
    if (tl != -2) {
        s += dom;
        if (tl >= 0) {
            s += d_ + tld_[tl];
        }
    } else {
        s += swapper(dom);
    }
    return s;
}
function swapper(d) {
    var s = "";
    for (var i = 0; i < d.length; i += 2)
        if (i + 1 == d.length) {
        s += d.charAt(i)
    } else {
        s += d.charAt(i + 1) + d.charAt(i);
    }
    return s.replace(/\?/g, '.');
}

// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

// HISTORY
// ------------------------------------------------------------------
// December 29, 2003: Added the option to specify a delimiter for
//    multiple valued input field via getInputValue(), etc.

//-------------------------------------------------------------------
// Trim functions
//   Returns string with whitespace trimmed
//-------------------------------------------------------------------
function LTrim(str) {
    if (str == null) { return null; }
    for (var i = 0; str.charAt(i) == " "; i++);
    return str.substring(i, str.length);
}
function RTrim(str) {
    if (str == null) { return null; }
    for (var i = str.length - 1; str.charAt(i) == " "; i--);
    return str.substring(0, i + 1);
}
function Trim(str) { return LTrim(RTrim(str)); }
function LTrimAll(str) {
    if (str == null) { return str; }
    for (var i = 0; str.charAt(i) == " " || str.charAt(i) == "\n" || str.charAt(i) == "\t"; i++);
    return str.substring(i, str.length);
}
function RTrimAll(str) {
    if (str == null) { return str; }
    for (var i = str.length - 1; str.charAt(i) == " " || str.charAt(i) == "\n" || str.charAt(i) == "\t"; i--);
    return str.substring(0, i + 1);
}
function TrimAll(str) {
    return LTrimAll(RTrimAll(str));
}
//-------------------------------------------------------------------
// isNull(value)
//   Returns true if value is null
//-------------------------------------------------------------------
function isNull(val) { return (val == null); }

//-------------------------------------------------------------------
// isBlank(value)
//   Returns true if value only contains spaces
//-------------------------------------------------------------------
function isBlank(val) {
    if (val == null) { return true; }
    for (var i = 0; i < val.length; i++) {
        if ((val.charAt(i) != ' ') && (val.charAt(i) != "\t") && (val.charAt(i) != "\n") && (val.charAt(i) != "\r")) { return false; }
    }
    return true;
}

//-------------------------------------------------------------------
// isInteger(value)
//   Returns true if value contains all digits
//-------------------------------------------------------------------
function isInteger(val) {
    if (isBlank(val)) { return false; }
    for (var i = 0; i < val.length; i++) {
        if (!isDigit(val.charAt(i))) { return false; }
    }
    return true;
}

//-------------------------------------------------------------------
// isNumeric(value)
//   Returns true if value contains a positive float value
//-------------------------------------------------------------------
function isNumeric(val) { return (parseFloat(val, 10) == (val * 1)); }

//-------------------------------------------------------------------
// isArray(obj)
// Returns true if the object is an array, else false
//-------------------------------------------------------------------
function isArray(obj) { return (typeof (obj.length) == "undefined") ? false : true; }

//-------------------------------------------------------------------
// isDigit(value)
//   Returns true if value is a 1-character digit
//-------------------------------------------------------------------
function isDigit(num) {
    if (num.length > 1) { return false; }
    var string = "1234567890";
    if (string.indexOf(num) != -1) { return true; }
    return false;
}

//-------------------------------------------------------------------
// setNullIfBlank(input_object)
//   Sets a form field to "" if it isBlank()
//-------------------------------------------------------------------
function setNullIfBlank(obj) { if (isBlank(obj.value)) { obj.value = ""; } }

//-------------------------------------------------------------------
// setFieldsToUpperCase(input_object)
//   Sets value of form field toUpperCase() for all fields passed
//-------------------------------------------------------------------
function setFieldsToUpperCase() {
    for (var i = 0; i < arguments.length; i++) {
        arguments[i].value = arguments[i].value.toUpperCase();
    }
}

//-------------------------------------------------------------------
// disallowBlank(input_object[,message[,true]])
//   Checks a form field for a blank value. Optionally alerts if 
//   blank and focuses
//-------------------------------------------------------------------
function disallowBlank(obj) {
    var msg = (arguments.length > 1) ? arguments[1] : "";
    var dofocus = (arguments.length > 2) ? arguments[2] : false;
    if (isBlank(getInputValue(obj))) {
        if (!isBlank(msg)) { alert(msg); }
        if (dofocus) {
            if (isArray(obj) && (typeof (obj.type) == "undefined")) { obj = obj[0]; }
            if (obj.type == "text" || obj.type == "textarea" || obj.type == "password") { obj.select(); }
            obj.focus();
        }
        return true;
    }
    return false;
}

//-------------------------------------------------------------------
// disallowModify(input_object[,message[,true]])
//   Checks a form field for a value different than defaultValue. 
//   Optionally alerts and focuses
//-------------------------------------------------------------------
function disallowModify(obj) {
    var msg = (arguments.length > 1) ? arguments[1] : "";
    var dofocus = (arguments.length > 2) ? arguments[2] : false;
    if (getInputValue(obj) != getInputDefaultValue(obj)) {
        if (!isBlank(msg)) { alert(msg); }
        if (dofocus) {
            if (isArray(obj) && (typeof (obj.type) == "undefined")) { obj = obj[0]; }
            if (obj.type == "text" || obj.type == "textarea" || obj.type == "password") { obj.select(); }
            obj.focus();
        }
        setInputValue(obj, getInputDefaultValue(obj));
        return true;
    }
    return false;
}

//-------------------------------------------------------------------
// commifyArray(array[,delimiter])
//   Take an array of values and turn it into a comma-separated string
//   Pass an optional second argument to specify a delimiter other than
//   comma.
//-------------------------------------------------------------------
function commifyArray(obj, delimiter) {
    if (typeof (delimiter) == "undefined" || delimiter == null) {
        delimiter = ",";
    }
    var s = "";
    if (obj == null || obj.length <= 0) { return s; }
    for (var i = 0; i < obj.length; i++) {
        s = s + ((s == "") ? "" : delimiter) + obj[i].toString();
    }
    return s;
}

//-------------------------------------------------------------------
// getSingleInputValue(input_object,use_default,delimiter)
//   Utility function used by others
//-------------------------------------------------------------------
function getSingleInputValue(obj, use_default, delimiter) {
    switch (obj.type) {
        case 'radio': case 'checkbox': return (((use_default) ? obj.defaultChecked : obj.checked) ? obj.value : null);
        case 'text': case 'hidden': case 'textarea': return (use_default) ? obj.defaultValue : obj.value;
        case 'password': return ((use_default) ? null : obj.value);
        case 'select-one':
            if (obj.options == null) { return null; }
            if (use_default) {
                var o = obj.options;
                for (var i = 0; i < o.length; i++) { if (o[i].defaultSelected) { return o[i].value; } }
                return o[0].value;
            }
            if (obj.selectedIndex < 0) { return null; }
            return (obj.options.length > 0) ? obj.options[obj.selectedIndex].value : null;
        case 'select-multiple':
            if (obj.options == null) { return null; }
            var values = new Array();
            for (var i = 0; i < obj.options.length; i++) {
                if ((use_default && obj.options[i].defaultSelected) || (!use_default && obj.options[i].selected)) {
                    values[values.length] = obj.options[i].value;
                }
            }
            return (values.length == 0) ? null : commifyArray(values, delimiter);
    }
    alert("FATAL ERROR: Field type " + obj.type + " is not supported for this function");
    return null;
}

//-------------------------------------------------------------------
// getSingleInputText(input_object,use_default,delimiter)
//   Utility function used by others
//-------------------------------------------------------------------
function getSingleInputText(obj, use_default, delimiter) {
    switch (obj.type) {
        case 'radio': case 'checkbox': return "";
        case 'text': case 'hidden': case 'textarea': return (use_default) ? obj.defaultValue : obj.value;
        case 'password': return ((use_default) ? null : obj.value);
        case 'select-one':
            if (obj.options == null) { return null; }
            if (use_default) {
                var o = obj.options;
                for (var i = 0; i < o.length; i++) { if (o[i].defaultSelected) { return o[i].text; } }
                return o[0].text;
            }
            if (obj.selectedIndex < 0) { return null; }
            return (obj.options.length > 0) ? obj.options[obj.selectedIndex].text : null;
        case 'select-multiple':
            if (obj.options == null) { return null; }
            var values = new Array();
            for (var i = 0; i < obj.options.length; i++) {
                if ((use_default && obj.options[i].defaultSelected) || (!use_default && obj.options[i].selected)) {
                    values[values.length] = obj.options[i].text;
                }
            }
            return (values.length == 0) ? null : commifyArray(values, delimiter);
    }
    alert("FATAL ERROR: Field type " + obj.type + " is not supported for this function");
    return null;
}

//-------------------------------------------------------------------
// setSingleInputValue(input_object,value)
//   Utility function used by others
//-------------------------------------------------------------------
function setSingleInputValue(obj, value) {
    switch (obj.type) {
        case 'radio': case 'checkbox': if (obj.value == value) { obj.checked = true; return true; } else { obj.checked = false; return false; }
        case 'text': case 'hidden': case 'textarea': case 'password': obj.value = value; return true;
        case 'select-one': case 'select-multiple':
            var o = obj.options;
            for (var i = 0; i < o.length; i++) {
                if (o[i].value == value) { o[i].selected = true; }
                else { o[i].selected = false; }
            }
            return true;
    }
    alert("FATAL ERROR: Field type " + obj.type + " is not supported for this function");
    return false;
}

//-------------------------------------------------------------------
// getInputValue(input_object[,delimiter])
//   Get the value of any form input field
//   Multiple-select fields are returned as comma-separated values, or
//   delmited by the optional second argument
//   (Doesn't support input types: button,file,reset,submit)
//-------------------------------------------------------------------
function getInputValue(obj, delimiter) {
    var use_default = (arguments.length > 2) ? arguments[2] : false;
    if (isArray(obj) && (typeof (obj.type) == "undefined")) {
        var values = new Array();
        for (var i = 0; i < obj.length; i++) {
            var v = getSingleInputValue(obj[i], use_default, delimiter);
            if (v != null) { values[values.length] = v; }
        }
        return commifyArray(values, delimiter);
    }
    return getSingleInputValue(obj, use_default, delimiter);
}

//-------------------------------------------------------------------
// getInputText(input_object[,delimiter])
//   Get the displayed text of any form input field
//   Multiple-select fields are returned as comma-separated values, or
//   delmited by the optional second argument
//   (Doesn't support input types: button,file,reset,submit)
//-------------------------------------------------------------------
function getInputText(obj, delimiter) {
    var use_default = (arguments.length > 2) ? arguments[2] : false;
    if (isArray(obj) && (typeof (obj.type) == "undefined")) {
        var values = new Array();
        for (var i = 0; i < obj.length; i++) {
            var v = getSingleInputText(obj[i], use_default, delimiter);
            if (v != null) { values[values.length] = v; }
        }
        return commifyArray(values, delimiter);
    }
    return getSingleInputText(obj, use_default, delimiter);
}

//-------------------------------------------------------------------
// getInputDefaultValue(input_object[,delimiter])
//   Get the default value of any form input field when it was created
//   Multiple-select fields are returned as comma-separated values, or
//   delmited by the optional second argument
//   (Doesn't support input types: button,file,password,reset,submit)
//-------------------------------------------------------------------
function getInputDefaultValue(obj, delimiter) { return getInputValue(obj, delimiter, true); }

//-------------------------------------------------------------------
// isChanged(input_object)
//   Returns true if input object's value has changed since it was
//   created.
//-------------------------------------------------------------------
function isChanged(obj) { return (getInputValue(obj) != getInputDefaultValue(obj)); }

//-------------------------------------------------------------------
// setInputValue(obj,value)
//   Set the value of any form field. In cases where no matching value
//   is available (select, radio, etc) then no option will be selected
//   (Doesn't support input types: button,file,password,reset,submit)
//-------------------------------------------------------------------
function setInputValue(obj, value) {
    var use_default = (arguments.length > 1) ? arguments[1] : false;
    if (isArray(obj) && (typeof (obj.type) == "undefined")) {
        for (var i = 0; i < obj.length; i++) { setSingleInputValue(obj[i], value); }
    }
    else { setSingleInputValue(obj, value); }
}

//-------------------------------------------------------------------
// isFormModified(form_object,hidden_fields,ignore_fields)
//   Check to see if anything in a form has been changed. By default
//   it will check all visible form elements and ignore all hidden 
//   fields. 
//   You can pass a comma-separated list of field names to check in
//   addition to visible fields (for hiddens, etc).
//   You can also pass a comma-separated list of field names to be
//   ignored in the check.
//-------------------------------------------------------------------
function isFormModified(theform, hidden_fields, ignore_fields) {
    if (hidden_fields == null) { hidden_fields = ""; }
    if (ignore_fields == null) { ignore_fields = ""; }
    var hiddenFields = new Object();
    var ignoreFields = new Object();
    var i, field;
    var hidden_fields_array = hidden_fields.split(',');
    for (i = 0; i < hidden_fields_array.length; i++) {
        hiddenFields[Trim(hidden_fields_array[i])] = true;
    }
    var ignore_fields_array = ignore_fields.split(',');
    for (i = 0; i < ignore_fields_array.length; i++) {
        ignoreFields[Trim(ignore_fields_array[i])] = true;
    }
    for (i = 0; i < theform.elements.length; i++) {
        var changed = false;
        var name = theform.elements[i].name;
        if (!isBlank(name)) {
            var type = theform.elements[i].type;
            if (!ignoreFields[name]) {
                if (type == "hidden" && hiddenFields[name]) { changed = isChanged(theform[name]); }
                else if (type == "hidden") { changed = false; }
                else { changed = isChanged(theform[name]); }
            }
        }
        if (changed) { return true; }
    }
    return false;
}

function roundNum(val, dec) {
    var value = Math.round(val * Math.pow(10, dec)) / Math.pow(10, dec);
    return value;
}
	
