﻿function chradio(id, checked) {
    if (checked)
        $("#" + id).attr("checked", "");
    else
        $("#" + id).attr("checked", "checked");
}
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function(a) { a.fn.marquee = function(c) { var e = [], f = this.length; function d(l, j, h) { var m = h.behavior, i = h.width, g = h.dir; var k = 0; if (m == "alternate") { k = l == 1 ? j[h.widthAxis] - (i * 2) : i } else { if (m == "slide") { if (l == -1) { k = g == -1 ? j[h.widthAxis] : i } else { k = g == -1 ? j[h.widthAxis] - (i * 2) : 0 } } else { k = l == -1 ? j[h.widthAxis] : 0 } } return k } function b() { var j = e.length, l = null, m = null, g = {}, h = [], k = false; while (j--) { l = e[j]; m = a(l); g = m.data("marqueeState"); if (m.data("paused") !== true) { l[g.axis] += (g.scrollamount * g.dir); k = g.dir == -1 ? l[g.axis] <= d(g.dir * -1, l, g) : l[g.axis] >= d(g.dir * -1, l, g); if ((g.behavior == "scroll" && g.last == l[g.axis]) || (g.behavior == "alternate" && k && g.last != -1) || (g.behavior == "slide" && k && g.last != -1)) { if (g.behavior == "alternate") { g.dir *= -1 } g.last = -1; m.trigger("stop"); g.loops--; if (g.loops === 0) { if (g.behavior != "slide") { l[g.axis] = d(g.dir, l, g) } else { l[g.axis] = d(g.dir * -1, l, g) } m.trigger("end") } else { h.push(l); m.trigger("start"); l[g.axis] = d(g.dir, l, g) } } else { h.push(l) } g.last = l[g.axis]; m.data("marqueeState", g) } else { h.push(l) } } e = h; if (e.length) { setTimeout(b, 25) } } this.each(function(m) { var g = a(this), h = g.attr("width") || g.width(), p = g.attr("height") || g.height(), k = g.after("<div " + (c ? 'class="' + c + '" ' : "") + 'style="display: block-inline; width: ' + h + "px; height: " + p + 'px; overflow: hidden;"><div style="float: left; white-space: nowrap;">' + g.html() + "</div></div>").next(), n = k.get(0), j = 0, l = (g.attr("direction") || "left").toLowerCase(), o = { dir: /down|right/.test(l) ? -1 : 1, axis: /left|right/.test(l) ? "scrollLeft" : "scrollTop", widthAxis: /left|right/.test(l) ? "scrollWidth" : "scrollHeight", last: -1, loops: g.attr("loop") || -1, scrollamount: g.attr("scrollamount") || this.scrollAmount || 2, behavior: (g.attr("behavior") || "scroll").toLowerCase(), width: /left|right/.test(l) ? h : p }; if (g.attr("loop") == -1 && o.behavior == "slide") { o.loops = 1 } g.remove(); if (/left|right/.test(l)) { k.find("> div").css("padding", "0 " + h + "px") } else { k.find("> div").css("padding", p + "px 0") } k.bind("stop", function() { k.data("paused", true) }).bind("pause", function() { k.data("paused", true) }).bind("start", function() { k.data("paused", false) }).bind("unpause", function() { k.data("paused", false) }).data("marqueeState", o); e.push(n); n[o.axis] = d(o.dir, n, o); k.trigger("start"); if (m + 1 == f) { b() } }); return a(e) } } (jQuery));

