/* Copyright (c) 2010.  Ken Schutte. */
if(!this.JSON)this.JSON={};
(function(){function k(a){return a<10?"0"+a:a}function f(a){p.lastIndex=0;return p.test(a)?'"'+a.replace(p,function(d){var e=q[d];return typeof e==="string"?e:"\\u"+("0000"+d.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(a,d){var e,j,n=h,i,c=d[a];if(c&&typeof c==="object"&&typeof c.toJSON==="function")c=c.toJSON(a);if(typeof o==="function")c=o.call(d,a,c);switch(typeof c){case "string":return f(c);case "number":return isFinite(c)?String(c):"null";case "boolean":case "null":return String(c);case "object":if(!c)return"null";
h+=g;i=[];if(Object.prototype.toString.apply(c)==="[object Array]"){j=c.length;for(a=0;a<j;a+=1)i[a]=b(a,c)||"null";d=i.length===0?"[]":h?"[\n"+h+i.join(",\n"+h)+"\n"+n+"]":"["+i.join(",")+"]";h=n;return d}if(o&&typeof o==="object"){j=o.length;for(a=0;a<j;a+=1){e=o[a];if(typeof e==="string")if(d=b(e,c))i.push(f(e)+(h?": ":":")+d)}}else for(e in c)if(Object.hasOwnProperty.call(c,e))if(d=b(e,c))i.push(f(e)+(h?": ":":")+d);d=i.length===0?"{}":h?"{\n"+h+i.join(",\n"+h)+"\n"+n+"}":"{"+i.join(",")+"}";
h=n;return d}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var l=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,g,q={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o;if(typeof JSON.stringify!=="function")JSON.stringify=function(a,d,e){var j;g=h="";if(typeof e==="number")for(j=0;j<e;j+=1)g+=" ";else if(typeof e==="string")g=e;if((o=d)&&typeof d!=="function"&&(typeof d!=="object"||typeof d.length!=="number"))throw new Error("JSON.stringify");return b("",
{"":a})};if(typeof JSON.parse!=="function")JSON.parse=function(a,d){function e(j,n){var i,c,m=j[n];if(m&&typeof m==="object")for(i in m)if(Object.hasOwnProperty.call(m,i)){c=e(m,i);if(c!==undefined)m[i]=c;else delete m[i]}return d.call(j,n,m)}l.lastIndex=0;if(l.test(a))a=a.replace(l,function(j){return"\\u"+("0000"+j.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){a=eval("("+a+")");return typeof d==="function"?e({"":a},""):a}throw new SyntaxError("JSON.parse");}})();if(typeof exports!="undefined")exports.JSON=JSON;
(function(k){var f=[];k.Watermark={ShowAll:function(){for(var b=0;b<f.length;b++)if(f[b].obj.val()==""){f[b].obj.val(f[b].text);f[b].obj.css("color",f[b].WatermarkColor)}else f[b].obj.css("color",f[b].DefaultColor)},HideAll:function(){for(var b=0;b<f.length;b++)f[b].obj.val()==f[b].text&&f[b].obj.val("")}};k.fn.Watermark=function(b,l){l||(l="#aaa");return this.each(function(){function p(){g.val()==b&&g.val("");g.css("color",q)}function h(){if(g.val().length==0||g.val()==b){g.val(b);g.css("color",
l)}else g.css("color",q)}var g=k(this),q=g.css("color");f[f.length]={text:b,obj:g,DefaultColor:q,WatermarkColor:l};g.focus(p);g.blur(h);g.change(h);h()})}})(jQuery);
