
J16.util=window.J16.util||{console:function(type,message){if(window.console)
window.console[type](message);},getType:function(o){var s=Object.prototype.toString,t={'undefined':'undefined','number':'number','boolean':'boolean','string':'string',"[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"};return t[typeof o]||t[s.call(o)]||(o?'object':'null');},getDomain:function(){return"."+location.host.split(".").slice(-2).join(".");},setHome:function(o,r){o.target="_self";var a="url(#default#homepage)",b="http://bbs.1616.net/thread-1913-1-4.html";try{if(document.all&&!external.max_version){o.style.behavior=a;o.setHomePage(r?r:"http://www"+this.getDomain());}else window.open(b);}catch(e){if(document.all){o.style.behavior=a;o.setHomePage(r?r:"http://www"+this.getDomain());}else window.open(b);}
return false;},getQueryString:function(name){var reg=new RegExp("[?&]"+name+"=([^&]*)");var r=location.search.match(reg);return r?r[1]:"";},hitTest:function(elem1,elem2){var pos1=elem1.getBoundingClientRect(),pos2=elem2.getBoundingClientRect(),x1=pos1.left,y1=pos1.top,x2=pos2.left,y2=pos2.top,w1=elem1.offsetWidth,h1=elem1.offsetHeight,w2=elem2.offsetWidth,h2=elem2.offsetHeight;return(x1<x2?x1+w1>x2:x1<x2+w2)&&(y1<y2?y1+h1>y2:y1<y2+h2);},mt:(function(){function parse(s){var a=[];var re_t=/\{\$((?:[^\\}]|\\[\s\S])+)\}/;var re_s=/\\([\s\S])/g;var esc=function(s){return s.replace(re_s,'$1');};var re_c=/(?:^|[^\\])(?:\\\\)*$/;var t,m,n;while(t=re_t.exec(s)){n=(m=t.index)+t[0].length;if(re_c.test(s.substr(0,m))){a.push(esc(s.substr(0,m)));a.push([esc(t[1])]);}
else a.push(esc(s.substr(0,n)));s=s.substr(n);}
return a;}
function show(s,o){var a=parse(s);for(var i=0;i<a.length;i++)
if(typeof a[i]=='object')
a[i]=o[a[i]]||'';return a.join('');}
function show2(s,o){return s.replace(/\{\$([^}]+)\}/g,function(a,b){return o[b]||'';});}
return function(template,data,adv){var f=adv?show:show2;if(!(data instanceof Array))
return f(template,data);var s='';for(var i=0;i<data.length;i++)
s+=f(templet,data[i]);return s;};})(),guid:(function(){if(typeof document.documentElement.uniqueID!=='undefined'){return function(element){return element.uniqueID;};}
var uid=0;return function(element){return element.__uniqueID||(element.__uniqueID='uniqueID__'+uid++);};})()};J16.util.cookie={set:function(n,v,e,p,d,s){if(!e)e=365;if(!p)p='/';e=e*1000*60*60*24;var e_date=new Date(new Date().getTime()+(e));document.cookie=n+'='+encodeURIComponent(v)+((e)?';expires='+e_date.toGMTString():'')+
((p)?';path='+p:'')+((d)?';domain='+d:'')+((s)?';secure':'');},get:function(n){var c=document.cookie.split("; ");for(var i=0;i<c.length;i++){var p=c[i].split("=");if(n==p[0])try{return decodeURIComponent(p[1])}catch(e){return null}}
return null;},del:function(name,path,domain){document.cookie=name+"=1"+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}};J16.util.json={obj2str:function(o){var r=[];if(typeof o=="string")return quote(o);if(typeof o=="undefined")return"undefined";if(typeof o=="object"){if(o===null)return"null";else if(!o.sort){for(var i in o)
r.push(this.obj2str(i)+":"+this.obj2str(o[i]));r="{"+r.join()+"}";}else{for(var i=0;i<o.length;i++)
r.push(this.obj2str(o[i]));r="["+r.join()+"]";}
return r;}
return o.toString();function quote(string){var escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};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+'"';}},str2obj:function(str){var undefined;try{if(str){return eval('('+str+')');}}catch(ex){}
return null;}};J16.util.string={cut:function(s,length,postfix){if(typeof(s)!="string")return s;postfix=postfix||"";if(!s||!length){return"";}
var len=0,temp="";for(var i=0;i<s.length;i++){if(s.charCodeAt(i)>255){len+=2;}else{len++;}
if(len>length){return temp+postfix;}
temp+=s.charAt(i);}
return s;}};