/*
* includeMany 1.2.2
* Copyright (c) 2009 Arash Karimzadeh (arashkarimzadeh.com)
* Licensed under the MIT (MIT-LICENSE.txt)
* http://www.opensource.org/licenses/mit-license.php
* Date: Dec 03 2009
*/
(function($) { $.chainclude = function(urls, finaly) { var onload = function(callback, data) { if (typeof urls.length != "undefined") { if (urls.length == 0) { return $.isFunction(finaly) ? finaly(data) : null } urls.shift(); return $.chainclude.load(urls, onload) } for (var item in urls) { urls[item](data); delete urls[item]; var count = 0; for (var i in urls) { count++ } return (count == 0) ? $.isFunction(finaly) ? finaly(data) : null : $.chainclude.load(urls, onload) } }; $.chainclude.load(urls, onload) }; $.chainclude.load = function(urls, onload) { if (typeof urls == "object" && typeof urls.length == "undefined") { for (var item in urls) { return $.include.load(item, onload, urls[item].callback) } } urls = $.makeArray(urls); $.include.load(urls[0], onload, null) }; $.include = function(urls, finaly) { var luid = $.include.luid++; var onload = function(callback, data) { if ($.isFunction(callback)) { callback(data) } if (--$.include.counter[luid] == 0 && $.isFunction(finaly)) { finaly() } }; if (typeof urls == "object" && typeof urls.length == "undefined") { $.include.counter[luid] = 0; for (var item in urls) { $.include.counter[luid]++ } return $.each(urls, function(url, callback) { $.include.load(url, onload, callback) }) } urls = $.makeArray(urls); $.include.counter[luid] = urls.length; $.each(urls, function() { $.include.load(this, onload, null) }) }; $.extend($.include, { luid: 0, counter: [], load: function(url, onload, callback) { url = url.toString(); if ($.include.exist(url)) { return onload(callback) } if (/.css$/.test(url)) { $.include.loadCSS(url, onload, callback) } else { if (/.js$/.test(url)) { $.include.loadJS(url, onload, callback) } else { $.get(url, function(data) { onload(callback, data) }) } } }, loadCSS: function(url, onload, callback) { var css = document.createElement("link"); css.setAttribute("type", "text/css"); css.setAttribute("rel", "stylesheet"); css.setAttribute("href", "" + url); $("head").get(0).appendChild(css); $.browser.msie ? $.include.IEonload(css, onload, callback) : onload(callback) }, loadJS: function(url, onload, callback) { var js = document.createElement("script"); js.setAttribute("type", "text/javascript"); js.setAttribute("src", "" + url); $.browser.msie ? $.include.IEonload(js, onload, callback) : js.onload = function() { onload(callback) }; $("head").get(0).appendChild(js) }, IEonload: function(elm, onload, callback) { elm.onreadystatechange = function() { if (this.readyState == "loaded" || this.readyState == "complete") { onload(callback) } } }, exist: function(url) { var fresh = false; $("head script").each(function() { if (/.css$/.test(url) && this.href == url) { return fresh = true } else { if (/.js$/.test(url) && this.src == url) { return fresh = true } } }); return fresh } }) })(jQuery);

