Sysolar={
debug:false
}
$=function(id){
var e=document.getElementById(id);
if(null==e){
return null;
}
return $$(e);
}
$t=function(tagName){
var es=document.getElementsByTagName(tagName);
if(null==es||es.length==0){
return null;
}
return $$(es[0]);
}
$$=function(e){
if(typeof e.son!='undefined'){
return e;
}
e.creationTime=new Date().getTime();
e.cacheTime=360*60*1000;
e.isOld=function(){
if(new Date().getTime()-e.creationTime<e.cacheTime){
return false;
}
return true;
}
e.hide=function(){
e.style.display='none';
};
e.show=function(){
e.style.display='block';
};
e.showAsInline=function(){
e.style.display='inline';
};
e.drop=function(){
e.id='';
if(e.parentNode){
e.parentNode.removeChild(e);
}
};
e.trunc=function(sonName){
if(sonName){
var nodeList=e.sonList(sonName);
for(var i=0; i<nodeList.length; i++){
nodeList[i].drop();
}
}
else{
while(e.firstChild){
if(e.firstChild.id){
e.firstChild.id='';
}
e.removeChild(e.firstChild);
}
}
};
e.isVisible=function(){
return e.style.display!='none';
};
e.unVisibility=function(){
e.style.visibility='hidden';
}
e.visibility=function(){
e.style.visibility='visible';
}
e.toggle=function(){
return e[e.isVisible()?'hide':'show']();
};
e.replace=function(dest){
e.parentNode.replaceChild(dest,e);
};
e.getHeight=function(){
return e.offsetHeight;
};
e.getWidth=function(){
return e.offsetWidth;
};
e.nodeList=function(){
var nodeList=e.childNodes;
var result=new Array();
for (var i=0,j=0; i<nodeList.length; i++){
if(nodeList[i].nodeType!=1){
continue;
}
result[j++]=$$(nodeList[i]);
}
return result;
}
e.sonList=function(sonName){
sonName=sonName.toUpperCase();
var nodeList=e.childNodes;
var result=new Array();
for (var i=0,j=0; i<nodeList.length; i++){
if(nodeList[i].nodeType!=1){
continue;
}
var className='';
if(nodeList[i].className){
className=nodeList[i].className.toUpperCase();
}
if ((className==sonName)
||(className.indexOf(' '+sonName)>=0)
||(className.indexOf(sonName+' ')>=0)
||(nodeList[i].tagName.toUpperCase()==sonName)){
result[j++]=$$(nodeList[i]);
}
}
return result;
};
e.son=function(sonName){
var list=e.sonList(sonName);
var docObj=(list.length>0)?list[0]:null;
list.clear();
return docObj;
};
e.tagList=function(tagName){
var nodeList=e.getElementsByTagName(tagName);
for(var i=0; i<nodeList.length; i++){
$$(nodeList[i]);
}
return nodeList;
}
e.sonByTag=function(tagName){
var list=e.tagList(tagName);
var docObj=(list.length>0)?list[0]:null;
return docObj;
}
e.childList=function(tagName,className){
className=className.toUpperCase();
var result=new Array();
var nodeList=e.getElementsByTagName(tagName);
for (var i=0,j=0; i<nodeList.length; i++){
if(nodeList[i].className.toUpperCase().indexOf(className)>=0){
result[j++]=$$(nodeList[i]);
}
}
return result;
};
e.child=function(tagName,className){
var list=e.childList(tagName,className);
var docObj=(list.length>0)?list[0]:null;
list.clear();
return docObj;
};
e.getHtml=function(){
return e.innerHTML;
};
e.setHtml=function(html){
e.innerHTML=html;
return e;
};
e.seekBean=function(){
var node=e;
do{
if(node.bean){
return node.bean;
}
} while(node=node.parentNode);
return null;
};
e.seekNode=function(){
var node=e;
do{
if(node.bean){
return node;
}
} while(node=node.parentNode);
return null;
};
e.copy=function(){
var newTag=$$(document.createElement(e.tagName));
if(e.className){
newTag.updateClass(e.className);
}
return newTag.setHtml(e.getHtml());
},
e.clone=function(json){
var newTag=$$(document.createElement(e.tagName));
if(e.className){
newTag.updateClass(EL.parse(e.className,json));
}
var text=e.getHtml().replace(/%7B/g,'{').replace(/%7D/g,'}')
.replace(/%28/g,'(').replace(/%29/g,')')
.replace(/%20/g,'');
newTag.setHtml(EL.parse(text,json));
var imgs=newTag.childList('img','JS_IMG');
for(var i=0; i<imgs.length; i++){
imgs[i].src=imgs[i].alt;
imgs[i].alt='';
}
if(newTag.className&&(newTag.className.indexOf('JS_ON_MOUSE')>=0)){
newTag.enableOnMouse();
}
var lis=newTag.childList('li','JS_ON_MOUSE');
for(var i=0; i<lis.length; i++){
lis[i].enableOnMouse();
}
newTag.bean=json;
return newTag;
};
e.updateClass=function(className){
e.className=className;
};
e.appendClass=function(className){
if(e.className){
e.removeClass(className);
e.className=(e.className+' '+className).trim();
}
else{
e.className=className;
}
};
e.removeClass=function(className){
e.replaceClass(className,'');
};
e.replaceClass=function(oldClassName,newClassName){
if(e.className){
e.className=e.className.replace(oldClassName,newClassName).trim();
}
};
e.turnOn=function(){
if(e.parentNode){
$$(e.parentNode).clearOn();
}
e.appendClass('on');
};
e.turnOff=function(){
e.removeClass('on');
};
e.clearOn=function(){
var ons=e.sonList('on');
for(var i=0; i<ons.length; i++){
ons[i].turnOff();
}
};
e.enableOnMouse=function(){
e.onmouseover=function(evt){
this.appendClass('hover');
};
e.onmouseout=function(evt){
this.removeClass('hover');
}
};
e.enableOnClick=function(){
e.onclick=function(evt){
var target=Browser.getTarget(evt);
if(!target.className) return;
if(target.className.indexOf('core')>=0){
this.turnOn();
}
else if(target.className.indexOf('ddAngle')>=0){
this.son('dropMenu').show();
}
}
};
e.enableAutoHide=function(){
e.onmouseover=function(evt){
this.show();
}
e.onmouseout=function(evt){
this.hide();
}
e.onclick=function(evt){
this.hide();
if(this.parentNode){
$$(this.parentNode).turnOn();
}
}
};
return e;
}
EL={
parse:function(text,json){
var els=text.match(/@\{[()\w\+\-\*\/\.%\s]+\}/g);
if(null==els) return text;
var el,doEval,fields,field,value,regExp;
try{
for(var i=0; i<els.length; i++){
el=els[i].replace(/[@\{\}\s]/g,'');
doEval=(el.search(/[\+\-\*\/%\(]/)>=0);
fields=el.replace(/[a-z_$]\w*\s*\(/ig,'').match(/[a-z_]\w*/ig);
for(var j=0; (null!=fields)&&(j<fields.length); j++){
field=fields[j];
value=eval('json.'+field);
if(value){
el=el.replace(field,value);
}
else{
el='';
}
}
text=text.replace(els[i],(doEval&&''!=el)?eval(el):el);
}
}
catch(err){
Logger.log('EL.parse:'+err,el,field,value);
}
return text;
}
}
function ArrayList(){
this.array=new Array();
this.add=function(element){
this.array[this.array.length]=element;
}
this.get=function(index){
return this.array[index];
}
this.remove=function(index){
if(index>=this.array.length){
return;
}
for(var i=index; i<this.array.length; i++){
this.array[i]=this.array[i+1];
}
this.array.length=this.array.length-1;
}
this.removeElement=function(element){
for(var i=0; i<this.array.length; i++){
if(this.array[i]==element){
this.remove(i);
return;
}
}
}
this.size=function(){
return this.array.length;
}
this.clear=function(){
this.array.length=0;
}
}
function HashMap(){
this.list=new ArrayList();
this.put=function(key,value){
var element=this.get(key);
if(null==element){
element=new Object();
element.key=key;
element.value=value;
this.list.add(element);
}
else{
element.value=value;
}
}
this.get=function(key){
for(var i=0; i<this.list.size(); i++){
var element=this.list.get(i);
if(element.key==key){
return element.value;
}
}
return null;
}
this.remove=function(key){
for(var i=0; i<this.list.size(); i++){
var element=this.list.get(i);
if(element.key==key){
this.list.remove(i);
return element.value;
}
}
return null;
}
this.clear=function(){
this.list.clear();
}
}
function HashSet(){
this.list=new ArrayList();
this.add=function(element){
var theElement;
for(var i=this.list.size()-1; i>=0; i--){
theElement=this.list.get(i);
if(theElement==element||(''+theElement)==(''+element)){
return;
}
}
this.list.add(element);
}
this.toList=function(){
return this.list;
}
this.clear=function(){
this.list.clear();
}
}
Thread={
maxTaskId:0,
taskList:new ArrayList(),
isStarted:false,
add:function(func,interval){
var task=new Object();
task.func=func;
task.interval=interval;
task.lastRunTime=null;
task.id=Thread.maxTaskId++;
Thread.taskList.add(task);
return task.id;
},
remove:function(taskId){
var task,taskList=Thread.taskList;
for(var i=taskList.size()-1; i>=0; i--){
task=taskList.get(i);
if(task.id==taskId){
taskList.remove(i);
return true;
}
}
return false;
},
run:function(){
if(!Thread.isStarted){
return;
}
var timestamp,task,taskList=Thread.taskList;
for(var i=taskList.size()-1; i>=0; i--){
task=taskList.get(i);
timestamp=new Date().getTime();
if(null==task.lastRunTime||(timestamp-task.lastRunTime)>=task.interval){
task.lastRunTime=timestamp;
task.func();
}
}
},
start:function(interval){
if(!Thread.isStarted){
Thread.isStarted=true;
setInterval(Thread.run,interval);
}
}
}
Thread.start(100);
Anchor={
create:function(anchorName){
if(null==$(anchorName)){
var element=document.createElement('a');
element.setAttribute('name',anchorName);
element.setAttribute('id',anchorName+'Id');
var body=document.getElementsByTagName('body')[0];
body.insertBefore(element,body.firstChild)
}
},
update:function(anchorName){
anchorName=Encrypt.base64encode(anchorName);
Anchor.create(anchorName);
location.href='#'+anchorName+".html";
},
parse:function (){
var currentUrl=location.href;//e.g.:http:
var jsonObj={
anchorName:null,
personalDomain:null,
paramArr:null,
func:null
};
var anchorName='';
var params=[];
var func;
if(currentUrl.trim()==Handler.domain||currentUrl.trim()==Handler.domain+"/"){
jsonObj.anchorName='openHome';
jsonObj.func="openHome";
return jsonObj;
}
var afterBias=currentUrl.substring(currentUrl.lastIndexOf("/")+1);
var anchorIndex=afterBias.indexOf('#');
var anchor='';
if(anchorIndex!=-1){
domain=afterBias.substring(0,afterBias.indexOf('#'));
anchor=afterBias.substring(anchorIndex+1);
if(anchor.trim()==''&&domain.trim()==''){
jsonObj.anchorName='openHome';
jsonObj.func="openHome";
return jsonObj;
}
else{
jsonObj.personalDomain=domain;
anchor=anchor.substring(0,anchor.indexOf(".html"));
anchor=Encrypt.base64decode(anchor);
var paramIndex=anchor.indexOf('_');
if(paramIndex!=-1){
anchorName=anchor.substring(0,paramIndex);
params=anchor.substring(paramIndex+1);
params=params.split('_');
}
else{
anchorName=anchor;
}
if(domain!=""&&anchor==""){
func="openUserUrl";
}
else{
func=anchorName;
}
jsonObj.anchorName=anchorName;
jsonObj.paramArr=params;
jsonObj.func=func;
}
}
else{
jsonObj.personalDomain=afterBias;
}
return jsonObj;
},
change:function(str){
location.href=str;
}
}
Encrypt={
base64EncodeChars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
base64DecodeChars:new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1),
base64encode:function (str){
var out,i,len;
var c1,c2,c3;
len=str.length;
i=0;
out="";
while (i<len){
c1=str.charCodeAt(i++)&255;
if (i==len){
out+=Encrypt.base64EncodeChars.charAt(c1>>2);
out+=Encrypt.base64EncodeChars.charAt((c1&3)<<4);
out+="==";
break;
}
c2=str.charCodeAt(i++);
if (i==len){
out+=Encrypt.base64EncodeChars.charAt(c1>>2);
out+=Encrypt.base64EncodeChars.charAt(((c1&3)<<4)|((c2&240)>>4));
out+=Encrypt.base64EncodeChars.charAt((c2&15)<<2);
out+="=";
break;
}
c3=str.charCodeAt(i++);
out+=Encrypt.base64EncodeChars.charAt(c1>>2);
out+=Encrypt.base64EncodeChars.charAt(((c1&3)<<4)|((c2&240)>>4));
out+=Encrypt.base64EncodeChars.charAt(((c2&15)<<2)|((c3&192)>>6));
out+=Encrypt.base64EncodeChars.charAt(c3&63);
}
return out;
},
base64decode:function (str){
var c1,c2,c3,c4;
var i,len,out;
len=str.length;
i=0;
out="";
while (i<len){
do{
c1=Encrypt.base64DecodeChars[str.charCodeAt(i++)&255];
} while (i<len&&c1==-1);
if (c1==-1){
break;
}
do{
c2=Encrypt.base64DecodeChars[str.charCodeAt(i++)&255];
} while (i<len&&c2==-1);
if (c2==-1){
break;
}
out+=String.fromCharCode((c1<<2)|((c2&48)>>4));
do{
c3=str.charCodeAt(i++)&255;
if (c3==61){
return out;
}
c3=Encrypt.base64DecodeChars[c3];
} while (i<len&&c3==-1);
if (c3==-1){
break;
}
out+=String.fromCharCode(((c2&15)<<4)|((c3&60)>>2));
do{
c4=str.charCodeAt(i++)&255;
if (c4==61){
return out;
}
c4=Encrypt.base64DecodeChars[c4];
} while (i<len&&c4==-1);
if (c4==-1){
break;
}
out+=String.fromCharCode(((c3&3)<<6)|c4);
}
return out;
}
}
String.prototype.trim=function (){
return this.replace(/(^\s*)|(\s*$)/g,'');
};
String.prototype.ltrim=function (){
return this.replace(/(^\s*)/g,'');
};
String.prototype.rtrim=function (){
return this.replace(/(\s*$)/g,'');
};
String.prototype.isEmpty=function(){
return (this=='');
};
String.prototype.asciiLength=function(){
var count=0;
var c;
for(var i=0; i<this.length; i++){
c=this.charAt(i);
if( c>=' '&&c<='~'){
count++;
}
}
return count;
};
String.prototype.halfAngleLength=function(){
return 2*this.length-this.asciiLength();
}
String.prototype.trimTo=function(length,suffix){
var str=this;
if(str.halfAngleLength()<=length){
return str;
}
if(str.length>length){
str=str.substring(0,length);
}
while(str.halfAngleLength()>length){
str=str.substring(0,str.length-1);
}
return str+suffix;
}
String.prototype.replaceAll=function(s1,s2){
return this.replace(new RegExp(s1,"gm"),s2);
}
String.prototype.count=function(sign){
var count=0;
var m=this.indexOf(sign);
while(m!=-1){
m=this.indexOf(sign,m+1);
count=count+1;
}
return count;
}
String.prototype.startsWith=function(str){
if (str==null||str==""||this.length==0
||str.length>this.length)
return false;
if (this.substr(0,str.length)==str)
return true;
else
return false;
return true;
}
Array.prototype.clear=function (){
this.length=0;
};
Array.prototype.get=function (i){
return this[i];
};
Array.prototype.size=function (){
return this.length;
};
Array.prototype.remove=function(index){
if(index>=this.length){
return null;
}
var element=this[index];
for(var i=index; i<this.length; i++){
this[i]=this[i+1];
}
this.length=this.length-1;
return element;
}
Array.prototype.removeElement=function(element){
for(var i=0; i<this.length; i++){
if(this[i]==element){
this.remove(i);
return;
}
}
}
Date.prototype.format=function(pattern){
var year,month,day,hour,min,sec,ms;
year=this.getFullYear();
month=this.getMonth()+1;
day=this.getDate();
hour=this.getHours();
min=this.getMinutes();
sec=this.getSeconds();
ms=this.getMilliseconds();
pattern=pattern.replace('yyyy',year);
pattern=pattern.replace('mm',month>9?month:('0'+month));
pattern=pattern.replace('dd',day>9?day:('0'+day));
pattern=pattern.replace('HH',hour>9?hour:('0'+hour));
pattern=pattern.replace('MM',min>9?min:('0'+min));
pattern=pattern.replace('SS',sec>9?sec:('0'+sec));
pattern=pattern.replace('sss',(ms>99?ms:(ms>9?('0'+ms):('00'+ms))));
return pattern;
}
Logger={
index:0,
doFilt:function(){
var _sys_logger=$('sysLogger');
var key=_sys_logger.son('form').key.value.trim();
var logItems=_sys_logger.son('logZone').sonList('logItem');
var msg;
for(var i=0; i<logItems.length; i++){
msg=logItems[i].son('logMsg').innerHTML;
if(key!=''&&msg.indexOf(key)==-1){
logItems[i].hide();
}
else{
logItems[i].show();
}
}
},
doClear:function(){
$('sysLogger').son('logZone').trunc();
},
log:function(){
var _sys_logger=$('sysLogger');
var _t_log_item=$('tLogItem');
if(!Sysolar.debug||null==_sys_logger||null==_t_log_item){
return;
}
else{
_sys_logger.show();
}
var msg='';
for(var i=0; i<arguments.length; i++){
msg+=(arguments[i]+'; ');
}
var param={
logIndex:Logger.index++,
logTime:new Date().format('HH:MM:SS sss'),
logMsg:msg
};
var logItemClone=_t_log_item.clone(param);
var _log_zone=_sys_logger.son('logZone');
if(_log_zone.firstChild){
_log_zone.insertBefore(logItemClone,_log_zone.firstChild);
}
else{
_log_zone.appendChild(logItemClone);
}
var key=_sys_logger.son('form').key.value.trim();
if(key!=''&&msg.indexOf(key)==-1){
logItemClone.hide();
}
}
};
Loader={
loadJs:function(filePath){
var jsId=Loader.generateFileId(filePath);
if(null!=$(jsId)){
return;
}
var element=document.createElement('script');
element.setAttribute('type','text/javascript');
element.setAttribute('src',filePath);
element.setAttribute('id',jsId);
Loader.add(element);
return jsId;
},
loadCss:function(filePath){
var cssId=Loader.generateFileId(filePath);
if(null!=$(cssId)){
return;
}
var element=document.createElement('link');
element.setAttribute('rel','stylesheet');
element.setAttribute('type','text/css');
element.setAttribute('href',filePath);
element.setAttribute('id',cssId);
Loader.add(element);
return cssId;
},
loadSkin:function(filePath){
var skinId=Loader.generateFileId(filePath);
if(null!=$(skinId)){
$(skinId).drop();
}
Loader.loadCss(filePath);
return skinId;
},
add:function(element){
if(typeof _head_tag!='undefined'){
_head_tag.appendChild(element);
}
else{
document.getElementsByTagName('head')[0].appendChild(element);
}
},
generateFileId:function(filePath){
filePath=filePath.replace('\.','_');
var arr=filePath.split('/');
var fileId='';
for(var i=0; i<arr.length; i++){
fileId=fileId+'_'+arr[i].toLowerCase();
}
return fileId;
}
};
Browser={
isIe:false,
isIe6:false,
isFirefox:false,
isChrome:false,
isOpera:false,
isSafari:false,
init:function(){
var ua=navigator.userAgent.toLowerCase();
if(ua.match(/msie ([\d.]+)/)){
Browser.isIe=true;
}
else if(ua.match(/firefox\/([\d.]+)/)){
Browser.isFirefox=true;
}
else if(ua.match(/chrome\/([\d.]+)/)){
Browser.isChrome=true;
}
else if(ua.match(/opera.([\d.]+)/)){
Browser.isOpera=true;
}
else if(ua.match(/version\/([\d.]+).*safari/)){
Browser.isSafari=true;
}
if(/msie (5\.5|6)/.test(ua)){
Browser.isIe6=true;
}
},
getDocumentBody:function(){
if(document.compatMode&&document.compatMode!="BackCompat"){
return document.documentElement;
}
return document.body;
},
getEvent:function(ev){
return ev?ev:window.event;
},
getTarget:function(ev){
if(!ev){
ev=Browser.getEvent(ev);
}
if(Browser.isIe){
return ev.srcElement;
}
var node=ev.target;
return (node.nodeType==3)?node.parentNode:node;
},
getMouseCoor:function(ev){
if(!ev){
ev=Browser.getEvent(ev);
}
if(Browser.isIe){
var docBody=Browser.getDocumentBody();
return{
x:(ev.clientX+docBody.scrollLeft-docBody.clientLeft),
y:(ev.clientY+docBody.scrollTop-docBody.clientTop)
};
}
return{x:ev.pageX,y:ev.pageY};
},
setNodeCoor:function(node){
var origin=node;
origin.minx=origin.offsetLeft;
origin.miny=origin.offsetTop;
var oStyle=null;
while (node=node.offsetParent){
oStyle=Browser.getStyle(node);
borderLeftWidth=isNaN(parseInt(oStyle.borderLeftWidth))?0:parseInt(oStyle.borderLeftWidth);
borderTopWidth=isNaN(parseInt(oStyle.borderTopWidth))?0:parseInt(oStyle.borderTopWidth);
origin.minx+=(node.offsetLeft+borderLeftWidth);
origin.miny+=(node.offsetTop+borderTopWidth);
}
origin.midx=origin.minx+origin.offsetWidth*0.5;
origin.midy=origin.miny+origin.offsetHeight*0.5;
origin.maxx=origin.minx+origin.offsetWidth;
origin.maxy=origin.miny+origin.offsetHeight;
return origin;
},
getStyle:function(node){
if(node.currentStyle){
return node.currentStyle;
}
if(document.defaultView&&document.defaultView.getComputedStyle){
return document.defaultView.getComputedStyle(node,'');
}
return node.style;
},
getMouseOffset:function(ev){
var mouseCoor=Browser.getMouseCoor(ev);
var nodeCoor=Browser.getNodeCoor(Browser.getTarget(ev));
return{
x:(mouseCoor.x-nodeCoor.minX),
y:(mouseCoor.y-nodeCoor.minY)
};
},
getPageWidth:function(){
return docBody.scrollWidth;
},
getPageHeight:function(){
return Browser.getDocumentBody().scrollHeight;
},
getScreenHeight:function(){
return window.screen.height;
},
setHomePage:function(url){
if(Browser.isIe){
document.body.style.behavior="url(#default#homepage)";
document.body.setHomePage(url);
}
else if(Browser.isFirefox){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e){
alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为true");
return;
}
var pref=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch );
pref.setCharPref('browser.startup.homepage',url);
}
}
};
Browser.init();
try{
document.execCommand('BackgroundImageCache',false,true);
}
catch(ex){}
$$AjaxResultWrapper=function (e){
$$(e);
e.fill=function(responseText){
e.innerHTML=responseText;
}
e.eval=function(){
var scriptList=e.getElementsByTagName('script');
for(var i=0; i<scriptList.length; i++){
eval(scriptList[i].innerHTML);
}
}
e.shiftTo=function(target){
$$(target).trunc();
var nodeList=e.nodeList();
for(var i=0; i<nodeList.length; i++){
target.appendChild(nodeList[i]);
}
}
return e;
}
Ajax={
charset:'UTF-8',
xmlHttp:null,
currRequest:null,
requestList:new ArrayList(),
REQ_TYPE_AJAX:1,
REQ_TYPE_SCRIPT:2,
REQ_STATE_SENDED:1,
REQ_STATE_BACKED:4,
doOnRequest:null,
doFirst:null,
doFinal:null,
errorCode:null,
intValue:null,
stringValue:null,
objectValue:null,
jsonValue:null,
reset:function(){
Ajax.errorCode=null;
Ajax.intValue=null;
Ajax.stringValue=null;
Ajax.objectValue=null;
Ajax.jsonValue=null;
},
load:function(url,params,callback,charset){
Ajax.add(Ajax.REQ_TYPE_AJAX,url,params,callback,charset);
},
send:function(url,params,callback,charset){
Ajax.add(Ajax.REQ_TYPE_SCRIPT,url,params,callback,charset);
},
add:function(reqType,url,params,callback,charset){
var request=new Object();
request.url=url;
request.queryString=Ajax.buildQueryString(params);
request.callback=(callback?callback:null);
request.charset=(charset?charset:null);
request.addedTime=new Date().getTime();
request.sendedTime=null;
request.backedTime=null;
request.reqType=reqType;
request.reqState=null;
request.reSendedNum=0;
request.toString=function(){
var s='Ajax{';
s+=( 'reqType:'+this.reqType);
if(null!=this.sendedTime){
s+=( ',wait:'+(this.sendedTime-this.addedTime)+'ms');
}
if(null!=this.backedTime){
s+=( ',deal:'+(this.backedTime-this.sendedTime)+'ms');
}
s+=(',reqList.size:'+Ajax.requestList.size());
s+=(',Thread.size:'+Thread.taskList.size());
s+=(',url:<b>'+this.url.replace(/\?t=\d+/,'')+'</b>')
s+=( ',queryString:'+this.queryString);
s+='}';
return  s;
}
Ajax.requestList.add(request);
Ajax.listen();
},
listen:function(){
var request,requestList=Ajax.requestList;
while(requestList.size()>0){
request=requestList.get(0);
if(null==request.reqState){
Ajax.makeRequest(request);
return;
}
else if(request.reqState==Ajax.REQ_STATE_SENDED){
var rightNow=new Date().getTime();
if(request.reqType==Ajax.REQ_TYPE_AJAX
&&rightNow-request.sendedTime>10*1000){
Ajax.xmlHttp.abort();
location.reload();
return;
}
if(request.reqType==Ajax.REQ_TYPE_SCRIPT
&&rightNow-request.sendedTime>1000){
request.reqState=Ajax.REQ_STATE_BACKED;
continue;
}
return;
}
else if(request.reqState==Ajax.REQ_STATE_BACKED){
requestList.remove(0);
Logger.log(request);
}
}
},
makeRequest:function(request){
request.reqState=Ajax.REQ_STATE_SENDED;
request.sendedTime=new Date().getTime();
request.url+=('?t='+request.sendedTime);
if(request.reqType==Ajax.REQ_TYPE_AJAX){
Ajax.makeAjaxRequest(request);
}
else if(request.reqType==Ajax.REQ_TYPE_SCRIPT){
Ajax.makeScriptRequest(request);
}
},
makeAjaxRequest:function(request){
Ajax.reset();
var xmlHttp=Ajax.xmlHttp=Ajax.createXmlHttp();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==Ajax.REQ_STATE_BACKED){
request.reqState=Ajax.REQ_STATE_BACKED;
request.backedTime=new Date().getTime();
if(xmlHttp.status==200||xmlHttp.status==0){
if(null!=Ajax.doFirst){
Ajax.doFirst();
}
if(null!=request.callback){
request.callback();
}
}
if(null!=Ajax.doFinal){
Ajax.doFinal();
}
}
};
if(null!=request.queryString){
xmlHttp.open('POST',request.url,true);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset='
+(null==request.charset?Ajax.charset:request.charset));
}
else{
xmlHttp.open('GET',request.url,true);
}
xmlHttp.send(request.queryString);
},
makeScriptRequest:function(request){
var head=$t('head');
var script=document.createElement("script");
if(null==request.queryString){
script.src=request.url;
}
else{
script.src=request.url+'&'+request.queryString;
}
script.charset=(null==request.charset?Ajax.charset:request.charset);
script.onload=script.onreadystatechange=function(){
if (!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){
request.reqState=Ajax.REQ_STATE_BACKED;
request.backedTime=new Date().getTime();
script.onload=script.onreadystatechange=null;
if(!Sysolar.debug){
head.removeChild(script);
}
if(null!=request.callback){
request.callback();
}
if(null!=Ajax.doFinal){
Ajax.doFinal();
}
}
};
head.appendChild(script);
},
createXmlHttp:function(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}
if(window.ActiveXObject){
try{
return new ActiveXObject('Msxml2.XMLHTTP');
}
catch(e){
return new ActiveXObject('Microsoft.XMLHTTP');
}
}
return null;
},
buildQueryString:function(params){
var queryString=null;
if(null!=params){
queryString='';
for(var i in params){
if(null!=params[i]&&typeof params[i]!='undefined'){
queryString+=('&'+i+'='+encodeURIComponent(Util.syEncode(params[i])));
}
}
queryString=queryString.substring(1);
}
return queryString;
},
getText:function(){
return Ajax.xmlHttp.responseText.toString().trim();
},
getString:function(){
return Ajax.stringValue;
},
getInt:function(){
return Ajax.intValue;
},
getObject:function(){
return Ajax.objectValue;
},
getJson:function(){
return Ajax.jsonValue;
},
update:function(url,params,callback){
Ajax.load(url,params,callback);
},
post:function(url,params,callback){
Ajax.load(url,params,callback);
}
};
Thread.add(Ajax.listen,300);
DB={
map:new Object(),
put:function(key,obj){
DB.remove(key);
DB.map[key]=new Bean(obj);
},
get:function(key){
if(DB.map[key]){
return DB.map[key].value;
}
return null;
},
remove:function(key){
delete DB.map[key];
},
setCacheTime:function(key,cacheTime){
if(DB.map[key]){
return DB.map[key].setCacheTime(cacheTime);
}
},
isOld:function(key){
if(DB.map[key]){
return DB.map[key].isOld();
}
},
list:function(){
for(var key in DB.map){
Logger.log(key+'='+DB.map[key]);
}
}
};
function Bean(value){
this.value=value;
this.cacheTime=null;
this.timestamp=new Date().getTime();
this.setCacheTime=function(cacheTime){
this.cacheTime=cacheTime;
};
this.isOld=function(){
if(!this.cacheTime){
return false;
}
var now=new Date().getTime();
if(now-this.timestamp>this.cacheTime){
return true;
}
return false;
};
}
PngFixer={
doFix:function(obj){
if(!Browser.isIe6){
return;
}
var style=Browser.getStyle(obj);
var imgUrl=style.backgroundImage.substring(5,style.backgroundImage.length-2);
obj.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='+imgUrl+')';
obj.style.backgroundImage='none';
}
};
SysRadio={
addEvent:function(ulWrapper){
var liList=ulWrapper.sonList('li');
for(var i=0; i<liList.length; i++){
liList[i].onmouseover=function(evt){
this.appendClass('hover');
}
liList[i].onmouseout=function(evt){
this.removeClass('hover');
}
liList[i].onclick=function(evt){
this.son('input').checked=1
}
}
}
}
Util={
promptLeftLen:function(inputRef,propmtRef,maxLen,evt){
var left=maxLen-inputRef.value.halfAngleLength();
propmtRef.innerHTML=left;
},
getRadioValue:function(radioName){
var obj;
obj=document.getElementsByName(radioName);
if(obj!=null){
var i;
for(i=0;i<obj.length;i++){
if(obj[i].checked){
return obj[i].value;
}
}
}
return null;
},
unCheckRadio:function(radioName){
var obj;
obj=document.getElementsByName(radioName);
if(obj!=null){
for(var i=0;i<obj.length;i++){
if(obj[i].checked){
obj[i].checked=false;
}
}
}
},
checkRadio:function(radioName,value){
var obj=document.getElementsByName(radioName);
if(obj!=null){
for(var i=0;i<obj.length;i++){
if(obj[i].value==value){
obj[i].checked=true;
}
}
}
},
selectSelect:function(selectDomId,value){
var options=$(selectDomId).options;
for(var i=0;i<options.length;i++){
if(options[i].value==value){
options[i].selected=true;
}
}
},
copyToClipboard:function(txt){
if(window.clipboardData){
window.clipboardData.clearData();
window.clipboardData.setData("Text",txt);
return true;
} else if(navigator.userAgent.indexOf("Opera")!=-1){
window.location=txt;
} else if (window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e){
return false;
}
var clip=Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip)
return false;
var trans=Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans)
return false;
trans.addDataFlavor('text/unicode');
var str=new Object();
var len=new Object();
var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=txt;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip){
return false;
}
clip.setData(trans,null,clipid.kGlobalClipboard);
return true;
}
},
getClipboardData:function(){
if (window.clipboardData){
return window.clipboardData.getData("Text");
}
else{
return false;
}
},
syEncode:function(text){
if(typeof text!='string'){
return text;
}
text=text.replaceAll("'","&#39;");
text=text.replaceAll('"',"&#34;");
text=text.replaceAll('<',"&#60;");
text=text.replaceAll('>',"&#62;");
var index=-1;
while((index=text.indexOf('\n'))!=-1){
text=text.substring(0,index)+"&nbsp;"+text.substring(index+1);
}
while((index=text.indexOf('\r'))!=-1){
text=text.substring(0,index)+text.substring(index+1);
}
return text;
},
syDecode:function(text){
if(typeof text!='string'){
return text;
}
text=text.replaceAll("&#39;","'");
text=text.replaceAll("&#34;",'"');
text=text.replaceAll("&#60;",'<');
text=text.replaceAll("&#62;",'>');
var regExp=new RegExp('&nbsp;','g');
text=text.replace(regExp,'\r\n');
return text;
}
}
Keyboard={
isEnable:false,
altDown:false,
enable:function(){
Keyboard.isEnable=true;
document.onkeypress=Keyboard.onKeyPress;
},
onKeyPress:function(event){
event=Browser.getEvent(event);
if(!Browser.isIe){
}
altDown=event.altKey;
Logger.log(event.keyCode,altDown);
},
isAltDown:function(){
return altDown;
}
}
Pager={
create:function(totalNum,pageOnClick){
var pager=$$Pager($('tPager').copy(),totalNum,pageOnClick);
pager.turn(1);
return pager;
},
newPager:function(pagerDomId,totalPageNum,condition,parentNode,callback){
var pagerDom=$(pagerDomId);
if(null!=pagerDom){
pagerDom.drop();
}
pagerDom=Pager.create(totalPageNum,function(pageNum){
condition.pageNum=pageNum;
callback(condition);
});
parentNode.appendChild(pagerDom);
pagerDom.id=pagerDomId;
}
}
$$Pager=function(e,totalNum,pageOnClick){
e.pageNum=1;
e.totalNum=totalNum<1?1:totalNum;
e.pageOnClick=pageOnClick;
e.turn=function(pageNum){
var begin=pageNum-3;
var end=pageNum+3;
var totalNum=e.totalNum;
if(begin<3){
begin=3;
}
if(end>totalNum-2){
end=totalNum-2;
}
if(end-begin<6){
if(pageNum<totalNum/2){
end=(totalNum-2)>9?9:(totalNum-2);
}
else{
begin=(totalNum-8)>3?(totalNum-8):3;
}
}
if(begin>e.totalNum){
begin=e.totalNum;
}
if(end<1){
end=1;
}
aTags=e.sonList('a');
spanTags=e.sonList('span');
if(pageNum==1||totalNum==1){
aTags[0].updateClass('core invalid');
aTags[0].onclick=function(ev){
return false
};
}
else{
aTags[0].updateClass('core');
aTags[0].onclick=function(ev){
e.turn(pageNum-1);
pageOnClick(pageNum-1);
return false;
}
}
if(pageNum==totalNum||totalNum==1){
aTags[12].updateClass('core invalid');
aTags[12].onclick=function(ev){
return false
};
}
else{
aTags[12].updateClass('core');
aTags[12].onclick=function(ev){
e.turn(pageNum+1);
pageOnClick(pageNum+1);
return false;
}
}
if(begin<=3){
spanTags[0].hide();
}
else{
spanTags[0].show();
}
if(end<totalNum-2){
spanTags[1].show();
}
else{
spanTags[1].hide();
}
if(totalNum>=2){
aTags[2].show();
}
else{
aTags[2].hide();
}
if(totalNum>=4){
aTags[10].show();
aTags[10].setHtml(totalNum-1);
}
else{
aTags[10].hide();
}
if(totalNum>=3){
aTags[11].show();
aTags[11].setHtml(totalNum);
}
else{
aTags[11].hide();
}
if(totalNum>4){
for(var i=begin,j=3; i<=end; i++,j++){
aTags[j].setHtml(i);
}
for(var i=4+(end-begin); i<=9; i++){
aTags[i].hide();
}
}
else{
for(var i=3; i<=9; i++){
aTags[i].hide();
}
}
for(var i=1; i<aTags.length-1; i++){
if(parseInt(aTags[i].getHtml())==pageNum){
aTags[i].turnOn();
}
aTags[i].onclick=function(){
var pageNum=parseInt(this.getHtml());
e.turn(pageNum);
pageOnClick(pageNum);
return false;
}
}
}
return e;
}
if (typeof deconcept=="undefined"){
var deconcept=new Object();
}
if (typeof deconcept.util=="undefined"){
deconcept.util=new Object();
}
if (typeof deconcept.SWFObjectUtil=="undefined"){
deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject=function (_1,id,w,h,_5,c,_7,_8,_9,_a){
if (!document.getElementById){
return;
}
this.DETECT_KEY=_a?_a:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if (_1){
this.setAttribute("swf",_1);
}
if (id){
this.setAttribute("id",id);
}
if (w){
this.setAttribute("width",w);
}
if (h){
this.setAttribute("height",h);
}
if (_5){
this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));
}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if (!window.opera&&document.all&&this.installedVer.major>7){
deconcept.SWFObject.doPrepUnload=true;
}
if (c){
this.addParam("bgcolor",c);
}
var q=_7?_7:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var _c=(_8)?_8:window.location;
this.setAttribute("xiRedirectUrl",_c);
this.setAttribute("redirectUrl","");
if (_9){
this.setAttribute("redirectUrl",_9);
}
};
deconcept.SWFObject.prototype={useExpressInstall:function (_d){
this.xiSWFPath=!_d?"expressinstall.swf":_d;
this.setAttribute("useExpressInstall",true);
},setAttribute:function (_e,_f){
this.attributes[_e]=_f;
},getAttribute:function (_10){
return this.attributes[_10];
},addParam:function (_11,_12){
this.params[_11]=_12;
},getParams:function (){
return this.params;
},addVariable:function (_13,_14){
this.variables[_13]=_14;
},getVariable:function (_15){
return this.variables[_15];
},getVariables:function (){
return this.variables;
},getVariablePairs:function (){
var _16=new Array();
var key;
var _18=this.getVariables();
for (key in _18){
_16[_16.length]=key+"="+_18[key];
}
return _16;
},getSWFHTML:function (){
var _19="";
if (navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if (this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for (var key in _1a){
_19+=[key]+"=\""+_1a[key]+"\" ";
}
var _1c=this.getVariablePairs().join("&");
if (_1c.length>0){
_19+="flashvars=\""+_1c+"\"";
}
_19+="/>";
} else{
if (this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath);
}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\"/>";
var _1d=this.getParams();
for (var key in _1d){
_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\"/>";
}
var _1f=this.getVariablePairs().join("&");
if (_1f.length>0){
_19+="<param name=\"flashvars\" value=\""+_1f+"\"/>";
}
_19+="</object>";
}
return _19;
},write:function (_20){
if (this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if (this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+"-Flash Player Installation";
this.addVariable("MMdoctitle",document.title);
}
}
if (this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
} else{
if (this.getAttribute("redirectUrl")!=""){
document.location.replace(this.getAttribute("redirectUrl"));
}
}
return false;
}};
deconcept.SWFObjectUtil.getPlayerVersion=function (){
var _23=new deconcept.PlayerVersion([0,0,0]);
if (navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if (x&&x.description){
_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));
}
} else{
if (navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){
var axo=1;
var _26=3;
while (axo){
try{
_26++;
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);
_23=new deconcept.PlayerVersion([_26,0,0]);
}
catch (e){
axo=null;
}
}
} else{
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}
catch (e){
try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);
axo.AllowScriptAccess="always";
}
catch (e){
if (_23.major==6){
return _23;
}
}
try{
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
}
catch (e){
}
}
if (axo!=null){
_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}
}
}
return _23;
};
deconcept.PlayerVersion=function (_29){
this.major=_29[0]!=null?parseInt(_29[0]):0;
this.minor=_29[1]!=null?parseInt(_29[1]):0;
this.rev=_29[2]!=null?parseInt(_29[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function (fv){
if (this.major<fv.major){
return false;
}
if (this.major>fv.major){
return true;
}
if (this.minor<fv.minor){
return false;
}
if (this.minor>fv.minor){
return true;
}
if (this.rev<fv.rev){
return false;
}
return true;
};
deconcept.util={getRequestParameter:function (_2b){
var q=document.location.search||document.location.hash;
if (_2b==null){
return q;
}
if (q){
var _2d=q.substring(1).split("&");
for (var i=0; i<_2d.length; i++){
if (_2d[i].substring(0,_2d[i].indexOf("="))==_2b){
return _2d[i].substring((_2d[i].indexOf("=")+1));
}
}
}
return "";
}};
deconcept.SWFObjectUtil.cleanupSWFs=function (){
var _2f=document.getElementsByTagName("OBJECT");
for (var i=_2f.length-1; i>=0; i--){
_2f[i].style.display="none";
for (var x in _2f[i]){
if (typeof _2f[i][x]=="function"){
_2f[i][x]=function (){
};
}
}
}
};
if (deconcept.SWFObject.doPrepUnload){
if (!deconcept.unloadSet){
deconcept.SWFObjectUtil.prepUnload=function (){
__flash_unloadHandler=function (){
};
__flash_savedUnloadHandler=function (){
};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true;
}
}
if (!document.getElementById&&document.all){
document.getElementById=function (id){
return document.all[id];
};
}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
C={
SITE_ID:1,
Msg:{
REGISTERING:'注册中..',
LOGING_IN:'登录中..',
LOGING_OUT:'退出中..',
LOADING:'数据加载中..',
CREATING:'创建中..',
UPDATING:'更新中..',
REMOVING:'删除中..',
INTERACTING:'数据交互中..请耐心等待，或'
+'<a href="#" class="func" onclick="Handler.refresh();return false;">刷新页面</a>',
MAIL_SENDDING:'邮件发送中..',
UPLOADING:'上传中..'
},
Action:{
HELPER:'HelperAction.do',
GOLD_USER:'GoldUserAction.do',
INDEX:'IndexAction.do',
MY_URL:'MyUrlAction.do',
USER_URL_CAT:'UserUrlCatAction.do',
USER_WEB_CAT:'UserWebCatAction.do',
DOMAIN:'DomainAction.do',
CORE_URL:'CoreUrlAction.do',
HOT_URL_CAT:'HotUrlCatAction.do',
HOT_URL:'HotUrlAction.do',
USER_URL:'UserUrlAction.do',
WANGYU_USER:'WangyuUserAction.do',
USER_WEB:'UserWebAction.do',
HOT_WEB_CAT:'HotWebCatAction.do',
HOT_WEB:'HotWebAction.do',
USER_TOP_URL:'UserTopUrlAction.do',
USER_BBS_MSG:'UserBbsMsgAction.do',
PROXY:'ProxyAction.do',
USER_BBS_MSG:'UserBbsMsgAction.do',
USER_FRIEND:'UserFriendAction.do',
USER_VISITOR:'UserVisitorAction.do',
USER_VOTE:'UserVoteAction.do',
CLICK_LOG:'ClickLogAction.do',
SITE_CLICK_LOG:'SiteClickLogAction.do'
},
Ajax:{
RESULT_OK:1,
RESULT_YES:1,
RESULT_NO:0,
RESULT_ERR_01:-1,
RESULT_ERR_02:-2,
RESULT_ERR_03:-3,
RESULT_ERR_04:-4,
RESULT_ERR_05:-5
},
Time:{
M10:1000*60*10,
M30:1000*60*30
},
Log:{
LOG_USERPHOTO:false
}
}
function getImgPath(id){
return parseInt((id-1)/10000);
}
function beforeTime(timestamp){
var curTimeInMillins=new Date().getTime();
var paramTimeInMillins=timestamp;
var chaSecond=(curTimeInMillins-paramTimeInMillins)/1000;
var beforeTime=0;
if(chaSecond<60){
beforeTime=Math.floor(chaSecond)+"秒";
}
else if(chaSecond>=60&&chaSecond<60*60){
beforeTime=Math.floor(chaSecond/60)+"分钟";
}
else if(chaSecond>=60*60&&chaSecond<60*60*24){
beforeTime=Math.floor(chaSecond/(60*60))+"小时";
}
else if(chaSecond>=60*60*24&&chaSecond<60*60*24*7){
beforeTime=Math.floor(chaSecond/(60*60*24))+"天";
}
else if(chaSecond>=60*60*24*7&&chaSecond<60*60*24*30){
beforeTime=Math.floor(chaSecond/(60*60*24*7))+"周";
}
else if(chaSecond>=60*60*24*30&&chaSecond<60*60*24*30*12){
beforeTime=Math.floor(chaSecond/(60*60*24*30))+"个月";
}
else{
beforeTime=Math.floor(chaSecond/(60*60*24*30*12))+"年";
}
return beforeTime;
}
function getTime(millisecond){
var date=new Date();
date.setTime(millisecond);
return date.format('HH:MM:SS');
}
function undefined2empty(o){
if(typeof o=='undefined'){
return '-';
}
else{
return o;
}
}
UrlTool={
isNative:function(href){
return true;
},
getDefaultUrlName:function(href){
return href.split('://')[1].split('/')[0];
},
formatHref:function(href){
href=href.trim();
if(href.charAt(href.length-1)=='/'){
href=href.substring(0,href.length-1);
}
if(!/\w+:[\/]{2}.+/.test(href)){
href='http://'+href;
}
var hrefSplit=href.split("//");//['http:','www.123.com/345/455.html']
var protocol=hrefSplit[0].toLowerCase();
var domainHref=hrefSplit[1].substring(0,hrefSplit[1].indexOf('/')).toLowerCase();
href=protocol+"//"+domainHref+hrefSplit[1].substring(hrefSplit[1].indexOf('/'));
return href;
},
formatUrlName:function(urlName,length){
var suffix='';
if(urlName.halfAngleLength()>length){
suffix="...";
}
if(urlName.length>length){
urlName=urlName.substring(0,length);
}
while(urlName.halfAngleLength()>length){
urlName=urlName.substring(0,urlName.length-1);
}
return urlName+suffix;
}
}
TextAreaTool={
format:function(text){
text=text.trim();
var index=-1;
while((index=text.indexOf('\n'))!=-1){
text=text.substring(0,index)+"<br>"+text.substring(index+1);
}
while((index=text.indexOf('\r'))!=-1){
text=text.substring(0,index)+text.substring(index+1);
}
return text;
},
revert:function(text){
var regExp=new RegExp('<br>','g');
text=text.replace(regExp,'\r\n');
return text;
}
}
function Cache(cacheTime,docObj){
this.cacheTime=cacheTime;
this.lastModified=new Date().getTime();
this.docObj=docObj;
this.isOld=function(){
if(null==this.cacheTime||null==this.lastModified){
return false;
}
if(new Date().getTime()-this.lastModified<this.cacheTime){
return false;
}
return true;
}
this.show=function(){
this.docObj.show();
}
this.hide=function(){
this.docObj.hide();
}
this.drop=function(){
this.docObj.drop();
}
}
$$FormWrapper=function(e){
e.f=e.getElementsByTagName('form')[0];
if(null==e.f){
return e;
}
$$(e.f);
e.f.onkeydown=function(event){
var evt=Browser.getEvent(event);
var target=Browser.getTarget(evt);
if(evt.keyCode==13&&target.tagName&&target.tagName.toUpperCase()!='TEXTAREA'){
return false;
}
return true;
}
return e;
}
$$BtnBox=function(e){
var btnBox=e.child('div','btnBox');
if(null==btnBox){
btnBox=e.child('p','btnBox');
}
e.btnBox=btnBox;
e.showGif=function(){
if(null!=e.btnBox){
var btn=e.btnBox.son('btn');
var gif=e.btnBox.son('gif');
if(null!=gif&&null!=btn){
btn.hide();
gif.show();
}
}
}
e.hideGif=function(){
if(null!=e.btnBox){
var btn=e.btnBox.son('btn');
var gif=e.btnBox.son('gif');
if(null!=gif&&null!=btn){
gif.hide();
btn.show();
}
}
}
return e;
}
$$FormOnkeydownWrapper=function(e){
$$FormWrapper(e);
e.f.onkeydown=function(event){
var firstBtn=e.child('a','btn');
var evt=Browser.getEvent(event);
if(evt.keyCode==13 ){
if(e.f.target=='_blank'){
return true;
}
if(firstBtn.onclick){
firstBtn.onclick();
return false;
}
}
}
return e;
}
$$Template=function(e){
e.tee=null;
e.setTee=function(tee){
e.tee=tee;
return e;
};
return e;
}
$$MsgBar=function(e){
e.posRef=null;
e.msg=e.son('msg');
e.err=e.son('err');
e.exc=e.son('exc');
e.setPosRef=function(posRef){
e.posRef=posRef;
return e;
};
e.reset=function(){
e.msg.hide();
e.err.hide();
e.exc.hide();
e.show();
};
e.open=function(){
var posRef=e.posRef;
e.style.left=0;
e.style.top=0;
Browser.setNodeCoor(posRef);
Browser.setNodeCoor(e);
var refWidth=posRef.maxx-posRef.minx;
var eWidth=e.maxx-e.minx;
if(eWidth>=refWidth){
e.style.left=posRef.minx+'px';
}
else{
e.style.left=posRef.minx+(refWidth-eWidth)/2+'px';
}
var offsetTop=posRef.miny-(e.maxy-e.miny)+5;
if(offsetTop>0){
e.style.top=offsetTop+'px';
};
};
e.showMsg=function(msg){
e.reset();
e.msg.show();
e.msg.innerHTML=msg;
e.open();
};
e.showErr=function(err){
e.reset();
e.err.show();
e.err.innerHTML=err;
e.open();
};
e.showExc=function(){
e.reset();
e.exc.show();
e.exc.innerHTML='';
e.open();
};
return e;
}
$$MsgWrapper=function(e){
e.showMsg=function(msg){
e.hideErr();
var msgNode=e.child('span','msg');
if(null!=msgNode){
msgNode.innerHTML='('+msg+')';
msgNode.showAsInline();
}
}
e.hideMsg=function(){
var msgNode=e.child('span','msg');
if(null!=msgNode){
msgNode.hide();
}
}
e.showErr=function(err){
e.hideMsg();
var errNode=e.child('span','err');
if(null!=errNode){
errNode.innerHTML='('+err+')';
errNode.showAsInline();
}
}
e.removeErr=function(){
e.hideMsg();
var errNode=e.child('span','err');
if(null!=errNode){
errNode.innerHTML='';
errNode.showAsInline();
}
}
e.hideErr=function(){
var errNode=e.child('span','err');
if(null!=errNode){
errNode.hide();
}
}
e.hideErrMsg=function(){
e.hideMsg();
e.hideErr();
}
return e;
}
$$DragAble=function(e){
var divBody=e.son('body');
if(divBody!=null){
var h1Dom=divBody.son('h1');
if(h1Dom!=null){
h1Dom.onmousedown=function(evt){
Drag.PuDrag.mouseDown(evt,e);
}
}
}
}
$$DropMenu=function(e){
$$(e);
e.onmouseover=function(evt){
this.show();
}
e.onmouseout=function(evt){
this.hide();
}
}
$$LiOnMouse=function(e){
$$(e);
e.onmouseover=function(evt){
this.appendClass('hover');
}
e.onmouseout=function(evt){
this.removeClass('hover');
}
return e;
}
$$LiOnClick=function(e){
$$(e);
e.active=function(){
var current=$$(this.parentNode).son('on');
if(null!=current&&this!=current){
current.removeClass('on');
}
if(this!=current){
this.appendClass('on');
}
}
e.onclick=function(evt){
var target=Browser.getTarget(evt);
if(target.className&&target.className.indexOf('ddAngle')>=0){
this.son('dropMenu').show();
}
else{
this.active();
}
}
var dropMenu=e.son('dropMenu');
if(null!=dropMenu){
$$DropMenu(dropMenu);
}
return e;
}
$$LiLeader=function(e){
$$(e);
e.clearActive=function(){
var activeLiList=e.childList('li','on');
for(var k=0; k<activeLiList.length; k++){
activeLiList[k].removeClass('on');
}
}
}
$$LiTeamOnClick=function(){
var args=arguments;
for(var i=0; i<args.length; i++){
$$LiLeader(args[i]);
}
var liList=args[0].tagList('li');
for(var i=0; i<liList.length; i++){
liList[i].leader=args;
liList[i].onclick=function(evt){
var target=Browser.getTarget(evt);
if(target.className&&target.className.indexOf('core')>=0){
for(var j=0; j<this.leader.length; j++){
this.leader[j].clearActive();
}
this.appendClass('on');
}
}
}
return args[0];
}
LiUtil={
clearActive:function(parent){
var activeLiList=parent.childList('li','on');
for(var k=0; k<activeLiList.length; k++){
activeLiList[k].removeClass('on');
}
},
batchOnMouse:function(parent){
var liList=$$(parent).childList('li','JS_ON_MOUSE');
for(var i=0; i<liList.length; i++){
$$LiOnMouse(liList[i]);
}
var ulList=parent.childList('ul','JS_BATCH_ON_CLICK');
for(var i=0; i<ulList.length; i++){
LiUtil.batchOnClick(ulList[i]);
}
var divList=parent.childList('div','JS_BATCH_ON_CLICK');
for(var i=0; i<divList.length; i++){
LiUtil.batchOnClick(divList[i]);
}
},
batchOnClick:function(){
var liList=arguments[0].tagList('li');
for(var i=0; i<liList.length; i++){
liList[i].leader=arguments;
liList[i].active=function(){
for(var j=0; j<this.leader.length; j++){
LiUtil.clearActive(this.leader[j]);
}
this.appendClass('on');
}
liList[i].onclick=function(evt){
var target=Browser.getTarget(evt);
if(!target.className) return;
if(target.className.indexOf('core')>=0){
this.active();
}
else if(target.className.indexOf('ddAngle')>=0){
this.son('dropMenu').show();
}
}
var dropMenu=liList[i].son('dropMenu');
if(null!=dropMenu){
$$DropMenu(dropMenu);
}
}
}
}
$$DdLayer=function(e){
e.activeDd=null;
e.open=function(){
e.style.height=Browser.getPageHeight()+"px";
e.show();
};
e.close=function(){
if(e.activeDd){
e.activeDd.hide();
}
e.hide();
};
return e;
}
$$Dd=function(e){
$$Template(e);
e.posRef=null;
e.open=function(posRef){
_dd_layer.activeDd=e;
_dd_layer.open();
e.show();
e.posRef=posRef;
Browser.setNodeCoor(posRef);
var posRefParent=Browser.setNodeCoor(posRef.parentNode);
if (posRefParent.minx+10>posRef.minx){
e.style.left=posRef.minx+"px";
}
else{
e.style.left=(posRef.maxx-e.offsetWidth)+"px";
}
e.style.top=posRef.maxy+"px";
};
return e;
}
$$AutoDd=function(e){
e.open=function(posRef){
_dd_layer.open();
_dd_layer.activeDd=e;
e.show();
Browser.setNodeCoor(posRef);
e.style.left=posRef.minx+"px";
e.style.top=posRef.miny+"px";
}
return e;
}
$$PuLayer=function(e){
e.activePu=null;
e.open=function(){
var h=Browser.getPageHeight();
e.style.height=(h>1000?h:1000)+'px';
e.show();
}
e.close=function(){
if(null!=e.activePu){
e.activePu.close();
}
}
return e;
}
$$Pu=function(e){
if(typeof e.isPuExtended!='undefined'){
return e;
}
e.isPuExtended=true;
$$FormWrapper(e);
$$BtnBox(e);
$$MsgWrapper(e);
$$DragAble(e);
e.isPngFixed=false;
e.isRequestSending=false;
e.open=function(){
if(null!=_pu_layer.activePu){
_pu_layer.activePu.close();
}
_pu_layer.activePu=e;
_pu_layer.open();
e.show();
e.hideGif();
e.hideErrMsg();
var docBody=Browser.getDocumentBody();
e.style.top=docBody.scrollTop+(docBody.clientHeight-e.getHeight())/2+"px";
e.style.left=docBody.scrollLeft+(docBody.clientWidth-e.getWidth())/2+"px";
if(!e.isPngFixed){
if(null!=e.son('body')){
PngFixer.doFix(e.son('body'));
}
if(null!=e.son('foot')){
PngFixer.doFix(e.son('foot'));
}
e.isPngFixed=true;
}
};
e.close=function(){
_msg_bar.hide();
if(null!=e){
e.hide();
}
_pu_layer.activePu=null;
_pu_layer.hide();
};
return e;
}
$$Fade=function(e){
e.step=10;
e.timeOutId=null;
e.open=function(title,msg){
if(e.timeOutId){
clearTimeout(e.timeOutId);
}
if(title){
e.son('h1').son('span').innerHTML=title;
}
if(msg){
e.son('p').innerHTML=msg;
}
_dd_layer.open();
e.show();
var docBody=Browser.getDocumentBody();
e.style.top=docBody.scrollTop+(docBody.clientHeight-e.getHeight())/2+"px";
e.style.left=docBody.scrollLeft+(docBody.clientWidth-e.getWidth())/2+"px";
if(e.filters){
e.filters[0].opacity=100;
}
else{
e.style.opacity=1;
}
e.timeOutId=setTimeout(e.fadeOut,1000);
}
e.close=function(){
e.hide();
_dd_layer.close();
}
e.fadeOut=function(){
if(e.step>0){
if(e.filters){
e.filters[0].opacity=e.step*10;
}
else{
e.style.opacity=e.step/10.0;
}
e.step-=0.5;
e.timeOutId=setTimeout(e.fadeOut,50);
}
else{
e.step=10;
e.close();
}
}
return e;
}
$$Ne=function(e){
$$FormWrapper(e);
e.open=function(posRef){
posRef.parentNode.insertBefore(e,posRef);
e.show();
};
e.close=function(){
e.hide();
};
return e;
}
$$Module=function (e){
e.titl=e.son("mtitl");
e.cont=e.son("mcont");
e.minbox=e.titl.son("minbox");
e.maxbox=e.titl.son("maxbox");
e.expand=function(){
e.cont.show();
e.minbox.show();
e.maxbox.hide();
};
e.shrink=function(){
e.cont.hide();
e.minbox.hide();
e.maxbox.show();
};
e.getTitle=function(){
return e.titl.son('b').innerHTML;
};
e.setTitle=function(title){
e.titl.son('b').innerHTML=title;
};
e.getContent=function(){
return e.cont;
};
return e;
}
$$NavItem=function(e){
e.active=function(){
e.show();
var className='on';
var liList=e.parentNode.childList('li',className);
for(var i=0; i<liList.length; i++){
liList[i].removeClass(className);
}
e.appendClass(className);
liList.clear();
}
return e;
}
$$Nav=function(e){
var liList=e.sonList('li');
for(var i=0; i<liList.length; i++){
e[liList[i].id]=$$NavItem(liList[i]);
}
e.clear=function Nav_clear(){
var className='on';
var liList=e.childList('li',className);
for(var i=0; i<liList.length; i++){
liList[i].removeClass(className);
}
}
return e;
}
$$UserUrlCol=function(e){
e.userUrlCatList=new Array();
e.getCatList=function(){
return e.sonList('module');
};
e.reset=function(){
var catList=e.getCatList();
for(var i=0; i<catList.length; i++){
catList[i].catOrder=i;
}
catList.clear();
};
e.insertCat=function(userUrlCat){
if(e.firstChild){
e.insertBefore(userUrlCat,e.firstChild);
e.reset();
}
else{
e.appendChild(userUrlCat);
}
};
e.removeCat=function(userUrlCat){
e.removeChild(userUrlCat);
e.reset();
}
return e;
}
$$UserUrlCat=function(e){
$$Module(e);
e.dragbox=e.titl.son('dragbox');
e.moreBox=e.son('more');
e._show_more=e.moreBox.son('showMore');
e._show_less=e.moreBox.son('showLess');
e.expand=function(){
e.cont.show();
e.moreBox.show();
e.minbox.show();
e.maxbox.hide();
};
e.shrink=function(){
e.cont.hide();
e.moreBox.hide();
e.minbox.hide();
e.maxbox.show();
};
e.highLightDragbox=function(){
e.dragbox.className='dragboxHover';
};
e.lowLightDragbox=function(){
e.dragbox.className='dragbox';
};
e.getUrlList=function(){
return e.getContent().sonList('urlBox');
}
e.getUrlCount=function(){
return parseInt(e.titl.son('span').innerHTML.replace(/[\(\)]+/,'').trim())
};
e.setUrlCount=function(urlCount){
e.titl.son('span').innerHTML='('+urlCount+')';
};
e.plusUrlCount=function(){
e.setUrlCount(e.getUrlCount()+1);
};
e.minusUrlCount=function(){
e.setUrlCount((e.getUrlCount()>=1)?(e.getUrlCount()-1):0);
};
e.insertUrl=function(userUrl){
var content=e.getContent();
content.insertBefore(userUrl,content.firstChild);
e.plusUrlCount();
e.reset();
};
e.appendUrl=function(userUrl){
var content=e.getContent();
content.appendChild(userUrl);
};
e.removeUrl=function(userUrl){
try{
e.getContent().removeChild(userUrl);
}
catch(ex){
userUrl.drop();
}
e.minusUrlCount();
e.reset();
};
e.clearUrl=function(){
var urlList=e.getUrlList();
for(var i=0; i<urlList.length; i++){
urlList[i].drop();
urlList[i].id='';
}
urlList.clear();
};
e.reset=function(){
var urlCount=e.getUrlCount();
var urlList=e.getUrlList();
if(urlList.length>e.catShowNum){
e._show_more.hide();
e._show_less.showAsInline();
}
else if(urlCount>urlList.length){
e._show_more.showAsInline();
e._show_less.hide();
}
else if(urlCount<e.catShowNum){
e._show_less.hide();
e._show_more.hide();
}
for(var i=0; i<urlList.length; i++){
urlList[i].urlOrder=i;
}
urlList.clear();
};
e.showMore=function(){
var urlCount=e.getUrlCount();
var urlList=e.getUrlList();
if(urlCount==urlList.length){
for(var i=0; i<urlList.length; i++){
urlList[i].show();
}
}
else{
UserUrlCatAction.showMore(e);
}
urlList.clear();
e._show_more.hide();
e._show_less.showAsInline();
};
e.showLess=function(){
var urlList=e.getUrlList();
for(var i=e.catShowNum; i<urlList.length; i++){
urlList[i].hide();
}
urlList.clear();
e._show_more.showAsInline();
e._show_less.hide();
};
return e;
}
$$UserUrlCatList=function(e){
$$Dd(e);
e.assign=function(evt){
UserUrlView.targetUserUrlCat=Browser.getTarget(evt).userUrlCat;
e.tee.f.catName.value=UserUrlView.targetUserUrlCat.catName;
return false;
}
e.assemble=function(){
var colList=_user_url_body.colList;
var ulList=e.sonList('ul');
for(var i=0; i<colList.length; i++){
ulList[i].trunc();
var userUrlCatList=null;
if(typeof colList[i].sonList!='undefined'){
userUrlCatList=colList[i].sonList('module');
}
else{
userUrlCatList=colList[i];
}
for(var j=0; j<userUrlCatList.length; j++){
var liElement=document.createElement('li');
var aElement=document.createElement('a');
aElement.setAttribute('title',userUrlCatList[j].catName);
aElement.setAttribute('href','#');
aElement.className='item pl5';
aElement.setAttribute('onclick','return false;');
aElement.innerHTML=userUrlCatList[j].catName;
aElement.userUrlCat=userUrlCatList[j];
aElement.onclick=e.assign;
liElement.appendChild(aElement);
ulList[i].appendChild(liElement);
}
}
return e;
}
return e;
}
$$UserUrl=function(e){
if(e==null){
return e;
}
e.dragbox=e.son('dragbox');
e.url=e.son('url')==null?e.child('a','core'):e.son('url');
e.highLightDragbox=function(){
if(e.dragbox==null){
return;
}
e.dragbox.className='dragboxHover';
e.dragbox.show();
};
e.lowLightDragbox=function(){
if(e.dragbox==null){
return;
}
e.dragbox.hide();
};
e.getUrlName=function(){
return e.url.title;
};
e.setUrlName=function(urlName){
e.url.title=urlName;
e.url.innerHTML=UrlTool.formatUrlName(urlName,16);
};
e.getUrlHref=function(){
return e.url.href;
};
e.setUrlHref=function(urlHref){
e.url.href=urlHref;
};
return e;
}
$$PPT=function(e){
e.dataList=e.son('data').sonList('li');
e.numList=e.son('nav').son('ul').sonList('li');
e.count=e.dataList.length;
e.index=0;
e.breakTime=5000;
e.imageWidth=null;
e.imageSpeed=null;
e.titleWidth=null;
e.titleStep=null;
e.timeId=null;
e.status=true;
e.init=function(imageWidth,titleWidth,expandNum,breakTime){
e.imageWidth=imageWidth;
e.titleWidth=titleWidth;
e.breakTime=breakTime;
e.imageSpeed=(imageWidth-5)/(expandNum-1);
e.titleStep=(titleWidth-5)/(expandNum-1);
}
e.start=function(num){
e.index=num;
clearTimeout(e.timeId);
e.slide();
}
e.slide=function(){
if(e.index<0){
e.index=e.count-1;
}
if(e.index>=e.count){
e.index=0;
}
for(var i=0; i<e.dataList.length; i++){
e.dataList[i].removeClass('on');
e.dataList[i].removeClass('prev');
e.numList[i].removeClass('on');
}
e.dataList[e.index].appendClass('on');
if(e.index==0){
e.dataList[e.count-1].appendClass('prev');
}
else{
e.dataList[e.index-1].appendClass('prev');
}
e.numList[e.index].appendClass('on');
e.dataList[e.index].style.left=e.imageWidth+'px';
e.numList[e.index].son('span').style.width=0;
e.move();
}
e.move=function(){
var data=e.dataList[e.index];
var title=e.numList[e.index].son('span');
if(parseInt(data.offsetLeft)-e.imageSpeed>0){
data.style.left=(parseInt(data.offsetLeft)-e.imageSpeed)+'px';
title.style.width=(parseInt(title.style.width)+e.titleStep)+'px';
setTimeout(e.move,100);
}
else{
data.style.left=0;
title.style.width=e.titleWidth+'px';
e.index=e.index+1;
if(e.status){
e.timeId=setTimeout(e.slide,e.breakTime);
}
}
}
e.play=function(){
e.status=true;
e.son('nav').son('control').son('play').hide();
e.son('nav').son('control').son('stop').show();
e.slide();
}
e.stop=function(){
e.status=false;
clearTimeout(e.timeId);
e.son('nav').son('control').son('play').show();
e.son('nav').son('control').son('stop').hide();
}
e.forward=function(){
e.start(e.index);
}
e.back=function(){
e.start(e.index-2);
}
return e;
}
Cookie={
save:function (name,value){
document.cookie=name+"="+escape(value);
},
get:function (name){
str=document.cookie;
nameIndex=str.indexOf(name+'=');
if(nameIndex!=-1){
return str.substring(nameIndex+name.length+1,str.indexOf(';',nameIndex));
}
else{
return null;
}
}
}
Shade={
colArr:null,
i:0,
targetDom:null,
shade:function(){
if (Shade.i<=Shade.colArr.length){
Shade.i++;
Shade.targetDom.style.backgroundColor=Shade.colArr