//----------------------------------------------------------
// Author: Wang Zhen [Kevin Wang]
// Dual Licenses: http://www.htmladdons.com/index.htm
// Version     Date               Log 
// 1.0.1        2010-10-03     Fixed bugs for IE9
// 1.0.0        2010-09-30     Released 
//----------------------------------------------------------
var WZjs=WZjs?WZjs:new Object();WZjs.Common=function(){var a=navigator.userAgent.toLowerCase();var k=navigator.appName.toUpperCase();var h=navigator.appVersion.toLowerCase();var i={isIE:a.indexOf("msie")!=-1,isFirefox:a.indexOf("firefox")!=-1,isOpera:a.indexOf("opera")!=-1,isIE6Plus:h.indexOf("msie 6")!=-1,isIE8:h.indexOf("msie 8")!=-1,isIE9:h.indexOf("msie 9")!=-1,isChrome:a.indexOf("chrome")!=-1,isStrict:document.compatMode=="CSS1Compat"};var m={overflow:["hidden","auto","scroll","visible","inherit"],animateSpeed:["fast","normal","slow","immediate"],size:["big","normal","small","none"]};function g(w,s,z){var y=new Array();if(s==null){s=document}if(z==null){z="*"}var u=s.getElementsByTagName(z);var r=u.length;var x=new RegExp("(^|\\\\s)"+w+"(\\\\s|$)");for(var v=0,t=0;v<r;v++){if(x.test(u[v].className)){y[t]=u[v];t++}}return y}function f(w,v,t,s){if(typeof(s)=="undefined"){s=true}if(w.addEventListener){w.addEventListener(v,t,s);return true}else{if(w.attachEvent){var u=w.attachEvent("on"+v,t);return u}else{w["on"+v]=t}}}function c(w,v,t,s){if(typeof(s)=="undefined"){s=true}if(w.removeEventListener){w.removeEventListener(v,t,s);return true}else{if(w.detachEvent){var u=w.detachEvent("on"+v,t);return u}else{w["on"+v]=null}}}function p(r){var s=window.onload;if(typeof window.onload!="function"){window.onload=r}else{window.onload=function(){s();r()}}}var o=function(){var s=document.documentElement;function v(){if(i.isChrome){return document.body.scrollLeft}if(i.isStrict){return document.body.parentNode.scrollLeft}else{return document.body.scrollLeft}}function u(){if(i.isChrome){return document.body.scrollTop}if(i.isStrict){return document.body.parentNode.scrollTop}else{return document.body.scrollTop}}function t(){if(i.isChrome){return document.body.scrollWidth}if(i.isStrict){return document.body.parentNode.scrollWidth}else{return document.body.scrollWidth}}function y(){if(i.isChrome){return document.body.scrollHeight}if(i.isStrict){return document.body.parentNode.scrollHeight}else{return document.body.scrollHeight}}function w(){return $(document.documentElement).innerWidth()}function r(){return $(document.documentElement).innerHeight()}function z(){return $(document.documentElement).outerWidth()}function x(){return $(document.documentElement).outerHeight()}return{Base:s,ScrollLeft:v,ScrollTop:u,ScrollWidth:t,ScrollHeight:y,InnerWidth:w,InnerHeight:r,OuterWidth:z,OuterHeight:x}}();var d={Percent:function(){function w(y){var x=/^(\d{0,2}(\.\d{0,2})?|100)%$/;return x.test(y)?true:false}function t(x){}function v(y){var x=new Number();x=(1/y).toFixed(4)*100;return x+"%"}function r(x,A,z){var y=NaN;if(w(x)){y=parseFloat(x.replace("%",""));isNaN(y)?y=0:y=y/A;y=y.toFixed(z)+"%"}return y}function u(z,y,A){var x=NaN;if(w(y)){y=parseFloat(y.substr(0,y.length-1))/100;x=(z*y).toFixed(A)}return x}function s(z,y){var x=NaN;if(w(y)){y=parseFloat(y.substr(0,y.length-1))/100;x=Math.floor(z*y)}return x}return{IsPer:w,CalPer:v,AvePer:r,MulPer:u,MulPerFlr:s}}(),Integer:function(){function v(w){return isNaN(w)?false:Math.round(w)==w?true:false}function u(w){return v(w)&&w>0?true:false}function r(w){return v(w)&&w<0?true:false}function t(w){return u(w)||w==0?true:false}function s(){var A=[],B=0;var y=arguments[0],x=arguments[1],w=Math.round(y/x);for(var z=0;z<x;z++){if(z==x-1){A[z]=y-B}else{if(B+w>y){A[z]=y-B}else{A[z]=w}}B+=A[z]}return A}return{IsInt:v,IsPositive:u,IsNegative:r,IsNonNeg:t,SplitInteger:s}}()};var q=function(){function r(v){if(document.cookie.length>0){c_start=document.cookie.indexOf(v+"=");if(c_start!=-1){c_start=c_start+v.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}function s(w,x,v){var y=new Date();y.setDate(y.getDate()+v);document.cookie=w+"="+escape(x)+((v==null)?"":";expires="+y.toGMTString())}function t(v){s(v,"",-1)}var u=function(){function v(y){var z={};if(q.Get(y)!=""){z=JSON.parse(q.Get(y))}return z}function w(z,A,y){if(typeof A==="object"){q.Set(z,JSON.stringify(A),y)}else{q.Set(z,A,y)}}function x(y){q.Remove(y)}return{Get:v,Set:w,Remove:x}}();return{Set:s,Get:r,Remove:t,JSON:u}}();var e=function(){var r=function(){return{isPx:function(s){var t=true;if(s.toLowerCase().indexOf("px")==-1){t=false}return t}}}();return{Test:r,pxToInt:function(s){s=String(s);return r.isPx(s)?parseInt(s.replace("px","")):isNaN(parseInt(s))?0:parseInt(s)},sizeToInt:function(t){var s=parseInt(t);if(isNaN(s)){switch(t.toLowerCase()){case"big":s=40;break;case"normal":s=25;break;case"small":s=15;break;case"none":s=0;break;default:s=25;break}}else{if(s<0){s=0}}return s},speedToInt:function(t){var s=parseInt(t);if(isNaN(s)){switch(t.toLowerCase()){case"fast":s=typeof jQuery!="undefined"?jQuery.fx.speeds.fast:200;break;case"normal":s=typeof jQuery!="undefined"?jQuery.fx.speeds._default:400;break;case"slow":s=typeof jQuery!="undefined"?jQuery.fx.speeds.slow:600;break;case"immediate":s=0;break;default:s=400;break}}else{if(s<0){s=0}}return s}}}();function l(r){var r=r?r:(window.event?window.event:null);return r.srcElement?r.srcElement:r.target}function b(t,r,s){while(t.indexOf(r)>=0){t=t.replace(r,s)}return t}function n(r){if(r.style.display!="none"){r.style.display="none"}else{r.style.display="block"}}function j(r){if(r.style.visibility!="hidden"){r.style.visibility="hidden"}else{r.style.visibility="visible"}}return{$C:g,$:function(){var t=new Array();for(var s=0;s<arguments.length;s++){var r=arguments[s];if(typeof r=="string"){r=document.getElementById(r)}if(arguments.length==1){return r}t.push(r)}return t},$N:function(r){return document.getElementsByName(r)},$T:function(r){return document.getElementsByTagName(r)},AddEvent:f,RemoveEvent:c,AddLoadEvent:p,Brw:i,Doc:o,SrcElement:l,Rpl:b,tglD:n,tglV:j,Maths:d,Cookies:q,Convert:e,KeyValDic:m,isEmptyObject:function(s){for(var r in s){return false}return true}}}();var $_Com=WZjs.Common;WZjs.CSS=function(){return{createWZSS:function(c){if(!$_Com.$(c)){var b=$_Com.$T("head")[0];var a=document.createElement("style");a.setAttribute("type","text/css");a.setAttribute("id",c);b.appendChild(a)}},getWZSS:function(a){},deleteWZSS:function(a){if($_Com.$(a)){$_Com.$(a).parentNode.removeChild($_Com.$(a))}},createWZSSLink:function(c,b){if(!$_Com.$(c)){var a=document.createElement("link");a.setAttribute("rel","stylesheet");a.setAttribute("type","text/css");a.setAttribute("id",c);a.setAttribute("href",b);$_Com.$T("head")[0].appendChild(a)}else{this.alterWZSSLink(c,b)}},deleteWZSSLink:function(a){deleteWZSS(a)},alterWZSSLink:function(b,a){if($_Com.$(b)){$_Com.$(b).setAttribute("href",a)}},addRule:function(e,a,d){if($_Com.$(e)){var c=$_Com.$(e).styleSheet?$_Com.$(e).styleSheet:($_Com.$(e).sheet||document.styleSheets[document.styleSheets.length-1]);if($_Com.Brw.isIE){c.addRule(a,d)}else{var b=a+" {"+d+"}";c.insertRule(b,c.cssRules.length)}}},alterRule:function(c,a,b){},deleteRule:function(b,a){},deleteRuleBySelector:function(b,a){},getRule:function(f,a){var b="";if($_Com.$(f)){var d=$_Com.$(f).styleSheet?$_Com.$(f).styleSheet:($_Com.$(f).sheet||document.styleSheets[document.styleSheets.length-1]);var e=$_Com.Brw.isIE?d.rules:d.cssRules;for(var c=0;c<e.length;c++){if(e[c].selectorText.toLowerCase()==a.toLowerCase()){b=e[c].style.cssText;break}}}return b},isSSExisting:function(a){var c=false,d=document.styleSheets;if(d){for(var b=0;b<d.length;b++){if(d[b].href.toLowerCase().indexOf(a.toLowerCase())!=-1){c=true;break}}}return c},getRuleStyle:function(c,b){var a=new Object(),g=document.styleSheets;if(g){for(var e=0;e<g.length;e++){if(g[e].href.toLowerCase().indexOf(c.toLowerCase())!=-1){var f=$_Com.Brw.isIE?g[e].rules:g[e].cssRules;for(var d=0;d<f.length;d++){if(f[d].selectorText.toLowerCase().indexOf(b.toLowerCase())!=-1){a=f[d].style}}}}}return a}}}();$_CSS=WZjs.CSS;WZjs.Collection=function(){var a=function(){var b={};if(typeof arguments[0]==="object"){b=arguments[0]}this.Instance=b;this.add=function(c,d){b[c]=d};this.remove=function(c){delete b[c]};this.clear=function(){};this.update=function(c,d){b[c]=d};this.getByKey=function(c){return b[c]};this.getByIndex=function(c){}};return{Dictionary:a}}();$_Clct=WZjs.Collection;if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