/*
* jQuery JSON Plugin
* version: 2.1 (2009-08-14)
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
*
* Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 
* website's http://www.json.org/json2.js, which proclaims:
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
* I uphold.
*
* It is also influenced heavily by MochiKit's serializeJSON, which is 
* copyrighted 2005 by Bob Ippolito.
*/
(function($) { $.toJSON = function(o) { if (typeof (JSON) == "object" && JSON.stringify) { return JSON.stringify(o) } var type = typeof (o); if (o === null) { return "null" } if (type == "undefined") { return undefined } if (type == "number" || type == "boolean") { return o + "" } if (type == "string") { return $.quoteString(o) } if (type == "object") { if (typeof o.toJSON == "function") { return $.toJSON(o.toJSON()) } if (o.constructor === Date) { var month = o.getUTCMonth() + 1; if (month < 10) { month = "0" + month } var day = o.getUTCDate(); if (day < 10) { day = "0" + day } var year = o.getUTCFullYear(); var hours = o.getUTCHours(); if (hours < 10) { hours = "0" + hours } var minutes = o.getUTCMinutes(); if (minutes < 10) { minutes = "0" + minutes } var seconds = o.getUTCSeconds(); if (seconds < 10) { seconds = "0" + seconds } var milli = o.getUTCMilliseconds(); if (milli < 100) { milli = "0" + milli } if (milli < 10) { milli = "0" + milli } return '"' + year + "-" + month + "-" + day + "T" + hours + ":" + minutes + ":" + seconds + "." + milli + 'Z"' } if (o.constructor === Array) { var ret = []; for (var i = 0; i < o.length; i++) { ret.push($.toJSON(o[i]) || "null") } return "[" + ret.join(",") + "]" } var pairs = []; for (var k in o) { var name; var type = typeof k; if (type == "number") { name = '"' + k + '"' } else { if (type == "string") { name = $.quoteString(k) } else { continue } } if (typeof o[k] == "function") { continue } var val = $.toJSON(o[k]); pairs.push(name + ":" + val) } return "{" + pairs.join(", ") + "}" } }; $.evalJSON = function(src) { if (typeof (JSON) == "object" && JSON.parse) { return JSON.parse(src) } return eval("(" + src + ")") }; $.secureEvalJSON = function(src) { if (typeof (JSON) == "object" && JSON.parse) { return JSON.parse(src) } var filtered = src; filtered = filtered.replace(/\\["\\\/bfnrtu]/g, "@"); filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]"); filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, ""); if (/^[\],:{}\s]*$/.test(filtered)) { return eval("(" + src + ")") } else { throw new SyntaxError("Error parsing JSON, source is not valid.") } }; $.quoteString = function(string) { if (string.match(_escapeable)) { return '"' + string.replace(_escapeable, function(a) { var c = _meta[a]; if (typeof c === "string") { return c } c = a.charCodeAt(); return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16) }) + '"' } return '"' + string + '"' }; var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g; var _meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\"} })(jQuery);

