
var isDebug=true;var isMoz=(typeof document.implementation!='undefined')&&(typeof document.implementation.createDocument!='undefined');var isIE=(typeof window.ActiveXObject!='undefined');var enableMessage=true;var basePath="/jcl/res/default/";var imagePath=basePath+"image/";function $package(pkname){if(!pkname)return;var pkNames=pkname.split(".");var pn,prevpn="";for(var i=0;i<pkNames.length;i++){pn=pkNames[i];var _s="var adl_result=window."+prevpn+pn;executeScript(_s);if(!adl_result){_s="window."+prevpn+pn+"=new Object();";executeScript(_s);}
prevpn+=pn+".";}}
function $id(id){return document.getElementById(id);}
function executeScript(script){if(isIE)
return execScript(script,"JavaScript");else
return window.eval(script);}
$package("js.lang");js.lang.Object=Object;function $extends(superclass,_class){if(!superclass)return;var __class=_class;if(!__class)__class=this;if(__class.prototype){for(var key in superclass.prototype){if(!__class.prototype[key])
if(!(key.indexOf("__")==0)){__class.prototype[key]=superclass.prototype[key];}}}
else{var obj=__class;var superobject=superclass;if(superclass.prototype){superobject=superclass.prototype;}
else{}
obj.constructor=superobject.constructor;for(var key in superobject){if(!(key.indexOf("__")==0)){obj[key]=superobject[key];}}
superobject=null;}}
$implements=$extends;js.lang.BaseObject=function(){}
js.lang.BaseObject.prototype=new Object();js.lang.BaseObject.prototype.$super=function(){if(!this.constructor)
return null;var superclass=this.__superClass;if(!superclass)
superclass=this.constructor.prototype.__superClass;if(superclass){var __EnableMessage=enableMessage;enableMessage=false;var _super=new superclass();enableMessage=__EnableMessage;for(var key in this){if(!this[key]&&!(key.indexOf("__")==0)&&typeof(this[key])=="function")
_super[key]=this[key];}
return _super;}
return null;}
js.lang.BaseObject.prototype.destory=function(){browser.destory(this);}
js.lang.BaseObject.prototype.getClassName=function(object){var obj=object;if(obj==null)
obj=this;if(obj.className)return obj.className;try{if(!obj.constructor)
return typeof(object);var s=obj.constructor.toString();s=s.replace("function","");var pos=s.indexOf("(");if(pos!=-1)
s=s.substring(0,pos);s=s.Trim();obj.className=s;return obj.className;}
catch(e){return"unknown";}}
js.lang.BaseObject.prototype.getName=function(){if(!this.name){this.name="autoName"+Math.random();this.name=this.name.replace(".","");}
if(!this.hasRegisterName){var js='window.'+this.name+'=this;';eval(js);this.hasRegisterName=true;}
return this.name;}
js.lang.BaseObject.prototype.hashCode=function(){if(!this.__HashCode){this.__HashCode=this.GetClassName()+Math.random();this.__HashCode=this.__HashCode.replace(".","");}
return this.__HashCode;}
$package("js.lang");js.lang.String=String;js.lang.String.prototype.trim=function()
{return this.replace(/(^\s*)|(\s*$)/g,"");}
js.lang.String.prototype.leftTrim=function()
{return this.replace(/(^\s*)/g,"");}
js.lang.String.prototype.rightTrim=function()
{return this.replace(/(\s*$)/g,"");}
js.lang.String.prototype.toDate=function(token,mask){if(token==null)token="-";if(mask==null)mask="ymd";var dateArray=this.split(token);var y=dateArray[mask.indexOf("y")];var m=dateArray[mask.indexOf("m")]-1;var d=dateArray[mask.indexOf("d")];return new Date(y,m,d);}
js.lang.Math=Math;js.lang.Math.isOddNumber=function(value){var v=parseInt(value/2);if(v*2!=value)return true;else return false;}
js.lang.System=function(){this.processes=new Array();this.windows=new Array();this.listeners=new Array();}
js.lang.System.prototype=new js.lang.BaseObject();js.lang.System.prototype.messageBox=function(message,title)
{if(js.ui.MessageBox){if(!this.messageDlg)
this.messageDlg=new js.ui.MessageBox();if(!title)title="Info";this.messageDlg.showMessage(title,message);}
else
alert(message);}
js.lang.System.prototype.openWindow=function(url,parent){var win=new js.ui.Window();if(!parent)parent=document.body;parent.appendChild(win.getUI());win.iframe=document.createElement("iframe");win.add(win.iframe);win.iframe.src=url;return win;}
js.lang.System.prototype.isIE=isIE;js.lang.System.prototype.isMoz=isMoz;var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body))
js.lang.System.prototype.isIE55_6=true;js.lang.System.prototype.getBrowserType=function()
{if(isIE)
return"IE";else if(isMoz)
return"Moz";return"Other";}
js.lang.System.prototype.destory=function(object){object=null;}
js.lang.System.prototype.gc=function(){if(this.isIE){CollectGarbage();setTimeout("CollectGarbage();",1);}}
js.lang.System.prototype.setTimeout=function(callback,timeout,param){var args=Array.prototype.slice.call(arguments,2);var _cb=function(){callback.apply(null,args);}
return setTimeout(_cb,timeout);}
js.lang.System.prototype.setInterval=function(callback,interval,param){var args=Array.prototype.slice.call(arguments,2);var _cb=function(){callback.apply(null,args);}
return setInterval(_cb,interval);}
js.lang.System.prototype.sendMessage=function(hwnd,msg,params,src){if(!enableMessage)return;if(hwnd){if(hwnd.processMessage)
hwnd.processMessage(msg,params,src);}
else{var hwnd;if(this.listeners[msg]){for(var i=0;i<this.listeners[msg].length;i++){hwnd=this.listeners[msg][i];if(hwnd.style)if(hwnd.style.display=="none")continue;if(hwnd.processMessage)
hwnd.processMessage(msg,params,src);}}
if(parent!=window){parent.browser.sendMessage(null,msg,params,src);}}}
js.lang.System.prototype.addListener=function(hwnd,msg){if(!this.listeners[msg])
this.listeners[msg]=new js.lang.Array();if(!this.listeners[msg].contains(hwnd)){this.listeners[msg].addItem(hwnd);}}
js.lang.System.prototype.removeListener=function(hwnd,msg){if(this.listeners[msg])
this.listeners[msg].removeItem(hwnd);}
js.lang.System.prototype.language=(navigator.userLanguage==undefined?navigator.language:navigator.userLanguage).replace("-","_").toLowerCase();var browser=new js.lang.System();function props(propname){var value;if(typeof(ADL_LANGUAGE_PACKAGE)!="undefined")
value=ADL_LANGUAGE_PACKAGE[propname];if(!value)
if(typeof(TOMOS_LANGUAGE_PACKAGE)!="undefined")
value=TOMOS_LANGUAGE_PACKAGE[propname];if(!value)
value=propname;return value;}
$package("js.lang");js.lang.Array=Array;js.lang.Array.prototype.addItem=function(obj){this[this.length]=obj;}
js.lang.Array.prototype.removeItem=function(val){var retCount=0;for(var i=0;i<this.length;i++){if(this[i]==val){for(var j=i;j<this.length-1;j++){this[j]=this[j+1];}
this.length=this.length-1;retCount++;}}
return retCount;}
js.lang.Array.prototype.removeItemAt=function(index){if(index<this.length){for(var i=index;i<this.length-1;i++){this[i]=this[i+1];}
this.length=this.length-1;}}
js.lang.Array.prototype.clear=function(){this.length=0;}
js.lang.Array.prototype.contains=function(obj){return this.indexOf(obj,0)>=0;}
js.lang.Array.prototype.indexOf=function(obj,index){var i;if(!index)index=0;if(obj==null){for(i=index;i<this.length;i++)
if(this[i]==null)return i;}else{for(i=index;i<this.length;i++)
if(obj==this[i])return i;}
return-1;}
js.lang.Array.prototype.getItem=function(idx){return this[idx];}
js.lang.Array.prototype.getFirstItem=function(){if(this.length==0)throw"NoSuchItemException";return this[0];}
js.lang.Array.prototype.getLastItem=function(){if(this.length==0)throw"NoSuchItemException";return this[this.length-1];}
js.lang.Array.prototype.setItemAt=function(obj,index){if(index==null){alert("index is undefined!");throw"index is undefined!";}
if(this.length<index){alert("this.length < "+index);throw"this.length < "+index;}
this[index]=obj;}
js.lang.Array.prototype.insertItem=function(obj,index){if(index>this.length)throw"ArrayIndexOutOfBoundsException: "+index+" > "+this.length;if(this.length>0)
this.arrayCopy(this,index,this,index+1,this.length-index);this[index]=obj;}
js.lang.Array.prototype.arrayCopy=function(srcArray,srcIndex,dstArray,dstIndex,copyLength){if((srcIndex+copyLength)>srcArray.length){alert("(srcIndex + copyLength) > srcArray.length");throw"(srcIndex + copyLength) > srcArray.length";}
if(dstIndex>dstArray.length){alert("dstIndex > dstArray.length");throw"dstIndex > dstArray.length";}
if((dstArray.length-dstIndex)<copyLength){dstArray.length=dstIndex+copyLength;}
var i;var tempArray=new Array();for(i=0;i<copyLength;i++){tempArray.addItem(srcArray[srcIndex+i]);}
for(i=0;i<copyLength;i++){dstArray.setItemAt(tempArray[i],dstIndex+i);}}
$package("js.lang");js.lang.Thread=function(delay){if(delay!=null)this.delay=delay;}
js.lang.Thread.prototype=new js.lang.BaseObject();js.lang.ThreadState={UNSTARTED:-1,TERMINATED:0,STARTED:1,RUNNABLE:2,BLOCKED:3,WAITING:4,TIMED_WAITING:5};js.lang.ThreadPriority={MIN_PRIORITY:1,NORM_PRIORITY:5,MAX_PRIORITY:10};js.lang.Thread.prototype.priority=js.lang.ThreadPriority.MIN_PRIORITY;js.lang.Thread.prototype.state=js.lang.ThreadState.STARTED;js.lang.Thread.prototype.started=false;js.lang.Thread.prototype.delay=0;js.lang.Thread.prototype.tid=null;js.lang.Thread.prototype.interrupted=false;js.lang.Thread.prototype.stop=function(){if(!(this.started))return;window.clearInterval(this.tid);this.tid=null;this.state="TERMINATED";this.started=false;this.interrupted=false;}
js.lang.Thread.prototype.start=function(){if(this.started)return;this.started=true;this.state=js.lang.ThreadState.RUNNABLE;this.interrupted=false;this.tid=window.setInterval(this.run,this.delay);}
js.lang.Thread.prototype.sleep=function(_interval){if(!(this.started))return;if(this.interrupted)return;window.clearInterval(this.tid);this.state=js.lang.ThreadState.TIMED_WAITING;this.interrupted=true;window.setTimeout(this.getName()+".resume();",_interval);}
js.lang.Thread.prototype.run=function(){}
js.lang.Thread.prototype.suspend=function(){if(!(this.started))return;if(this.interrupted)return;window.clearInterval(this.tid);this.state=js.lang.ThreadState.WAITING;this.interrupted=true;}
js.lang.Thread.prototype.resume=function(){if(!(this.started))return;if(!(this.interrupted))return;this.state=js.lang.ThreadState.RUNNABLE;this.interrupted=false;this.tid=window.setInterval(this.run,this.delay);}
$package("js.util");js.util.Timer=function(interval){if(interval!=null)
this.delay=this.interval=interval;var js="if("+this.getName()+".ontimer)"+this.getName()+".ontimer("+this.getName()+");";this.run=new Function(js);}
js.util.Timer.prototype=new js.lang.Thread();js.util.Timer.prototype.interval=1000;js.util.Timer.prototype.active=false;js.util.Timer.prototype.ontimer=function(){};js.util.Timer.prototype.setInterval=function(interval){if(interval!=null)
this.delay=this.interval=interval;}
js.util.Timer.prototype.setActive=function(active){this.active=active;if(active){if(this.started)return;this.delay=this.interval;this.start();}
else{this.stop();}}
$package("js.data");js.data.DOMImpl=function(){}
js.data.DOMImpl.prototype.parse=function(st){var result;if(browser.isIE){result=new js.data.XmlDocument();result.loadXML(st);}
else{var parser=new DOMParser();result=parser.parseFromString(st,"text/xml");}
return result;}
js.data.DOMImpl.prototype.xmlToString=function(xml){if(browser.isIE){return xml.xml;}
else{var xmls=new XMLSerializer();var s=xmls.serializeToString(xml);return s;}}
js.data.XmlDocument=function(){var xmlDoc;if(browser.isIE){xmlDoc=new ActiveXObject("Microsoft.XMLDOM");}else{xmlDoc=document.implementation.createDocument("","",null);}
return xmlDoc;}
$package("js.util");js.util.Utils=function(){}
js.util.Utils.prototype.correctAllPNG=function(){for(var i=0;i<document.images.length;i++)
{js.util.Utils.prototype.correctPNG(document.images[i]);}}
js.util.Utils.prototype.correctPNG=function(img,w,h){var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){var imgName=img.src;var imgNameUp=imgName.toUpperCase();var ext=null;var pos=imgNameUp.lastIndexOf(".");if(pos!=-1)
ext=imgNameUp.substring(pos+1,pos+4);if(ext=="PNG"){var LW=img.width;var LH=img.height;if(!LW)LW=img.offsetWidth;if(!LH)LH=img.offsetHeight;if(w)LW=w;if(h)LH=h;img.onload=null;img.src=imagePath+"/common/transparent.gif";img.__filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+imgName+"', sizingmethod=scale);";img.style.filter+=img.__filter;img.__src=imgName;img.style.width=LW;img.style.height=LH;}
else{if(img.__filter)
img.style.filter=img.style.filter.replace(img.__filter,"");}}}
js.util.Utils.prototype.correctPNGBackground=function(obj,url){var bg;if(!url){bg=obj.style.backgroundImage;bg=bg.replace(/url\(/g,'');bg=bg.replace(/\)/g,'');}
else{bg=url+"?";}
var imgName=bg.toUpperCase();var ext=null;var pos=imgName.lastIndexOf(".");if(pos!=-1)
ext=imgName.substring(pos+1,pos+4);if(ext=="PNG"){obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg+"', sizingmethod=scale);";if(!url)
obj.style.background="none";}}
js.util.Utils.prototype.setImage=function(img,src,w,h){if(w)img.style.width=w;if(h)img.style.height=h;if(browser.isIE){if(browser.isIE55_6){img.onload=function(){js.util.Utils.prototype.correctPNG(this,w,h);}}
img.src=src;}
else{img.src=src;}}
js.util.Utils.prototype.encodeString=function(text){text=text.replace(/%/g,"%25");text=text.replace(/ /g,"%20");text=text.replace(/\+/g,"%2B");text=text.replace(/#/g,"%23");text=text.replace(/&/g,"%26");text=text.replace(/=/g,"%3D");text=text.replace(/\?/g,"%3F");return text;}
js.util.Utils.prototype.getBodyScrollXY=function(){var x,y;if(document.body.scrollTop){x=document.body.scrollLeft;y=document.body.scrollTop;}
else{x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}
return{x:x,y:y};}
js.util.Utils.prototype.copyEdit=function(edit){try{if(edit.value)
window.clipboardData.setData("Text",edit.value);else if(edit.innerHTML)
window.clipboardData.setData("Text",edit.innerHTML);browser.messageBox('Copy Sucessfuly!');}catch(e){edit.select();browser.messageBox('No support clipboard!');}}
js.util.Date=Date;js.util.Date.prototype.format=function(style){}
js.util.Date.prototype.formatDateTime=function(format){var o={"M+":this.getMonth()+1,"d+":this.getDate(),"H+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S":this.getMilliseconds()}
if(/(y+)/.test(format))format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length));for(var k in o)if(new RegExp("("+k+")").test(format))
format=format.replace(RegExp.$1,RegExp.$1.length==1?o[k]:("00"+o[k]).substr((""+o[k]).length));return format;}
js.util.Format=function(){}
js.util.Format.prototype.formatFloat=function(value,mask){var action;if(browser.isIE)
action="formatNumber";else
action="format-number";return js.util.Format.prototype.basicFormat(value,mask,action)}
js.util.Format.prototype.formatDate=function(varDate,bstrFormat,varDestLocale){if(browser.isIE){action="formatDate";return js.util.Format.prototype.basicFormat(varDate,bstrFormat,action,varDestLocale);}
else{var v=new js.util.Date(varDate);v=v.format(bstrFormat);return v;}}
js.util.Format.prototype.formatTime=function(varTime,bstrFormat,varDestLocale){if(browser.isIE){action="formatTime";return js.util.Format.prototype.basicFormat(varTime,bstrFormat,action,varDestLocale);}
else{var v=new js.util.Date(varTime);v=v.format(bstrFormat);return v;}}
js.util.Format.prototype.basicFormat=function(value,mask,action,param){var xmlDoc;var xslDoc;var dom_impl=new js.data.DOMImpl();var v='<formats><format><value>'+value+'</value><mask>'+mask+'</mask></format></formats>';xmlDoc=dom_impl.parse(v);var x;if(browser.isIE)
x='<xsl:stylesheet xmlns:xsl="uri:xsl">'
else
x='<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math">';x+='<xsl:template match="/">';if(isIE){if(action=='formatDate'||action=='formatTime')
x+='<xsl:eval>'+action+'(new Date("'+value+'").getVarDate(),"'+mask+'"';else
x+='<xsl:eval>'+action+'('+value+',"'+mask+'"';if(param)x+=',"'+param+'"';x+=')</xsl:eval>';}
else{x+='<xsl:value-of select="'+action+'(\''+value+'\',\''+mask+'\')" />';}
x+='</xsl:template></xsl:stylesheet>';xslDoc=dom_impl.parse(x);var s;if(browser.isIE)
s=xmlDoc.transformNode(xslDoc)
else{var processor=new XSLTProcessor();processor.importStylesheet(xslDoc);var result=processor.transformToFragment(xmlDoc,xmlDoc);var xmls=new XMLSerializer();s=xmls.serializeToString(result);}
return s;}
js.util.Format.prototype.formatUnits=function(baseNumber,unitDivisors,unitLabels,singleFractional){var i,unit,unitDivisor,unitLabel;if(baseNumber===0){return"0 "+unitLabels[unitLabels.length-1];}
if(singleFractional){unit=baseNumber;unitLabel=unitLabels.length>=unitDivisors.length?unitLabels[unitDivisors.length-1]:"";for(i=0;i<unitDivisors.length;i++){if(baseNumber>=unitDivisors[i]){unit=(baseNumber/unitDivisors[i]).toFixed(2);unitLabel=unitLabels.length>=i?" "+unitLabels[i]:"";break;}}
return unit+unitLabel;}else{var formattedStrings=[];var remainder=baseNumber;for(i=0;i<unitDivisors.length;i++){unitDivisor=unitDivisors[i];unitLabel=unitLabels.length>i?" "+unitLabels[i]:"";unit=remainder/unitDivisor;if(i<unitDivisors.length-1){unit=Math.floor(unit);}else{unit=unit.toFixed(2);}
if(unit>0){remainder=remainder%unitDivisor;formattedStrings.push(unit+unitLabel);}}
return formattedStrings.join(" ");}}
js.util.Format.prototype.formatBytes=function(baseNumber){var sizeUnits=[1073741824,1048576,1024,1],sizeUnitLabels=["GB","MB","KB","bytes"];return this.formatUnits(baseNumber,sizeUnits,sizeUnitLabels,true);}
js.util.Format.prototype.formatMinutes=function(minutes){var day=parseInt(Math.floor(minutes/1440));var hour=day>0?Math.floor((minutes-day*1440)/60):Math.floor(minutes/60);var minute=hour>0?Math.floor(minutes-day*1440-hour*60):minutes;var time="";if(day>0)time+=day+" ";if(hour>0)time+=hour+":";if(minute>0)time+=minute+":";return time;}
js.util.Format.prototype.formatSeconds=function(seconds){if(seconds>0){var minutes=Math.floor(seconds/60);seconds=seconds-minutes*60;return this.formatMinutes(minutes)+(seconds>0?seconds+"s":"");}
return seconds;}
$package("js.ui");var rootPanel=document.body;js.ui.Point=function(x,y){if(!x)
x=0;if(!y)
y=0;this.x=x;this.y=y;}
js.ui.Point.prototype.setLocation=function(x,y){this.x=x;this.y=y;}
js.ui.Dimension=function(width,height){if(!width)
width=0;if(!height)
height=0;this.width=width;this.height=height;}
js.ui.Dimension.prototype.setSize=function(width,height){this.width=width;this.height=height;}
js.ui.Rectangle=function(x,y,width,height){if(!x)
x=0;if(!y)
y=0;if(!width)
width=0;if(!height)
height=0;this.x=x;this.y=y;this.width=width;this.height=height;}
js.ui.Rectangle.prototype.contains=function(x,y){var x1=this.x;var x2=this.width;var y1=this.y;var y2=this.height;if((x-x1)<x2&&(x-x1)>0&&(y-y1)<y2&&(y-y1)>0)return true;else return false;}
js.ui.MouseEvent=function(){if(browser.isIE){this.leftButton=1;this.rightButton=2;this.middleButton=4;}
else{this.leftButton=0;this.rightButton=2;this.middleButton=1;}}
var MouseEvent=new js.ui.MouseEvent();js.ui.Component=function(){}
js.ui.Component.prototype=new js.lang.BaseObject();js.ui.Component.prototype.popupMenu=null;js.ui.Component.prototype.ui=null;js.ui.Component.prototype.getUI=function(){if(this.ui)return this.ui;this.ui=this.getDomNode();this.ui.owner=this;this.ui.oncontextmenu=js.ui.Component.default_oncontextmenu;this.bindUI();return this.ui;}
js.ui.Component.prototype.setUI=function(ui){this.ui=ui;ui.owner=this;this.bindUI();}
js.ui.Component.prototype.bindUI=function(){}
js.ui.Component.prototype.getDomNode=function(id){if(!id)id=this.getNativeClass();var classNode=document.getElementById(id);if(!classNode)
throw"NativeClass not exists.";var node=classNode.cloneNode(true);node.id="";return node;}
js.ui.Component.prototype.getNativeClass=function(){}
js.ui.Component.prototype.addListener=function(msg){browser.addListener(this,msg);}
js.ui.Component.prototype.removeListener=function(msg){browser.removeListener(this,msg);}
js.ui.Component.default_oncontextmenu=function(event,noEventCancel){if(!event)event=window.event;var popupmenu=this.owner.popupMenu;if(popupmenu)if(popupmenu.autoPopup){if(this.style.zIndex>=0)
popupmenu.ui.style.zIndex=this.style.zIndex+1;var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;popupmenu.popup(x+2,y);if(!noEventCancel)
return js.ui.Component.eventCancelBubble(event);else
return true;}}
js.ui.Component.eventCancelBubble=function(event){if(!event)event=window.event;if(browser.isIE){event.cancelBubble=true;event.returnValue=false;}
else
event.stopPropagation();return false;}
js.ui.Component.prototype.show=function(){this.getUI().style.display="";}
js.ui.Component.prototype.hide=function(){this.getUI().style.display="none";}
js.ui.Component.prototype.setBounds=function(x,y,w,h){this.getUI().style.position="absolute";this.ui.style.left=x;this.ui.style.top=y;this.ui.style.width=w;this.ui.style.height=h;}
js.ui.Component.prototype.setSize=function(w,h){this.getUI().style.width=w;this.ui.style.height=h;}
js.ui.Component.prototype.setOpacity=function(opacity){if(!this.ui)this.getUI();if(!this.ui.style)return;this.opacity=opacity;if(browser.isIE){if(opacity==null){if(this.ui.filters.alpha){var op="alpha(opacity="+this.ui.filters.alpha.opacity+")";this.ui.style.filter=this.ui.style.filter.replace(op,"");}}
else{if(!this.ui.style.filter)
this.ui.style.filter="alpha(opacity="+opacity+")";else
this.ui.style.filter+=" alpha(opacity="+opacity+")";if(typeof(this.ui.filters)!="unknown")
if(this.ui.filters.alpha)this.ui.filters.alpha.opacity=opacity;}}
else{if(opacity==null)
this.ui.style.MozOpacity=null;else
this.ui.style.MozOpacity=opacity/100;}}
js.ui.Component.prototype.center=function(){this.ui.style.position="absolute";var left=(document.documentElement.clientWidth-this.ui.offsetWidth)/2+js.util.Utils.prototype.getBodyScrollXY().x;if(left<0)left=0;this.ui.style.left=left+"px";var top=(document.documentElement.clientHeight-this.ui.offsetHeight)/2+js.util.Utils.prototype.getBodyScrollXY().y;if(top<0)top=0;this.ui.style.top=top+"px";}
js.ui.Component.prototype.setMoveable=function(enable_move){this.moveable=enable_move;var ui=this.getUI();if(enable_move){ui.onmousedown=js.ui.Component.__onmousedown;ui.onmousemove=js.ui.Component.__onmousemove;ui.onmouseup=js.ui.Component.__onmouseup;ui.ondragstart=js.ui.Component.__ondragstart;ui.ondrag=js.ui.Component.__ondrag;ui.ondragend=js.ui.Component.__ondragend;}
else{ui.onmousedown=null;ui.onmousemove=null;ui.onmouseup=null;ui.ondragstart=null;ui.ondrag=null;ui.ondragend=null;}}
js.ui.Component.prototype.borderWidth=10;js.ui.Component.prototype.setResizeable=function(enable_resize){this.resizeable=enable_resize;var ui=this.getUI();if(enable_resize){ui.onmousedown=js.ui.Component.__onmousedown;ui.onmousemove=js.ui.Component.__onmousemove;ui.onmouseup=js.ui.Component.__onmouseup;ui.ondragstart=js.ui.Component.__ondragstart;ui.ondrag=js.ui.Component.__ondrag;ui.ondragend=js.ui.Component.__ondragend;ui.onmouseout=js.ui.Component.__onmouseout;}
else{ui.onmousedown=null;ui.onmousemove=null;ui.onmouseup=null;ui.ondragstart=null;ui.ondrag=null;ui.ondragend=null;ui.onmouseout=null;}}
js.ui.Component.prototype.setDragable=function(enable_drag){this.dragable=enable_drag;var ui=this.getUI();if(enable_drag){ui.onmousedown=js.ui.Component.__onmousedown;ui.onmousemove=js.ui.Component.__onmousemove;ui.onmouseup=js.ui.Component.__onmouseup;ui.ondragstart=js.ui.Component.__ondragstart;ui.ondrag=js.ui.Component.__ondrag;ui.ondragend=js.ui.Component.__ondragend;}
else{ui.onmousedown=null;ui.onmousemove=null;ui.onmouseup=null;ui.ondragstart=null;ui.ondrag=null;ui.ondragend=null;}}
js.ui.Component.prototype.getOffsetLeft=function(parent,scroll){var x=0;var el=this.getUI();while(el){x+=el.offsetLeft-el.scrollLeft;if(scroll)x-=el.scrollLeft;if(el.offsetParent==parent)break;el=el.offsetParent;}
return x;}
js.ui.Component.prototype.getOffsetTop=function(parent,scroll){var y=0;var el=this.getUI();while(el){y+=el.offsetTop-el.scrollTop;if(el.offsetParent==parent)break;el=el.offsetParent;}
return y;}
js.ui.Component.prototype.getOffsetZIndex=function(parent){var el=this.getUI();var zIndex=el.style.zIndex;if(!parent)parent==document.body;while(el){if(el.offsetParent==parent)break;zIndex=el.style.zIndex;el=el.offsetParent;}
if(zIndex==null)zIndex=1;return zIndex;}
js.ui.Component.__onmousedown=function(event){if(!event)event=window.event;var owner=this.owner;if(event.button==MouseEvent.leftButton&&(owner.dragable||owner.moveable||owner.resizeable)){var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;owner.__oldX=x;owner.__oldY=y;owner.__oldOffsetLeft=this.offsetLeft;owner.__oldOffsetTop=this.offsetTop;owner.__oldOffsetWidth=this.offsetWidth;owner.__oldOffsetHeight=this.offsetHeight;if(owner.__willResize)owner.__isResize=true;if(!owner.__isResize)owner.__isDrag=true;owner.__isStartDrag=false;return js.ui.Component.eventCancelBubble(event);}}
js.ui.Component.__onmouseup=function(event){var __this;if(window.captureEventObject)
__this=window.captureEventObject;else __this=this;var owner=__this.owner;if(!owner)return;if(owner.__isDrag||owner.__isResize){if(!event)event=window.event;if(owner.moveable&&owner.__isDrag){var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;if(owner.__isStartDrag){if(x)__this.style.left=owner.__oldOffsetLeft+x-owner.__oldX+"px";if(y){var top=owner.__oldOffsetTop+y-owner.__oldY;if(top>=0)__this.style.top=top+"px";}
if(__this.style.position=='relative'){if(__this.parentNode.childNodes.length>1){__this.style.position="absolute";}}}}
if(owner.__isStartDrag){if(__this.ondragend)
__this.ondragend(event);}
if(browser.isIE)
this.releaseCapture();else{window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);}
if(owner.__isStartDrag){owner.__isStartDrag=false;js.ui.Component.eventCancelBubble(event);}}
owner.__isDrag=false;owner.__isResize=false;window.captureEventObject=null;}
js.ui.Component.__onmousemove=function(event){if(!event)event=window.event;var __this,owner;if(window.captureEventObject)
__this=window.captureEventObject;else __this=this;if(__this==window)return;owner=__this.owner;if(!owner.__oldCursor){owner.__oldCursor=__this.style.cursor;if(!owner.__oldCursor)owner.__oldCursor="default";}
var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;if(!owner.__isStartDrag&&(owner.__isResize||owner.__isDrag)){if(x!=owner.__oldX||y!=owner.__oldY){owner.__isStartDrag=true;if(browser.isIE){this.setCapture();}
else{window.captureEventObject=this;window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);window.__oldonmousemove=window.onmousemove;window.__oldonmouseup=window.onmouseup;window.onmousemove=this.onmousemove;window.onmouseup=this.onmouseup;}}}
if(owner.__isDrag&&owner.__isStartDrag){if(owner.dragable){if(browser.isIE)
this.dragDrop();else{if(__this.ondragstart&&!owner.__dragStart)
__this.ondragstart(event);if(__this.ondrag)
__this.ondrag(event);}}
else if(owner.moveable){if(__this.ondragstart&&!owner.__dragStart)
__this.ondragstart(event);if(__this.ondrag)
__this.ondrag(event);}}
else if(owner.resizeable){if(owner.__isResize&&owner.__isStartDrag){owner.__willResize=false;var cursor=__this.style.cursor;cursor=cursor.substring(0,2);if(cursor.indexOf("e")!=-1&&x){var w=x-__this.owner.getOffsetLeft();if(w>=0)__this.style.width=w+"px";}
if(cursor.indexOf("s")!=-1&&y){var h=y-__this.owner.getOffsetTop();if(h>=0)__this.style.height=h+"px";}
if(cursor.indexOf("w")!=-1&&x){var w=owner.__oldOffsetWidth+(owner.__oldX-x);if(w>=0)__this.style.width=w+"px";__this.style.left=owner.__oldOffsetLeft-(owner.__oldX-x)+"px";}
if(cursor.indexOf("n")!=-1&&y){var h=owner.__oldOffsetHeight+(owner.__oldY-y);if(h>=0)__this.style.height=h+"px";__this.style.top=owner.__oldOffsetTop-(owner.__oldY-y)+"px";}}
else{var cursor="";owner.__willResize=true;if(y<owner.getOffsetTop(null,true)+owner.borderWidth){cursor+="n";}
if(y>owner.getOffsetTop(null,true)+__this.offsetHeight-owner.borderWidth&&y<=owner.getOffsetTop(null,true)+__this.offsetHeight){cursor+="s";}
if(x>owner.getOffsetLeft(null,true)+__this.offsetWidth-owner.borderWidth&&x<=owner.getOffsetLeft(document.body,true)+__this.offsetWidth){cursor+="e";}
if(x<owner.getOffsetLeft(null,true)+owner.borderWidth){cursor+="w";}
if(cursor!=""){cursor+="-resize";}
if(!cursor){owner.__willResize=false;cursor=owner.__oldCursor;if(!cursor)cursor="default";}
__this.style.cursor=cursor;window.status=cursor;}}
if(owner.__isStartDrag){return js.ui.Component.eventCancelBubble(event);}}
js.ui.Component.__onmouseout=function(event){if(!event)event=window.event;var owner=this.owner;if(owner.__isResize||owner.__isDrag){this.onmousemove(event);js.ui.Component.eventCancelBubble(event);}}
js.ui.Component.__ondragstart=function(event){if(!event)event=window.event;var owner=this.owner;if(this.owner.dragable){if(!event.dataTransfer)
event.dataTransfer=new js.lang.Array();event.dataTransfer.effectAllowed="move";}
owner.__dragStart=true;if(!owner.__dragView){owner.__dragView=new js.ui.Div();owner.__dragView.getUI().style.zIndex=this.style.zIndex+1;owner.__dragView.getUI().style.position="absolute";owner.__dragView.getUI().onmousemove=function(event){if(!event)event=window.event;var x=event.clientX?event.clientX:event.pageX;if(x)this.style.left=x+"px";};}
owner.__dragView.getUI().innerHTML="";if(!this.owner.optimizeDisplay){var newnode=this.cloneNode(true);newnode.style.position="static";newnode.style.width="100%";newnode.style.height="100%";owner.__dragView.getUI().appendChild(newnode);owner.__dragView.setOpacity(50);}
else{owner.__dragView.getUI().className="ui_moving";}
document.body.appendChild(owner.__dragView.getUI());}
js.ui.Component.__ondrag=function(event){if(!event)event=window.event;var owner=this.owner;var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;owner.__dragView.getUI().style.width=this.offsetWidth+"px";owner.__dragView.getUI().style.height=this.offsetHeight+"px";if(x&&y){owner.__dragView.getUI().style.left=this.owner.getOffsetLeft(document.body,true)+x-owner.__oldX+"px";owner.__dragView.getUI().style.top=this.owner.getOffsetTop(document.body,true)+y-owner.__oldY+"px";}}
js.ui.Component.__ondragend=function(event){if(!event)event=window.event;var owner=this.owner;owner.__dragStart=false;if(owner.__dragView){if(owner.__dragView.getUI().parentNode==document.body){document.body.removeChild(owner.__dragView.getUI());}}
if(browser.isIE)
this.releaseCapture();else{window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);}
owner.__isResize=false;owner.__isDrag=false;window.captureEventObject=null;}
js.ui.Container=function(){}
js.ui.Container.prototype=new js.ui.Component();js.ui.Component.prototype.container=null;js.ui.Container.prototype.getContainer=function(){if(!this.ui)this.getUI();return this.container;}
js.ui.Container.prototype.add=function(child){var childUI=child;if(child.getUI)childUI=child.getUI();this.getContainer().appendChild(childUI);}
js.ui.Container.prototype.remove=function(indexOrobj){}
js.ui.Container.prototype.removeAll=function(){}
js.ui.Container.prototype.destory=function(){}
js.ui.Component.prototype.getOuterHTML=function(element)
{if(!element)element=this;if(element.outerHTML)return element.outerHTML;element=element.cloneNode(true);var outer=document.createElement("DIV");outer.appendChild(element);return outer.innerHTML;}
$package("js.ui");js.ui.Img=function(){}
js.ui.Img.prototype=new js.ui.Component();js.ui.Img.prototype.getNativeClass=function(){return"js.ui.Img";}
js.ui.Img.prototype.setSrc=function(src,w,h){if(w)this.getUI().style.width=w;if(h)this.getUI().style.height=h;if(browser.isIE&&src){if(browser.isIE55_6&&src.indexOf(".png")!=-1){this.getUI().onload=function(){js.util.Utils.prototype.correctPNG(this,w,h);}
this.getUI().src=src;}
else this.getUI().src=src;}
else{this.getUI().src=src;}}
js.ui.Img.prototype.getSrc=function(){if(this.getUI().__src)
return this.getUI().__src;else
return this.getUI().src;}
js.ui.Edit=function(){}
js.ui.Edit.prototype=new js.ui.Component();js.ui.Edit.prototype.getUI=function(){if(!this.ui){this.ui=document.createElement("input");this.ui.type="text";this.ui.owner=this;this.bindUI();}
return this.ui;}
js.ui.Div=function(){}
js.ui.Div.prototype=new js.ui.Component();js.ui.Div.prototype.getUI=function(){if(!this.ui){this.ui=document.createElement("div");this.ui.owner=this;this.bindUI();}
return this.ui;}
js.ui.HLayout=function(){}
js.ui.HLayout.prototype=new js.ui.Component();js.ui.HLayout.prototype.getUI=function(){if(!this.ui){this.ui=document.createElement("table");this.ui.width=this.ui.height="100%";this.ui.border=0;this.ui.cellSpacing=0;this.ui.cellpadding=0;this.ui.owner=this;this.bindUI();}
return this.ui;}
js.ui.HLayout.prototype.bindUI=function(){this.row=this.ui.insertRow(-1);this.left=this.row.insertCell(-1);this.right=this.row.insertCell(-1);this.left.vAlign="top";this.right.vAlign="top";}
js.ui.HLayout.prototype.addLeft=function(child){if(!this.ui)this.getUI();if(child.getUI)child=child.getUI();this.left.appendChild(child);}
js.ui.HLayout.prototype.addRight=function(child){if(!this.ui)this.getUI();if(child.getUI)child=child.getUI();this.right.appendChild(child);}
js.ui.VLayout=function(){}
js.ui.VLayout.prototype=new js.ui.Component();js.ui.VLayout.prototype.getUI=function(){if(!this.ui){this.ui=document.createElement("table");this.ui.border=0;this.ui.cellSpacing=0;this.ui.cellpadding=0;this.ui.width=this.ui.height="100%";this.ui.owner=this;this.bindUI();}
return this.ui;}
js.ui.VLayout.prototype.bindUI=function(){this.topRow=this.ui.insertRow(-1);this.top=this.topRow.insertCell(-1);this.bottomRow=this.ui.insertRow(-1);this.bottom=this.bottomRow.insertCell(-1);}
js.ui.VLayout.prototype.addTop=function(child){if(!this.ui)this.getUI();if(child.getUI)child=child.getUI();this.top.appendChild(child);}
js.ui.VLayout.prototype.addBottom=function(child){if(!this.ui)this.getUI();if(child.getUI)child=child.getUI();this.bottom.appendChild(child);}
js.ui.ImageButton=function(){}
js.ui.ImageButton.prototype=new js.ui.Img();js.ui.ImageButton.prototype.bindUI=function(){var __this=this;this.ui.style.backgroundColor="";this.ui.onmouseover=function(){if(__this.mouseoverImage){this.style.filter="";__this.setSrc(__this.mouseoverImage);}
else{__this.__oldOpacity=__this.opacity;__this.setOpacity(100);}}
this.ui.onmouseout=function(){if(__this.mouseoverImage){this.style.filter="";__this.setSrc(__this.__image);}
else
__this.setOpacity(__this.__oldOpacity);}
this.ui.onmousedown=function(event){if(!event)event=window.event;if(__this.mousedownImage){this.style.filter="";__this.setSrc(__this.mousedownImage);}
else
__this.setOpacity(30);js.ui.Component.eventCancelBubble(event);}
this.ui.onmouseup=function(event){if(!event)event=window.event;if(__this.mousedownImage){this.style.filter="";__this.setSrc(__this.__image);}
else
__this.setOpacity(__this.__oldOpacity);js.ui.Component.eventCancelBubble(event);}}
js.ui.ImageButton.prototype.setImage=function(src,w,h){this.setSrc(src,w,h);this.__image=src;}
$package("js.ui")
js.ui.MenuSeparator=function(){}
js.ui.MenuSeparator.prototype=new js.ui.Component();js.ui.MenuSeparator.prototype.getNativeClass=function(){return"js.ui.MenuSeparator";}
js.ui.MenuItem=function(){this.items=new js.lang.Array();}
js.ui.MenuItem.prototype=new js.ui.Component();js.ui.MenuItem.prototype.selected=false;js.ui.MenuItem.prototype.isParent=false;js.ui.MenuItem.prototype.getNativeClass=function(){return"js.ui.MenuItem";}
js.ui.MenuItem.prototype.bindUI=function(){var tds=this.ui.getElementsByTagName("tr")[1].getElementsByTagName("td");this.iconCell=tds[1];this.text=tds[2];this.rightCell=tds[3];var __this=this;this.ui.onmouseover=function(){this.className="MenuItem Panel Panel_over";__this.setSelected(true);if(__this.__isMenuBarItem&&!__this.menu.__isPopuped)return;if(__this.hasSubMenu()&&__this.subMenu.visible)return;if(__this.menu){if(__this.menu.hideSubMenu){__this.menu.hideSubMenu(__this.menu);}}
__this.showSubMenu();}
this.ui.onmouseout=function(){this.className="MenuItem Panel";}
this.ui.onkeydown=function(event){}
this.ui.onmousedown=function(event){return js.ui.Component.eventCancelBubble(event);}
this.ui.onclick=function(event){if(!event)event=window.event;if(!__this.hasSubMenu()){if(__this.menu&&!__this.__isMenuBarItem){__this.menu.hide();}
if(!__this.root.isMenuBar)
__this.root.hide();else
__this.root.hideSubMenu();}
if(__this.onclick){__this.onclick(event);browser.sendMessage(null,201,event,window);}
return js.ui.Component.eventCancelBubble(event);}}
js.ui.MenuItem.prototype.setIcon=function(url,w,h){if(!this.ui)this.getUI();if(!this.icon){this.icon=new js.ui.Img();this.iconCell.appendChild(this.icon.getUI());}
this.icon.setSrc(url,w,h);}
js.ui.MenuItem.prototype.setRightIcon=function(url,w,h){if(!this.ui)this.getUI();if(!this.rightIcon){this.rightIcon=new js.ui.Img();this.rightCell.appendChild(this.rightIcon.getUI());}
this.rightIcon.setSrc(url,w,h);}
js.ui.MenuItem.prototype.setText=function(lable){if(!this.ui)this.getUI();this.text.innerHTML=lable;}
js.ui.MenuItem.prototype.setSubMenu=function(menu){document.body.appendChild(menu.getUI());this.subMenu=menu;this.subMenu.root=this.root;this.subMenu.menu=this.menu;this.subMenu.hide();menu.owner=this;if(!this.__isMenuBarItem){var url=imagePath+'menu/rightArrow.gif';this.setRightIcon(url);}}
js.ui.MenuItem.prototype.subMenuClass=null;js.ui.MenuItem.prototype.createSubMenu=function(){if(!this.subMenuClass)
this.subMenuClass=js.ui.Menu;this.subMenu=new this.subMenuClass();this.setSubMenu(this.subMenu);return this.subMenu;}
js.ui.MenuItem.prototype.showSubMenu=function(){if(!this.hasSubMenu())return;this.subMenu.getUI().style.zIndex=this.getOffsetZIndex()+1;this.subMenu.ui.style.position="absolute";this.subMenu.show();var top;if(this.__isMenuBarItem){top=this.getOffsetTop()+this.ui.offsetHeight;this.subMenu.getUI().style.left=this.getOffsetLeft();}
else{this.subMenu.getUI().style.left=this.getOffsetLeft()+this.ui.offsetWidth;top=this.getOffsetTop();var maxbottom=this.menu.getOffsetTop()+this.menu.ui.offsetHeight;if(top>maxbottom-this.subMenu.getUI().offsetHeight){top=maxbottom-this.subMenu.getUI().offsetHeight;}}
this.subMenu.getUI().style.top=top;this.subMenu.popup(this.subMenu.ui.style.left,top);this.menu.__isPopuped=true;}
js.ui.MenuItem.prototype.hideSubMenu=function(except){if(this.hasSubMenu()){this.subMenu.hideSubMenu(except);this.subMenu.setVisible(false);}
this.menu.__isPopuped=false;}
js.ui.MenuItem.prototype.setSelected=function(selected){this.selected=selected;if(selected){this.className="js_ui_Style_Selected js_ui_MenuItem js_ui_MenuItem_Selected";}
else{this.className="js_ui_MenuItem";}}
js.ui.MenuItem.prototype.setEnabled=function(enabled){if(enabled)this.enabled=enabled;this.disabled=!enabled;if(browser.isMoz){if(!enabled){this.setOpacity(30);if(this.onclick&&!this.__oldOnClick)
this.__oldOnClick=this.onclick;this.onmouseup=js.ui.Component.eventCancelBubble;}
else{this.setOpacity(null);if(this.__oldOnClick)
this.onclick=this.__oldOnClick;this.__oldOnClick=null;this.onmouseup=js.ui.MenuItem.prototype.__MenuItem_onclick;}}}
js.ui.MenuItem.prototype.isEnabled=function(){return this.enabled;}
js.ui.MenuItem.prototype.hasSubMenu=function(){if(this.subMenu)return true;else return false;}
js.ui.MenuItem.prototype.hasPopupMenu=function(){if(this.popupMenu)return true;else return false;}
js.ui.MenuItem.prototype.__MenuItem_onclick=function(event){if(!event)event=window.event;if(!this.hasSubMenu()){if(this.menu&&!this.__isMenuBarItem){this.menu.Hide();}
if(!this.root.isMenuBar)
this.root.hide();else
this.root.hideSubMenu();}
js.ui.Component.eventCancelBubble(event);if(this.onclick){this.onclick(event);browser.sendMessage(null,201,event,window);}}
function MenuItem_onmouseover(event){this.setSelected(true);if(this.__isMenuBarItem&&!this.menu.__isPopuped)return;if(this.hasSubMenu()&&this.subMenu.visible)return;if(this.menu){if(this.menu.hideSubMenu){this.menu.hideSubMenu(this.menu);}}
this.showSubMenu();this.setSelected(true);return true;}
function MenuItem_onmouseout(){if(!this.hasSubMenu())
this.setSelected(false);else{if(!this.subMenu.visible)
this.setSelected(false);}}
js.ui.Menu=function(){this.items=new js.lang.Array();}
js.ui.Menu.prototype=new js.ui.Container();js.ui.Menu.prototype.getNativeClass=function(){return"js.ui.Menu";}
js.ui.Menu.prototype.bindUI=function(){this.container=this.ui.getElementsByTagName("table")[0];}
js.ui.Menu.prototype.addSeparator=function(){var sep=new js.ui.MenuSeparator();this.getContainer().appendChild(sep.getUI());return sep;}
js.ui.Menu.prototype.insert=function(menuitem,beforeitem){this.add(menuitem,beforeitem);}
js.ui.Menu.prototype.add=js.ui.Menu.prototype.addItem=function(menuitem,beforeitem){if(beforeitem){this.getContainer().insertBefore(menuitem.getUI(),beforeitem.getUI());}else{this.getContainer().appendChild(menuitem.getUI());this.items.addItem(menuitem);}
menuitem.menu=this;menuitem.__isMenuBarItem=false;if(this.root)
menuitem.root=this.root;else
menuitem.root=this;}
js.ui.Menu.prototype.remove=function(indexOrobj){if(typeof indexOrobj=="object"){if(indexOrobj.Hide)indexOrobj.Hide();if(this.removeChild)
this.tbody.removeChild(indexOrobj);this.Items.RemoveItem(indexOrobj);}
else if(typeof indexOrobj=="number"){var obj=this.Items[indexOrobj];if(!obj){alert("out of index");return;}
if(obj.Hide)obj.Hide();if(this.removeChild)
this.tbody.removeChild(obj);this.Items.RemoveItem(obj);}}
js.ui.Menu.prototype.removeAll=function(){var num=this.Items.length;for(var i=0;i<num;i++){this.Remove(0);}
this.RemoveSubMenu();}
js.ui.Menu.prototype.contains=function(menuitem){var value=false;for(var i=0;i<this.Items.length;i++){var currentItem=this.Items[i];if(currentItem==menuitem)value=true;}}
js.ui.Menu.prototype.indexOf=function(menuitem){for(var i=0;i<this.items.length;i++){var currentItem=this.items[i];if(currentItem==menuitem)return i;}
return null;}
js.ui.Menu.prototype.getItem=function(index){return this.Items.GetItem(index);}
js.ui.Menu.prototype.getItemCount=function(){return this.Items.GetLength();}
js.ui.Menu.prototype.getItemByName=function(name){}
js.ui.Menu.prototype.replace=function(olditem,newitem){var index=this.IndexOf(olditem);this.Remove(olditem);if(index)this.Add(newitem,index);}
js.ui.Menu.prototype.hide=function(){this.__superHide=js.ui.Component.prototype.hide;this.__superHide();this.hideSubMenu();if(this.root)
this.root.__isPopuped=false;if(this.owner)
if(this.owner.menu)
this.owner.menu.autoPopup=false;}
js.ui.Menu.prototype.hideSubMenu=function(except){var menuitem,submenu,isvisible;for(var i=0;i<this.items.length;i++){menuitem=this.items.getItem(i);if(menuitem.hasSubMenu()){if(except)
isvisible=this.isExistSubMenu(except);else
isvisible=false;if(!isvisible){menuitem.subMenu.hide();menuitem.setSelected(false);menuitem.subMenu.hideSubMenu(except);}}}}
js.ui.Menu.prototype.isExistSubMenu=function(menu){var result;for(var i=0;i<this.items.length;i++){menuitem=this.items.getItem(i);if(menuitem.subMenu==menu){return true;}
if(menuitem.hasSubMenu()){result=menuitem.subMenu.isExistSubMenu(menu);if(result)
return true;}}
return false;}
js.ui.Menu.prototype.removeSubMenu=function(except){var menuitem,submenu;for(var i=0;i<this.Items.length;i++){menuitem=this.Items.GetItem(i);if(menuitem.HasSubMenu()&&menuitem.SubMenu!=except){menuitem.SubMenu.RemoveAll();menuitem.SubMenu.RemoveSubMenu(except);}}}
js.ui.Menu.prototype.popup=function(x,y,zIndex){browser.sendMessage(null,201,null,this);if(!zIndex)zIndex=999;this.ui.style.zIndex=zIndex;this.ui.style.position="absolute";if(x)
this.ui.style.left=x+"px";if(y)
this.ui.style.top=y+"px";this.show();if(browser.isIE){if(document.onclick!=js.ui.Menu.__windowonmousedown){document.__oldonmousedown=document.onclick;document.onclick=js.ui.Menu.__windowonmousedown;}}
else{if(window.onclick!=js.ui.Menu.__windowonmousedown){window.__oldonmousedown=window.onclick;window.onclick=js.ui.Menu.__windowonmousedown;}}
this.addListener(201);if(this.onpopup)this.onpopup(x,y);}
js.ui.Menu.__windowonmousedown=function(event){if(!event)event=window.event;browser.sendMessage(null,201,event,window);}
js.ui.Menu.prototype.processMessage=function(msg,params,src){switch(msg){case 201:if(browser.isIE){if(document.__oldonmousedown)
document.onmousedown=document.__Oldonmousedown;}
else
window.onmousedown=window.__oldonmousedown;this.hide();break;}}
js.ui.PopupMenu=function(){this.items=new js.lang.Array();}
js.ui.PopupMenu.prototype=new js.ui.Menu();js.ui.PopupMenu.prototype.autoPopup=true;js.ui.MenuBar=function(parent){if(!parent)
parent=GetDocument().body;var obj=new js.ui.Menu(parent);obj.MenuBarRow=obj.AddRow(obj.Tbody);obj.SetVisible(true);obj.Items=new js.lang.Array();obj.AutoPopup=false;obj.RemoveListener(201);obj.IsMenuBar=true;obj.className="js_ui_MenuBar";return obj;}
js.ui.MenuBar.prototype.add=function(menuitem){var cell=this.AddCell(this.MenuBarRow);cell.style.borderwidth='0';cell.style.border='0';var table=new js.dhtml.Table(cell);table.style.borderwidth='0';table.cellSpacing="0";table.cellPadding="0";table.style.border='0';table.style.height="100%";table.style.paddingLeft=5;table.tbody.appendChild(menuitem);menuitem.Menu=this;menuitem.__IsMenuBarItem=true;menuitem.Text.style.paddingLeft=2;menuitem.Text.style.paddingRight=2;this.Items.AddItem(menuitem);if(this.Root)
menuitem.Root=this.Root;else
menuitem.Root=this;}
js.ui.MenuItem.prototype.popup=function(x,y){this.style.zIndex=999;if(x)
this.style.left=x;if(y)
this.style.top=y;this.PopMenu.Show();if(this.PopMenu.OnPopup)this.PopMenu.OnPopup(x,y);}
js.ui.MenuItem.prototype.getPopLocation=function(x,y){var point=new js.ui.Point();point.X=this.GetOffsetLeft();point.Y=this.GetOffsetTop()+this.offsetHeight;return point;}
js.ui.MenuItem.prototype.hidePopupMenu=function(){if(this.HasPopupMenu()){this.PopupMenu.Hide();}
this.Menu.AutoPopup=false;}
js.ui.MenuItem.prototype.showPopupMenu=function(){if(!this.HasPopupMenu())return;var point=this.GetPopLocation();this.PopupMenu.Owner=this;this.PopupMenu.Popup(point.X,point.Y);this.Menu.AutoPopup=true;}
js.ui.MenuItem.prototype.add=function(menuitem){if(!this.subMenu)
this.createSubMenu();this.subMenu.addItem(menuitem);}
js.ui.MenuItem.prototype.addSeparator=function(){if(!this.subMenu)
this.createSubMenu();this.subMenu.addSeparator();}
js.ui.MenuBar.prototype.hidePopupMenu=function(item){if(item)var item1=item;else var item1=null;for(var i=0;i<this.Items.length;i++){if(this.Items[i]!=item1){this.Items[i].HidePopupMenu();}
else item1.ShowPopupMenu();}
if(item1.PopupMenu)item1.Menu.AutoPopup=true;}
function MenuBar_MenuItem_OnMouseOver(){this.SetSelected(true);if(this.HasPopupMenu()&&this.PopupMenu.Visible)return;if(this.HasPopupMenu()&&this.Menu.AutoPopup)
this.Menu.HidePopupMenu(this);return true;}
function MenuBar_MenuItem_OnClick(){if(this.HasPopupMenu()&&(!this.PopupMenu.Visible)){this.ShowPopupMenu();}
else if(this.HasPopupMenu()&&this.PopupMenu.Visible){this.HidePopupMenu();}}
function MenuBar_MenuItem_OnMouseOut(){if(this.HasPopupMenu())this.SetSelected(false);}
$package("js.ui");js.ui.BaseWindow=function(){}
js.ui.BaseWindow.prototype=new js.ui.Container();js.ui.BaseWindow.prototype.borderWidth=20;js.ui.BaseWindow.prototype.state=1;js.ui.BaseWindow.prototype.NORMAL=1;js.ui.BaseWindow.prototype.MINIMIZE=2;js.ui.BaseWindow.prototype.MAXIMIZE=3;js.ui.BaseWindow.prototype.transparentBorder=true;js.ui.BaseWindow.prototype.optimizeDisplay=true;js.ui.BaseWindow.prototype.getNativeClass=function(){return"js.ui.BaseWindow";}
js.ui.BaseWindow.prototype.extendUI=function(){}
js.ui.BaseWindow.prototype.bindUI=function(){if(browser.isIE55_6){js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[0]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[1]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[2]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[3]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[4]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[5]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[0].cells[6]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[1].cells[0]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[1].cells[2]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[2].cells[0]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[2].cells[1]);js.util.Utils.prototype.correctPNGBackground(this.ui.rows[2].cells[2]);}
var __this=this;this.titleRow=new js.ui.Component();this.titleRow.ui=this.ui.rows[0];this.bodyRow=new js.ui.Component();this.bodyRow.ui=this.ui.rows[1];this.bottomRow=new js.ui.Component();this.bottomRow.ui=this.ui.rows[2];this.titleText=this.ui.rows[0].cells[2].getElementsByTagName("span")[0];this.iconCell=this.ui.rows[0].cells[1];this.closeCell=this.ui.rows[0].cells[5];this.container=this.ui.getElementsByTagName("div")[3];this.closeButton=new js.ui.ImageButton();this.closeCell.appendChild(this.closeButton.getUI());this.closeButton.setImage(imagePath+'window/closewindow.gif');this.closeButton.mouseoverImage=imagePath+'window/closewindow_mouseover.gif';this.closeButton.mousedownImage=imagePath+'window/closewindow_mousedown.gif';this.closeButton.getUI().onclick=function(){__this.close();}
if(this.minButton)
this.titleRow.getUI().ondblclick=function(event){if(!event)event=window.event;var x=event.clientX?event.clientX:event.pageX;if(x<__this.getOffsetLeft()+20+__this.borderWidth){__this.close();}
else if(__this.resizeable){if(__this.state==__this.NORMAL)
__this.maximize();else{__this.normal();}}};this.setResizeable(true);this.setMoveable(true);this.extendUI();browser.sendMessage(null,1,null,this);}
js.ui.BaseWindow.prototype.setMoveable=function(enable_move){this.__superSetMoveable=js.ui.Component.prototype.setMoveable;this.__superSetMoveable(enable_move);if(enable_move){this.getUI().onmousedown=js.ui.BaseWindow.__onmousedown;}
else{this.getUI().onmousedown=null;}}
js.ui.BaseWindow.__onmousedown=function(event){var __this=this.owner;__this.setActive(true);if(!event)event=window.event;this.__superonmousedown=js.ui.Component.__onmousedown;this.__superonmousedown(event);var x=event.clientX?event.clientX:event.pageX;var y=event.clientY?event.clientY:event.pageY;if(__this.__isDrag){if(y>__this.titleRow.getOffsetTop(null,true)+__this.titleRow.getUI().offsetHeight)
__this.__isDrag=false;}
browser.sendMessage(null,201,event,window);}
js.ui.BaseWindow.prototype.setIcon=function(url,w,h){if(!this.ui)this.getUI();if(!this.icon){this.icon=new js.ui.Img();this.iconCell.appendChild(this.icon.getUI());}
if(!w)w=16;if(!h)h=16;this.icon.setSrc(url,w,h);browser.sendMessage(null,74,url,this);}
js.ui.BaseWindow.prototype.title="";js.ui.BaseWindow.prototype.icon=null;js.ui.BaseWindow.prototype.setTitle=function(title){this.title=title;this.titleText.innerHTML=title;browser.sendMessage(null,12,title,this);}
js.ui.BaseWindow.prototype.showModal=function(){if(!this.__modalDiv){this.__modalDiv=new js.ui.Div();document.body.appendChild(this.__modalDiv.getUI());this.__modalDiv.ui.style.position="absolute";this.__modalDiv.ui.style.background="black";this.__modalDiv.setOpacity(10);}
this.__modalDiv.setBounds(0,0,document.body.offsetWidth,document.body.offsetHeight);this.__modalDiv.show();this.__oldzIndex=this.ui.style.zIndex;this.show();this.setActive(true);this.__modalDiv.ui.style.zIndex=this.ui.style.zIndex;this.ui.style.zIndex=this.ui.style.zIndex+1;}
js.ui.BaseWindow.prototype.close=function(){if(this.onclose)
if(!this.onclose())return;this.state=this.HIDE;if(this.__modalDiv)
this.__modalDiv.hide();if(this.__oldzIndex)
this.getUI().style.zIndex=this.__oldzIndex;this.__oldResizeDelay=this.resizeDelay;this.hide();this.setActive(false);browser.sendMessage(null,16,null,this);if(this.destoryOnClose)
this.destory();}
js.ui.BaseWindow.prototype.destory=function(){}
js.ui.BaseWindow.prototype.minimize=function(){this.__oldState=this.state;if(browser.taskProcessBar){this.hide();}
else{if(this.state==this.NORMAL){this.oldLeft=this.getUI().offsetLeft;this.oldTop=this.getUI().offsetTop;this.oldWidth=this.getUI().offsetWidth;this.oldHeight=this.getUI().offsetHeight;}
this.getUI().style.height=this.titleRow.getUI().offsetHeight;this.bodyRow.hide();this.bottomRow.hide();this.getUI().style.width=100;if(this.oldLeft){this.getUI().style.left=this.oldLeft;this.getUI().style.top=this.oldTop;}}
this.state=this.MINIMIZE;this.setActive(false);}
js.ui.BaseWindow.prototype.reset=function(){if(this.__oldState==this.NORMAL){this.normal();}
else if(this.__oldState==this.MAXIMIZE){this.maximize();}
if(browser.taskProcessBar){this.show();}}
js.ui.BaseWindow.prototype.maximize=function(){if(this.state==this.NORMAL){this.oldLeft=this.getUI().offsetLeft;this.oldTop=this.getUI().offsetTop;this.oldWidth=this.getUI().offsetWidth;this.oldHeight=this.getUI().offsetHeight;}
if(this.bodyRow.getUI().style.display=='none'){this.bodyRow.show();this.bottomRow.show();}
if(browser.taskProcessBar){this.setVisible(true);this.getUI().style.height=document.body.clientHeight-36;this.getUI().style.top=36;}
else{this.getUI().style.top=0;this.getUI().style.height="100%";}
this.getUI().style.width="100%";this.getUI().style.left=0;this.state=this.MAXIMIZE;}
js.ui.BaseWindow.prototype.normal=function(){this.show();if(this.bodyRow.getUI().style.display=='none'){this.bodyRow.show();this.bottomRow.show();}
if(this.oldWidth){this.getUI().style.left=this.oldLeft;this.getUI().style.top=this.oldTop;this.getUI().style.width=this.oldWidth;this.getUI().style.height=this.oldHeight;}
this.state=this.NORMAL;}
js.ui.BaseWindow.prototype.setActive=function(active){if(this.active==active)return;this.active=active;if(active){for(var i=0;i<browser.windows.length;i++){if(this!=browser.windows[i])
browser.windows[i].setActive(false);}
this.getUI().style.zIndex=100;this.titleRow.setOpacity(null);this.bottomRow.setOpacity(null);this.titleText.className=null;browser.sendMessage(null,6,null,this);if(this.onactive)this.onactive();}
else{if(this.getUI().style.zIndex>2)
this.getUI().style.zIndex=this.getUI().style.zIndex-1;else
this.getUI().style.zIndex=1;var opacity=70;this.titleRow.setOpacity(opacity);this.bottomRow.setOpacity(opacity);this.titleText.className="inactive";browser.sendMessage(null,801,null,this);if(this.oninactive)this.oninactive();}}
js.ui.Window=function(parent){}
js.ui.Window.prototype=new js.ui.BaseWindow();js.ui.Window.prototype.extendUI=function(){var __this=this;this.minCell=this.ui.rows[0].cells[3];this.minButton=new js.ui.ImageButton();this.minCell.appendChild(this.minButton.getUI());this.minButton.setImage(imagePath+'window/minwindow.gif');this.minButton.mouseoverImage=imagePath+'window/minwindow_mouseover.gif';this.minButton.mousedownImage=imagePath+'window/minwindow_mousedown.gif';this.minButton.getUI().onclick=function(){__this.minimize();__this.setActive(true);}
this.maxCell=this.ui.rows[0].cells[4];this.maxButton=new js.ui.ImageButton();this.maxCell.appendChild(this.maxButton.getUI());this.maxButton.setImage(imagePath+'window/maxwindow.gif');this.maxButton.mouseoverImage=imagePath+'window/maxwindow_mouseover.gif';this.maxButton.mousedownImage=imagePath+'window/maxwindow_mousedown.gif';this.maxButton.getUI().onclick=function(){__this.maximize();__this.setActive(true);}}
js.ui.Window.prototype.minimize=function(){var __this=this;this.maxButton.setImage(imagePath+'window/resetwindow.gif');this.maxButton.mouseoverImage=imagePath+'window/resetwindow_mouseover.gif';this.maxButton.mousedownImage=imagePath+'window/resetwindow_mousedown.gif';this.maxButton.getUI().onclick=function(){__this.reset();__this.setActive(true);};this.__superMinimize=js.ui.BaseWindow.prototype.minimize;this.__superMinimize();}
js.ui.Window.prototype.maximize=function(){var __this=this;this.maxButton.setImage(imagePath+'window/resetwindow.gif');this.maxButton.mouseoverImage=imagePath+'window/resetwindow_mouseover.gif';this.maxButton.mousedownImage=imagePath+'window/resetwindow_mousedown.gif';this.maxButton.getUI().onclick=function(){__this.normal();__this.setActive(true);};this.__superMaximize=js.ui.BaseWindow.prototype.maximize;this.__superMaximize();}
js.ui.Window.prototype.normal=function(){var __this=this;this.maxButton.setImage(imagePath+'window/maxwindow.gif');this.maxButton.mouseoverImage=imagePath+'window/maxwindow_mouseover.gif';this.maxButton.mousedownImage=imagePath+'window/maxwindow_mousedown.gif';this.maxButton.getUI().onclick=function(){__this.maximize();__this.setActive(true);};this.__superNormal=js.ui.BaseWindow.prototype.normal;this.__superNormal();}
$package("js.ui");js.ui.MessageBox=function(){}
js.ui.MessageBox.prototype=new js.ui.BaseWindow();js.ui.MessageBox.prototype.extendUI=function(){var __this=this;this.ui.style.zIndex=11;this.setTitle(props("Info"));var extui=this.getDomNode("js.ui.MessageBox");this.container.appendChild(extui);this.message=extui.getElementsByTagName("span")[0];this.okButton=extui.getElementsByTagName("button")[0];this.okButton.onclick=this.closeButton.ui.onclick;this.setResizeable(false);this.setMoveable(false);}
js.ui.MessageBox.prototype.showMessage=function(title,msg){if(!this.getUI().parentNode!=document.body)
document.body.appendChild(this.ui);this.setTitle(props(title));this.message.innerHTML=props(msg);this.showModal();this.center();}
$package("js.ui");js.ui.ToolBar=function(){}
js.ui.ToolBar.prototype=new js.ui.Container();js.ui.ToolBar.prototype.getNativeClass=function(){return"js.ui.ToolBar";}
js.ui.ToolBar.prototype.bindUI=function(){this.container=this.ui.getElementsByTagName("tr")[0];}
js.ui.ToolBar.prototype.add=function(button){var newCol=this.container.insertCell(this.container.cells.length-1);newCol.appendChild(button.getUI());}
js.ui.ToolBar.prototype.addSeparator=function(){var sep=new js.ui.Img();sep.setSrc(imagePath+"toolbar/separator.gif");sep.ui.className="ToolSeparator";this.add(sep);}
js.ui.ToolButton=function(){}
js.ui.ToolButton.prototype=new js.ui.Component();js.ui.ToolButton.prototype.align="hAlign";js.ui.ToolButton.prototype.getNativeClass=function(){var id="js.ui.ToolButton";return id;}
js.ui.ToolButton.prototype.bindUI=function(){var tds=this.ui.getElementsByTagName("tr")[1].getElementsByTagName("td");this.iconCell=tds[1];this.textCell=tds[2];this.text=this.ui.getElementsByTagName("a")[0];this.rightCell=tds[3];var __this=this;this.ui.onmouseover=function(){if(__this.disabled)return;this.className="ToolButton Panel Panel_selected";}
this.ui.onmouseout=function(){this.className="ToolButton Panel";}}
js.ui.ToolButton.prototype.setText=function(text){if(!this.ui)this.getUI();this.text.innerHTML=text;}
js.ui.ToolButton.prototype.setIcon=function(url,w,h){if(!this.ui)this.getUI();if(!this.icon){this.icon=new js.ui.Img();if(this.align=="vAlign"){this.textCell.align="center";this.textCell.insertBefore(this.icon.getUI(),this.text);}
else{this.iconCell.appendChild(this.icon.getUI());}}
this.icon.setSrc(url,w,h);}
js.ui.ToolButton.prototype.setRightIcon=function(url,w,h){if(!this.ui)this.getUI();if(!this.rightIcon){this.rightIcon=new js.ui.Img();this.rightCell.appendChild(this.rightIcon.getUI());}
this.rightIcon.setSrc(url,w,h);}
js.ui.ToolButton.prototype.setEnabled=function(enabled){this.disabled=!enabled;if(enabled){if(this.enableImage)
this.setIcon(this.enableImage);if(this.oldonclick)this.onclick=this.oldonclick;this.className="Toolbar_disable";}
else{if(this.disableImage){if(!this.enableImage)
this.enableImage=this.icon.getUI().src;this.setIcon(this.disableImage);}
if(this.onclick)this.oldonclick=this.onclick;this.onclick=null;this.className="Toolbutton Panel";}}
$package("js.net");js.net.HttpConnection=function(httpType){this.httpType=js.net.HttpConnection.prototype.XMLHTTP;this.method=js.net.HttpConnection.prototype.POST;this.url="about:blank";this.async=true;if(httpType)
this.httpType=httpType;}
js.net.HttpConnection.prototype.XMLHTTP="js.net.XMLHttpConnection";js.net.HttpConnection.prototype.IFRAME="js.net.IFrameConnection";js.net.HttpConnection.prototype.WINDOW_OPEN="js.net.WindowOpenConnection";js.net.HttpConnection.prototype.HttpType=js.net.HttpConnection.prototype.XMLHTTP;js.net.HttpConnection.prototype.POST="POST";js.net.HttpConnection.prototype.GET="GET";js.net.HttpConnection.prototype.method=js.net.HttpConnection.prototype.POST;js.net.HttpConnection.prototype.url="about:blank";js.net.HttpConnection.prototype.async=true;js.net.HttpConnection.prototype.instance=null;js.net.HttpConnection.prototype.onload=null;js.net.HttpConnection.prototype.onerror=null;js.net.HttpConnection.prototype.open=function(url){if(url)
this.url=url;if(!this.instance){this.instance=new js.net.XMLHttpConnection();this.instance.owner=this;}
if(this.instance){return this.instance.open(this.method,this.url,this.async);}}
js.net.HttpConnection.prototype.send=function(text){if(this.instance){this.instance.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");return this.instance.send(text);}}
js.net.HttpFactory=function(){}
js.net.HttpFactory.prototype.getInstance=function(httpType){if(!httpType)
httpType=js.net.HttpConnection.prototype.XMLHTTP;return js.lang.ClassLoader.prototype.load(httpType);}
js.net.IHttpRequest=function(){};js.net.IHttpRequest.prototype=new js.lang.BaseObject();js.net.IHttpRequest.prototype.open=function(url,method,async){};js.net.IHttpRequest.prototype.send=function(str){};js.net.IHttpRequest.prototype.onload=function(){};js.net.IHttpRequest.prototype.onerror=function(){};js.net.XMLHttpConnection=function()
{try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try
{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(ex){this.xmlHttp=null;}}
if(!this.xmlHttp&&typeof XMLHttpRequest!="undefined")
{this.xmlHttp=new XMLHttpRequest();}}
js.net.XMLHttpConnection.prototype=new js.net.IHttpRequest();js.net.XMLHttpConnection.prototype.open=function(method,url,async){this.__method=method;this.xmlHttp.open(method,url,async);};js.net.XMLHttpConnection.prototype.setRequestHeader=function(key,value){this.xmlHttp.setRequestHeader(key,value);}
js.net.XMLHttpConnection.prototype.send=function(str){var __this=this;if(browser.isIE){this.xmlHttp.onreadystatechange=function(){var http=__this.xmlHttp;var result=false;if(http.readyState==4){if(http.status==200||http.status==0){result=true;if(__this.onload)__this.onload(http);}
if(!result&&__this.onerror)__this.onerror(http);}}}
else{this.xmlHttp.onload=function(){if(__this.onload)__this.onload(this);};this.xmlHttp.onerror=function(){if(__this.onerror)__this.onerror(this);};}
if(this.__method=="GET")
str=null;this.xmlHttp.send(str);}
js.net.XMLHttpConnection.prototype.onload=function(xmlhttp){if(this.owner)if(this.owner.onload)this.owner.onload(xmlhttp);};js.net.XMLHttpConnection.prototype.onerror=function(xmlhttp){if(this.owner)if(this.owner.onerror)this.owner.onerror(xmlhttp);};js.net.XMLHttpConnection.prototype.xmlHttp=null;$package("js.ui.list");js.ui.list.AbstractListItemRenderer=function(owner){this.owner=owner;}
js.ui.list.AbstractListItemRenderer.prototype=new js.ui.Container();js.ui.list.AbstractListItemRenderer.prototype.getNativeClass=function(){return"js.ui.list.AbstractListItemRenderer";}
js.ui.list.AbstractListItemRenderer.prototype.state=0;js.ui.list.AbstractListItemRenderer.prototype.bindUI=function(){var __this=this;this.ui.onmouseover=function(){__this.state=1;this.className=__this.baseCSS+" "+__this.baseCSS+"_over";}
this.ui.onmouseout=function(){__this.state=0;__this.paintSelect();}
this.ui.onclick=function(event){this.oncontextmenu(event);return js.ui.Component.eventCancelBubble(event);}
this.ui.onmousedown=function(event){browser.sendMessage(null,201,event,window);return js.ui.Component.eventCancelBubble(event);}
this.ui.oncontextmenu=function(event){var curListBox=__this.owner;if(!curListBox)return;if(!event)event=window.event;if(!event.ctrlKey)
curListBox.clearSelection();curListBox.setSelectedValue(__this.userObject,!curListBox.isSelectedItem(__this.userObject));}
this.baseCSS=this.ui.className;}
js.ui.list.AbstractListItemRenderer.prototype.owner=null;js.ui.list.AbstractListItemRenderer.prototype.baseCSS=null;js.ui.list.AbstractListItemRenderer.prototype.userObject=null;js.ui.list.AbstractListItemRenderer.prototype.setValue=function(value){this.userObject=value;this.paint();}
js.ui.list.AbstractListItemRenderer.prototype.isSelected=function(){var curListBox=this.owner;if(!curListBox)return false;return curListBox.isSelectedItem(this.userObject);}
js.ui.list.AbstractListItemRenderer.prototype.paintSelect=function(){if(this.isSelected()){this.getUI().className=this.baseCSS+"_selected";}
else{this.getUI().className=this.baseCSS;}}
js.ui.list.AbstractListItemRenderer.prototype.paintText=function(){var text=this.userObject;if(text=='')text="&nbsp";this.getUI().innerHTML=text;}
js.ui.list.AbstractListItemRenderer.prototype.paint=function(){this.paintText();this.paintSelect();}
$package("js.ui.list");js.ui.list.Columns=function(){this.column=new js.lang.Array();}
js.ui.list.Columns.prototype.column=null;js.ui.list.Columns.prototype.colSpan=null;js.ui.list.Columns.prototype.visible=true;js.ui.list.Columns.prototype.add=function(column){this.column.addItem(column);column.index=this.column.length-1;}
js.ui.list.Columns.prototype.size=function(){return this.column.length;}
js.ui.list.Columns.prototype.remove=function(column){this.column.removeItem(column);this.count=this.column.length;for(var i=0;i<this.column.length;i++){this.column[i].index=i;}}
js.ui.list.Columns.prototype.clear=function(){this.column.clear();}
js.ui.list.Columns.prototype.getColumn=js.ui.list.Columns.prototype.getItem=function(i){return this.column[i];}
js.ui.list.Columns.prototype.getColumnByIndex=function(index){for(var j=0;j<this.column.length;j++){if(this.column[j].index==index)
return this.column[j];}
return null;}
js.ui.list.ColumnCellRenderer=function(owner){this.owner=owner;}
js.ui.list.ColumnCellRenderer.prototype=new js.ui.list.AbstractListItemRenderer();js.ui.list.ColumnCellRenderer.prototype.getNativeClass=function(){return"js.ui.list.ColumnCellRenderer";}
js.ui.list.ColumnCellRenderer.prototype.bindUI=function(){this.__superBindUI=js.ui.list.AbstractListItemRenderer.prototype.bindUI;this.__superBindUI();this.text=this.ui.getElementsByTagName("a")[0];}
js.ui.list.ColumnCellRenderer.prototype.paintText=function(){var text=this.userObject;if(text=='')text="&nbsp";this.text.innerHTML=text;}
js.ui.list.CheckBoxColumnCellRenderer=function(owner){this.owner=owner;}
js.ui.list.CheckBoxColumnCellRenderer.prototype=new js.ui.list.AbstractListItemRenderer();js.ui.list.CheckBoxColumnCellRenderer.prototype.getNativeClass=function(){return"js.ui.list.CheckBoxColumnCellRenderer";}
js.ui.list.CheckBoxColumnCellRenderer.prototype.bindUI=function(){this.__superBindUI=js.ui.list.AbstractListItemRenderer.prototype.bindUI;this.__superBindUI();this.ui=this.ui.getElementsByTagName("table")[0];this.checkbox=this.ui.getElementsByTagName("input")[0];}
js.ui.list.CheckBoxColumnCellRenderer.prototype.paintText=function(){var text=this.userObject;if(text=='')text="&nbsp";this.checkbox.value=text;}
js.ui.list.Column=function(){}
js.ui.list.Column.prototype=new js.lang.BaseObject();js.ui.list.Column.prototype.caption="";js.ui.list.Column.prototype.width=null;js.ui.list.Column.prototype.visible=true;js.ui.list.Column.prototype.allowSort=true;js.ui.list.Column.prototype.renderClass=js.ui.list.ColumnCellRenderer;js.ui.list.Column.prototype.editor=null;js.ui.list.Column.prototype.index=0;js.ui.list.Column.prototype.dataType;js.ui.list.Column.prototype.renderer;js.ui.list.Column.prototype.createCellRenderer=function(){if(!this.renderClass)this.renderClass=js.ui.list.AbstractListItemRenderer;this.renderer=new this.renderClass();return this.renderer;}
$package("js.ui.list");js.ui.list.AbstractListSelectionModel=function(){this.delegate=new js.lang.Array();}
js.ui.list.AbstractListSelectionModel.prototype=new js.lang.BaseObject();js.ui.list.AbstractListSelectionModel.prototype.SINGLE_SELECTION=0;js.ui.list.AbstractListSelectionModel.prototype.SINGLE_INTERVAL_SELECTION=1;js.ui.list.AbstractListSelectionModel.prototype.MULTIPLE_INTERVAL_SELECTION=2;js.ui.list.AbstractListSelectionModel.prototype.selectionMode=js.ui.list.AbstractListSelectionModel.prototype.MULTIPLE_INTERVAL_SELECTION;js.ui.list.AbstractListSelectionModel.prototype.getSelectionMode=function(){return this.selectionMode;}
js.ui.list.AbstractListSelectionModel.prototype.setSelectionMode=function(selectionMode){switch(selectionMode){case this.SINGLE_SELECTION:case this.SINGLE_INTERVAL_SELECTION:case this.MULTIPLE_INTERVAL_SELECTION:this.selectionMode=selectionMode;break;default:throw props("invalid selectionMode");}}
js.ui.list.AbstractListSelectionModel.prototype.isSelected=function(index){return this.delegate[index];}
js.ui.list.AbstractListSelectionModel.prototype.setSelected=function(index,value){if(index<0){this.clearSelection();return;}
if(value&&this.selectionMode==this.SINGLE_SELECTION){this.clearSelection();}
this.delegate[index]=value;}
js.ui.list.AbstractListSelectionModel.prototype.insertSelected=function(value,index){this.delegate.insertItem(value,index);}
js.ui.list.AbstractListSelectionModel.prototype.removeItemAt=function(index){this.delegate.removeItemAt(index);}
js.ui.list.AbstractListSelectionModel.prototype.clearSelection=function(){this.delegate.length=0;}
js.ui.list.AbstractListSelectionModel.prototype.getSelectedIndex=function(){for(var i=0;i<this.delegate.length;i++){if(this.isSelected(i))
return i;}
return-1;}
js.ui.list.AbstractListSelectionModel.prototype.getSelectedIndices=function(){var retArray=new Array();for(var i=0;i<this.delegate.length;i++){if(this.isSelected(i))
retArray.addItem(i);}
return retArray;}
$package("js.ui.list");js.ui.list.AbstractListModel=function(){this.delegate=new js.lang.Array();this.selectionModel=new js.ui.list.AbstractListSelectionModel();}
js.ui.list.AbstractListModel.prototype=new js.lang.BaseObject();js.ui.list.AbstractListModel.prototype.getOwner=function(){return this.owner;}
js.ui.list.AbstractListModel.prototype.setOwner=function(value){this.owner=value;}
js.ui.list.AbstractListModel.prototype.size=function(){return this.delegate.length;}
js.ui.list.AbstractListModel.prototype.elementAt=js.ui.list.AbstractListModel.prototype.getElementAt=function(index){return this.delegate[index];}
js.ui.list.AbstractListModel.prototype.contains=function(elem){return this.delegate.contains(elem);}
js.ui.list.AbstractListModel.prototype.indexOf=function(elem){return this.delegate.indexOf(elem,0);}
js.ui.list.AbstractListModel.prototype.lastIndexOf=function(elem){return this.delegate.lastIndexOf(elem);}
js.ui.list.AbstractListModel.prototype.firstElement=function(){return this.delegate.getFirstItem();}
js.ui.list.AbstractListModel.prototype.lastElement=function(){return this.delegate.getLastItem();}
js.ui.list.AbstractListModel.prototype.setElementAt=function(elem,index){this.delegate.setItemAt(elem,index);}
js.ui.list.AbstractListModel.prototype.removeElementAt=function(index){this.delegate.removeItemAt(index);this.selectionModel.removeItemAt(index);}
js.ui.list.AbstractListModel.prototype.insertElementAt=function(elem,index){this.delegate.insertItem(elem,index);this.selectionModel.insertSelected(false,index);}
js.ui.list.AbstractListModel.prototype.add=js.ui.list.AbstractListModel.prototype.addElement=function(elem){this.delegate.addItem(elem);}
js.ui.list.AbstractListModel.prototype.remove=js.ui.list.AbstractListModel.prototype.removeElement=function(elem){var idx=this.indexOf(elem);this.removeElementAt(idx);}
js.ui.list.AbstractListModel.prototype.removeAllElements=function(){this.clear();}
js.ui.list.AbstractListModel.prototype.toArray=function(){return this.delegate;}
js.ui.list.AbstractListModel.prototype.get=function(index){return this.delegate.getItem(index);}
js.ui.list.AbstractListModel.prototype.set=function(index,elem){this.delegate.setItemAt(elem,index);}
js.ui.list.AbstractListModel.prototype.clear=function(){this.delegate.clear();this.selectionModel.clearSelection();}
js.ui.list.AbstractListModel.prototype.removeRange=function(fromIndex,toIndex){}
js.ui.list.AbstractListModel.prototype.getSelectedValue=js.ui.list.AbstractListModel.prototype.getFirstSelectedItem=function(){var idx=this.getSelectedIndex();if(idx>=0&&idx<this.Size())
return this.getElementAt(idx);else return null;}
js.ui.list.AbstractListModel.prototype.getSelectedIndex=function(){return this.selectionModel.getSelectedIndex();}
js.ui.list.AbstractListModel.prototype.getSelectedIndices=function(){return this.selectionModel.getSelectedIndices();}
js.ui.list.AbstractListModel.prototype.getSelectedValues=function(){var retArray=new Array();var selectedIndices=this.selectionModel.getSelectedIndices();for(var i=0;i<selectedIndices.length;i++){retArray.addItem(this.getElementAt(selectedIndices[i]));}
return retArray;}
js.ui.list.AbstractListModel.prototype.setMultiSelected=function(value){if(value)
this.selectionModel.setSelectionMode(2);else
this.selectionModel.setSelectionMode(0);}
js.ui.list.AbstractListModel.prototype.getMultiSelected=function(){return this.selectionModel.getSelectionMode()!=0;}
js.ui.list.AbstractListModel.prototype.isSelected=function(idx){return this.selectionModel.isSelected(idx);}
js.ui.list.AbstractListModel.prototype.isSelectedItem=function(item){var idx=this.delegate.indexOf(item,0);return this.selectionModel.isSelected(idx);}
js.ui.list.AbstractListModel.prototype.setSelected=function(idx,value){this.selectionModel.setSelected(idx,value);}
js.ui.list.AbstractListModel.prototype.clearSelection=function(){this.selectionModel.clearSelection();}
js.ui.list.AbstractListModel.prototype.selectAll=function(){for(var i=0;i<this.delegate.length;i++){this.setSelected(i,true);}}
js.ui.list.AbstractListModel.prototype.setSelectedValue=function(anObject,value){if(anObject==null)
this.clearSelection();else{var idx=this.indexOf(anObject);this.setSelected(idx,value);}}
$package("js.ui.list");js.ui.list.AbstractListBox=function(){this.renderers=new js.lang.Array();}
js.ui.list.AbstractListBox.prototype=new js.ui.Container();js.ui.list.AbstractListBox.prototype.getNativeClass=function(){return"js.ui.list.AbstractListBox";}
js.ui.list.AbstractListBox.prototype.getModel=function(){if(!this.dataModel){this.dataModel=new js.ui.list.AbstractListModel();this.dataModel.setMultiSelected(this.multiSelected);}
return this.dataModel;}
js.ui.list.AbstractListBox.prototype.bindUI=function(){var __this=this;this.ui.onkeydown=js.ui.list.AbstractListBox.__onkeydown;this.container=this.ui.getElementsByTagName("table")[0];return this.ui;}
js.ui.list.AbstractListBox.prototype.addItem=function(item){this.getModel().addElement(item);var table=this.getContainer();var row=table.insertRow(-1);var cell=row.insertCell(-1);var renderer=this.createCellRenderer();renderer.setValue(item);cell.renderer=renderer;cell.appendChild(renderer.getUI());}
js.ui.list.AbstractListBox.prototype.getCellRenderer=function(idx){return this.renderers[idx];}
js.ui.list.AbstractListBox.prototype.createCellRenderer=function(){if(!this.renderClass)this.renderClass=js.ui.list.AbstractListItemRenderer;var renderer=new this.renderClass(this);return renderer;}
js.ui.list.AbstractListBox.prototype.multiSelected=false;js.ui.list.AbstractListBox.prototype.clearSelection=function(){var sel=this.getSelectedIndex();this.getModel().clearSelection();if(sel>=0)
for(var i=0;i<this.getModel().size();i++){var renderer=this.getCellRenderer(i);if(renderer)
renderer.paintSelect(false);}}
js.ui.list.AbstractListBox.prototype.selectAll=function(){this.getModel().selectAll();for(var i=0;i<this.getModel().size();i++){var renderer=this.getCellRenderer(i);if(renderer)
renderer.paintSelect(true);}}
js.ui.list.AbstractListBox.prototype.setSelected=function(idx,value){if(!this.multiSelected&&value){var oldSelectedIndex=this.getSelectedIndex();if(oldSelectedIndex==idx)
return;if(oldSelectedIndex>=0)
this.clearSelection();}
this.getModel().setSelected(idx,value);var renderer=this.getCellRenderer(idx);if(renderer)
renderer.paintSelect();}
js.ui.list.AbstractListBox.prototype.getSelectedIndex=function(){return this.getModel().getSelectedIndex();}
js.ui.list.AbstractListBox.prototype.setSelectedValue=function(anObject,value){var idx=this.getModel().indexOf(anObject);this.setSelected(idx,value);}
js.ui.list.AbstractListBox.prototype.isSelectedItem=function(item){return this.getModel().isSelectedItem(item);}
js.ui.list.AbstractListBox.prototype.activeIndex=-1;js.ui.list.AbstractListBox.prototype.size=function(){return this.getModel().size();}
js.ui.list.AbstractListBox.prototype.getSelectedIndices=function(){return this.getModel().getSelectedIndices();}
js.ui.list.AbstractListBox.prototype.getSelectedValues=function(){return this.getModel().getSelectedValues();}
js.ui.list.AbstractListBox.__onkeydown=function(event){var __this=this.owner;if(!event)event=window.event;var keycode=event.keyCode?event.keyCode:event.which;switch(keycode){case 39:case 40:if(__this.activeIndex<__this.size()-1){if(!event.shiftKey){__this.clearSelection();__this.setSelected(__this.activeIndex+1,true);}
else{var idxs=__this.getSelectedIndices();var min_idx=idxs[0];var max_idx=idxs[idxs.length-1];if(__this.activeIndex<max_idx)
__this.setSelected(__this.activeIndex,false);else
__this.setSelected(__this.activeIndex+1,true);}
__this.activeIndex++;}
break;case 37:case 38:if(__this.activeIndex>0){if(!event.shiftKey){__this.clearSelection();__this.setSelected(__this.activeIndex-1,true);}
else{var idxs=__this.getSelectedIndices();var min_idx=idxs[0];var max_idx=idxs[idxs.length-1];if(__this.activeIndex<=min_idx)
__this.setSelected(__this.activeIndex-1,true);else
__this.setSelected(__this.activeIndex,false);}
__this.activeIndex--;}
break;case 13:if(__this.onclickItem)__this.onclickItem(__this.activeIndex);}}
js.ui.list.AbstractListBox.prototype.clear=function(){this.getModel().clear();this.renderers.clear();var e;var tb=this.getContainer();while(e=tb.firstChild)tb.removeChild(e);}
$package("js.ui.list");js.ui.list.AbstractListView=function(){if(js.ui.list.Columns)
this.columns=new js.ui.list.Columns();}
js.ui.list.AbstractListView.prototype=new js.ui.list.AbstractListBox();js.ui.list.AbstractListView.prototype.getNativeClass=function(){return"js.ui.list.AbstractListView";}
js.ui.list.AbstractListView.prototype.columns=null;js.ui.list.AbstractListView.prototype.multiSelected=true;js.ui.list.AbstractListView.ViewType={DETAILINFO:0,BIGICON:1,SMALLICON:2,ICON:3,LIST:4,LARGE:5};js.ui.list.AbstractListView.Arrangement={TOP:0,LEFT:1};js.ui.list.AbstractListView.prototype.arrangement=js.ui.list.AbstractListView.Arrangement.TOP;js.ui.list.AbstractListView.prototype.viewType=1;js.ui.list.AbstractListView.prototype.cols=5;js.ui.list.AbstractListView.prototype.setViewType=function(value){this.viewType=value;this.paintHeader();this.clear();if(this.refresh)this.refresh();}
js.ui.list.AbstractListView.prototype.setOpenType=function(value){this.openType=value;}
js.ui.list.AbstractListView.prototype.createRow=function(){if(!this.cols)
this.cols=5;var row,cell;row=this.body.insertRow(-1);row.vAlign="top";for(var i=0;i<this.cols;i++){cell=row.insertCell(-1);}}
js.ui.list.AbstractListView.prototype.createCol=function(){if(!this.cols)
this.cols=5;var row,cell;if(this.body.rows.length<=0){for(var i=0;i<this.cols;i++){row=this.body.insertRow(-1);row.vAlign="top";}}
for(var i=0;i<this.cols;i++){row=this.body.rows[i];cell=row.insertCell(-1);}}
js.ui.list.AbstractListView.prototype.addItem=function(item){this.getModel().addElement(item);var table=this.getContainer();var renderer=this.createCellRenderer();if(this.viewType==0){table.appendChild(renderer.getUI());}
else{if(renderer.size<=16)renderer.size=32;var rowIdx=Math.floor((this.getModel().size()/this.cols)-0.0001);var colIdx=(this.getModel().size()-1)%this.cols;if(!this.body){this.body=document.createElement("tbody");this.container.appendChild(this.body);}
if(this.arrangement==0&&rowIdx>=this.body.rows.length)
this.createRow();else if(this.arrangement==1&&(this.body.rows.length<=0||rowIdx>=this.body.rows[0].cells.length)){this.createCol();}
var cell;if(this.arrangement==0)
cell=this.body.rows[rowIdx].cells[colIdx];else
cell=this.body.rows[colIdx].cells[rowIdx];cell.appendChild(renderer.getUI());cell.renderer=renderer;}
renderer.setValue(item);this.renderers.addItem(renderer);}
js.ui.list.AbstractListView.prototype.addColumn=function(column){if(!this.thead){this.thead=this.getUI().getElementsByTagName("tbody")[0];this.theadrow=this.thead.rows[0];}
var col=this.theadrow.insertCell(-1);if(this.columns.size()==0&&!column.colSpan){col.colSpan=3;}
if(column.colSpan)
col.colSpan=column.colSpan;if(column.width)
col.width=column.width;var renderer=column.createCellRenderer();col.appendChild(renderer.getUI());renderer.setValue(column.caption);this.columns.add(column);}
js.ui.list.AbstractListView.prototype.createCellRenderer=function(){if(!this.renderClass)this.renderClass=js.ui.list.AbstractListItemRenderer;var renderer=new this.renderClass(this);renderer.style=this.viewType;return renderer;}
js.ui.list.AbstractListView.prototype.clear=function(){this.getModel().clear();this.renderers.clear();this.body=null;var tb=this.getContainer();for(var i=tb.childNodes.length-1;i>1;i--){tb.removeChild(tb.childNodes[i]);}}
js.ui.list.AbstractListView.prototype.paintHeader=function(){if(this.viewType==1&&this.thead){this.thead.style.display="none";}
else if(this.thead){this.thead.style.display="";}}
js.ui.list.AbstractListView.prototype.paint=function(){}
$package("js.ui.tree");js.ui.tree.AbstractTreeCellRenderer=function(treeNode){this.treeNode=treeNode;}
js.ui.tree.AbstractTreeCellRenderer.prototype=new js.ui.list.AbstractListItemRenderer();js.ui.tree.AbstractTreeCellRenderer.prototype.getNativeClass=function(){return"js.ui.tree.AbstractTreeCellRenderer";}
js.ui.tree.AbstractTreeCellRenderer.prototype.bindUI=function(){this.__superBindUI=js.ui.list.AbstractListItemRenderer.prototype.bindUI;this.__superBindUI();this.topBody=this.ui.getElementsByTagName("tbody")[0];this.bottomBody=this.ui.getElementsByTagName("tbody")[1];this.container=this.bottomBody.getElementsByTagName("td")[0];this.btn=new js.ui.Img();this.btn.setUI(this.topBody.getElementsByTagName("img")[0]);this.text=this.ui.getElementsByTagName("a")[0];this.iconCell=this.topBody.getElementsByTagName("td")[5];this.bindEvents();}
js.ui.tree.AbstractTreeCellRenderer.prototype.bindEvents=function(){var __this=this;this.ui.onmouseover=function(event){__this.state=1;__this.paintSelect();js.ui.Component.eventCancelBubble(event);}
this.btn.ui.onclick=function(event){if(__this.container.style.display=="none"){__this.expand();}
else
__this.collapse();js.ui.Component.eventCancelBubble(event);}
this.ui.ondblclick=function(event){__this.btn.ui.onclick(event);js.ui.Component.eventCancelBubble(event);}
this.ui.onclick=function(event){if(__this.treeNode)
__this.treeNode.treeview.setSelected(__this.treeNode);js.ui.Component.eventCancelBubble(event);}}
js.ui.tree.AbstractTreeCellRenderer.prototype.setLevel=function(level){if(!this.ui)this.getUI();this.btn.ui.style.marginLeft=16*level+"px";}
js.ui.tree.AbstractTreeCellRenderer.prototype.expand=function(){this.container.style.display="";this.paintButton();}
js.ui.tree.AbstractTreeCellRenderer.prototype.collapse=function(){this.container.style.display="none";this.paintButton();}
js.ui.tree.AbstractTreeCellRenderer.prototype.isSelected=function(){if(this.treeNode){return this.treeNode.isSelected();}}
js.ui.tree.AbstractTreeCellRenderer.prototype.setIcon=function(url){if(!url)return;if(!this.icon){this.icon=new js.ui.Img();this.icon.getUI().className="icon";this.iconCell.appendChild(this.icon.getUI());}
this.icon.setSrc(url);}
js.ui.tree.AbstractTreeCellRenderer.prototype.paintSelect=function(){var css="Panel";if(this.isSelected())
css="Panel Panel_selected";if(this.state==1)
css="Panel Panel_over";this.topBody.className=css;}
js.ui.tree.AbstractTreeCellRenderer.prototype.paintText=function(){var text=this.treeNode.userObject;if(text=='')text="&nbsp";this.text.innerHTML=text;}
js.ui.tree.AbstractTreeCellRenderer.prototype.paintIcon=function(){var icon=this.treeNode.icon;this.setIcon(icon);}
js.ui.tree.AbstractTreeCellRenderer.prototype.paintButton=function(){if(!this.treeNode)return;if(this.treeNode.getChildCount()>0){this.btn.getUI().style.visibility="visible";if(this.container.style.display=="none")
this.btn.setSrc(imagePath+"tree/collapse.png");else
this.btn.setSrc(imagePath+"tree/expand.png");}
else
this.btn.getUI().style.visibility="hidden";}
js.ui.tree.AbstractTreeCellRenderer.prototype.paint=function(){this.paintButton();this.paintIcon();this.paintText();this.paintSelect();}
$package("js.ui.tree");js.ui.tree.AbstractTreeModel=function(){}
js.ui.tree.AbstractTreeModel.prototype.owner=null;js.ui.tree.AbstractTreeModel.prototype.root=null;js.ui.tree.AbstractTreeModel.prototype.asksAllowsChildren=true;js.ui.tree.AbstractTreeModel.prototype.setRoot=function(value){this.root=value;}
js.ui.tree.AbstractTreeModel.prototype.getRoot=function(){return this.root;}
js.ui.tree.AbstractTreeModel.prototype.getIndexOfChild=function(parent,child){if(parent==null||child==null)return-1;else return parent.getIndex(child);}
js.ui.tree.AbstractTreeModel.prototype.getChild=function(parent,index){return parent.GetChildAt(index);}
js.ui.tree.AbstractTreeModel.prototype.getChildCount=function(parent){return parent.getChildCount();}
js.ui.tree.AbstractTreeModel.prototype.isLeaf=function(node){if(this.asksAllowsChildren)return!node.getAllowsChildren();else return node.isLeaf();}
$package("js.ui.tree");js.ui.tree.AbstractTreeNode=function(treeview){this.treeview=treeview;}
js.ui.tree.AbstractTreeNode.prototype=new js.lang.BaseObject();js.ui.tree.AbstractTreeNode.prototype.parent=null;js.ui.tree.AbstractTreeNode.prototype.items=null;js.ui.tree.AbstractTreeNode.prototype.icon=null;js.ui.tree.AbstractTreeNode.prototype.isExpanded=function(){return this.expanded;}
js.ui.tree.AbstractTreeNode.prototype.isFocused=function(){return this.focused;}
js.ui.tree.AbstractTreeNode.prototype.setUserObject=function(value){this.userObject=value;}
js.ui.tree.AbstractTreeNode.prototype.getUserObject=function(){return this.userObject;}
js.ui.tree.AbstractTreeNode.prototype.setRenderer=function(renderer){if((this.renderer)&&(this.renderer!=renderer)){this.renderer.clear();}
this.renderer=renderer;this.renderer.paint();}
js.ui.tree.AbstractTreeNode.prototype.getRenderer=function(){if(!this.renderer)this.renderer=new this.treeview.renderClass(this);return this.renderer;}
js.ui.tree.AbstractTreeNode.prototype.focus=function(){var treeview=this.treeview;treeview.setSelected(this);}
js.ui.tree.AbstractTreeNode.prototype.isSelected=function(){var treeview=this.treeview;if(treeview)
return treeview.isSelected(this);}
js.ui.tree.AbstractTreeNode.prototype.doExpand=js.ui.tree.AbstractTreeNode.prototype.setExpanded=function(expanded){if(this.isExpanded()==expanded)return;var treeview=this.treeview;this.expanded=false;if(expanded){if(!this.isLeaf()){this.expanded=true;this.getRenderer().expand();if(this.treeview.onexpanded)this.treeview.onexpanded(this);}}else{if(!this.isLeaf()){this.getRenderer().collapse();if(this.treeview.oncollapsed)this.treeview.oncollapsed(this);}}}
js.ui.tree.AbstractTreeNode.prototype.expand=function(){this.doExpand(true);}
js.ui.tree.AbstractTreeNode.prototype.expandAll=function(){this.expand();for(var i=0;i<this.getChildCount();i++){var childNode=this.getChildAt(i);childNode.expandAll();}}
js.ui.tree.AbstractTreeNode.prototype.collapseAll=function(){this.collapse();for(var i=0;i<this.getChildCount();i++){var childNode=this.getChildAt(i);childNode.collapseAll();}}
js.ui.tree.AbstractTreeNode.prototype.collapse=function(){this.doExpand(false);}
js.ui.tree.AbstractTreeNode.prototype.isLastChild=function(){if(this.isRoot())return true;var lastChild=this.getParent().getLastChild();return(lastChild==this);}
js.ui.tree.AbstractTreeNode.prototype.insert=function(newChild,childIndex){if(childIndex==null)childIndex=0;if(!this.allowsChildren)alert("node does not allow children");else if(newChild==null)alert("new child is null");else if(this.isNodeAncestor(newChild))alert("new child is an ancestor");var oldParent=newChild.getParent();if(oldParent!=null)oldParent.remove(newChild);newChild.setParent(this);newChild.treeview=this.treeview;if(this.items==null)this.items=new js.lang.Array();if(childIndex<this.items.getLength()-1)
this.items.SetItemAt(newChild,childIndex);else this.items.AddItem(newChild);}
js.ui.tree.AbstractTreeNode.prototype.removeAt=function(childIndex){var child=this.getChildAt(childIndex);this.items.removeItemAt(childIndex);child.setParent(null);if(this.isLeaf())this.expanded=false;this.getRenderer().paint(this);if(this.treeview.ondeletion)this.treeview.ondeletion(this);}
js.ui.tree.AbstractTreeNode.prototype.remove=function(aChild){if(aChild==null)alert("argument is null");if(!this.isNodeChild(aChild))alert("argument is not a child");this.removeAt(this.getIndex(aChild));}
js.ui.tree.AbstractTreeNode.prototype.setParent=function(newParent){this.parent=newParent;}
js.ui.tree.AbstractTreeNode.prototype.getParent=function(){return this.parent;}
js.ui.tree.AbstractTreeNode.prototype.getChildAt=function(index){if(this.items==null)alert("node has no children");return this.items.getItem(index);}
js.ui.tree.AbstractTreeNode.prototype.getChildCount=function(){if(this.items==null)return 0;else return this.items.length;}
js.ui.tree.AbstractTreeNode.prototype.getIndex=function(aChild){if(aChild==null)alert("argument is null");if(!this.isNodeChild(aChild))return-1;return this.items.indexOf(aChild,0);}
js.ui.tree.AbstractTreeNode.prototype.getChildren=function(){return this.items;}
js.ui.tree.AbstractTreeNode.prototype.setAllowsChildren=function(allows){if(allows!=this.allowsChildren){this.allowsChildren=allows;if(!this.allowsChildren){this.removeAllChildren();}}}
js.ui.tree.AbstractTreeNode.prototype.getAllowsChildren=function(){return this.allowsChildren;}
js.ui.tree.AbstractTreeNode.prototype.setUserObject=function(userObject){this.userObject=userObject;}
js.ui.tree.AbstractTreeNode.prototype.getUserObject=function(){return this.userObject;}
js.ui.tree.AbstractTreeNode.prototype.removeFromParent=function(){var parent=this.getParent();if(parent!=null)parent.remove(this);}
js.ui.tree.AbstractTreeNode.prototype.removeAllChildren=function(){for(var i=this.getChildCount()-1;i>=0;i--){this.removeAt(0);}}
js.ui.tree.AbstractTreeNode.prototype.getItems=function(){if(!this.items)
this.items=new js.lang.Array();return this.items;}
js.ui.tree.AbstractTreeNode.prototype.add=function(newChild){if(!newChild)return;newChild.setParent(this);newChild.treeview=this.treeview;this.getItems().addItem(newChild);newChild.getRenderer().setLevel(this.getLevel()+1);this.getRenderer().add(newChild.getRenderer());this.getRenderer().paintButton();newChild.getRenderer().paint();if(this.treeview.onaddition)this.treeview.onaddition(newChild);}
js.ui.tree.AbstractTreeNode.prototype.isNodeAncestor=function(anotherNode){if(anotherNode==null)return false;var ancestor=this;if(ancestor==anotherNode)return false;do{if(ancestor==anotherNode)return true;}while((ancestor=ancestor.getParent())!=null);return false;}
js.ui.tree.AbstractTreeNode.prototype.isNodeDescendant=function(anotherNode){if(anotherNode==null)return false;return anotherNode.isNodeAncestor(this);}
js.ui.tree.AbstractTreeNode.prototype.getSharedAncestor=function(node){var aNode=node;if(aNode==null)return null;while(aNode){otherNode=this;while(otherNode){if(aNode==otherNode)return true;otherNode=otherNode.getParent();}
aNode=aNode.getParent();}
return false;}
js.ui.tree.AbstractTreeNode.prototype.isNodeRelated=function(aNode){return(aNode!=null)&&(this.getRoot()==aNode.getRoot());}
js.ui.tree.AbstractTreeNode.prototype.getLevel=function(){var ancestor;var levels=0;ancestor=this;while((ancestor=ancestor.getParent())!=null){levels++;}
return levels;}
js.ui.tree.AbstractTreeNode.prototype.getPath=function(){}
js.ui.tree.AbstractTreeNode.prototype.getPathToRoot=function(aNode,depth){}
js.ui.tree.AbstractTreeNode.prototype.getUserObjectPath=function(){}
js.ui.tree.AbstractTreeNode.prototype.getRoot=function(){var ancestor=this;var previous;do{previous=ancestor;ancestor=ancestor.getParent();}while(ancestor!=null);return previous;}
js.ui.tree.AbstractTreeNode.prototype.isRoot=function(){return this.getParent()==null;}
js.ui.tree.AbstractTreeNode.prototype.getNextNode=function(){if(this.getChildCount()==0){var nextSibling=this.getNextSibling();if(nextSibling==null){var aNode=this.getParent();do{if(aNode==null)return null;nextSibling=aNode.getNextSibling();if(nextSibling!=null)return nextSibling;aNode=aNode.getParent();}while(true);}else return nextSibling;}else return this.getChildAt(0);}
js.ui.tree.AbstractTreeNode.prototype.getPreviousNode=function(){var previousSibling;var myParent=this.getParent();if(myParent==null)return null;previousSibling=this.getPreviousSibling();if(previousSibling!=null){if(previousSibling.getChildCount()==0)return previousSibling;else return previousSibling.getLastLeaf();}else return myParent;}
js.ui.tree.AbstractTreeNode.prototype.isNodeChild=function(aNode){var retval;if(aNode==null)retval=false;else{if(this.getChildCount()==0)retval=false;else retval=(aNode.getParent()==this);}
return retval;}
js.ui.tree.AbstractTreeNode.prototype.getFirstChild=function(){if(this.getChildCount()==0)return null;return this.getChildAt(0);}
js.ui.tree.AbstractTreeNode.prototype.getLastChild=function(){if(this.getChildCount()==0)return null;return this.getChildAt(this.getChildCount()-1);}
js.ui.tree.AbstractTreeNode.prototype.getChildAfter=function(aChild){if(aChild==null)alert("argument is null");var index=this.getIndex(aChild);if(index==-1)alert("node is not a child");if(index<this.getChildCount()-1)return this.getChildAt(index+1);else return null;}
js.ui.tree.AbstractTreeNode.prototype.getChildBefore=function(aChild){if(aChild==null)alert("argument is null");var index=this.getIndex(aChild);if(index==-1)alert("argument is not a child");if(index>0)return this.getChildAt(index-1);else return null;}
js.ui.tree.AbstractTreeNode.prototype.isNodeSibling=function(anotherNode){var retval;if(anotherNode==null)retval=false;else if(anotherNode==this)retval=true;else{var myParent=this.getParent();retval=(myParent!=null&&myParent==anotherNode.getParent());if(retval&&!(this.getParent()).isNodeChild(anotherNode))
alert("sibling has different parent");}
return retval;}
js.ui.tree.AbstractTreeNode.prototype.getSiblingCount=function(){var myParent=this.getParent();if(myParent==null)return 1;else return myParent.getChildCount();}
js.ui.tree.AbstractTreeNode.prototype.getNextSibling=function(){var retval;var myParent=this.getParent();if(myParent==null)retval=null;else retval=myParent.getChildAfter(this);if(retval!=null&&!this.isNodeSibling(retval))
alert("child of parent is not a sibling");return retval;}
js.ui.tree.AbstractTreeNode.prototype.getPreviousSibling=function(){var retval;var myParent=this.getParent();if(myParent==null)retval=null;else retval=myParent.getChildBefore(this);if(retval!=null&&!this.isNodeSibling(retval))
alert("child of parent is not a sibling");return retval;}
js.ui.tree.AbstractTreeNode.prototype.isLeaf=function(){return(this.getChildCount()==0);}
js.ui.tree.AbstractTreeNode.prototype.getFirstLeaf=function(){var node=this;while(!node.isLeaf()){node=node.getFirstChild();}
return node;}
js.ui.tree.AbstractTreeNode.prototype.getLastLeaf=function(){var node=this;while(!node.isLeaf()){node=node.getLastChild();}
return node;}
js.ui.tree.AbstractTreeNode.prototype.getNextLeaf=function(){var nextSibling;var myParent=this.getParent();if(myParent==null)return null;nextSibling=this.getNextSibling();if(nextSibling!=null)return nextSibling.getFirstLeaf();return myParent.getNextLeaf();}
js.ui.tree.AbstractTreeNode.prototype.getPreviousLeaf=function(){var previousSibling;var myParent=this.getParent();if(myParent==null)return null;previousSibling=this.getPreviousSibling();if(previousSibling!=null)return previousSibling.getLastLeaf();return myParent.getPreviousLeaf();}
js.ui.tree.AbstractTreeNode.prototype.getLeafCount=function(){var count=0;var node=this;if(node.isLeaf())return 1;for(var i=0;i<node.getChildCount();i++){if(node.getChildAt(i)&&node.getChildAt(i).isLeaf())count=count+1;else if(node.getChildAt(i)&&!node.getChildAt(i).isLeaf())
count=count+node.getChildAt(i).getLeafCount();}
return count;}
js.ui.tree.AbstractTreeNode.prototype.clear=function(){this.getItems().clear();this.getRenderer().getContainer().innerHTML="";}
js.ui.tree.TreeNode=function(treeview){this.treeview=treeview;}
js.ui.tree.TreeNode.prototype=new js.ui.tree.AbstractTreeNode();$package("js.ui.tree");js.ui.tree.AbstractTree=function(){this.selections=new js.lang.Array();}
js.ui.tree.AbstractTree.prototype=new js.ui.Container();js.ui.tree.AbstractTree.prototype.getNativeClass=function(){return"js.ui.tree.AbstractTree";}
js.ui.tree.AbstractTree.prototype.renderClass=js.ui.tree.AbstractTreeCellRenderer;js.ui.tree.AbstractTree.prototype.treeModel=new js.ui.tree.AbstractTreeModel();js.ui.tree.AbstractTree.prototype.setRoot=function(value){this.getModel().setRoot(value);var rootui=this.getRoot().getRenderer().getUI();if(rootui.parentNode!=this.getUI()){this.getUI().appendChild(rootui);this.getRoot().getRenderer().paint();}}
js.ui.tree.AbstractTree.prototype.getRoot=function(){if(this.treeModel){return this.treeModel.getRoot();}else return null;}
js.ui.tree.AbstractTree.prototype.clearSelections=function(){this.selections.Clear();}
js.ui.tree.AbstractTree.prototype.getSelections=function(){return this.selections;}
js.ui.tree.AbstractTree.prototype.getSelectionsCount=function(){return this.selections.length;};js.ui.tree.AbstractTree.prototype.setModel=function(newModel){this.treeModel=newModel;}
js.ui.tree.AbstractTree.prototype.setAutoExpand=function(value){this.autoExpand=value;};js.ui.tree.AbstractTree.prototype.setEditable=function(value){this.editable=value;}
js.ui.tree.AbstractTree.prototype.setRootVisible=function(value){this.rootVisible=value;if(!this.rootVisible){var root=this.treeModel.getRoot();root.row0TreeNode.style.display="none";this.expand(root);}}
js.ui.tree.AbstractTree.prototype.setSelected=function(treeNode){if(!treeNode)return;if(this.oldSelected==treeNode)return;this.selected=treeNode;this.selected.focused=true;if(this.oldSelected){this.oldSelected.focused=false;this.oldSelected.getRenderer().paintSelect();}
this.selected.getRenderer().paintSelect();if(this.onchange)this.onchange(this.selected);this.oldSelected=this.selected;}
js.ui.tree.AbstractTree.prototype.isSelected=function(treeNode){return this.selected==treeNode;}
js.ui.tree.AbstractTree.prototype.getAutoExpand=function(){return this.autoExpand;};js.ui.tree.AbstractTree.prototype.getModel=function(){return this.treeModel;}
js.ui.tree.AbstractTree.prototype.isEditable=function(){return this.editable;}
js.ui.tree.AbstractTree.prototype.isRootVisible=function(){return this.rootVisible;}
js.ui.tree.AbstractTree.prototype.isExpanded=function(treeNode){return treeNode.isExpanded();}
js.ui.tree.AbstractTree.prototype.isCollapsed=function(treeNode){return treeNode.isCollapsed();}
js.ui.tree.AbstractTree.prototype.isVisible=function(treeNode){}
js.ui.tree.AbstractTree.prototype.isEditing=function(){}
js.ui.tree.AbstractTree.prototype.stopEditing=function(){}
js.ui.tree.AbstractTree.prototype.cancelEditing=function(){}
js.ui.tree.AbstractTree.prototype.expand=function(treeNode){treeNode.expand();}
js.ui.tree.AbstractTree.prototype.collapse=function(treeNode){treeNode.collapse();}
js.ui.tree.AbstractTree.prototype.fullExpand=function(){if(!this.selected)return;else this.selected.expandAll();}
js.ui.tree.AbstractTree.prototype.fullCollapse=function(){if(!this.selected)return;else this.selected.collapseAll();}
js.ui.tree.AbstractTree.prototype.removeChild=function(treeNode){var parentTreeNode=treeNode.getParent();parentTreeNode.remove(treeNode);}
js.ui.tree.AbstractTree.prototype.addChild=function(aParentNode,aChildNode){aParentNode.add(aChildNode);}
js.ui.tree.AbstractTree.prototype.paintChild=function(parent){for(var i=0;i<parent.getChildCount();i++){var child=parent.getChildAt(i);child.rreeView=parent.treeview;var childRenderer=child.getRenderer();childRenderer.paint(child);if(child.getChildCount()>0)this.paintChild(child);}}
js.ui.tree.AbstractTree.prototype.paint=function(){}
js.ui.tree.AbstractTree.prototype.onaddition=function(node){}
js.ui.tree.AbstractTree.prototype.onchange=function(node){}
js.ui.tree.AbstractTree.prototype.onchanging=function(node){}
js.ui.tree.AbstractTree.prototype.onclick=function(){}
js.ui.tree.AbstractTree.prototype.oncollapsed=function(node){}
js.ui.tree.AbstractTree.prototype.oncollapsing=function(node){}
js.ui.tree.AbstractTree.prototype.ondblClick=function(){}
js.ui.tree.AbstractTree.prototype.ondeletion=function(node){}
js.ui.tree.AbstractTree.prototype.onenter=function(){}
js.ui.tree.AbstractTree.prototype.onexit=function(){}
js.ui.tree.AbstractTree.prototype.onexpanded=function(node){}
js.ui.tree.AbstractTree.prototype.onexpanding=function(node,allowExpansion){}
js.ui.tree.AbstractTree.prototype.onkeydown=function(key,shift){}
js.ui.tree.AbstractTree.prototype.onkeypress=function(key){}
js.ui.tree.AbstractTree.prototype.onkeyup=function(key,shift){}
js.ui.tree.AbstractTree.prototype.onstopEditing=function(node){}
$package("js.ui.tree");js.ui.tree.TreeView=function(){this.selections=new js.lang.Array();}
js.ui.tree.TreeView.prototype=new js.ui.tree.AbstractTree();js.ui.tree.TreeView.prototype.getDefaultTreeModel=function(){var root=new js.ui.tree.TreeNode(this);root.setUserObject("JTree");var parent=new js.ui.tree.TreeNode(this);parent.setUserObject("colors");root.add(parent);var child;child=new js.ui.tree.TreeNode(this);child.setUserObject("blue");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("violet");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setRenderer(new js.ui.RadioBoxTreeCellRenderer(child));child.setUserObject("red");parent.add(child);temp=new js.ui.tree.TreeNode(this);temp.setRenderer(new js.ui.CheckBoxTreeCellRenderer(temp));temp.setUserObject("yellow");parent.add(temp);parent=new js.ui.tree.TreeNode(this);parent.setUserObject("sports");root.add(parent);child=new js.ui.tree.TreeNode(this);child.setUserObject("basketball");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("soccer");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("football");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("hockey");parent.add(child);parent=new js.ui.tree.TreeNode(this);parent.setUserObject("food");root.add(parent);child=new js.ui.tree.TreeNode(this);child.setUserObject("hot dogs");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("pizza");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("ravioli");parent.add(child);child=new js.ui.tree.TreeNode(this);child.setUserObject("bananas");parent.add(child);return new js.ui.tree.TreeModel(root);}
$package("js.ui.list");js.ui.list.IconListItemRenderer=function(owner){this.owner=owner;}
js.ui.list.IconListItemRenderer.prototype=new js.ui.list.AbstractListItemRenderer();js.ui.list.IconListItemRenderer.prototype.style=1;js.ui.list.IconListItemRenderer.prototype.getNativeClass=function(){if(this.style==0)
return"js.ui.list.IconListItemRenderer_Report";else
return"js.ui.list.IconListItemRenderer";}
js.ui.list.IconListItemRenderer.prototype.getCSS=function(){if(this.isSelected())
return this.baseCSS+" Panel_selected";if(this.state==1)
return this.baseCSS+" Panel_over";return this.baseCSS;}
js.ui.list.IconListItemRenderer.prototype.bindUI=function(){this.__superBindUI=js.ui.list.AbstractListItemRenderer.prototype.bindUI;this.__superBindUI();this.edit=this.ui.getElementsByTagName("textarea")[0];this.textDiv=this.ui.getElementsByTagName("div")[3];this.text=this.ui.getElementsByTagName("a")[0];var icon=this.ui.getElementsByTagName("img")[0];this.iconDiv=icon.parentNode;this.icon=new js.ui.Img();this.icon.ui=icon;this.bindEvents();}
js.ui.list.IconListItemRenderer.prototype.bindEvents=function(){var __this=this;this.ui.onmouseover=function(){__this.state=1;this.className=__this.getCSS();}
this.ui.onkeydown=function(event){if(!event)event=window.event;if(event.which==113||event.keyCode==113)
__this.rename();};this.ui.ondblclick=function(event){__this.__mouseClickTimer.stop();if(__this.onopen)
__this.onopen();};this.__mouseClickTimer=new js.util.Timer();this.__mouseClickTimer.setInterval(500);this.__mouseClickTimer.ontimer=function(){__this.rename();this.stop();};this.text.onclick=function(){if(__this.isSelected())
__this.__mouseClickTimer.setActive(true);return js.ui.Component.eventCancelBubble(event);};this.edit.onkeydown=function(event){if(!event)event=window.event;if(event.which==13||event.keyCode==13)
__this.toTextView();if(event.which==27||event.keyCode==27)
__this.cancelEdit();}}
js.ui.list.IconListItemRenderer.prototype.rename=function(){if(this.readOnly)return;if(this.edit.style.display=="block")return;var value=this.text.innerHTML;this.edit.value=value;this.edit.style.width=this.textDiv.offsetWidth+2;this.edit.style.height=this.textDiv.offsetHeight+2;this.edit.style.display="block";this.textDiv.style.display="none";this.edit.focus();this.edit.select();var __this=this;this.edit.onblur=function(){__this.toTextView();}}
js.ui.list.IconListItemRenderer.prototype.toTextView=function(){this.text.innerHTML=this.edit.value;this.textDiv.style.display="";this.edit.style.display="none";if(this.onchange)this.onchange(this.edit.value);}
js.ui.list.IconListItemRenderer.prototype.cancelEdit=function(){var func=this.edit.onblur;this.edit.onblur=null;this.textDiv.style.display="";this.edit.style.display="none";}
js.ui.list.IconListItemRenderer.prototype.setIcon=function(url){this.icon.setSrc(url);}
js.ui.list.IconListItemRenderer.prototype.paintSelect=function(){this.getUI().className=this.getCSS();}
js.ui.list.IconListItemRenderer.prototype.paintText=function(){var text=this.userObject.text;if(text=='')text="&nbsp";this.text.innerHTML=text;this.edit.value=text;}
js.ui.list.IconListItemRenderer.prototype.paintIcon=function(){var icon=this.userObject.icon;this.setIcon(icon);}
js.ui.list.IconListItemRenderer.prototype.paint=function(){this.paintText();this.paintIcon();this.paintSelect();}
$package("com.joyistar.ui");com.joyistar.ui.Panel=function(){}
com.joyistar.ui.Panel.prototype=new js.ui.Container();com.joyistar.ui.Panel.prototype.bindUI=function(){this.container=this.ui.getElementsByTagName("td")[4];}
com.joyistar.ui.Panel.prototype.getNativeClass=function(){return"com.joyistar.ui.Panel";}
$package("com.joyistar.ui");com.joyistar.ui.IconListItemRenderer=function(owner){this.owner=owner;}
com.joyistar.ui.IconListItemRenderer.prototype=new js.ui.list.IconListItemRenderer();$package("com.joyistar.ui");com.joyistar.ui.IconListView=function(){}
com.joyistar.ui.IconListView.prototype=new js.ui.list.AbstractListView();com.joyistar.ui.IconListView.prototype.renderClass=com.joyistar.ui.IconListItemRenderer;$package("com.qn.ui");com.qn.ui.FileIconRenderer=function(owner){this.owner=owner;}
com.qn.ui.FileIconRenderer.prototype=new js.ui.list.IconListItemRenderer();com.qn.ui.FileIconRenderer.prototype.size=16;com.qn.ui.FileIconRenderer.prototype.getNativeClass=function(){if(this.style==0)
return"com.qn.ui.FileIconRenderer_Report";else
return"js.ui.list.IconListItemRenderer";}
com.qn.ui.FileIconRenderer.prototype.bindEvents=function(){var __this=this;if(this.style==0){this.checkbox=this.ui.getElementsByTagName("input")[0];this.sizeSpan=this.ui.getElementsByTagName("span")[0];this.lastModified=this.ui.getElementsByTagName("span")[1];this.absoluteIP=this.ui.getElementsByTagName("span")[2];this.editButton=this.ui.getElementsByTagName("a")[1];this.linkButton=this.ui.getElementsByTagName("a")[2];}
this.__superBindEvents=js.ui.list.IconListItemRenderer.prototype.bindEvents;this.__superBindEvents();var curListBox=this.owner;this.text.onclick=function(){if(curListBox.onclickItem)curListBox.onclickItem(__this);}
if(this.style==0){this.ui.onclick=null;this.ui.onmousedown=null;this.checkbox.onclick=function(event){curListBox.setSelectedValue(__this.userObject,this.checked);}
this.editButton.onclick=function(event){if(curListBox.onedit)curListBox.onedit(__this);return js.ui.Component.eventCancelBubble(event);}
if(curListBox.columns.size()<5){this.absoluteIP.style.display="none";this.editButton.style.display="none";this.linkButton.style.display="none";}}
else{}}
com.qn.ui.FileIconRenderer.prototype.setValue=function(value){this.userObject=value;this.getUI().title=value.getFilename();this.paint();}
com.qn.ui.FileIconRenderer.prototype.paintType=function(){var typeIcon=this.userObject.getTypeIcon();if(typeIcon&&!this.typeIcon){this.typeIcon=new js.ui.Img();this.typeIcon.getUI().className="typeIcon";this.iconDiv.appendChild(this.typeIcon.getUI());}
if(typeIcon&&this.typeIcon){this.typeIcon.show();this.typeIcon.setSrc(typeIcon);this.typeIcon.ui.style.left=this.icon.ui.offsetLeft;this.typeIcon.ui.style.top=this.icon.ui.offsetTop;}
else if(this.typeIcon)this.typeIcon.hide();}
com.qn.ui.FileIconRenderer.prototype.paintText=function(){if(this.style==0)
this.linkButton.href=this.userObject.getLinkUrl();if(this.userObject.isDirectory()){this.text.href="#";}
else{this.text.href=this.userObject.getDownLink();this.text.target="_blank";}
var text=this.userObject.getDisplayName();if(!text)text="";this.text.innerHTML=text;this.edit.value=text;if(this.viewType>0&&text.length>20)
this.textDiv.style.height=30;else
this.textDiv.style.height="";if(this.style==0){this.sizeSpan.innerHTML=this.userObject.getSizeDisp();this.lastModified.innerHTML=this.userObject.getLastModifiedDisp();this.absoluteIP.innerHTML=this.userObject.getAbsoluteIPDisp();}}
com.qn.ui.FileIconRenderer.prototype.paintIcon=function(){var icon;if(this.size>16)
icon=this.userObject.getBigIcon();else
icon=this.userObject.getSmallIcon();this.setIcon(icon);this.paintType();}
com.qn.ui.FileIconRenderer.prototype.paintSelect=function(selected){this.getUI().className=this.getCSS();if(this.checkbox){if(selected==null){if(this.isSelected()){this.checkbox.checked=true;}
else{this.checkbox.checked=false;}}
else
this.checkbox.checked=selected;}}
com.qn.ui.FileIconRenderer.prototype.onchange=function(text){this.userObject.setFilename(text);this.getUI().title=this.userObject.getFilename();this.paintText();}
com.qn.ui.FileIconRenderer.prototype.onopen=function(){var __this=this;this.owner.openWithExplorer(__this.userObject.getPath());}
$package("com.qn.ui");com.qn.ui.FileListView=function(){this.multiSelected=true;if(js.ui.list.Columns)
this.columns=new js.ui.list.Columns();}
com.qn.ui.FileListView.prototype=new js.ui.list.AbstractListView();com.qn.ui.FileListView.prototype.renderClass=com.qn.ui.FileIconRenderer;com.qn.ui.FileListView.prototype.viewType=0;com.qn.ui.FileListView.prototype.list=function(path,exts,isListDirs,startRecord){var __this=this;this.getFile().onerror=function(msg){alert(msg);}
this.getFile().onload=function(files){__this.clear();__this.fillFiles(files);}
this.getFile().setPath(path);this.getFile().list(exts,isListDirs,startRecord);}
com.qn.ui.FileListView.prototype.parseText=function(responseText){var __this=this;this.getFile().onerror=function(msg){alert(msg);}
this.getFile().onload=function(files){__this.clear();__this.fillFiles(files);}
this.getFile().doListed(responseText);}
com.qn.ui.FileListView.prototype.refresh=function(){this.list(this.getFile().getPath());}
com.qn.ui.FileListView.prototype.file=null;com.qn.ui.FileListView.prototype.getFile=function(){if(!this.file){this.addListener(810);this.file=new com.qn.io.File();}
return this.file;}
com.qn.ui.FileListView.prototype.fillFiles=function(files){if(this.onlist)
this.onlist(files);var f;for(var i=0;i<files.length;i++){f=files[i];this.addItem(f);}
if(this.onlisted)
this.onlisted(files);}
com.qn.ui.FileListView.prototype.processMessage=function(msg,action,src){if(msg==810){if(this.getFile().getPath()!=src.getParent()&&!this.isRecycle())return;if(action==0){this.refresh();}
else if(action==1){this.refresh();}
else if(action==2){this.refresh();}
else if(action==6){this.refresh();}}}
com.qn.ui.FileListView.prototype.getSelFileIds=function(){var sels=this.getSelectedValues();var fns="";for(var i=0;i<sels.length;i++){fns+=sels[i].fileId+":";}
return fns;}
com.qn.ui.FileListView.prototype.buildDefColumns=function(){var __this=this;var column=new js.ui.list.Column();column.caption="";column.width="16";column.colSpan=2;column.renderClass=js.ui.list.CheckBoxColumnCellRenderer;this.addColumn(column);this.selectAllCheckBox=column.renderer.checkbox;column.renderer.checkbox.onclick=function(){if(this.checked)
__this.selectAll();else
__this.clearSelection();}
var column=new js.ui.list.Column();column.caption=props("Name");column.width="270";column.colSpan=2;this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Size");column.width="100";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Date");column.width="100";this.addColumn(column);}
com.qn.ui.FileListView.prototype.buildDefExColumns=function(){var column=new js.ui.list.Column();column.caption=props("Downloads");column.width="100";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Edit");column.width="50";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Link");column.width="50";this.addColumn(column);}
com.qn.ui.FileListView.prototype.bindPopupMenu=function(){var __this=this;this.ui.super_oncontextmenu=js.ui.Component.default_oncontextmenu;this.ui.oncontextmenu=function(event){this.owner.doPopupMenu();return this.super_oncontextmenu(event);}
this.ui.ondblclick=function(event){if(__this.popupMenu)
__this.popupMenu.hide();}}
com.qn.ui.FileListView.prototype.doPopupMenu=function(){if(this.isRecycle()){if(this.getSelFileIds().length>0){this.popupMenu=this.getRecyclePopMenu();}}
else{if(this.getSelFileIds().length>0){this.popupMenu=this.getSelPopMenu();}
else{this.popupMenu=this.getWhileSpacePopMenu();}}}
com.qn.ui.FileListView.prototype.getSelPopMenu=function(){if(this.selPopMenu)return this.selPopMenu;var __this=this;var popmenu=this.selPopMenu=new js.ui.PopupMenu();popmenu.hide();rootPanel.appendChild(popmenu.getUI());var item=new js.ui.MenuItem();item.setText(props("Open"));popmenu.add(item);item.onclick=function(){var selFile=__this.getSelectedValues()[0];if(selFile!=null){__this.openWithExplorer(selFile.getPath());}}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Link"));popmenu.add(item);item.onclick=function(){__this.link();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Move"));popmenu.add(item);item.onclick=function(){__this.moveSels();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Delete"));popmenu.add(item);item.onclick=function(){__this.deleteSels();}
var item=new js.ui.MenuItem();item.setText(props("Rename"));popmenu.add(item);item.onclick=function(){var selFile=__this.getSelectedValues()[0];if(selFile!=null){__this.onedit(selFile);}}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Properties"));popmenu.add(item);item.onclick=function(){__this.property();}
return this.selPopMenu;}
com.qn.ui.FileListView.prototype.getWhileSpacePopMenu=function(){if(this.whileSpacePopMenu)return this.whileSpacePopMenu;var __this=this;var popmenu=this.whileSpacePopMenu=new js.ui.PopupMenu();popmenu.hide();rootPanel.appendChild(popmenu.getUI());var item=new js.ui.MenuItem();item.setText(props("Upload"));popmenu.add(item);item.onclick=function(){__this.upload();}
var item=new js.ui.MenuItem();item.setText(props("Batch Upload"));popmenu.add(item);item.onclick=function(){__this.batchUpload();}
var item=new js.ui.MenuItem();item.setText(props("Remote Upload"));popmenu.add(item);item.onclick=function(){__this.remoteUpload();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Refresh"));popmenu.add(item);item.onclick=function(){__this.refresh();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("New Folder"));popmenu.add(item);item.onclick=function(){__this.newFolder();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Properties"));popmenu.add(item);item.onclick=function(){__this.property();}
return this.whileSpacePopMenu;}
com.qn.ui.FileListView.prototype.getRecyclePopMenu=function(){if(this.recyclePopMenu)return this.recyclePopMenu;var __this=this;var popmenu=this.recyclePopMenu=new js.ui.PopupMenu();popmenu.hide();rootPanel.appendChild(popmenu.getUI());var item=new js.ui.MenuItem();item.setText(props("Recovery"));popmenu.add(item);item.onclick=function(){__this.recoverySels();}
popmenu.addSeparator();var item=new js.ui.MenuItem();item.setText(props("Properties"));popmenu.add(item);item.onclick=function(){__this.property();}}
com.qn.ui.FileListView.prototype.onclickItem=function(item){var f=item.userObject;if(f.isDirectory()&&!this.isRecycle()){this.list(f.getTarget());}}
com.qn.ui.FileListView.prototype.openWithExplorer=function(path){}
com.qn.ui.FileListView.prototype.newFolder=function(path){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.setActive(true);dlg.ui.className+=" NewFolderDlg";dlg.setTitle(props("New Folder"));rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){contentWindow.parentPath=__this.getFile().getPath();}
dlg.openUrl("/explorer/newFolder.html");}
com.qn.ui.FileListView.prototype.deleteSels=function(){var selCount=this.getSelectedIndices().length;if(selCount<=0)return;if(window.confirm(props("Are you sure delete?"))){var selFile=this.getSelectedValues()[0];selFile.deleteFile(this.getSelFileIds());}}
com.qn.ui.FileListView.prototype.onedit=function(f){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.setActive(true);dlg.ui.className+=" EditFileDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){contentWindow.getData(f.fileId);}
dlg.setTitle(props("File Edit"));dlg.openUrl("/explorer/editFile.html");}
com.qn.ui.FileListView.prototype.moveSels=function(){var __this=this;var selCount=this.getSelectedIndices().length;if(selCount<=0)return;var dlg=new com.qn.dlg.DirDlg();document.body.appendChild(dlg.getUI());dlg.showModal();dlg.center();dlg.list();dlg.onclose=function(){if(this.result==1){var currentPath=this.currentPath;var selFile=__this.getSelectedValues()[0];return selFile.move(__this.getSelFileIds(),currentPath);}
return true;}}
com.qn.ui.FileListView.prototype.upload=function(){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.setActive(true);dlg.ui.className+=" UploadDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){if(contentWindow.setParentPath)
contentWindow.setParentPath(__this.getFile().getPath());}
dlg.setTitle(props("File Upload"));dlg.openUrl("/view?module=upload&action=uploadDlg");}
com.qn.ui.FileListView.prototype.batchUpload=function(){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.setActive(true);dlg.ui.className+=" BatchUploadDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){if(contentWindow.setParentPath)
contentWindow.setParentPath(__this.getFile().getPath());}
dlg.setTitle(props("Batch Upload"));dlg.openUrl("/view?module=flashUpload&action=uploadDlg");}
com.qn.ui.FileListView.prototype.remoteUpload=function(){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.setActive(true);dlg.ui.className+=" RemoteUploadDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){if(contentWindow.setParentPath)
contentWindow.setParentPath(__this.getFile().getPath());}
dlg.setTitle(props("Remote Upload"));dlg.openUrl("/view?module=remoteUpload&action=uploadDlg");}
com.qn.ui.FileListView.prototype.property=function(){var __this=this;var dlg=new com.qn.dlg.UrlDlg();dlg.getUI().className+=" PropertyDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.onload=function(contentWindow){var selFile=__this.getSelectedValues()[0];if(selFile)
contentWindow.getData(selFile.fileId);else
contentWindow.getData(__this.getFile().fileId,__this.getFile().path);}
dlg.setTitle(props("Properties"));dlg.setActive(true);dlg.openUrl("/explorer/attribute.html");}
com.qn.ui.FileListView.prototype.link=function(){var __this=this;var selFile=__this.getSelectedValues()[0];if(selFile){var dlg=new com.qn.dlg.UrlDlg();dlg.getUI().className+=" LinkDlg";rootPanel.appendChild(dlg.ui);dlg.center();dlg.setTitle(props("Link"));dlg.setActive(true);dlg.openUrl("/explorer/getLinkDlg/"+selFile.userId+"/"+selFile.fileId+".html");}}
com.qn.ui.FileListView.prototype.isRecycle=function(){return this.getFile().path=="Recycle";}
com.qn.ui.FileListView.prototype.recoverySels=function(){var selCount=this.getSelectedIndices().length;if(selCount<=0)return;var selFile=this.getSelectedValues()[0];selFile.recovery(this.getSelFileIds());}
com.qn.ui.FileListView.prototype.clear=function(){this.__superClear=js.ui.list.AbstractListView.prototype.clear;this.__superClear();if(this.selectAllCheckBox)
this.selectAllCheckBox.checked=false;}
$package("com.qn.ui");com.qn.ui.FileTreeNodeRenderer=function(treeNode){this.treeNode=treeNode;}
com.qn.ui.FileTreeNodeRenderer.prototype=new js.ui.tree.AbstractTreeCellRenderer();com.qn.ui.FileTreeNodeRenderer.prototype.paintText=function(){var text=this.treeNode.userObject.getDisplayName();if(!text)text="";this.text.innerHTML=text;}
com.qn.ui.FileTreeNodeRenderer.prototype.paintIcon=function(){var icon=this.treeNode.userObject.getSmallIcon();this.setIcon(icon);}
$package("com.qn.ui");com.qn.ui.FileTreeView=function(){this.multiSelected=true;this.onchange=function(selNode){if(selNode.getChildCount()>0)
selNode.clear();var file=selNode.userObject;this.list(file.getTarget(),selNode);}}
com.qn.ui.FileTreeView.prototype=new js.ui.tree.AbstractTree();com.qn.ui.FileTreeView.prototype.renderClass=com.qn.ui.FileTreeNodeRenderer;com.qn.ui.FileTreeView.prototype.list=function(path,parentNode){var __this=this;this.getFile().onerror=function(msg){alert(msg);}
this.getFile().onload=function(files){__this.fillFiles(files,parentNode);if(__this.onload)__this.onload(files,parentNode);}
this.getFile().setPath(path);this.getFile().list();}
com.qn.ui.FileTreeView.prototype.fillFiles=function(files,parentNode){if(!parentNode)
parentNode=this.getRoot();if(parentNode)
parentNode.clear();var file;for(var i=0;i<files.length;i++){file=files[i];if(file.isDirectory()||file.isDirShortcut()||file.isShareDirectory()){var node=new js.ui.tree.TreeNode(this);node.setUserObject(file);parentNode.add(node);}}
parentNode.expand();}
com.qn.ui.FileTreeView.prototype.file=null;com.qn.ui.FileTreeView.prototype.getFile=function(){if(!this.file){this.file=new com.qn.io.File();this.addListener(810);}
return this.file;}
com.qn.ui.FileTreeView.prototype.locateNode=function(path,parentNode){if(!parentNode)
parentNode=this.getRoot();var node;for(var i=0;i<parentNode.getChildCount();i++){node=parentNode.getChildAt(i);if(node.userObject.getTarget()==path)
this.setSelected(node);}}
com.qn.ui.FileTreeView.prototype.processMessage=function(msg,action,src){if(msg==810){if(this.getFile().getPath()!=src.getParent())return;if(action==0){this.list(src.getParent(),this.selected);}
else if(action==1){this.list(src.getParent(),this.selected);}
else if(action==2){this.list(src.getParent(),this.selected);}
else if(action==6){this.list(src.getParent(),this.selected);}}}
$package("com.qn.ui");com.qn.ui.ShortUrlListView=function(){this.multiSelected=true;if(js.ui.list.Columns)
this.columns=new js.ui.list.Columns();this.renderClass=com.qn.ui.ShortUrlRenderer;}
com.qn.ui.ShortUrlListView.prototype=new com.qn.ui.FileListView();com.qn.ui.ShortUrlListView.prototype.renderClass=com.qn.ui.ShortUrlRenderer;com.qn.ui.ShortUrlListView.prototype.viewType=0;com.qn.ui.ShortUrlListView.prototype.buildDefColumns=function(){var __this=this;var column=new js.ui.list.Column();column.caption="";column.width="16";column.colSpan=2;column.renderClass=js.ui.list.CheckBoxColumnCellRenderer;this.addColumn(column);this.selectAllCheckBox=column.renderer.checkbox;column.renderer.checkbox.onclick=function(){if(this.checked)
__this.selectAll();else
__this.clearSelection();}
var column=new js.ui.list.Column();column.caption=props("Name");column.width="150";column.colSpan=2;this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Source");column.width="200";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Date");column.width="100";this.addColumn(column);}
com.qn.ui.ShortUrlListView.prototype.buildDefExColumns=function(){var column=new js.ui.list.Column();column.caption=props("Mode");column.width="50";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Clicks");column.width="100";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Edit");column.width="50";this.addColumn(column);var column=new js.ui.list.Column();column.caption=props("Link");column.width="50";this.addColumn(column);}
com.qn.ui.ShortUrlListView.prototype.deleteSels=function(){var selCount=this.getSelectedIndices().length;if(selCount<=0)return;if(window.confirm(props("Are you sure delete?"))){var selFile=this.getSelectedValues()[0];selFile.deleteFile(this.getSelFileIds());}}
com.qn.ui.ShortUrlListView.prototype.clear=function(){this.__superClear=js.ui.list.AbstractListView.prototype.clear;this.__superClear();if(this.selectAllCheckBox)
this.selectAllCheckBox.checked=false;}
$package("com.qn.ui");com.qn.ui.ShortUrlRenderer=function(owner){this.owner=owner;}
com.qn.ui.ShortUrlRenderer.prototype=new com.qn.ui.FileIconRenderer();com.qn.ui.ShortUrlRenderer.prototype.size=16;com.qn.ui.ShortUrlRenderer.prototype.getNativeClass=function(){if(this.style==0)
return"com.qn.ui.ShortUrlRenderer_Report";else
return"js.ui.list.IconListItemRenderer";}
com.qn.ui.ShortUrlRenderer.prototype.bindEvents=function(){var __this=this;if(this.style==0){this.checkbox=this.ui.getElementsByTagName("input")[0];this.srcSpan=this.ui.getElementsByTagName("a")[1];this.lastModified=this.ui.getElementsByTagName("span")[0];this.modeSpan=this.ui.getElementsByTagName("span")[1];this.absoluteIP=this.ui.getElementsByTagName("span")[2];this.editButton=this.ui.getElementsByTagName("a")[2];this.linkButton=this.ui.getElementsByTagName("a")[3];}
this.__superBindEvents=js.ui.list.IconListItemRenderer.prototype.bindEvents;this.__superBindEvents();var curListBox=this.owner;this.text.onclick=function(){if(curListBox.onclickItem)curListBox.onclickItem(__this);}
if(this.style==0){this.ui.onclick=null;this.ui.onmousedown=null;this.checkbox.onclick=function(event){curListBox.setSelectedValue(__this.userObject,this.checked);}
this.editButton.onclick=function(event){if(curListBox.onedit)curListBox.onedit(__this);return js.ui.Component.eventCancelBubble(event);}
if(curListBox.columns.size()<5){this.absoluteIP.style.display="none";this.editButton.style.display="none";this.linkButton.style.display="none";}}
else{}}
com.qn.ui.ShortUrlRenderer.prototype.paintText=function(){if(this.style==0)
this.linkButton.href="/short/getSingleLink/"+this.userObject.userId+"/"+this.userObject.fileId+".html";if(this.userObject.isDirectory()){this.text.href="#";this.editButton.style.display="none";this.linkButton.style.display="none";}
else{this.text.href=this.userObject.getDownLink();this.text.target="_blank";this.linkButton.title=this.userObject.getLink();}
var text=this.userObject.getDisplayName();if(!text)text="";this.text.innerHTML=text;this.edit.value=text;if(this.viewType>0&&text.length>20)
this.textDiv.style.height=30;else
this.textDiv.style.height="";if(this.style==0){this.srcSpan.innerHTML=this.userObject.getRealPath();this.srcSpan.href=this.userObject.getRealPath();this.srcSpan.title=this.userObject.getRealPath();this.lastModified.innerHTML=this.userObject.getLastModifiedDisp();this.modeSpan.innerHTML=this.userObject.getAdMode();this.absoluteIP.innerHTML=this.userObject.getAbsoluteIPDisp();}}
$package("com.qn.ui");com.qn.ui.Progress=function(){}
com.qn.ui.Progress.prototype=new js.ui.Component();com.qn.ui.Progress.prototype.getNativeClass=function(){return"com.qn.ui.Progress";}
com.qn.ui.Progress.prototype.bindUI=function(){this.icon=this.ui.getElementsByTagName("img")[0];this.message=this.ui.getElementsByTagName("span")[0];this.ui.style.zIndex=9;this.icon.src=imagePath+"/progress/progress1.gif";}
com.qn.ui.Progress.prototype.setMessage=function(msg){this.message.innerHTML=msg;}
com.qn.ui.Progress.prototype.start=function(msg){this.show();this.center();if(msg)this.message.innerHTML=msg;}
$package("com.qn.io");com.qn.io.File=function(path){this.path=path;}
com.qn.io.File.prototype=new js.lang.BaseObject();com.qn.io.File.prototype.async=true;com.qn.io.File.prototype.result=null;com.qn.io.File.prototype.returnValue=false;com.qn.io.File.prototype.parent=null;com.qn.io.File.prototype.filename=null;com.qn.io.File.prototype.target=null;com.qn.io.File.prototype.desc=null;com.qn.io.File.prototype.fileId=null;com.qn.io.File.prototype.userId=null;com.qn.io.File.prototype.onload=null;com.qn.io.File.prototype.onerror=null;com.qn.io.File.prototype.score=0;com.qn.io.File.prototype.shareName=null;com.qn.io.File.prototype.host=null;com.qn.io.File.prototype.windowType=0;com.qn.io.File.prototype.baseUrl="/view?module=fileService&action=";com.qn.io.File.prototype.getHttp=function(){if(!this.http){this.http=new js.net.HttpConnection();this.http.method="POST";this.http.owner=this;}
this.http.async=this.async;this.http.onerror=function(http){if(browser.progress)browser.progress.hide();this.owner.returnValue=false;var error=http.responseText;if(!error)browser.messageBox("Network or service error.");else if(this.owner.onerror)
this.owner.onerror(error);else browser.messageBox(error);}
this.http.onload=function(http){var data=this.owner.processResponse(http.responseText);if(!data.errorMsg)
this.owner.returnValue=true;if(!data.errorMsg&&this.owner.onload)this.owner.onload(data);}
if(browser.progress)browser.progress.start(props("Loading......"));return this.http;}
com.qn.io.File.prototype.processResponse=function(responseText){if(browser.progress)browser.progress.hide();var data;try{eval('data='+responseText);}catch(e){data=new Array();};if(data.errorMsg)
if(this.onerror)
this.onerror(data.errorMsg);else
browser.messageBox(data.errorMsg);else if(!data.errorMsg){if(this.__action>=0){browser.sendMessage(null,810,this.__action,this);}}
return data;}
com.qn.io.File.prototype.onerror=function(errorMsg){browser.messageBox(errorMsg);}
com.qn.io.File.prototype.list=function(exts,isListDirs,startRecord){this.async=true;var __this=this;var http=this.getHttp();var url=this.baseUrl+"dir";var params="path="+js.util.Utils.prototype.encodeString(this.path);if(exts){params+="&exts="+exts;}
if(isListDirs==true){params+="&islistdirs="+isListDirs;}
if(startRecord!=null){params+="&recno="+startRecord;}
http.onload=function(http){if(browser.progress)browser.progress.hide();this.owner.doListed(http.responseText);}
http.open(url);http.send(params);}
com.qn.io.File.prototype.doListed=function(responseText){var data=this.processResponse(responseText);if(!data)return;if(data.errorMsg)return;this.result=new js.lang.Array();var file;for(var i=0;i<data.length;i++){file=new com.qn.io.File();file.fillData(data[i]);this.result.addItem(file);}
if(this.onload)
this.onload(this.result);}
com.qn.io.File.prototype.fillData=function(data){this.parent=data.parent;this.target=data.target;this.type=data.type;this.filename=data.name;this.lastModified=data.lastModified;this.size=data.size;this.bigIcon=data.bigIcon;this.smallIcon=data.smallIcon;this.absoluteIP=data.absoluteIP;this.isShared=data.isShared;this.desc=data.desc;this.userId=data.userId;this.fileId=data.fileId;this.realPath=data.realPath;this.link=data.link;this.adMode=data.adMode;this.isPass=data.isPass;}
com.qn.io.File.prototype.mkdir=function(){this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"createNewFolder";var params="path="+js.util.Utils.prototype.encodeString(this.path);this.__action=0;http.open(url);http.send(params);return this.returnValue;}
com.qn.io.File.prototype.getSizeDisp=function(){if(!this.isFile())return"";var ft=new js.util.Format();return ft.formatBytes(this.getSize());}
com.qn.io.File.prototype.getIsPassDisp=function(){if(this.isPass==2||this.isPass==5)
return props("Abuse");else return"";}
com.qn.io.File.prototype.getLastModifiedDisp=function(){if(this.getLastModified()==0)return"";var ft=new js.util.Format();var dt=new js.util.Date(this.getLastModified());return dt.formatDateTime(props("dateTimeFormat"));}
com.qn.io.File.prototype.getAbsoluteIPDisp=function(){if(this.getIsPassDisp()!="")return this.getIsPassDisp();if(!this.absoluteIP||this.absoluteIP<=0)return"";return this.absoluteIP;}
com.qn.io.File.prototype.getDescDisp=function(){if(!this.desc)return"";return this.desc;}
com.qn.io.File.prototype.getAttributes=function(){this.async=true;var __this=this;var http=this.getHttp();var url=this.baseUrl+"getAttributes";var params="fileId="+this.fileId;http.onload=function(http){var data=__this.processResponse(http.responseText);if(!data.errorMsg){__this.fillData(data);if(__this.onload)
__this.onload(data);}}
http.open(url);http.send(params);}
com.qn.io.File.prototype.deleteFile=function(fileIds){if(!fileIds||fileIds.length==0)return;this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"delete";var params="fileIds="+fileIds;this.__action=2;http.open(url);http.send(params);return this.returnValue;}
com.qn.io.File.prototype.recovery=function(fileIds){if(!fileIds||fileIds.length==0)return;this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"recovery";var params="fileIds="+fileIds;this.__action=6;http.open(url);http.send(params);return this.returnValue;}
com.qn.io.File.prototype.deleteOnExist=function(){return true;}
com.qn.io.File.prototype.editSave=function(){this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"editSave";var params="fileId="+js.util.Utils.prototype.encodeString(this.fileId);params+="&desc="+js.util.Utils.prototype.encodeString(this.desc);http.open(url);http.send(params);}
com.qn.io.File.prototype.renameTo=function(newParent,newName){this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"rename";this.__action=1;var params="fileId="+js.util.Utils.prototype.encodeString(this.fileId);params+="&newParent="+js.util.Utils.prototype.encodeString(newParent);params+="&newName="+js.util.Utils.prototype.encodeString(newName);http.open(url);http.send(params);if(this.returnValue){this.parent=newParent;this.filename=newName;}
return this.returnValue;}
com.qn.io.File.prototype.move=function(fileIds,newPath){this.async=false;var __this=this;var http=this.getHttp();var url=this.baseUrl+"move";this.__action=1;var params="fileIds="+js.util.Utils.prototype.encodeString(fileIds);params+="&newPath="+js.util.Utils.prototype.encodeString(newPath);http.open(url);http.send(params);return this.returnValue;}
com.qn.io.File.prototype.getRealPath=function(){if(this.isShortUrl())
return this.realPath;else return"";}
com.qn.io.File.prototype.getShortUrl=function(){if(this.isShortUrl())
return this.link;else return"";}
com.qn.io.File.prototype.getLink=function(){return this.link;}
com.qn.io.File.prototype.getDownLink=function(){return this.link;}
com.qn.io.File.prototype.getLinkUrl=function(){return"/explorer/getLink/"+this.userId+"/"+this.fileId+".html";}
com.qn.io.File.prototype.getAdMode=function(){if(!this.adMode)return"";return this.adMode;}
com.qn.io.File.prototype.validateFilename=function(filename){var regex=/[/\\\\<>*:?|\"]/;
    if (regex.test(filename)) return false;
    else return true;
}



com.qn.io.File.prototype.searchList = function(params,startRecord){

}

com.qn.io.File.prototype.setAsync = function(async){
 this.async = async;
 this.getHttp().async = async;
}

com.qn.io.File.prototype.clone = function(){
 var newfile = new com.qn.io.File();
 newfile.setPath(this.getPath());
 newfile.setTarget(this.getTarget());
 newfile.type = this.type;
 newfile.lastModified = this.lastModified;
 newfile.size = this.size;
 newfile.bigIcon = this.bigIcon;
 newfile.smallIcon = this.smallIcon;
 newfile.windowType = this.windowType;
 return newfile;
}

com.qn.io.File.prototype.setTarget = function(target){
 this.target= target;
}

com.qn.io.File.prototype.getTarget = function(){
 if(!this.target)
  return this.getPath();
 return this.target;
}

com.qn.io.File.prototype.canRead = function(){
 return true;
}
com.qn.io.File.prototype.canWrite = function(){
 return true;
}
/*com.qn.io.File.prototype.renameTo = function(filename){
 var __this = this;
 this.__action = 1;//rename

 this.getHttp().OpenURL = com.qn.io.File.prototype.OPEN_URL+"?ds=" + "tomos.filesystem.File.renameTo";
 this.GetDataSet().Close();
 this.GetDataSet().Fields.Clear();
 this.GetDataSet().Params.Clear();
 var param1 = new js.db.Param("path", this.Path, "String");
 var param2 = new js.db.Param("rename", filename, "String");
 this.GetDataSet().Params.Add(param1);
 this.GetDataSet().Params.Add(param2);
 this.GetDataSet().OnAfterOpen = function(){
  __this.ReturnValue = true;
  __this.Result = this;
  __this.__OldPath = __this.GetPath();
  __this.SetPath(__this.GetParent()+"/"+filename);
  __this.SetFileName(filename);
  if(!__this.IsFileShortcut() && !__this.IsDirShortcut())
   __this.Target = __this.GetPath();
  Browser.SendMessage(null, 810, __this.__Action, __this);//WM_FILESYSTEMCHANGE.rename
  if(__this.Onload)
   __this.Onload(__this.Result);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}*/

com.qn.io.File.prototype.createShortcut = function(target, icon, windowtype){
 var __this = this;
 this.__Action = 0;//new
 this.GetDataSet().OpenURL = com.qn.io.File.prototype.OPEN_URL+"?datasource=" +"tomos.filesystem.File.createShortcut";
 this.GetDataSet().Close();
 this.GetDataSet().Fields.Clear();
 this.GetDataSet().Params.Clear();
 var param1 = new js.db.Param("path", this.GetPath(), "String");
 var param2 = new js.db.Param("target", target, "String");
 var param3 = new js.db.Param("icon", icon, "String");
 var param4 = new js.db.Param("windowtype", windowtype, "String");
 this.GetDataSet().Params.Add(param1);
 this.GetDataSet().Params.Add(param2);
 this.GetDataSet().Params.Add(param3);
 this.GetDataSet().Params.Add(param4);
 this.GetDataSet().OnAfterOpen = function(){
  __this.ReturnValue = true;
  __this.Result = this;
  var filename = __this.GetPath();
  var file = new com.qn.io.File(filename);
  if(__this.IsFile())
   file.Type = 3;
  else
   file.Type = 2;
  file.SetTarget(target);
  file.BigIcon = icon;
  file.WindowType = windowtype;
  Browser.SendMessage(null, 810, __this.__Action, file);//WM_FILESYSTEMCHANGE.new
  if(this.Owner.Onload)
   this.Owner.Onload(this.Owner.Result);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}
com.qn.io.File.prototype.createShare = function(sharename, permissions, desc, point, cash,sharetype){
 var __this = this;
 this.GetDataSet().OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.createShare";
 this.GetDataSet().Close();
 this.GetDataSet().Fields.Clear();
 this.GetDataSet().Params.Clear();
 var param1 = new js.db.Param("path", this.GetTarget(), "String");
 var param2 = new js.db.Param("sharename", sharename, "String");
 var param3 = new js.db.Param("permissions", permissions, "String");
 var param4 = new js.db.Param("desc", desc, "String");
 var param5 = new js.db.Param("point", point, "String");
 var param6 = new js.db.Param("cash", cash, "String");
 var param7 = new js.db.Param("sharetype", sharetype, "String");
 this.GetDataSet().Params.Add(param1);
 this.GetDataSet().Params.Add(param2);
 this.GetDataSet().Params.Add(param3);
 this.GetDataSet().Params.Add(param4);
 this.GetDataSet().Params.Add(param5);
 this.GetDataSet().Params.Add(param6);
 this.GetDataSet().Params.Add(param7);
 this.GetDataSet().OnAfterOpen = function(){
  __this.ReturnValue = true;
  if(__this.IsFile())
   __this.Type = 5;
  else
   __this.Type = 6;
  this.Owner.Result = this;
  if(this.Owner.Onload)
   this.Owner.Onload(this.Owner.Result);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}

com.qn.io.File.prototype.deleteShare = function(sharename){
 var __this = this;
 this.GetDataSet().OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.deleteShare";
 this.GetDataSet().Close();
 this.GetDataSet().Fields.Clear();
 this.GetDataSet().Params.Clear();
 var param1 = new js.db.Param("sharename", sharename, "String");
 this.GetDataSet().Params.Add(param1);
 this.GetDataSet().OnAfterOpen = function(){
  __this.ReturnValue = true;
  if(__this.IsShareFile()){
   __this.Type = 0;
  }
  else{
   __this.Type = 1;
  }
  this.Owner.Result = this;
  if(this.Owner.Onload)
   this.Owner.Onload(this.Owner.Result);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}

com.qn.io.File.prototype.cut = function(src, target){
 this.GetDataSet().OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.cut";
 this.__Action = 3;
 this.Copy(src, target);
 this.__Action = 4;
}

com.qn.io.File.prototype.copy = function(src, target){
 var __this = this;
 if(this.__Action!=3){
  this.__Action = 4;
  this.GetDataSet().OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.copy";
 }
 this.GetDataSet().Close();
 this.GetDataSet().Fields.Clear();
 this.GetDataSet().Params.Clear();
 var param1 = new js.db.Param("path", src, "String");
 var param2 = new js.db.Param("target", target, "String");
 this.GetDataSet().Params.Add(param1);
 this.GetDataSet().Params.Add(param2);
 this.__BuildPriceInfo();

 this.GetDataSet().OnAfterOpen = function(){
  __this.ReturnValue = true;
  __this.Result = this;
  if(__this.__Action==3){
            var filenames = src.split(";");
   for(var i=0; i<filenames.length-1; i++){
    Browser.SendMessage(null, 810, 2, new com.qn.io.File(filenames[i]));//WM_FILESYSTEMCHANGE.delete
   }
  }
//  Browser.SendMessage(null, 810, 0, new com.qn.io.File(target));//WM_FILESYSTEMCHANGE.new
  if(this.Owner.Onload)
   this.Owner.Onload(this.Owner.Result);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}

com.qn.io.File.prototype.setFilename = function(filename){
 this.filename = filename;
}

com.qn.io.File.prototype.getFilename = function(filename){
 if(!filename){
  if(this.filename)
   return this.filename;
  else
   filename = this.getPath();

 }
 if(!filename) return;
 var pos = filename.lastIndexOf("/");
 if(pos==-1)
  pos = filename.lastIndexOf("\\");
 if(pos!=-1)
  filename = filename.substring(pos+1);
 return filename;
}

com.qn.io.File.prototype.getParent = function(){
 if(this.parent)
  return this.parent;
 else {
  var path = this.getPath();
//  if(this.getFilename()!=null)
//   path = path.replaceLast(path, this.getFilename());
  var pos = path.lastIndexOf("/");
  if(pos!=-1)
   path = path.substring(0, pos);
  return path;
 }
}
com.qn.io.File.prototype.getPath = function(){
 if(!this.path)
  return this.parent + "/" + this.filename;
 else {
  var path = this.path;
  if(path && path!=""){
   if("/"==path.substring(path.length-1)){
    path = path.substring(0, path.length-1);
   }
  }
  return path;
 }
}
com.qn.io.File.prototype.setPath = function(path){
 this.path = path;
}

com.qn.io.File.prototype.getDisplayName = function(){
 var filename = this.getFilename();
 var ext = com.qn.io.File.prototype.getExtName(filename);
 if("sht"==ext || "sfd"==ext || "share"==ext){
  return com.qn.io.File.prototype.getFrontName(filename)
 }
 else return filename; 
}

com.qn.io.File.prototype.getDesc = function(){
 var desc = this.desc;
 if(!desc)
  desc = this.getDisplayname();
 return desc;
}
com.qn.io.File.prototype.readText = function(filename){
 var __this = this;
 if(filename)
  this.SetPath(filename);
 if(!this.HttpConnection)
  this.HttpConnection = new js.net.HttpConnection();
 this.HttpConnection.Async = this.Async;
 this.HttpConnection.Owner = this;
 this.HttpConnection.Onload = function(http){
  __this.ReturnValue = true;
  this.Owner.Result = http.responseText;
  if(this.Owner.Onload)
   this.Owner.Onload(this.Owner.Result);
 }
 this.HttpConnection.Onerror = function(http){
  __this.ReturnValue = false;
  this.Owner.Result = null;
  var error = http.responseText;
  if(this.Owner.Onerror)
   this.Owner.Onerror(error);
  else Browser.MessageBox(error);
 }
 this.HttpConnection.Open(com.qn.io.File.prototype.READTEXT_URL);
 this.HttpConnection.Instance.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
 this.HttpConnection.Send(com.qn.io.File.prototype.__BuildPriceUrl("filename="+this.GetPath()));
 return this.ReturnValue;
}

com.qn.io.File.prototype.writeText = function(text, filename){
 var __this = this;
 if(filename){
  this.SetPath(filename);}
 if(!this.HttpConnection)
  this.HttpConnection = new js.net.HttpConnection();
 this.HttpConnection.Async = this.Async;
 this.HttpConnection.Owner = this;
 this.HttpConnection.Onload = function(http){
  __this.ReturnValue = true;
  __this.Result = http.responseText;
  if(!http.responseText || http.responseText==""){
   if(__this.Onload)
    __this.Onload(__this.Result);
  }
  else {
   __this.ReturnValue = false;
   if(__this.Onerror)
    __this.Onerror(__this.Result);
   else Browser.MessageBox(__this.Result);
  }
 }
 this.HttpConnection.Onerror = function(http){
  __this.ReturnValue = false;
  this.Owner.Result = null;
  var error = http.responseText;
  if(this.Owner.Onerror)
   this.Owner.Onerror(error);
  else Browser.MessageBox(__this.Result);
 }
 this.HttpConnection.Open(com.qn.io.File.prototype.WRITE_URL);
// this.HttpConnection.Instance.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
// this.HttpConnection.Send("filename="+this.Path+"&context="+text);
 this.HttpConnection.Send(this.GetPath()+"&context="+text);
 return this.ReturnValue;
}
com.qn.io.File.prototype.OPEN_URL = "/servlet/DataSet";
com.qn.io.File.prototype.READ_URL = "/servlet/ReadFileStream";
com.qn.io.File.prototype.READTEXT_URL = "/servlet/ReadFileText";
com.qn.io.File.prototype.WRITE_URL = "/servlet/WriteFileText";

com.qn.io.File.prototype.read = function(){
 var url = this.baseUrl + "read&userId=" + this.userId + "&fileId=" + this.fileId;
 return url;
}
com.qn.io.File.prototype.write = function(value){
 return true;
}
com.qn.io.File.prototype.size = 0;

com.qn.io.File.prototype.getSize = function(){
 return this.size;
}
com.qn.io.File.prototype.close = function(){
 return true;
}
com.qn.io.File.prototype.getPathSeparator = function(){
 return "/";
}
com.qn.io.File.prototype.createNewFile = function(){
 var __this = this;
 this.GetDataSet().OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.createNewFile";
 this.__Action = 0;//new
 this.BuildPathParams();
 this.GetDataSet().Open();
 return this.ReturnValue;
}

com.qn.io.File.prototype.exists = function(){
 var __this = this;
 var dataset = this.GetDataSet();
 dataset.OpenURL  = com.qn.io.File.prototype.OPEN_URL+ "?datasource=" +"tomos.filesystem.File.exists";
 dataset.Close();
 dataset.Fields.Clear();
 dataset.Params.Clear();
 var param1 = new js.db.Param("path", this.GetPath(), "String");
 dataset.Params.Add(param1);
 dataset.OnAfterOpen = function(msg){
  if(msg=="true")
   __this.ReturnValue = true;
  else
   __this.ReturnValue = false;
  if(__this.Onload) __this.Onload(__this.ReturnValue);
 }
 this.GetDataSet().Open();
 return this.ReturnValue;
}

com.qn.io.File.prototype.type = 0;
com.qn.io.File.prototype.getType = function(){
 return this.Type;
}
com.qn.io.File.prototype.getTypeName = function(){
 var name = "unknown";
 if(this.Type==0) name = props("File") 
 else if(this.Type==1) name = props("Folder"); 
 else if(this.Type==2) name = props("DirShortcut"); 
 else if(this.Type==3) name = props("FileShortcut"); 
 else if(this.Type==4) name = props("Share"); 
 else if(this.Type==5) name = props("File"); 
 else if(this.Type==6) name = props("Folder"); 
 else if(this.Type==19) name = props("Group Share"); 
 else if(this.Type==20) name = props("My Groups"); 
 else if(this.Type==21) name = props("Group"); 
 else if(this.Type==22) name = props("Member"); 
 else if(this.Type==22) name = props("Manager"); 
 else if(this.Type==24) name = props("Creator"); 
 else if(this.Type==11) name = props("My Friends"); 
 else if(this.Type==12) name = props("Category"); 
 else if(this.Type==13) name = props("Friend"); 

 return name;
}


com.qn.io.File.prototype.isDirectory = function(){
 return this.type==1;
}

com.qn.io.File.prototype.isFile = function(){
 return this.type==0;
}

com.qn.io.File.prototype.isShortUrl = function(){
 return this.type==80;
}

com.qn.io.File.prototype.isShareFile = function(){
 return this.type==5;
}

com.qn.io.File.prototype.isShareDirectory = function(){
 return this.type==6;
}

com.qn.io.File.prototype.isFileShortcut = function(){
 return this.type==3;
}

com.qn.io.File.prototype.isDirShortcut = function(){
 var idx = -1;
 var target = this.getTarget();
 if(target)
  idx = target.indexOf("http:");
 return this.type==2 && idx==-1;
}

com.qn.io.File.prototype.isShare= function(){
 return this.type==4;
}

com.qn.io.File.prototype.isHidden = function(){
 return true;
}
com.qn.io.File.prototype.lastModified = 0;

com.qn.io.File.prototype.getLastModified = function(){
 return this.lastModified;
}


com.qn.io.File.prototype.sort = function(files, attrname, ascend, datatype){
 if(files){
  var sortfunc;
  if(datatype=="NUMBER")
   sortfunc = new Function("m,n", "if(!isNaN(n['"+attrname+"'])&&!isNaN(n['"+attrname+"']))return n['"+attrname+"']-m['"+attrname+"'];" + "if(n['"+attrname+"']<m['"+attrname+"'])return-1;else if(n['"+attrname+"']>=m['"+attrname+"'])return 1;return 0;");
  else
   sortfunc = new Function("m,n", "if(n['"+attrname+"']<m['"+attrname+"'])return-1;else if(n['"+attrname+"']>=m['"+attrname+"'])return 1;return 0;");
  files.sort(sortfunc);
  if(!ascend)
   files.reverse();
 }
}

com.qn.io.File.prototype.mkdirs = function(){
 return true;
}
com.qn.io.File.prototype.setLastModified = function(langtime){
 this.lastModified = langtime;
 return true;
}
com.qn.io.File.prototype.setReadOnly = function(readonly){
 return true;
}
com.qn.io.File.prototype.getCondensationName = function (type){ //get Condensation name
 var filename =  this.GetDisplayName();
 if(type==0||type==5){
  filename = filename.substring(0,filename.lastIndexOf("."))+".rar";
  if(filename.length >14)
   filename = filename.substring(0,10)+"...";
 }else{
  filename = filename+".rar";
 }
 return filename;
}

com.qn.io.File.prototype.getExtName = function(filename){
 if(!filename) return;
 var ext = null;
 var pos = filename.lastIndexOf(".");
 if(pos!=-1)
  ext = filename.substring(pos+1);
 return ext;
}
com.qn.io.File.prototype.getFrontName = function(filename){
 var fnt = null;
 var pos = filename.lastIndexOf(".");
 if(pos!=-1)
  fnt = filename.substring(0, pos);
 else
  fnt = filename;
 return fnt;
}

com.qn.io.File.prototype.getBigIcon = function(){
 if(com.qn.io.File.prototype.isImageFile(this.getFilename()))
  return this.read();
 else
  return this.getIcon(this.bigIcon, com.qn.io.File.SYSBIGICON);
}

com.qn.io.File.prototype.getSmallIcon = function(){
 return this.getIcon(this.smallIcon, com.qn.io.File.SYSSMALLICON);
}

com.qn.io.File.prototype.getIcon = function(defIcon, sysIconList){
 var imagesrc;
 if(defIcon)
  imagesrc = defIcon;
 else{
  if(this.isFile() || this.isFileShortcut() || this.isShareFile()){
/*   var app = Browser.Registry.GetFileProgram(this.GetTarget());
   if(app)
    imagesrc = app.BigIcon;
   else*/
    imagesrc = sysIconList.file;
  }
  else if(this.isDirShortcut()||this.isDirectory() || this.isShareDirectory()){
   imagesrc = sysIconList.folder;
  }
  else if(this.isShortUrl()){
   imagesrc = sysIconList.link;
  }
  else if(this.isShare()){
   imagesrc = sysIconList.share;
  }

 }
 if(imagesrc)
  if(imagesrc.indexOf("http:")==-1 && imagesrc.substring(0, 1)!="/")
   imagesrc = imagePath + imagesrc;
 return imagesrc;
}

com.qn.io.File.prototype.getTypeIcon = function(){
 if(this.bigIcon || this.smallIcon) return null;
 if(this.isShareFile() || this.isShareDirectory())
  return imagePath + com.qn.io.File.SYSTYPEICON.share;
 if(this.isFileShortcut() || this.isDirShortcut())
  return imagePath + com.qn.io.File.SYSTYPEICON.shortcut;
}

com.qn.io.File.SYSSMALLICON = {"file": "file/file48.png", "folder": "file/folder.png", "share": "file/share48.png", "link": "file/link.png"};
com.qn.io.File.SYSBIGICON = {"file": "file/file48.png", "folder": "file/folder.png", "share": "file/share48.png"};
com.qn.io.File.SYSTYPEICON = {"share": "file/share.png", "shortcut": "file/shortcut.png"};

com.qn.io.File.prototype.isImageFile = function(filename){
   var exname = com.qn.io.File.prototype.getExtName(filename);
   if(exname)
   exname = exname.toLowerCase();
   return (exname=="jpg" || exname=="png" || exname=="jpeg" || exname=="bmp" || exname=="gif");
}
$package("com.qn.dlg");

com.qn.dlg.UrlDlg = function (){
}

com.qn.dlg.UrlDlg.prototype = new js.ui.BaseWindow();

com.qn.dlg.UrlDlg.prototype.onload = null;

com.qn.dlg.UrlDlg.prototype.__superExtendUI = js.ui.BaseWindow.prototype.extendUI;

com.qn.dlg.UrlDlg.prototype.extendUI = function (){
 this.__superExtendUI();
 var __this = this;
 var extui = this.getDomNode("com.qn.dlg.UrlDlg");
 this.container.appendChild(extui);
 this.iframe = extui.getElementsByTagName("iframe")[0];
 var processload = function(){
  __this.iframe.contentWindow.win = __this;
  if(__this.iframe.contentWindow.doOnload)
   __this.iframe.contentWindow.doOnload(__this);
  if(__this.onload)
   __this.onload(__this.iframe.contentWindow);
 }
 if (this.iframe.addEventListener)
  this.iframe.addEventListener("load", processload, false);
 else if (this.iframe.attachEvent){
  this.iframe.attachEvent("onload", processload);
 }
 else
  this.iframe.onload = processload;
}

com.qn.dlg.UrlDlg.prototype.openUrl = function (url){
 this.iframe.src = url;
}

$package("com.qn.dlg");

com.qn.dlg.NewFolderDlg = function (){
}

com.qn.dlg.NewFolderDlg.prototype = new js.ui.BaseWindow();

com.qn.dlg.NewFolderDlg.prototype.basePath = null;

com.qn.dlg.NewFolderDlg.prototype.extendUI = function (){
 var __this = this;
 this.setTitle(props("New Folder"));
 var extui = this.getDomNode("com.qn.dlg.NewFolderDlg");
 this.container.appendChild(extui);
 this.okButton = extui.getElementsByTagName("input")[1];
 this.cancelButton = extui.getElementsByTagName("input")[2];
 this.nameText = extui.getElementsByTagName("input")[0];
 this.cancelButton.onclick = this.closeButton.ui.onclick;
 this.okButton.onclick = function(){
  var newfn = __this.nameText.value;
  if(newfn==""){
   browser.messageBox("Name can't empty.");
   __this.nameText.focus();
   return;
  }
  if(!com.qn.io.File.prototype.validateFilename(newfn)){
   browser.messageBox("Filename invalidate.");
   __this.nameText.focus();
   return;
  }
  var file = new com.qn.io.File();
  file.setPath(__this.basePath + "/" + newfn);
  file.mkdir();
  __this.close();
 }
}



$package("com.qn.dlg");

com.qn.dlg.UploadDlg = function (){
}

com.qn.dlg.UploadDlg.prototype = new js.ui.BaseWindow();

com.qn.dlg.UploadDlg.prototype.file = null;

com.qn.dlg.UploadDlg.prototype.extendUI = function (){
 var __this = this;
 this.setTitle(props("File Upload"));
 var extui = this.getDomNode("com.qn.dlg.UrlDlg");
 this.container.appendChild(extui);
 this.iframe = extui.getElementsByTagName("iframe")[0];
 this.ui.style.width = "700px";
 this.ui.style.height = "420px";
 this.setResizeable(false);
 this.setMoveable(false);
}

com.qn.dlg.UploadDlg.prototype.open = function (){
 this.iframe.src = "/view?module=upload&action=uploadDlg";
}

com.qn.dlg.UploadDlg.prototype.openUrl = function (url){
 this.iframe.src = url;
}

$package("com.qn.dlg");

com.qn.dlg.EditFileDlg = function (){
}

com.qn.dlg.EditFileDlg.prototype = new js.ui.BaseWindow();

com.qn.dlg.EditFileDlg.prototype.file = null;

com.qn.dlg.EditFileDlg.prototype.extendUI = function (){
 var __this = this;
 this.setTitle(props("File Edit"));
 var extui = this.getDomNode("com.qn.dlg.EditFileDlg");
 this.container.appendChild(extui);
 this.okButton = extui.getElementsByTagName("input")[1];
 this.cancelButton = extui.getElementsByTagName("input")[2];
 this.nameText = extui.getElementsByTagName("input")[0];
 this.descText = extui.getElementsByTagName("textarea")[0];
 this.cancelButton.onclick = this.closeButton.ui.onclick;
 this.okButton.onclick = function(){
  var newfn = __this.nameText.value;
  if(newfn==""){
   browser.messageBox("Name can't empty.");
   __this.nameText.focus();
   return;
  }
  if(!com.qn.io.File.prototype.validateFilename(newfn)){
   browser.messageBox("Filename invalidate.");
   __this.nameText.focus();
   return;
  }
  var desc = __this.descText.value;
  if(desc.length>=255){
   browser.messageBox("File description can't exceed 255 characters.");
   __this.descText.focus();
   return;
  }
  var changed = false;
  if(__this.nameText.value!=__this.file.getFilename()){
   var newpath = __this.file.getParent() + "/" + __this.nameText.value;
   __this.file.onload = function(){
//    browser.messageBox("File name saved.");
    __this.close();
   }
   __this.file.renameTo(__this.file.getParent(), __this.nameText.value);
   changed = true;
  }
  if(desc!=__this.file.getDescDisp()) {
   __this.file.desc = desc;
   __this.file.onload = function(){
//    browser.messageBox("File description saved.");
    __this.close();
   }
   __this.file.editSave();
   changed = true;
  }
  if(!changed) __this.close();
 }
 this.ui.style.width = "500px";
 this.ui.style.height = "300px";
}

com.qn.dlg.EditFileDlg.prototype.getData = function (fileId){
 var __this = this;
 this.file = new com.qn.io.File();
 this.file.fileId = fileId;
 this.file.onload = function(){
  __this.nameText.value = this.getFilename();
  var desc = this.getDescDisp();
  __this.descText.value = desc;
  __this.nameText.select();
  __this.okButton.disabled = false;
 }
 this.okButton.disabled = true;
 this.file.getAttributes();
}


$package("com.qn.dlg");

com.qn.dlg.DirDlg = function (){
}

com.qn.dlg.DirDlg.prototype = new js.ui.BaseWindow();

com.qn.dlg.DirDlg.prototype.file = null;

com.qn.dlg.DirDlg.prototype.extendUI = function (){
 var __this = this;
 this.setTitle(props("Select Directory"));
 var extui = this.getDomNode("com.qn.dlg.DirDlg");
 this.container.appendChild(extui);
 this.okButton = extui.getElementsByTagName("input")[0];
 this.cancelButton = extui.getElementsByTagName("input")[1];
 this.leftDiv = extui.getElementsByTagName("div")[1];
 this.okButton.onclick = function(){
  __this.result = 1;
  __this.close();
 }
 this.cancelButton.onclick = function(){
  __this.result = 0;
  __this.close();
 }
 this.ui.style.width = "500px";
 this.ui.style.height = "300px";
 this.buildTree();
}

com.qn.dlg.DirDlg.prototype.list = function (path){
 if(path) {
  var rootNode = this.tree.getRoot();
  var file = rootNode.userObject;
  file.setPath(path);
 }
 this.tree.setSelected(this.tree.getRoot());
}

com.qn.dlg.DirDlg.prototype.buildTree = function (){
 var __this = this;
 var tree = this.tree = new com.qn.ui.FileTreeView();
 tree.getUI().style.height = "170px";
 tree.getUI().style.width = "100%";

 this.leftDiv.appendChild(tree.getUI());

 var file = new com.qn.io.File();
 file.type = 1;
 file.setPath("Share");
 var rootnode = new js.ui.tree.TreeNode(tree);
 rootnode.setUserObject(file);
 tree.setRoot(rootnode);
 rootnode.getRenderer().text.innerHTML = props("Share Folders");

 tree.onload = function(files, parentNode){
  __this.currentPath = parentNode.userObject.getPath();
 }

}




