/**
 * This file merge by QZFL Merge GUI. By QZONE Web group.
 * Copyright Tencent 2008. 
*/


if(typeof(QZONE)=="undefined"||!QZONE){var QZONE={version:"1.3"};}
QZONE.userAgent=(function(){var vie,vff,vopera,vsf,vapple,wintype,mactype,vair,vchrome;var discerned=false;var agent=(/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel|Minefield).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/).exec(navigator.userAgent);var os=(/(Windows.*?;)|(Mac OS X.*?;)/).exec(navigator.userAgent);if(agent){vie=agent[1]?parseFloat(agent[1]):NaN;vff=agent[2]?parseFloat(agent[2]):NaN;vopera=agent[3]?parseFloat(agent[3]):NaN;vsf=agent[4]?parseFloat(agent[4]):NaN;if(!isNaN(vsf)){var _ua=navigator.userAgent;if(/AdobeAIR/.test(_ua)){vair=1;}else if(/Chrome/.test(_ua)){vchrome=1;}else{vapple=parseFloat((/Version\/(\d+(?:\.\d+)?)/).exec(_ua)[1]);}}}else{vie=vff=vopera=vsf=vapple=vair=NaN;}
if(os){wintype=!!os[1];mactype=!!os[2];}else{wintype=mactype=false;}
function adjustBehaviors(){if(ua.ie<7){try{document.execCommand('BackgroundImageCache',false,true);}catch(ignored){}}
adjusted=true;}
return{firefox:vff,ie:window.XDomainRequest?8:vie,opera:vopera,air:vair,safari:vsf,safariV:vapple,windows:wintype,macs:mactype,chrome:vchrome,adjustBehaviors:adjustBehaviors};})();QZONE.namespace={map:function(namespace){if(QZONE.lang.isHashMap(namespace)){for(var k in namespace){window[k]=namespace[k];}}}};QZONE.emptyFn=function(){};QZONE.widget={};var ua=QZONE.userAgent;
QZONE.event={KEYS:{BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},extendType:/(click|mousedown|mouseover|mouseout|mouseup|mousemove|scroll|contextmenu)/i,addEvent:function(obj,eventType,fn,argArray){var cfn=fn;var res=false;if(!obj){return res;}
if(!obj.eventsList){obj.eventsList={};}
if(!obj.eventsList[eventType]){obj.eventsList[eventType]={};}
if(QZONE.event.extendType.test(eventType)){argArray=argArray||[];cfn=function(e){return fn.apply(null,([QZONE.event.getEvent(e)]).concat(argArray));};}
if(obj.addEventListener){obj.addEventListener(eventType,cfn,false);res=true;}else if(obj.attachEvent){res=obj.attachEvent("on"+eventType,cfn);}else{res=false;}
if(res){obj.eventsList[eventType][fn.toString()]=cfn;}
return res;},removeEvent:function(obj,eventType,fn){var cfn=fn;var res=false;if(!obj){return res;}
if(!obj.eventsList){obj.eventsList={};}
if(!obj.eventsList[eventType]){obj.eventsList[eventType]={};}
if(!cfn){res=QZONE.event.purgeEvent(obj,eventType);return res;}
if(QZONE.event.extendType.test(eventType)&&obj.eventsList[eventType]&&obj.eventsList[eventType][fn.toString()]){cfn=obj.eventsList[eventType][fn.toString()];}
if(obj.removeEventListener){obj.removeEventListener(eventType,cfn,false);res=true;}else if(obj.detachEvent){res=obj.detachEvent("on"+eventType,cfn);}else{alert("Error.");}
if(res&&obj.eventsList[eventType]){delete obj.eventsList[eventType][fn.toString()];}
return res;},purgeEvent:function(obj,type){if(obj.eventsList&&obj.eventsList[type]){for(var i in obj.eventsList[type]){if(obj.removeEventListener){obj.removeEventListener(type,obj.eventsList[type][i],false);}else if(obj.detachEvent){obj.detachEvent('on'+type,obj.eventsList[type][i]);}}}
if(obj['on'+type]){obj['on'+type]=null;}},getEvent:function(evt){evt=evt||window.event;if(!evt&&!QZONE.userAgent.ie){var c=this.getEvent.caller;while(c){evt=c.arguments[0];if(evt&&Event==evt.constructor){break;}
c=c.caller;}}
return evt;},getButton:function(evt){var e=QZONE.event.getEvent(evt);if(!e){return-1}
if(QZONE.userAgent.ie){return e.button-Math.ceil(e.button/2);}else{return e.button;}},getTarget:function(evt){var e=QZONE.event.getEvent(evt);if(e){return e.target||e.srcElement;}else{return null;}},getCurrentTarget:function(evt){var e=QZONE.event.getEvent(evt);if(e){return e.currentTarget||document.activeElement;}else{return null;}},cancelBubble:function(evt){evt=QZONE.event.getEvent();if(!evt){return false}
if(evt.stopPropagation){evt.stopPropagation();}else{if(!evt.cancelBubble){evt.cancelBubble=true;}}},preventDefault:function(evt){evt=QZONE.event.getEvent();if(!evt){return false}
if(evt.preventDefault){evt.preventDefault();}else{evt.returnValue=false;}},mouseX:function(evt){evt=QZONE.event.getEvent();return evt.pageX||(evt.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},mouseY:function(evt){evt=QZONE.event.getEvent();return evt.pageY||(evt.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return t;},bind:function(obj,method){var args=Array.prototype.slice.apply(arguments,[2,arguments.length]);return function(){var _obj=obj||this;var _args=args.slice();for(var jj=0;jj<arguments.length;jj++){_args.push(arguments[jj]);}
if(typeof(method)=="string"){if(_obj[method]){return _obj[method].apply(_obj,_args);}}else{return method.apply(_obj,_args);}}}};QZONE.event.on=QZONE.event.addEvent;var addEvent=QZONE.event.addEvent;var removeEvent=QZONE.event.removeEvent;var getEvent=QZONE.event.getEvent;
QZONE.dom={getById:function(id){return document.getElementById(id);},getByName:function(name,tagName){if(!tagName)
return document.getElementsByName(name);var arr=[];var e=document.getElementsByTagName(tagName);for(var i=0;i<e.length;++i){if(!!e[i].getAttribute("name")&&(e[i].getAttribute("name").toLowerCase()==name.toLowerCase())){arr.push(e[i]);}}
return arr;},get:function(e){if(e&&(e.tagName||e.item)){return e;}
return this.getById(e);},removeElement:function(el){if(!el){return;}
if(el.removeNode){el.removeNode(true);}else{if(el.childNodes.length>0){for(var ii=el.childNodes.length-1;ii>=0;ii--){QZONE.dom.removeElement(el.childNodes[ii]);}}
el.parentNode.removeChild(el);}
el=null;return null;},searchElementByClassName:function(el,className){el=this.get(el);if(!el){return null}
var re=QZONE.css.getClassRegEx(className);while(el){if(re.test(el.className)){return el;}
el=el.parentNode;}
return null;},getElementsByClassName:function(className,tag,root){tag=tag||'*';root=(root)?this.get(root):null||document;if(!root){return[];}
var nodes=[],elements=root.getElementsByTagName(tag),re=QZONE.css.getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];}}
return nodes;},isAncestor:function(node1,node2){if(!node1||!node2){return false;}
if(node1.contains&&node2.nodeType&&!QZONE.userAgent.Safari){return node1.contains(node2)&&node1!=node2;}
if(node1.compareDocumentPosition&&node2.nodeType){return!!(node1.compareDocumentPosition(node2)&16);}else if(node2.nodeType){return!!this.getAncestorBy(node2,function(el){return el==node1;});}
return false;},getAncestorBy:function(node,method){while(node=node.parentNode){if(node&&node.nodeType==1&&(!method||method(node))){return node;}}
return null;},getFirstChild:function(node){node=this.get(node);if(!node){return null;}
var child=QZONE.lang.isElement(node)?node.firstChild:null;return child||this.getNextSibling(node.firstChild);},getNextSibling:function(node){node=this.get(node);if(!node){return null;}
while(node){node=node.nextSibling;if(QZONE.lang.isElement(node)){return node;}}
return null;},createElementIn:function(tagName,el,insertFirst,attributes){tagName=tagName||"div";el=this.get(el)||document.body;var _doc=el.ownerDocument;var _e=_doc.createElement(tagName);if(attributes){for(var k in attributes){if(/class/.test(k)){_e.className=attributes[k];}else if(/style/.test(k)){_e.style.cssText=attributes[k];}else{_e[k]=attributes[k];}}}
if(insertFirst){el.insertBefore(_e,el.firstChild);}else{el.appendChild(_e);}
return _e;},getStyle:function(el,property){el=this.get(el);var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;var computed=!w3cMode?null:document.defaultView.getComputedStyle(el,'');var value="";switch(property){case"float":property=w3cMode?"cssFloat":"styleFloat";break;case"opacity":if(!w3cMode){var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
return val/100;}
break;case"backgroundPositionX":if(w3cMode){property="backgroundPosition";return((computed||el.style)[property]).split(" ")[0];}
break;case"backgroundPositionY":if(w3cMode){property="backgroundPosition";return((computed||el.style)[property]).split(" ")[1];}
break;}
if(w3cMode){return(computed||el.style)[property];}else{return(el.currentStyle[property]||el.style[property]);}},setStyle:function(el,property,value){el=this.get(el);if(!el){return false;}
var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;switch(property){case"float":property=w3cMode?"cssFloat":"styleFloat";case"opacity":if(!w3cMode){if(value>=1){el.style.filter="";return;}
el.style.filter='alpha(opacity='+(value*100)+')';return true;}else{el.style[property]=value;return true;}
break;case"backgroundPositionX":if(w3cMode){var _y=QZONE.dom.getStyle(el,"backgroundPositionY");el.style["backgroundPosition"]=value+" "+(_y||"top");}else{el.style[property]=value;}
break;case"backgroundPositionY":if(w3cMode){var _x=QZONE.dom.getStyle(el,"backgroundPositionX");el.style["backgroundPosition"]=(_x||"left")+" "+value;}else{el.style[property]=value;}
break;default:if(typeof el.style[property]=="undefined"){return false}
el.style[property]=value;return true;}},createNamedElement:function(type,name,doc){doc=doc||document;var element;try{element=doc.createElement('<'+type+' name="'+name+'">');}catch(ignore){}
if(!element||!element.name){element=doc.createElement(type);element.name=name;}
return element;},getPosition:function(el){var xy=QZONE.dom.getXY(el);var size=QZONE.dom.getSize(el);return{"top":xy[1],"left":xy[0],"width":size[0],"height":size[1]};},setPosition:function(el,pos){QZONE.dom.setXY(el,pos['left'],pos['top']);QZONE.dom.setSize(el,pos['width'],pos['height']);},getXY:function(el){var _t=0;var _l=0;if(document.documentElement.getBoundingClientRect){var box=el.getBoundingClientRect();var oDoc=el.ownerDocument;_t=box.top-2+this.getScrollTop(oDoc);_l=box.left-2+this.getScrollLeft(oDoc);}else{while(el.offsetParent){_t+=el.offsetTop;_l+=el.offsetLeft;el=el.offsetParent;}}
return[_l,_t];},getSize:function(el){var _w=el.offsetWidth;var _h=el.offsetHeight;return[_w,_h];},setXY:function(el,x,y){el=this.get(el);var _ml=parseInt(this.getStyle(el,"marginLeft"))||0;var _mt=parseInt(this.getStyle(el,"marginTop"))||0;this.setStyle(el,"left",parseInt(x)-_ml+"px");this.setStyle(el,"top",parseInt(y)-_mt+"px");},getScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},getScrollHeight:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollHeight,doc.body.scrollHeight);},getScrollWidth:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollWidth,doc.body.scrollWidth);},setScrollLeft:function(value,doc){doc=doc||document;doc[doc.compatMode=="CSS1Compat"&&!QZONE.userAgent.safari?"documentElement":"body"].scrollLeft=value;},setScrollTop:function(value,doc){doc=doc||document;doc[doc.compatMode=="CSS1Compat"&&!QZONE.userAgent.safari?"documentElement":"body"].scrollTop=value;},getClientHeight:function(doc){doc=doc||document;return doc.compatMode=="CSS1Compat"?doc.documentElement.clientHeight:doc.body.clientHeight;},getClientWidth:function(doc){doc=doc||document;return doc.compatMode=="CSS1Compat"?doc.documentElement.clientWidth:doc.body.clientWidth;},setSize:function(el,width,height){el=this.get(el);var _wFix=/\d+([a-z%]+)/i.exec(width);_wFix=_wFix?_wFix[1]:"";var _hFix=/\d+([a-z%]+)/i.exec(height);_hFix=_hFix?_hFix[1]:"";this.setStyle(el,"width",(!width||width<0||/auto/i.test(width))?"auto":(parseInt(width)+(_wFix||"px")));this.setStyle(el,"height",(!height||height<0||/auto/i.test(height))?"auto":(parseInt(height)+(_hFix||"px")));},getDocumentWindow:function(doc){_doc=doc||document;return _doc.parentWindow||_doc.defaultView;},XMLselectSingleNode:function(o,xpath){var x=QZONE.dom.XMLselectNodes(o,xpath)
if(!x||x.length<1)
return null;return x[0];},XMLselectNodes:function(o,xpath){var xpe=new XPathEvaluator();var nsResolver=xpe.createNSResolver(o.ownerDocument==null?o.documentElement:o.ownerDocument.documentElement);var result=xpe.evaluate(xpath,o,nsResolver,0,null);var found=[];var res;while(res=result.iterateNext()){found.push(res);}
return found;}};var _CN=QZONE.dom.createNamedElement;var $=QZONE.dom.getById;var removeNode=QZONE.dom.removeElement;
QZONE.css={getClassRegEx:function(className){var re=QZONE.css.classNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');QZONE.css.classNameCache[className]=re;}
return re;},convertHexColor:function(color){color=/^#/.test(color)?color.substr(1):color;var reColor=new RegExp("\\w{2}","ig");color=color.match(reColor);if(!color||color.length<3){return[0,0,0]}
var r=parseInt(color[0],16);var g=parseInt(color[1],16);var b=parseInt(color[2],16);return[r,g,b];},styleSheets:{},getStyleSheetById:function(id){try{return QZONE.dom.get(id).sheet||document.styleSheets[id];}catch(e){return null}},getRulesBySheet:function(sheetId){var ss=QZONE.css.getStyleSheetById(sheetId);if(ss){try{return ss.cssRules||ss.rules;}catch(e){return null}}else{return null}},getRuleBySelector:function(sheetId,selector){var _ss=this.getStyleSheetById(sheetId);if(!_ss.cacheSelector){_ss.cacheSelector={}};if(_ss){var _rs=_ss.cssRules||_ss.rules;var re=new RegExp('^'+selector+'$',"i");var _cs=_ss.cacheSelector[selector];if(_cs&&re.test(_rs[_cs].selectorText)){return _rs[_cs];}else{for(var i=0;i<_rs.length;i++){if(re.test(_rs[i].selectorText)){_ss.cacheSelector[selector]=i;return _rs[i];}}
return null;}}else{return null;}},insertCSSLink:function(url){var cssLink=document.createElement("link");cssLink.rel="stylesheet";cssLink.rev="stylesheet";cssLink.type="text/css";cssLink.media="screen";cssLink.href=url;document.getElementsByTagName("head")[0].appendChild(cssLink);return cssLink.sheet||cssLink;},insertStyleSheet:function(sheetId){var ss=document.createElement("style");ss.id=sheetId;document.getElementsByTagName("head")[0].appendChild(cssLink);return cssLink.sheet||cssLink;},removeStyleSheet:function(id){var _ss=this.getStyleSheetById(id);if(_ss){var own=_ss.owningElement||_ss.ownerNode;QZONE.dom.removeElement(own);}},hasClassName:function(elem,cname){return(elem&&cname)?new RegExp('\\b'+trim(cname)+'\\b').test(elem.className):false;},swapClassName:function(elements,class1,class2){function _swap(el,c1,c2){if(QZONE.css.hasClassName(el,c1)){el.className=el.className.replace(c1,c2);}else if(QZONE.css.hasClassName(el,c2)){el.className=el.className.replace(c2,c1);}}
if(elements.constructor!=Array){elements=[elements];}
for(var i=0,len=elements.length;i<len;i++){_swap(elements[i],class1,class2);}},replaceClassName:function(elements,sourceClass,targetClass){function _replace(el,c1,c2){if(QZONE.css.hasClassName(el,c1)){el.className=el.className.replace(c1,c2);}}
if(elements.constructor!=Array){elements=[elements];}
for(var i=0,len=elements.length;i<len;i++){_replace(elements[i],sourceClass,targetClass);}},addClassName:function(elem,cname){if(elem&&cname){if(elem.className){if(QZONE.css.hasClassName(elem,cname)){return false;}else{elem.className+=' '+trim(cname);return true;}}else{elem.className=cname;return true;}}else{return false;}},removeClassName:function(elem,cname){if(elem&&cname&&elem.className){var old=elem.className;elem.className=trim(elem.className.replace(new RegExp('\\b'+trim(cname)+'\\b'),''));return elem.className!=old;}else{return false;}},toggleClassName:function(elem,cname){var r=QZONE.css;if(r.hasClassName(elem,cname)){r.removeClassName(elem,cname);}else{r.addClassName(elem,cname);}}}
QZONE.css.classNameCache={};
function copyToClip(text){if(ua.ie){return clipboardData.setData("Text",text);}else{var o=QZONE.shareObject.getValidSO();return o?o.setClipboard(text):false;}}
function _showHashmap(object){var descString=[];var n=20;for(var value in object){try{descString.push(value+" ==> "+object[value]);}catch(exception){descString.push(value+" =!> "+exception.message);}
if(!n--){alert(descString.join("\n"));descString=[];n=20;}}
if(descString.length>0){alert(descString.join("\n"));}else{alert(object);}}
function evalGlobal(js){var obj=document.createElement('script');obj.type='text/javascript';obj.id="__evalGlobal_"+evalGlobal._counter;try{obj.innerHTML=js;}catch(e){obj.text=js;}
document.body.appendChild(obj);evalGlobal._counter++;setTimeout('removeNode($("'+obj.id+'"));',50);}
evalGlobal._counter=0;function runStyleGlobal(st){if(ua.safari){var obj=document.createElement('style');obj.type='text/css';obj.id="__runStyle_"+runStyleGlobal._counter;try{obj.textContent=st;}catch(e){alert(e.message);}
var h=document.getElementsByTagName("head")[0];if(h){h.appendChild(obj);runStyleGlobal._counter++;}}else{rt.warn("plz use runStyleGlobal() in Safari!");}}
runStyleGlobal._counter=0;function URI(s){if(!isString(s)){return null;}
var depart=s.split("://");if(isArray(depart)&&depart.length>1&&(/^[a-zA-Z]+$/).test(depart[0])){this.protocol=depart[0].toLowerCase();var h=depart[1].split("/");if(isArray(h)&&h[0].length>0){this.host=h[0];this.href=s;var se=depart[1].lastIndexOf("?");var ha=depart[1].lastIndexOf("#");this.search=(se>=0)?depart[1].substring(se):"";this.hash=(ha>=0)?depart[1].substring(ha):"";if(this.search.length>0&&this.hash.length>0){if(ha<se){this.search="";}else{this.search=depart[1].substring(se,ha);}}
return this;}else{return null;}}else{return null;}}
function genHttpParamString(o){if(QZONE.lang.isHashMap(o)){var r=new StringBuilder();try{for(var i in o){r.append(i+"="+customEncode(o[i],"URICPT"));}}catch(ignore){return'';}
return r.toString("&");}else if(typeof(o)=='string'){return o;}else{return'';}}
function splitHttpParamString(s){return commonDictionarySplit(s,"&");}
function commonDictionarySplit(s,esp,vq){if(typeof(esp)=='undefined'){esp="&";}
if(typeof(vq)=='undefined'){vq="";}
var re_vq=new RegExp("^"+vq+"|"+vq+"$","g");if(isString(s)){var l=s.split(vq+esp);var tmp;var res={};for(var i=0,len=l.length;i<len;i++){tmp=l[i].split("=");if(tmp.length>1){res[tmp[0]]=(tmp.slice(1).join("=")).replace(re_vq,"");}else{res[l[i]]=true;}}
return res;}else{return{};}}
QZONE.lang={isString:function(o){return(typeof(o)!='undefined')&&(o!==null)&&(typeof(o)=='string'||!!o.toString);},isArray:function(o){return(typeof(o)=='object'&&(o instanceof Array));},isHashMap:function(o){return((o!==null)&&(typeof(o)=='object'));},isNode:function(o){if(typeof(Node)=='undefined'){Node=null;}
try{if(!o||!((Node!=undefined&&o instanceof Node)||o.nodeName)){return false;}}catch(ignored){return false;}
return true;},isElement:function(o){return o&&o.nodeType==1;},isValidXMLdom:function(o){if(!o){return false;}
if(!o.xml){return false;}
if(o.xml==""){return false;}
if(!(/^<\?xml/.test(o.xml))){return false;}
return true;},arg2arr:function(refArgs,start){if(typeof start=='undefined'){start=0;}
return Array.prototype.slice.apply(refArgs,[start,refArgs.length]);},getObjByNameSpace:function(ns){if(typeof(ns)=='undefined')
return ns;var l=ns.split(".");var r=window;try{for(var i=0,len=l.length;i<len;++i){r=r[l[i]];if(typeof(r)=='undefined')
return void(0);}
return r;}catch(ignore){return void(0);}},objectClone:function(obj,preventName){if((typeof obj)=='object'){var res=(QZONE.lang.isArray(obj)||!!obj.sort)?[]:{};for(var i in obj){if(i!=preventName)
res[i]=objectClone(obj[i],preventName);}
return res;}else if((typeof obj)=='function'){return(new obj()).constructor;}
return obj;},propertieCopy:function(s,b,propertiSet){if(typeof propertiSet=='undefined'){for(var p in b){s[p]=b[p];}}else{for(var p in propertiSet){s[p]=b[p];}}
return s;},tryThese:function(){var res;for(var ii=0,len=arguments.length;ii<len;ii++){try{res=arguments[ii]();return res;}catch(ignore){}}
return res;},chain:function(u,v){var calls=[];for(var ii=0,len=arguments.length;ii<len;ii++){calls.push(arguments[ii]);}
return(function(){for(var ii=0,len=calls.length;ii<len;ii++){if(calls[ii]&&calls[ii].apply(null,arguments)===false){return false;}}
return true;});},uniqueArray:function(arr){var flag={};var index=0;while(index<arr.length){if(flag[arr[index]]==typeof(arr[index])){arr.splice(index,1);continue;}
flag[arr[index].toString()]=typeof(arr[index]);++index;}
return arr;}};QZONE.namespace.map(QZONE.lang);
function commonReplace(s,p,r){return s.toString().replace(p,r);}
function listRaplace(s,l){if(isHashMap(l)){for(var i in l){s=(commonReplace(s,l[i],i)||s);}
return s;}else{return s;}}
function trim(str){if(isString(str)){return commonReplace(str,/^\s*|\s*$/g,'');}else{return'';}}
function ltrim(str){if(isString(str)){return commonReplace(str,/^\s*/g,'');}else{return'';}}
function rtrim(str){if(isString(str)){return commonReplace(str,/\s*$/g,'');}else{return'';}}
function nl2br(str){if(isString(str)){return commonReplace(str,/\n/g,'<br />');}else{return'';}}
function s2nb(str){if(isString(str)){return commonReplace(str,/[ ]{2}/g,'&nbsp;&nbsp;');}else{return'';}}
function URIencode(str){if(isString(str)){return str.replace(/[\x09\x0A\x0D\x21-\x29\x2B\x2C\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E]/g,function(a){return"%"+((a.charCodeAt(0)<16)?("0"+a.charCodeAt(0).toString(16)):(a.charCodeAt(0).toString(16)))}).replace(/[\x00-\x20]/g,"+");}else{return'';}}
function escHTML(str){if(isString(str)){return listRaplace(str,{'&amp;':/&/g,'&lt;':/</g,'&gt;':/>/g,'&#039;':new RegExp("\'","g"),'&quot;':new RegExp("\"","g")});}else{return'';}}
function restHTML(str){if(isString(str)){var t=restHTML.__utilDiv;t.innerHTML=str;if(typeof t.innerText!='undefined'){return t.innerText;}else if(typeof t.textContent!='undefined'){return t.textContent;}else if(typeof t.text!='undefined'){return t.text;}else{return'';}}else{return'';}}
restHTML.__utilDiv=document.createElement("div");var StringBuilder=function(){this._strList=arg2arr(arguments);};StringBuilder.prototype.append=function(str){if(isString(str)){this._strList.push(str.toString());}};StringBuilder.prototype.appendArray=function(arr){if(isArray(arr)){this._strList=this._strList.concat(arr);}};StringBuilder.prototype.toString=function(spliter){return this._strList.join(!spliter?'':spliter);};StringBuilder.prototype.clear=function(){this._strList.splice(0,this._strList.length);};function write(strFormat,someArgs){if(arguments.length<1||!isString(strFormat)){rt.warn('No patern to write()');return'';}
var rArr=arg2arr(arguments);var result=rArr.shift();var tmp;return result.replace(/\{(\d{1,2})(?:\:([xodQqb]))?\}/g,function(a,b,c){b=parseInt(b,10);if(b<0||(typeof rArr[b]=='undefined')){rt.warn('write() wrong patern:{0:Q}',strFormat);return'(n/a)';}else{if(!c){return rArr[b];}else{switch(c){case'x':return'0x'+rArr[b].toString(16);case'o':return'o'+rArr[b].toString(8);case'd':return rArr[b].toString(10);case'Q':return'\x22'+rArr[b].toString(16)+'\x22';case'q':return'`'+rArr[b].toString(16)+'\x27';case'b':return'<'+!!rArr[b]+'>';}}}});}
function isURL(s){var p=/^(?:ht|f)tp(?:s)?\:\/\/(?:[\w\-\.]+)\.\w+/i;return p.test(s);}
function customEncode(s,type){var r;if(typeof type=='undefined'){type='';}
switch(type.toUpperCase()){case"URICPT":r=encodeURIComponent(s);break;default:r=encodeURIComponent(s);}
return r;}
function escapeURI(s){if(!isString(s)){return'';}
if(encodeURIComponent){return encodeURIComponent(s);}
if(escape){return escape(s);}}
function parseXML(text){if(window.ActiveXObject){var doc=QZONE.lang.tryThese(function(){return new ActiveXObject('MSXML2.DOMDocument.6.0');},function(){return new ActiveXObject('MSXML2.DOMDocument.5.0');},function(){return new ActiveXObject('MSXML2.DOMDocument.4.0');},function(){return new ActiveXObject('MSXML2.DOMDocument.3.0');},function(){return new ActiveXObject('MSXML2.DOMDocument');},function(){return new ActiveXObject('Microsoft.XMLDOM');});doc.async="false";doc.loadXML(text);if(doc.parseError.reason){rt.error(doc.parseError.reason);return null;}}else{var parser=new DOMParser();var doc=parser.parseFromString(text,"text/xml");if(doc.documentElement.nodeName=='parsererror'){rt.error(doc.documentElement.textContent);return null;}
doc.documentElement.xml=new String(text);if(!ua.opera||ua.opera<9){doc.documentElement.selectSingleNode=function(xpath){return QZONE.dom.XMLselectSingleNode(this,xpath);};doc.documentElement.selectNodes=function(xpath){return QZONE.dom.XMLselectNodes(this,xpath);};}}
var x=doc.documentElement;return x;}
function fillLength(s,l,ss,isBack){if(typeof(s)!='string'){s=s.toString();}
if(s.length<l){var res=(1<<(l-s.length)).toString(2).substring(1);if(typeof(ss)!='undefined'&&!!ss){res=res.replace("0",ss.toString()).substring(1);}
return isBack?(s+res):(res+s);}else{return s;}};function timeFormatString(s,format){var n;if(typeof(s)=='number'){n=new Date();n.setTime(s);s=n;}
if(typeof(s)=='object'){try{s.getTime();}catch(err){rt.error("需要输入时间对象");return"";}
if(typeof(format)!='string'){return s.toString();}else{return format.replace(/\{([yYMdhms])(\:[\d\w\s]|)\}/g,function(a,b,c){var tmp;switch(b){case'y':tmp=s.getYear().toString();return fillLength(tmp.substring(tmp.length-2),2);case'Y':return fillLength(s.getFullYear(),2);case'M':return fillLength(s.getMonth()+1,2,c);case'd':return fillLength(s.getDate(),2,c);case'h':return fillLength(s.getHours(),2,c);case'm':return fillLength(s.getMinutes(),2);case's':return fillLength(s.getSeconds(),2);}});}}}
function cut(s,bl,tails){if(typeof(s)!='string')
return'';if(typeof(tails)=='undefined')
tails="";if(getRealLen(s)<=bl){return s;}
var res=[];var tmp;var ascii_re=/[\x00-\xFF]/;for(var i=0,cnt=0,len=s.length;i<len&&cnt<bl;++i){res.push(tmp=s.charAt(i));if(ascii_re.test(tmp)){cnt++;}else{cnt+=2;}}
return res.join("")+tails;}
function getRealLen(s){if(typeof(s)!='string')
return 0;return s.replace(/[^\x00-\xFF]/g,"**").length;}
QZONE.config={defaultDataCharacterSet:"GB2312",DCCookieDomain:"qzone.qq.com",domainPrefix:"qq.com",gbEncoderPath:"http://imgcache.qq.com/qzone/v5/toolpages/",FSHelperPage:"http://imgcache.qq.com/qzone/v5/toolpages/fp_gbk.html",defaultShareObject:"http://imgcache.qq.com/qzone/v5/toolpages/getset.swf"};
QZONE.cookie={set:function(name,value,domain,path,hour){if(hour){var today=new Date();var expire=new Date();expire.setTime(today.getTime()+3600000*hour);}
document.cookie=name+"="+value+"; "+(hour?("expires="+expire.toGMTString()+"; "):"")+(path?("path="+path+"; "):"path=/; ")+(domain?("domain="+domain+";"):("domain="+QZONE.config.domainPrefix+";"));return true;},get:function(name){var r=new RegExp("(?:^|;+|\\s+)"+name+"=([^;]*)");var m=document.cookie.match(r);return(!m?"":m[1]);},del:function(name,domain,path){document.cookie=name+"=; expires=Mon, 26 Jul 1997 05:00:00 GMT; "+(path?("path="+path+"; "):"path=/; ")+(domain?("domain="+domain+";"):("domain="+QZONE.config.domainPrefix+";"));}};
QZONE.JSONGetter=function(actionURL,cname,data,charset,junctionMode){if(!isURL(actionURL)){rt.error("error actionURL -> {0:Q} in QZONE.JSONGetter construct!",actionURL);return null;}
if(!isString(cname)){cname="_jsonInstence_"+(QZONE.JSONGetter.counter+1);}
var prot;if(QZONE.JSONGetter.instance[cname]instanceof QZONE.JSONGetter){prot=QZONE.JSONGetter.instance[cname];}else{prot=(QZONE.JSONGetter.instance[cname]=this);QZONE.JSONGetter.counter++;}
prot._name=cname;prot._uri=actionURL;prot._data=(isHashMap(data)||typeof(data)=='string')?data:null;prot._sender=null;prot._charset=(typeof charset!='string')?QZONE.config.defaultDataCharacterSet:charset;prot._jMode=!!junctionMode;this.onSuccess=QZONE.emptyFn;this.onError=QZONE.emptyFn;return prot;};QZONE.JSONGetter.instance={};QZONE.JSONGetter.counter=0;QZONE.JSONGetter._errCodeMap={999:{msg:'Connection or Server error'}};QZONE.JSONGetter.prototype.send=function(callbackFnName){var cfn=(typeof callbackFnName!='string')?"callback":callbackFnName;var clear;var da=this._uri+(this._data?("?"+genHttpParamString(this._data)):"");if(this._jMode){window[cfn]=this.onSuccess;var _sd=new QZONE.JsLoader();_sd.onerror=this.onError;_sd.load(da,void(0),this._charset);return;}
if(ua.ie&&ua.ie<8){var df=document.createDocumentFragment();var sender=df.createElement("script");sender.charset=this._charset;this._senderDoc=df;this._sender=sender;clear=function(o){if(o._sender)
o._sender.onreadystatechange=null;o._senderDoc=o._sender=null;};df[cfn]=QZONE.event.bind(this,function(o){this.onSuccess(o);clear(this);});sender.onreadystatechange=QZONE.event.bind(this,function(){if(this._sender&&this._sender.readyState=="loaded"){try{this.onError(QZONE.JSONGetter._errCodeMap[999]);clear(this);}catch(ignore){}}});this._sender.src=da;df.appendChild(sender);}else{clear=function(o){if(!ua.ie){o._sender.src="about:blank";o._sender=o._sender.callback=o._sender.errorCallback=null;if(ua.safari||ua.opera){setTimeout('removeNode($("_JSON_frm_'+o._name+'"))',50);}else{removeNode($("_JSON_frm_"+o._name));}}else{_hf.parentWindow["errorCallback"]=QZONE.emptyFn;_hf=null;}};var _cb=QZONE.event.bind(this,function(o){this.onSuccess(o);clear(this);});var _ecb=QZONE.event.bind(this,function(){this.onError(QZONE.JSONGetter._errCodeMap[999]);clear(this);});if(ua.ie){var _hf=new ActiveXObject("htmlfile");_hf.open();_hf.parentWindow[cfn]=function(o){_cb(objectClone(o));};_hf.parentWindow["errorCallback"]=_ecb;_hf.write("<script src=\""+da+"\" charset=\""+this._charset+"\"><\/script><script defer>setTimeout(\"errorCallback()\",0)<\/script>");if(_hf){_hf.close();}}else{var frm=document.createElement("iframe");frm.id="_JSON_frm_"+this._name;frm.style.width=frm.style.height=frm.style.borderWidth="0";this._sender=frm;var dout='<html><head><meta http-equiv="Content-type" content="text/html; charset='+this._charset+'" /></head><body><script>document.domain="'+document.domain+'";function '+cfn+'(o){frameElement.callback(o);}<\/script><script src="'+da+'" charset="'+this._charset+'"><\/script><script>setTimeout(frameElement.errorCallback,50);<\/script></body></html>';frm.callback=_cb;frm.errorCallback=_ecb;if(ua.opera){frm.src="javascript:'"+dout+"'";document.body.appendChild(frm);if(ua.opera>=9.5){frm.contentWindow.document.open('text/html');frm.contentWindow.document.close();}}else{document.body.appendChild(frm);frm.contentWindow.document.open('text/html');frm.contentWindow.document.write(dout);frm.contentWindow.document.close();}}}};QZONE.JSONGetter.prototype.destroy=function(){var n=this._name;delete QZONE.JSONGetter.instance[n]._sender;QZONE.JSONGetter.instance[n]._sender=null;delete QZONE.JSONGetter.instance[n];QZONE.JSONGetter.counter--;return null;};