// Tempest jQuery Templating Plugin
// ================================
/*Few examples:
* // Simple
* {% for (var i=0;i<100;i++) { %}
* <div id="{%= i %}"></div>
* {% } %}
* // With shorthands
* {%@ func(abc) { %}
* {%= abc %}
* {% } %}
* {% func("hello world!"); %}
* // Other features
* {%@ button(value) { %}
* {%= $('<button>'+value+'</button>').click(function() {
* alert(value);
* }) %}
* {% } %}
* {% button("text"); %}
* // Catch method
* {%catch var a %}hello world!{%/catch%}
* {%= a%}
* // Each method
* {%each city%}
* {%= this %}
* {%/each%}
* // Printing jQuery object
* {%= $('<button>click me</button>').click(function(){
* alert("Hello world!");
* }) %}
* Also this engine can have named templates and can easily call them from other templates (see demos).
* And my templates can have optional variables, so you won't see errors like: "undefined variable VALUE" (with some restrictions, of course).
* Some docs:
* tpl = $.template("..your template...", {predefined variables}, [optionally template name]);
* This example returns template object (which is a overloaded function).
* So you can call it:
* obj = tpl(); // Gets jQuery object as result
* Or without ability of printing jQuery objects:
* str = tpl.html(); // Gets string as result
* Or cached version:
* str = $.tpl("template name").html();
* obj = $.tpl("template name")();
* Also you can try this way:
* <script type="text/html" class="predefined-var1 ... predefined-varN" id="template">
* ..your template here..
* </script>
* <script type="text/javascript">
* var obj = $("#template").render(["template name"]).appendTo('body'); // This is jQuery object
* </script>
*/
"use strict"; (function(d) { var t = {}, J = /\{\{[\s]*?/g, B = /[\s]*?\}\}/g, v = /\{%[\s]*?/g, r = /[\s]*?%\}/g, G = new RegExp(J.source + "[\\w\\-\\.]+?" + B.source, "g"), w = new RegExp(v.source + "[\\w]+?(?:[ ]+?[\\w\\-\\.]*?)*?" + r.source, "g"), y = new RegExp(v.source + "end[\\w]*?" + r.source, "g"), o = { "for": { expectsEndTag: true, render: function(U) { var R = this.args, S = this.subNodes, Q = [], a, P, N, O, T, M; if (R.length === 3 && R[1] === "in") { P = R[0]; N = R[2]; O = f(N, U); for (a = 0; a < O.length; a++) { M = {}; M[P] = O[a]; M._index = a; T = d.extend(true, {}, U, M); d.each(S, function(V, W) { Q.push(W.render(T)) }) } return Q.join("") } else { throw new m("Bad for tag syntax. Use {% for <item> in <array> %}") } } }, "if": { expectsEndTag: true, render: function(M) { var N = [], a = this.subNodes; if (!!f(this.args[0], M)) { d.each(a, function(O, P) { N.push(P.render(M)) }) } return N.join("") } } }, I = { render: function(a) { return this.text || "" } }, j = { render: function(a) { var M = a[this.name] === undefined ? "" : a[this.name]; if (M === "" && this.name.search(/\./) !== -1) { return f(this.name, a) } return n(M) } }; function m(a) { if (!(this instanceof m)) { return new m(a) } this.message = a; return this } m.prototype = new SyntaxError(); m.prototype.name = "TemplateSyntaxError"; var q = (function() { if ("abc".split(/(b)/).length === 3) { return function(M, a) { return String.prototype.split.call(M, a) } } else { return function(N, S) { if (Object.prototype.toString.call(S) === "[object RegExp]") { var P = S.ignoreCase ? new RegExp(S.source, "gi") : new RegExp(S.source, "g"), O, Q = "", M = [], a, R = N.length; for (a = 0; a < R; a++) { Q += N.charAt(a); O = Q.match(P); if (O !== null && O.length > 0) { M.push(Q.replace(O[0], "")); M.push(O[0]); Q = "" } } if (Q !== "") { M.push(Q) } return M } else { return String.prototype.split.call(N, S) } } } } ()); function k(a) { return a.search(w) !== -1 } function F(a) { return a.search(y) !== -1 } function H(a) { return a.search(G) !== -1 } function L(a) { return a.replace(/^[\s]+/, "").replace(/[\s]+$/, "") } function n(a) { if (a instanceof d) { return h(a) } else { if (a !== null && !x(a) && typeof (a) === "object") { if (typeof (a.toHTML) === "function") { return n(a.toHTML()) } else { return a.toString() } } else { return a } } } function f(M, P) { var a = q(M, "."), O = P[a[0]], N; for (N = 1; N < a.length; N++) { if (O !== undefined) { O = O[a[N]] } else { return "" } } O = O === undefined ? "" : O; return n(O) } function h(a) { return d(document.createElement("div")).append(a).html() } function u(M) { if (M === undefined) { return M } var a = function() { }; a.prototype = M; return new a() } function D() { var a = []; d.each(t, function(M, N) { a.push([M, N]) }); return a } function g(a) { return typeof t[a] === "string" ? t[a] : a } function x(a) { return Object.prototype.toString.apply(a) === "[object Array]" } function l(M, a) { return x(M) ? d.each(M, a) : a(0, M) } function E(a) { return (function(M) { var N = []; for (i = 0; i < M.length; i++) { (function(O) { return O === "" ? null : N.push(O) } (M[i])) } return N } (q(a, new RegExp("(" + G.source + "|" + w.source + "|" + y.source + ")")))) } function e(a) { return a.slice(1) } function C(M, a) { return a.concat([M]) } function p(a) { var M = u(j); M.name = L(a.replace(J, "").replace(B, "")); return M } function z(a) { var M = u(I); M.text = a; return M } function A(a) { return (function(M, N) { var O = N[0]; return N.length === 0 ? [M, [], true] : F(O) ? [M, e(N)] : H(O) ? arguments.callee(C(p(O), M), e(N)) : k(O) ? c(M, N, arguments.callee) : arguments.callee(C(z(O), M), e(N)) } ([], a)) } function b(a) { return (function(N, M) { for (i = 0; i < M.length; i++) { (function(O) { return O === "" ? null : N.push(O) } (L(M[i]))) } return N } ([], q(a.replace(v, "").replace(r, ""), /[\s]+?/))) } function c(S, O, P) { var Q = b(O[0]), M = Q[0], R = e(Q), a = u(o[M]), N; if (a === undefined) { throw new m("Unknown Block Tag.") } a.args = R; O = e(O); if (a.expectsEndTag === true) { N = A(O); if (N[2] !== undefined) { throw new m("A block tag was expecting an ending tag but it was not found.") } a.subNodes = N[0]; O = N[1] } S = C(a, S); return P(S, O) } function K(M, N) { var a = g(M), O = []; l(N, function(R, S) { var P = A(E(a), S), Q = P[0]; if (P[1].length !== 0) { throw new m("An unexpected end tag was found.") } d.each(Q, function(T, U) { O.push(U.render(S)) }) }); return (function(P) { return P.charAt(0) === "<" ? d(P) : P } (L(O.join("")))) } d.extend({ tempest: function() { var a = arguments; if (a.length === 0) { return D() } else { if (a.length === 2 && typeof (a[0]) === "string" && typeof (a[1]) === "object") { return K(a[0], a[1]) } else { if (a.length === 1 && typeof (a[0]) === "string") { return t[a[0]] } else { if (a.length === 2 && typeof (a[0]) === "string" && typeof (a[1]) === "string") { t[a[0]] = a[1].replace(/^\s+/g, "").replace(/\s+$/g, "").replace(/[\n\r]+/g, ""); return t[a[0]] } else { throw new TypeError("jQuery.tempest can't handle the given arguments.") } } } } } }); d.fn.tempest = function() { var a = Array.prototype.slice.call(arguments, 0); var M = null; if (a.length == 2 && typeof a[0] == "string" && typeof a[1] == "object") { M = function() { d(this).html(d.tempest(a[0], a[1])) } } else { if (a.length == 3 && typeof a[0] == "string" && typeof a[1] == "string" && typeof a[2] == "object") { M = function() { d(this)[a[0]](d.tempest(a[1], a[2])) } } else { throw new TypeError(["jQuery(selector).tempest was passed the wrong number or type", "of arguments. Received " + a].join(" ")) } } return this.each(M) }; d.tempest.tags = o; if (window.testTempestPrivates === true) { d.tempest._test = {}; function s(M, a) { d.tempest._test[M] = a } s("isBlockTag", k); s("isEndTag", F); s("isVarTag", H); s("cleanVal", n); s("getValFromObj", f); s("jQueryToString", h); s("makeObj", u); s("storedTemplates", D); s("chooseTemplate", g); s("isArray", x); s("renderEach", l); s("tokenize", E); s("cdr", e); s("append", C); s("makeVarNode", p); s("makeTextNode", z); s("makeNodes", A); s("makeBits", b); s("makeBlockNode", c); s("renderToJQ", K); s("strip", L) } d(document).ready(function() { d(".tempest-template").each(function(a) { t[d(this).attr("title")] = L((d(this).val() || d(this).html()).replace(/[\n\r]+/g, " ")); d(this).remove() }) }) } (jQuery));

