
function XmlRequest(method,url,parameters,onComplete,onError){var xmlHttp;if((xmlHttp=createXMLHttp())!=null){xmlHttp.onreadystatechange=function(){onReadyStateChange(xmlHttp,onComplete,onError);}
xmlHttp.open(method,url,true);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");xmlHttp.send(parameters);}else{alert("A required object, XMLHttpRequest is not found!");}}
function createXMLHttp(){var xmlHttp;if(window.XMLHttpRequest){try{xmlHttp=new XMLHttpRequest();}catch(e){xmlHttp=null;}}else if(window.ActiveXObject){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xmlHttp=null;}}}
return xmlHttp;}
function onReadyStateChange(xmlHttp,onComplete,onError){if(xmlHttp.readyState==4){if(xmlHttp.status==200){if(onComplete)onComplete(xmlHttp);}else{if(onError)onError(xmlHttp);}}}
function ModalDialog(){}
ModalDialog.current=null;ModalDialog.simulation=(window.showModalDialog)?false:true;ModalDialog.show=function(url,width,height){var features;if(ModalDialog.simulation){if(ModalDialog.current){ModalDialog.current.focus();return;}
var left,top;left=(screen.availWidth-width)/2;top=(screen.availHeight-height)/2;features="toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no,modal=yes";features+=",outerHeight="+height;features+=",outerWidth="+width;features+=",left="+left;features+=",top="+top;ModalDialog.current=window.open(url,"modalDialog",features);ModalDialog.onLoad();}else{features="center:yes;help:no;resizable:no;status:yes;scroll:no";features+=";dialogWidth:"+width+"px";features+=";dialogHeight:"+height+"px";window.showModalDialog(url,window,features);}}
ModalDialog.onLoad=function(){ModalDialog.windowOnFocus=window.onfocus;window.onfocus=ModalDialog.holdFocus;}
ModalDialog.onUnload=function(){if(!ModalDialog.simulation)return;var parentWindow=window.opener;if(parentWindow){parentWindow.onfocus=ModalDialog.windowOnFocus;parentWindow.ModalDialog.current=null;}}
ModalDialog.holdFocus=function(){ModalDialog.current.focus();return false;}
ModalDialog.getParent=function(){var parent;if(ModalDialog.simulation){parent=top.opener;}else{parent=top.dialogArguments;}
return parent;}
function formatSize(size){var units=["B","KB","MB","GB","TB"];var unitDecimals=[0,0,2,2,2];var unitsCount=units.length-1;if(size=="")return"";size=(+size);var i=0;while(size>=1024&&i<unitsCount){size/=1024;i++;}
return size.toFixed(unitDecimals[i])+" "+units[i];}
function formatName(name){if(name.length>47)
return name.substr(0,47)+"...";else
return name;}
function trim(s){while(s.substring(0,1)==' ')
s=s.substring(1,s.length);while(s.substring(s.length-1,s.length)==' ')
s=s.substring(0,s.length-1);return s;}
function createUniqueID(){return(new Date()).getTime()+""+Math.floor((Math.random()*8999)+1000);}
function getClassName(obj)
{if(obj&&obj.constructor&&obj.constructor.toString)
{var arr=obj.constructor.toString().match(/function\s*(\w+)/);return arr&&arr.length==2?arr[1]:undefined;}
else
{return undefined;}}
function onSeparatorDragStart(e){separatorDrag=true;document.onmouseup=function(e){onSeparatorDragStop(e);};document.onmousemove=function(e){onSeparatorDrag(e);};}
function onSeparatorDragStop(e){separatorDrag=false;document.onmouseup=null;document.onmousemove=null;}
function onSeparatorDrag(e){if(!separatorDrag)return;var posx=0;var posy=0;if(!e)var e=window.event;var pageWidth=window.innerWidth?window.innerWidth:document.body.clientWidth;posx=(e.pageX)?e.pageX:e.clientX+document.body.scrollLeft;divLeft.style.width=posx+"px";divSeparator.style.left=posx+"px";divRight.style.width=(pageWidth-posx-6)+"px";divRight.style.left=(posx+6)+"px";}
function checkResultXml(xmlDoc){var resultNode=xmlDoc.getElementsByTagName("Result")[0];if(!resultNode)return false;var error,message,nextCommand;error=(+resultNode.getAttribute("error"));message=resultNode.getAttribute("message");nextCommand=resultNode.getAttribute("nextCommand");if(error==0){if(message!="")alert(message);if(nextCommand!=""){var parameters=nextCommand.split("?");downloadFile(currentFolder.rootFolderID,currentFolder.relativePath,parameters[1],true,true);return true;}
return false;}else{if(message!="")alert("An error occured:\n\n"+message);return true;}}
function Language(){this.strings=new Object();}
Language.prototype.addString=function(key,value){this.strings[key]=value;}
Language.prototype.getString=function(key,r0,r1,r2){var value=this.strings[key];if(r0)value=value.replace(/\{0\}/g,r0);if(r1)value=value.replace(/\{1\}/g,r1);if(r2)value=value.replace(/\{2\}/g,r2);return value;}
function createMenu(menuNode,onMenuItemClick){var menu=new Menu();menu.onMenuItemClick=onMenuItemClick;for(var i=0;i<menuNode.childNodes.length;i++){var node=menuNode.childNodes[i];if(node.nodeType==1){var command=node.getAttribute("command");if(command=="[Separator]")
menu.addSeparator();else{var menuItem=menu.addMenuItem(command,node.getAttribute("text"),node.getAttribute("description"),node.getAttribute("icon"),node.getAttribute("value"));if(node.getAttribute("isDefault")=="yes")menu.setDefault(menuItem);for(var j=0;j<node.childNodes.length;j++){var childNode=node.childNodes[j];if(childNode.nodeType==1){var submenu=createMenu(childNode,onMenuItemClick);menuItem.setSubmenu(submenu);}}}}}
menu.render(document.body);return menu;}
function enableElement(id,enabled,value,keepValue){var element=document.getElementById(id);element.disabled=!enabled;if(keepValue)
return element;if(element.type=="text"||element.type=="password")
element.value=(value!=null)?value:"";else if(element.type=="checkbox"||element.type=="radio")
element.checked=(value!=null)?value:false;else if(element.type=="select-one")
element.selectedIndex=(value!=null)?value:-1;return element;}
function showClientMessage(confirmMessage){var clientMessage=document.getElementById("ClientMessage");if(confirmMessage)
return confirm(clientMessage.value);else
alert(clientMessage.value);}
function strf(str){var outp="";for(i=0;i<=str.length;i++){outp=str.charAt(i)+outp}
return outp;}