/* ===========================================================================
* JQuery URL Parser
* Version 1.0
* Parses URLs and provides easy access to information within them.
* Author: Mark Perkins
* Author email: mark@allmarkedup.com
* For full documentation and more go to http://projects.allmarkedup.com/jquery_url_parser/
* ---------------------------------------------------------------------------
* CREDITS:
* Parser based on the Regex-based URI parser by Steven Levithan.
* For more information (including a detailed explaination of the differences
* between the 'loose' and 'strict' pasing modes) visit http://blog.stevenlevithan.com/archives/parseuri
* ---------------------------------------------------------------------------
* LICENCE:
* Released under a MIT Licence. See licence.txt that should have been supplied with this file,
* or visit http://projects.allmarkedup.com/jquery_url_parser/licence.txt
* ---------------------------------------------------------------------------
* EXAMPLES OF USE:
* Get the domain name (host) from the current page URL
* jQuery.url.attr("host")
* Get the query string value for 'item' for the current page
* jQuery.url.param("item") // null if it doesn't exist
* Get the second segment of the URI of the current page
* jQuery.url.segment(2) // null if it doesn't exist
* Get the protocol of a manually passed in URL
* jQuery.url.setUrl("http://allmarkedup.com/").attr("protocol") // returns 'http'
*/
jQuery.url = function() { var segments = {}; var parsed = {}; var options = { url: window.location, strictMode: false, key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/} }; var parseUri = function() { str = decodeURI(options.url); var m = options.parser[options.strictMode ? "strict" : "loose"].exec(str); var uri = {}; var i = 14; while (i--) { uri[options.key[i]] = m[i] || "" } uri[options.q.name] = {}; uri[options.key[12]].replace(options.q.parser, function($0, $1, $2) { if ($1) { uri[options.q.name][$1] = $2 } }); return uri }; var key = function(key) { if (!parsed.length) { setUp() } if (key == "base") { if (parsed.port !== null && parsed.port !== "") { return parsed.protocol + "://" + parsed.host + ":" + parsed.port + "/" } else { return parsed.protocol + "://" + parsed.host + "/" } } return (parsed[key] === "") ? null : parsed[key] }; var param = function(item) { if (!parsed.length) { setUp() } return (parsed.queryKey[item] === null) ? null : parsed.queryKey[item] }; var setUp = function() { parsed = parseUri(); getSegments() }; var getSegments = function() { var p = parsed.path; segments = []; segments = parsed.path.length == 1 ? {} : (p.charAt(p.length - 1) == "/" ? p.substring(1, p.length - 1) : path = p.substring(1)).split("/") }; return { setMode: function(mode) { strictMode = mode == "strict" ? true : false; return this }, setUrl: function(newUri) { options.url = newUri === undefined ? window.location : newUri; setUp(); return this }, segment: function(pos) { if (!parsed.length) { setUp() } if (pos === undefined) { return segments.length } return (segments[pos] === "" || segments[pos] === undefined) ? null : segments[pos] }, attr: key, param: param} } ();

/*
* jsHeartbeat by losingrose
*/
$.jheartbeat = {
    options: {
        url: "heartbeat_default.asp",
        delay: 10000,
        dataType: "html",
        type: "POST",
        div_id: "beat_div"
    },
    beatfunction: function(data) { $("#" + this.options.div_id).html(data); },
    running:false,
    timeoutobj: {
        id: -1
    },
    set: function(options, onbeatfunction) {
        if (this.timeoutobj.id > -1) {
            clearTimeout(this.timeoutobj);
        }
        if (options) {
            $.extend(this.options, options);
        }
        if (onbeatfunction) {
            this.beatfunction = onbeatfunction;
        }
        this.running = true;
        // Add the HeartBeatDIV to the page
        $("body").append("<div id=\"" + this.options.div_id + "\" style=\"display: none;\"></div>");
        this.beat();
    },
    beat: function() {
        if(this.running){
            $.ajax({
                url: this.options.url,
                dataType: this.options.dataType,
                type: this.options.type,
                error: function(e) {
                    return;
                    alert("Error Requesting Data" + e);
                },
                success: function(data) {
                    $.jheartbeat.beatfunction(data);
                }
            });
            this.timeoutobj.id = setTimeout("$.jheartbeat.beat();", this.options.delay);
        }
    },
    stop: function() {
        this.running = false;
        if (this.timeoutobj.id > -1) {
            clearTimeout(this.timeoutobj);
        }
    }
};
function formatJSONDate(jsonDate) {
    var date = new Date(parseInt(jsonDate.replace("/Date(", "").replace(")/", ""), 10));
    return dateFormat(date, "yyyy年mm月dd日");
 }

var serverUrl = "http://www.shenghuohui.com";
//异步加载脚本开始
try {
$.include(
    {
        "/base/Script/jquery/jquery.cookie.js": null,
        "/base/Script/jquery/jquery-jtemplates.js":null,
        "/base/style/smoothness/jquery-ui-1.8.custom.css": null,
        "/base/Script/jquery-ui.js": null,
        "/base/Script/shhjs/command.js":null
    }
);
}catch(er){alert("脚本加载异常，将有部分功能无法正常使用。")}
//异步加载脚本结束

function getiframe(url, w, h) {
    w = w || 0;
    h=h||0;
    $("body").append($("<iframe src='"+url+"' width='"+w+"' height='"+h+"' frameborder='0'></iframe>"));
}

//获取AjaxTools控件，eid定义层id，position位置数组，path接口页面名称，code配置中的控件代码，mode是否使用jqueryUI的对话框
$.getAjaxTools = function(eid, position, path, code, mode) {
    if (mode == false) {
        var element = $("<div id=\"dg_" + eid + "\"></div>")
        .hide()
        .css("position", "absolute")
        .appendTo(document.body);
        function OnSuccess(result) {
            if (result != null) {
                element.html(result);
            }
        }
        $.ajax({
            type: "Post",
            async: true,
            url: '/base/ajaxtools/' + path + '.ashx?code=' + code + '&eid=dg_' + eid,
            dataType: "html",
            success: OnSuccess
        });
        if (typeof (position) == "object") {
            var offset = $("#" + eid).offset();
            var offLeft = position[0];
            var offHeight = position[1];
            element.css({
                top: offset.top + offHeight,
                left: offset.left + offLeft
            }).show();
        }
        else {

        }
    }
    else {
        $('<div>').dialog({
            dialogClass: 'alert',
            modal: true,
            open: function() {
                $(this).load('/base/ajaxtools/' + path + '.ashx?code=' + code + '&eid=dg_' + eid);
            },
            height: 400,
            width: 600,
            title: ''
        });
    }
}
/**
* Copyright (c) 2009 Sergiy Kovalchuk (serg472@gmail.com)
* 
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*  
* Following code is based on Element.mask() implementation from ExtJS framework (http://extjs.com/)
*
*/
; (function($) {

    /**
    * Displays loading mask over selected element(s). Accepts both single and multiple selectors.
    *
    * @param label Text message that will be displayed on top of the mask besides a spinner (optional). 
    *                              If not provided only mask will be displayed without a label or a spinner.       
    * @param delay Delay in milliseconds before element is masked (optional). If unmask() is called 
    *              before the delay times out, no mask is displayed. This can be used to prevent unnecessary 
    *              mask display for quick processes.       
    */
    $.fn.mask = function(label, delay) {
        $(this).each(function() {
            if (delay !== undefined && delay > 0) {
                var element = $(this);
                element.data("_mask_timeout", setTimeout(function() { $.maskElement(element, label) }, delay));
            } else {
                $.maskElement($(this), label);
            }
        });
    };

    /**
    * Removes mask from the element(s). Accepts both single and multiple selectors.
    */
    $.fn.unmask = function() {
        $(this).each(function() {
            $.unmaskElement($(this));
        });
    };

    /**
    * Checks if a single element is masked. Returns false if mask is delayed or not displayed. 
    */
    $.fn.isMasked = function() {
        return this.hasClass("masked");
    };

    $.fn.center = function() {
        return this.each(function() {
            var top = ($(window).height() - $(this).outerHeight()) / 2;
            var left = ($(window).width() - $(this).outerWidth()) / 2;
            $(this).css({ position: 'absolute', margin: 0, top: (top > 0 ? top : 0) + 'px', left: (left > 0 ? left : 0) + 'px' });
        });
    }

    $.maskElement = function(element, label) {

        //if this element has delayed mask scheduled then remove it and display the new one
        if (element.data("_mask_timeout") !== undefined) {
            clearTimeout(element.data("_mask_timeout"));
            element.removeData("_mask_timeout");
        }

        if (element.isMasked()) {
            $.unmaskElement(element);
        }

        if (element.css("position") == "static") {
            element.addClass("masked-relative");
        }

        element.addClass("masked");

        var maskDivContainer = $('<div class="ui-overlay"></div>');
        var maskDiv = $('<div class="ui-widget-overlay"></div>');

        //auto height fix for IE
        if (navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
            maskDiv.height(element.height() + parseInt(element.css("padding-top")) + parseInt(element.css("padding-bottom")));
            maskDiv.width(element.width() + parseInt(element.css("padding-left")) + parseInt(element.css("padding-right")));
        }

        //fix for z-index bug with selects in IE6
        if (navigator.userAgent.toLowerCase().indexOf("msie 6") > -1) {
            element.find("select").addClass("masked-hidden");
        }

        maskDivContainer.append(maskDiv);

        element.append(maskDivContainer);

        if (label !== undefined) {
            var maskMsgDiv = $('<div class="ui-widget ui-widget-content ui-corner-all" style="display:none;position:absolute;"></div>');
            var maskShadow = $('<div class="ui-widget-shadow ui-corner-all" style="display:none;position:absolute;"></div>');
            maskDivContainer.append(maskShadow);

            maskMsgDiv.css("padding", "10px");
            //position: absolute; width: 280px; height: 130px; left: 50px; top: 30px; padding: 10px;
            if (typeof label == 'string') {
                maskMsgDiv.append('<div class=\"ui-overlay-loading\">' + label + '</div>');
            } else {
                maskMsgDiv.append($(label));
            }

            element.append(maskMsgDiv);

            //calculate center position
            //var top = Math.round(element.height() / 2 - (maskMsgDiv.height() - parseInt(maskMsgDiv.css("padding-top")) - parseInt(maskMsgDiv.css("padding-bottom"))) / 2);
            //var left = Math.round(element.width() / 2 - (maskMsgDiv.width() - parseInt(maskMsgDiv.css("padding-left")) - parseInt(maskMsgDiv.css("padding-right"))) / 2);
            var top = ($(element).height() - $(maskMsgDiv).outerHeight()) / 2;
            var left = ($(element).width() - $(maskMsgDiv).outerWidth()) / 2;
            maskMsgDiv.css("top", top + "px");
            maskMsgDiv.css("left", left + "px");

            maskShadow.css("top", top + "px");
            maskShadow.css("left", left + "px");
            maskShadow.css("width", (maskMsgDiv.width() + 22) + "px");
            maskShadow.css("height", (maskMsgDiv.height() + 22) + "px");

            maskShadow.show();
            maskMsgDiv.show();
        }

    };

    $.unmaskElement = function(element) {
        //if this element has delayed mask scheduled then remove it
        if (element.data("_mask_timeout") !== undefined) {
            clearTimeout(element.data("_mask_timeout"));
            element.removeData("_mask_timeout");
        }

        element.find(".ui-widget.ui-widget-content.ui-corner-all,.ui-overlay").remove();
        element.removeClass("masked");
        element.removeClass("masked-relative");
        element.find("select").removeClass("masked-hidden");
    };

})(jQuery);

; (function($) {
    $.fn.enterKey = function(message, fid, eventHandler) {
        $(this).keypress(function(event) {
            if (event.which == '13') {
                if (message !== undefined && message != "") {
                    alert(message);
                }
                if (fid !== undefined && fid != "") {
                    $("#" + fid).focus();
                }
                if (eventHandler !== undefined) {
                    eventHandler();
                }
            }
        });
    }
})(jQuery);
