if(!window.qxp)qxp={};
if(!qxp.Settings)qxp.Settings={};
if(!qxp.Settings._customSettings)qxp.Settings._customSettings={};
if(!qxp.Settings._customSettings["qxp.core.Init"])qxp.Settings._customSettings["qxp.core.Init"]={};
qxp.Settings._customSettings["qxp.core.Init"]["component"]="qxp.component.init.BasicInitComponent";



/* ID: qxp.Settings */
if(!window.qxp){qxp={};
}
if(window.qxpNamespaceCompat){qx=qxp;
}
if(!qxp.Settings){qxp.Settings={};
}
if(!qxp.Settings._customSettings){qxp.Settings._customSettings={};
}qxp.Settings._defaultSettings={};
qxp._LOADSTART=(new Date).valueOf();
qxp.Settings.substitute=function(vTemplate){if(typeof vTemplate!=="string"){return vTemplate;
}return vTemplate.replace(/\%\{(.+)\}/g,function(vMatch,vKey){return eval(vKey);
});
};
qxp.Settings.getValue=function(vKey){return qxp.Settings.getValueOfClass(qxp.Class.classname,vKey);
};
qxp.Settings.getValueOfClass=function(vClassName,vKey){var vCustomObject=qxp.Settings._customSettings[vClassName];
if(vCustomObject&&vCustomObject[vKey]!=null){return vCustomObject[vKey];
}var vDefaultObject=qxp.Settings._defaultSettings[vClassName];
if(vDefaultObject&&vDefaultObject[vKey]!=null){return vDefaultObject[vKey];
}return null;
};
qxp.Settings.setDefault=function(vKey,vValue){return qxp.Settings.setDefaultOfClass(qxp.Class.classname,vKey,vValue);
};
qxp.Settings.setDefaultOfClass=function(vClassName,vKey,vValue){var vDefaultObject=qxp.Settings._defaultSettings[vClassName];
if(!vDefaultObject){vDefaultObject=qxp.Settings._defaultSettings[vClassName]={};
}vDefaultObject[vKey]=vValue;
};
qxp.Settings.setCustom=function(vKey,vValue){return qxp.Settings.setCustomOfClass(qxp.Class.classname,vKey,vValue);
};
qxp.Settings.setCustomOfClass=function(vClassName,vKey,vValue){var vCustomObject=qxp.Settings._customSettings[vClassName];
if(!vCustomObject){vCustomObject=qxp.Settings._customSettings[vClassName]={};
}vCustomObject[vKey]=qxp.Settings.substitute(vValue);
};
qxp.Settings.init=function(){for(var vClass in qxp.Settings._customSettings){var vSettings=qxp.Settings._customSettings[vClass];
for(var vKey in vSettings){qxp.Settings.setCustomOfClass(vClass,vKey,vSettings[vKey]);
}}};
qxp.Settings.init();




/* ID: qxp.OO */
qxp.OO={};
qxp.OO.classes={};
qxp.OO.setter={};
qxp.OO.getter={};
qxp.OO.resetter={};
qxp.OO.values={};
qxp.OO.propertyNumber=0;
qxp.OO.C_SET="set";
qxp.OO.C_GET="get";
qxp.OO.C_APPLY="apply";
qxp.OO.C_RESET="reset";
qxp.OO.C_FORCE="force";
qxp.OO.C_TOGGLE="toggle";
qxp.OO.C_CHANGE="change";
qxp.OO.C_STORE="store";
qxp.OO.C_RETRIEVE="retrieve";
qxp.OO.C_PRIVATECHANGE="_change";
qxp.OO.C_INVALIDATE="_invalidate";
qxp.OO.C_INVALIDATED="_invalidated";
qxp.OO.C_RECOMPUTE="_recompute";
qxp.OO.C_CACHED="_cached";
qxp.OO.C_COMPUTE="_compute";
qxp.OO.C_COMPUTED="_computed";
qxp.OO.C_UNITDETECTION="_unitDetection";
qxp.OO.C_GLOBALPROPERTYREF="PROPERTY_";
qxp.OO.C_UNIT_VALUE="Value";
qxp.OO.C_UNIT_PARSED="Parsed";
qxp.OO.C_UNIT_TYPE="Type";
qxp.OO.C_UNIT_TYPE_NULL="TypeNull";
qxp.OO.C_UNIT_TYPE_PIXEL="TypePixel";
qxp.OO.C_UNIT_TYPE_PERCENT="TypePercent";
qxp.OO.C_UNIT_TYPE_AUTO="TypeAuto";
qxp.OO.C_UNIT_TYPE_FLEX="TypeFlex";
qxp.OO.C_GETDEFAULT="getDefault";
qxp.OO.C_SETDEFAULT="setDefault";
qxp.OO.C_RETRIEVEDEFAULT="retrieveDefault";
qxp.OO.C_STOREDEFAULT="storeDefault";
qxp.OO.C_VALUE="_value";
qxp.OO.C_NULL="_null";
qxp.OO.C_EVAL="_eval";
qxp.OO.C_CHECK="_check";
qxp.OO.C_MODIFY="_modify";
qxp.OO.C_NAMESPACE_SEP=".";
qxp.OO.C_UNDEFINED="undefined";
qxp.OO.defineClass=function(vClassName,vSuper,vConstructor){var vSplitName=vClassName.split(qxp.OO.C_NAMESPACE_SEP);
var vNameLength=vSplitName.length-1;
var vTempObject=window;
for(var i=0;i<vNameLength;i++){if(typeof vTempObject[vSplitName[i]]===qxp.OO.C_UNDEFINED){vTempObject[vSplitName[i]]={};
}vTempObject=vTempObject[vSplitName[i]];
}if(typeof vSuper===qxp.OO.C_UNDEFINED){if(typeof vConstructor!==qxp.OO.C_UNDEFINED){throw new Error("SuperClass is undefined, but constructor was given for class: "+vClassName);
}qxp.Class=vTempObject[vSplitName[i]]={};
qxp.Proto=null;
qxp.Super=null;
}else if(typeof vConstructor===qxp.OO.C_UNDEFINED){qxp.Class=vTempObject[vSplitName[i]]=vSuper;
qxp.Proto=null;
qxp.Super=vSuper;
}else{qxp.Class=vTempObject[vSplitName[i]]=vConstructor;
var vHelperConstructor=function(){};
vHelperConstructor.prototype=vSuper.prototype;
qxp.Proto=vConstructor.prototype=new vHelperConstructor;
qxp.Super=vConstructor.superclass=vSuper;
qxp.Proto.classname=vConstructor.classname=vClassName;
qxp.Proto.constructor=vConstructor;
}qxp.OO.classes[vClassName]=qxp.Class;
};
qxp.OO.addFastProperty=function(vConfig){var vName=vConfig.name;
var vUpName=qxp.lang.String.toFirstUp(vName);
var vStorageField=qxp.OO.C_VALUE+vUpName;
var vGetterName=qxp.OO.C_GET+vUpName;
var vSetterName=qxp.OO.C_SET+vUpName;
var vComputerName=qxp.OO.C_COMPUTE+vUpName;
qxp.Proto[vStorageField]=typeof vConfig.defaultValue!==qxp.constant.Type.UNDEFINED?vConfig.defaultValue:null;
if(vConfig.noCompute){qxp.Proto[vGetterName]=function(){return this[vStorageField];
};
}else{qxp.Proto[vGetterName]=function(){return this[vStorageField]==null?this[vStorageField]=this[vComputerName]():this[vStorageField];
};
}
if(vConfig.setOnlyOnce){qxp.Proto[vSetterName]=function(vValue){this[vStorageField]=vValue;
this[vSetterName]=null;
return vValue;
};
}else{qxp.Proto[vSetterName]=function(vValue){return this[vStorageField]=vValue;
};
}
if(!vConfig.noCompute){qxp.Proto[vComputerName]=function(){return null;
};
}};
qxp.OO.addCachedProperty=function(p){var vName=p.name;
var vUpName=qxp.lang.String.toFirstUp(vName);
var vStorageField=qxp.OO.C_CACHED+vUpName;
var vComputerName=qxp.OO.C_COMPUTE+vUpName;
var vChangeName=qxp.OO.C_PRIVATECHANGE+vUpName;
if(typeof p.defaultValue!==qxp.constant.Type.UNDEFINED){qxp.Proto[vStorageField]=p.defaultValue;
}qxp.Proto[qxp.OO.C_GET+vUpName]=function(){if(this[vStorageField]==null){this[vStorageField]=this[vComputerName]();
}return this[vStorageField];
};
qxp.Proto[qxp.OO.C_INVALIDATE+vUpName]=function(){if(this[vStorageField]!=null){this[vStorageField]=null;
if(p.addToQueueRuntime){this.addToQueueRuntime(p.name);
}}};
qxp.Proto[qxp.OO.C_RECOMPUTE+vUpName]=function(){var vOld=this[vStorageField];
var vNew=this[vComputerName]();
if(vNew!=vOld){this[vStorageField]=vNew;
this[vChangeName](vNew,vOld);
return true;
}return false;
};
qxp.Proto[vChangeName]=function(vNew,vOld){};
qxp.Proto[vComputerName]=function(){return null;
};
};
qxp.OO.addPropertyGroup=function(p){if(typeof p!==qxp.constant.Type.OBJECT){throw new Error("Param should be an object!");
}
if(qxp.util.Validation.isInvalid(p.name)){throw new Error("Malformed input parameters: name needed!");
}
if(qxp.util.Validation.isInvalid(p.members)){throw new Error("Malformed input parameters: members needed!");
}p.method=qxp.lang.String.toFirstUp(p.name);
p.getter=[];
p.setter=[];
for(var i=0,l=p.members.length;i<l;i++){p.setter.push(qxp.OO.C_SET+qxp.lang.String.toFirstUp(p.members[i]));
}
for(var i=0,l=p.members.length;i<l;i++){p.getter.push(qxp.OO.C_GET+qxp.lang.String.toFirstUp(p.members[i]));
}qxp.Proto[qxp.OO.C_GET+p.method]=function(){var a=[];
var g=p.getter;
for(var i=0,l=g.length;i<l;i++){a.push(this[g[i]]());
}return a;
};
switch(p.mode){case "shorthand":qxp.Proto[qxp.OO.C_SET+p.method]=function(){if(arguments.length>4||arguments.length==0){throw new Error("Invalid number of arguments for property "+p.name+": "+arguments);
}
try{var ret=qxp.lang.Array.fromShortHand(arguments);
}catch(ex){throw new Error("Invalid shorthand values for property "+p.name+": "+arguments+": "+ex);
}var s=p.setter;
var l=s.length;
for(var i=0;i<l;i++){this[s[i]](ret[i]);
}};
break;
default:qxp.Proto[qxp.OO.C_SET+p.method]=function(){var s=p.setter;
var l=s.length;
if(arguments.length!=l){throw new Error("Invalid number of arguments (needs: "+l+", is: "+arguments.length+") for property "+p.name+": "+qxp.lang.Array.fromArguments(arguments).toString());
}
for(var i=0;i<l;i++){this[s[i]](arguments[i]);
}};
}};
qxp.OO.removeProperty=function(p){if(typeof qxp.Proto._properties!==qxp.constant.Type.STRING){throw new Error("Has no properties!");
}
if(typeof p!==qxp.constant.Type.OBJECT){throw new Error("Param should be an object!");
}
if(qxp.util.Validation.isInvalid(p.name)){throw new Error("Malformed input parameters: name needed!");
}var pp=qxp.Proto;
p.method=qxp.lang.String.toFirstUp(p.name);
p.implMethod=p.impl?qxp.lang.String.toFirstUp(p.impl):p.method;
var valueKey=qxp.OO.C_VALUE+p.method;
pp._properties=qxp.lang.String.remove(pp._properties,p.name);
pp[valueKey]=null;
pp[qxp.OO.C_GET+p.method]=null;
pp[qxp.OO.C_SET+p.method]=null;
pp[qxp.OO.C_RESET+p.method]=null;
pp[qxp.OO.C_APPLY+p.method]=null;
pp[qxp.OO.C_FORCE+p.method]=null;
pp[qxp.OO.C_GETDEFAULT+p.method]=null;
pp[qxp.OO.C_SETDEFAULT+p.method]=null;
};
qxp.OO._createProperty=function(p){if(typeof p!==qxp.constant.Type.OBJECT){throw new Error("AddProperty: Param should be an object!");
}
if(qxp.util.Validation.isInvalid(p.name)){throw new Error("AddProperty: Malformed input parameters: name needed!");
}var pp=qxp.Proto;
p.method=qxp.lang.String.toFirstUp(p.name);
p.implMethod=p.impl?qxp.lang.String.toFirstUp(p.impl):p.method;
if(qxp.util.Validation.isInvalid(p.defaultValue)){p.defaultValue=null;
}
if(qxp.util.Validation.isInvalidBoolean(p.allowNull)){p.allowNull=true;
}
if(qxp.util.Validation.isInvalidBoolean(p.allowMultipleArguments)){p.allowMultipleArguments=false;
}
if(typeof p.type===qxp.constant.Type.STRING){p.hasType=true;
}else if(typeof p.type!==qxp.constant.Type.UNDEFINED){throw new Error("AddProperty: Invalid type definition for property "+p.name+": "+p.type);
}else{p.hasType=false;
}
if(typeof p.instance===qxp.constant.Type.STRING){p.hasInstance=true;
}else if(typeof p.instance!==qxp.constant.Type.UNDEFINED){throw new Error("AddProperty: Invalid instance definition for property "+p.name+": "+p.instance);
}else{p.hasInstance=false;
}
if(typeof p.classname===qxp.constant.Type.STRING){p.hasClassName=true;
}else if(typeof p.classname!==qxp.constant.Type.UNDEFINED){throw new Error("AddProperty: Invalid classname definition for property "+p.name+": "+p.classname);
}else{p.hasClassName=false;
}p.hasConvert=qxp.util.Validation.isValidFunction(p.convert);
p.hasPossibleValues=qxp.util.Validation.isValidArray(p.possibleValues);
p.hasUnitDetection=qxp.util.Validation.isValidString(p.unitDetection);
p.addToQueue=p.addToQueue||false;
p.addToQueueRuntime=p.addToQueueRuntime||false;
p.up=p.name.toUpperCase();
qxp.OO[qxp.OO.C_GLOBALPROPERTYREF+p.up]=p.name;
var valueKey=qxp.OO.C_VALUE+p.method;
var evalKey=qxp.OO.C_EVAL+p.method;
var changeKey=qxp.OO.C_CHANGE+p.method;
var modifyKey=qxp.OO.C_MODIFY+p.implMethod;
var checkKey=qxp.OO.C_CHECK+p.implMethod;
if(!qxp.OO.setter[p.name]){qxp.OO.setter[p.name]=qxp.OO.C_SET+p.method;
qxp.OO.getter[p.name]=qxp.OO.C_GET+p.method;
qxp.OO.resetter[p.name]=qxp.OO.C_RESET+p.method;
qxp.OO.values[p.name]=valueKey;
}if(p.hasUnitDetection){var cu=qxp.OO.C_COMPUTED+p.method;
pp[cu+qxp.OO.C_UNIT_VALUE]=null;
pp[cu+qxp.OO.C_UNIT_PARSED]=null;
pp[cu+qxp.OO.C_UNIT_TYPE]=null;
pp[cu+qxp.OO.C_UNIT_TYPE_NULL]=true;
pp[cu+qxp.OO.C_UNIT_TYPE_PIXEL]=false;
pp[cu+qxp.OO.C_UNIT_TYPE_PERCENT]=false;
pp[cu+qxp.OO.C_UNIT_TYPE_AUTO]=false;
pp[cu+qxp.OO.C_UNIT_TYPE_FLEX]=false;
var unitDetectionKey=qxp.OO.C_UNITDETECTION+qxp.lang.String.toFirstUp(p.unitDetection);
}pp[valueKey]=p.defaultValue;
pp[qxp.OO.C_GET+p.method]=function(){return this[valueKey];
};
pp[qxp.OO.C_FORCE+p.method]=function(newValue){return this[valueKey]=newValue;
};
pp[qxp.OO.C_RESET+p.method]=function(){return this[qxp.OO.C_SET+p.method](p.defaultValue);
};
if(p.type===qxp.constant.Type.BOOLEAN){pp[qxp.OO.C_TOGGLE+p.method]=function(newValue){return this[qxp.OO.C_SET+p.method](!this[valueKey]);
};
}
if(p.allowMultipleArguments||p.hasConvert||p.hasInstance||p.hasClassName||p.hasPossibleValues||p.hasUnitDetection||p.addToQueue||p.addToQueueRuntime||p.addToStateQueue){pp[qxp.OO.C_SET+p.method]=function(newValue){if(p.allowMultipleArguments&&arguments.length>1){newValue=qxp.lang.Array.fromArguments(arguments);
}if(p.hasConvert){try{newValue=p.convert.call(this,newValue,p);
}catch(ex){throw new Error("Attention! Could not convert new value for "+p.name+": "+newValue+": "+ex);
}}var oldValue=this[valueKey];
if(newValue===oldValue){return newValue;
}
if(!(p.allowNull&&newValue==null)){if(p.hasType&&typeof newValue!==p.type){return this.error("Attention! The value \""+newValue+"\" is an invalid value for the property \""+p.name+"\" which must be typeof \""+p.type+"\" but is typeof \""+typeof newValue+"\"!",new Error());
}
if(p.hasInstance&&!(newValue instanceof qxp.OO.classes[p.instance])){return this.error("Attention! The value \""+newValue+"\" is an invalid value for the property \""+p.name+"\" which must be an instance of \""+p.instance+"\"!",new Error());
}
if(p.hasClassName&&newValue.classname!=p.classname){return this.error("Attention! The value \""+newValue+"\" is an invalid value for the property \""+p.name+"\" which must be an object with the classname \""+p.classname+"\"!",new Error());
}
if(p.hasPossibleValues&&newValue!=null&&!qxp.lang.Array.contains(p.possibleValues,newValue)){return this.error("Failed to save value for "+p.name+". '"+newValue+"' is not a possible value!",new Error());
}}if(this[checkKey]){try{newValue=this[checkKey](newValue,p);
if(newValue===oldValue){return newValue;
}}catch(ex){return this.error("Failed to check property "+p.name,ex);
}}this[valueKey]=newValue;
if(this[modifyKey]){try{this[modifyKey](newValue,oldValue,p);
}catch(ex){return this.error("Modification of property \""+p.name+"\" failed with exception",ex);
}}if(p.hasUnitDetection){this[unitDetectionKey](p,newValue);
}if(p.addToQueue){this.addToQueue(p.name);
}else if(p.addToQueueRuntime){this.addToQueueRuntime(p.name);
}if(p.addToStateQueue){this.addToStateQueue();
}if(this.hasEventListeners&&this.hasEventListeners(changeKey)){try{this.createDispatchDataEvent(changeKey,newValue);
}catch(ex){throw new Error("Property "+p.name+" modified: Failed to dispatch change event: "+ex);
}}return newValue;
};
}else{pp[qxp.OO.C_SET+p.method]=function(newValue){var oldValue=this[valueKey];
if(newValue===oldValue){return newValue;
}
if(!(p.allowNull&&newValue==null)){if(p.hasType&&typeof newValue!==p.type){return this.error("Attention! The value \""+newValue+"\" is an invalid value for the property \""+p.name+"\" which must be typeof \""+p.type+"\" but is typeof \""+typeof newValue+"\"!",new Error());
}}if(this[checkKey]){try{newValue=this[checkKey](newValue,p);
if(newValue===oldValue){return newValue;
}}catch(ex){return this.error("Failed to check property "+p.name,ex);
}}this[valueKey]=newValue;
if(this[modifyKey]){try{this[modifyKey](newValue,oldValue,p);
}catch(ex){return this.error("Modification of property \""+p.name+"\" failed with exception",ex);
}}if(this.hasEventListeners&&this.hasEventListeners(changeKey)){var vEvent=new qxp.event.type.DataEvent(changeKey,newValue,oldValue,false);
vEvent.setTarget(this);
try{this.dispatchEvent(vEvent,true);
}catch(ex){throw new Error("Property "+p.name+" modified: Failed to dispatch change event: "+ex);
}}return newValue;
};
}if(typeof p.getAlias===qxp.constant.Type.STRING){pp[p.getAlias]=pp[qxp.OO.C_GET+p.method];
}if(typeof p.setAlias===qxp.constant.Type.STRING){pp[p.setAlias]=pp[qxp.OO.C_SET+p.method];
}};
qxp.OO.changeProperty=qxp.OO._createProperty;
qxp.OO.addProperty=function(p){qxp.OO.propertyNumber++;
qxp.OO._createProperty(p);
if(typeof qxp.Proto._properties!==qxp.constant.Type.STRING){qxp.Proto._properties=p.name;
}else{qxp.Proto._properties+=qxp.constant.Core.COMMA+p.name;
}switch(p.type){case undefined:case qxp.constant.Type.OBJECT:case qxp.constant.Type.FUNCTION:if(typeof qxp.Proto._objectproperties!==qxp.constant.Type.STRING){qxp.Proto._objectproperties=p.name;
}else{qxp.Proto._objectproperties+=qxp.constant.Core.COMMA+p.name;
}}};
qxp.OO.inheritField=function(vField,vData){qxp.lang.Object.carefullyMergeWith(vData,qxp.Super.prototype[vField]);
qxp.Proto[vField]=vData;
};
qxp.OO.isAvailable=function(vClassName){return typeof qxp.OO.classes[vClassName]!==qxp.constant.Type.UNDEFINED;
};




/* ID: qxp.lang.String */
qxp.OO.defineClass("qxp.lang.String");
qxp.Class.toCamelCase=function(str){var vArr=str.split(qxp.constant.Core.DASH),vLength=vArr.length;
if(vLength==1){return vArr[0];
}var vNew=str.indexOf(qxp.constant.Core.DASH)==0?vArr[0].charAt(0).toUpperCase()+vArr[0].substring(1):vArr[0];
for(var vPart,i=1;i<vLength;i++){vPart=vArr[i];
vNew+=vPart.charAt(0).toUpperCase()+vPart.substring(1);
}return vNew;
};
qxp.Class.trimLeft=function(str){return str.replace(/^\s+/,qxp.constant.Core.EMPTY);
};
qxp.Class.trimRight=function(str){return str.replace(/\s+$/,qxp.constant.Core.EMPTY);
};
qxp.Class.trim=function(str){return str.replace(/^\s+|\s+$/g,qxp.constant.Core.EMPTY);
};
qxp.Class.stripTags=function(str){return str.replace(/<\/?[^>]+>/gi,qxp.constant.Core.EMPTY);
};
qxp.Class.startsWith=function(fullstr,substr){return !fullstr.indexOf(substr);
};
qxp.Class.endsWith=function(fullstr,substr){return fullstr.lastIndexOf(substr)===fullstr.length-substr.length;
};
qxp.Class.pad=function(str,length,ch){if(typeof ch===qxp.constant.Type.UNDEFINED){ch=qxp.constant.Core.ZERO;
}var temp=qxp.constant.Core.EMPTY;
for(var i=length,l=str.length;l<i;l++){temp+=ch;
}return temp+str;
};
qxp.Class.toFirstUp=function(str){return str.charAt(0).toUpperCase()+str.substr(1);
};
qxp.Class.add=function(str,v,sep){if(str==v){return str;
}else if(str==qxp.constant.Core.EMPTY){return v;
}else{if(qxp.util.Validation.isInvalid(sep)){sep=qxp.constant.Core.COMMA;
}var a=str.split(sep);
if(a.indexOf(v)==-1){a.push(v);
return a.join(sep);
}else{return str;
}}};
qxp.Class.remove=function(str,v,sep){if(str==v||str==qxp.constant.Core.EMPTY){return qxp.constant.Core.EMPTY;
}else{if(qxp.util.Validation.isInvalid(sep)){sep=qxp.constant.Core.COMMA;
}var a=str.split(sep);
var p=a.indexOf(v);
if(p===-1){return str;
}
do{a.splice(p,1);
}while((p=a.indexOf(v))!=-1);
return a.join(sep);
}};
qxp.Class.contains=function(str,s){return str.indexOf(s)!=-1;
};
qxp.Class.escapeRegexpChars=function(str){return str.replace(/([\\\.\(\)\[\]\{\}\^\$\?\+\*])/g,"\\$1");
};




/* ID: qxp.constant.Core */
qxp.OO.defineClass("qxp.constant.Core",{EMPTY:"",SPACE:" ",SLASH:"/",DOT:".",ZERO:"0",QUOTE:'"',NEWLINE:"\n",SINGLEQUOTE:"'",STAR:"*",PLUS:"+",MINUS:"-",COMMA:",",DASH:"-",UNDERLINE:"_",SEMICOLON:";",COLON:":",EQUAL:"=",AMPERSAND:"&",QUESTIONMARK:"?",HASH:"#",SMALLER:"<",BIGGER:">",PERCENT:"%",PIXEL:"px",MILLISECONDS:"ms",FLEX:"1*",ZEROPIXEL:"0px",HUNDREDPERCENT:"100%",YES:"yes",NO:"no",ON:"on",OFF:"off",SET:"set",GET:"get",DEFAULT:"default",AUTO:"auto",NONE:"none",DISABLED:"disabled",HIDDEN:"hidden"});




/* ID: qxp.constant.Type */
qxp.OO.defineClass("qxp.constant.Type",{UNDEFINED:"undefined",NUMBER:"number",STRING:"string",BOOLEAN:"boolean",FUNCTION:"function",OBJECT:"object"});




/* ID: qxp.util.Validation */
qxp.OO.defineClass("qxp.util.Validation");
qxp.util.Validation.isValid=function(v){switch(typeof v){case qxp.constant.Type.UNDEFINED:return false;
case qxp.constant.Type.OBJECT:return v!==null;
case qxp.constant.Type.STRING:return v!==qxp.constant.Core.EMPTY;
case qxp.constant.Type.NUMBER:return !isNaN(v);
case qxp.constant.Type.FUNCTION:case qxp.constant.Type.BOOLEAN:return true;
}return false;
};
qxp.util.Validation.isInvalid=function(v){switch(typeof v){case qxp.constant.Type.UNDEFINED:return true;
case qxp.constant.Type.OBJECT:return v===null;
case qxp.constant.Type.STRING:return v===qxp.constant.Core.EMPTY;
case qxp.constant.Type.NUMBER:return isNaN(v);
case qxp.constant.Type.FUNCTION:case qxp.constant.Type.BOOLEAN:return false;
}return true;
};
qxp.util.Validation.isValidNumber=function(v){return typeof v===qxp.constant.Type.NUMBER&&!isNaN(v);
};
qxp.util.Validation.isInvalidNumber=function(v){return typeof v!==qxp.constant.Type.NUMBER||isNaN(v);
};
qxp.util.Validation.isValidString=function(v){return typeof v===qxp.constant.Type.STRING&&v!==qxp.constant.Core.EMPTY;
};
qxp.util.Validation.isInvalidString=function(v){return typeof v!==qxp.constant.Type.STRING||v===qxp.constant.Core.EMPTY;
};
qxp.util.Validation.isValidArray=function(v){return typeof v===qxp.constant.Type.OBJECT&&v!==null&&v instanceof Array;
};
qxp.util.Validation.isInvalidArray=function(v){return typeof v!==qxp.constant.Type.OBJECT||v===null||!(v instanceof Array);
};
qxp.util.Validation.isValidObject=function(v){return typeof v===qxp.constant.Type.OBJECT&&v!==null&&!(v instanceof Array);
};
qxp.util.Validation.isInvalidObject=function(v){return typeof v!==qxp.constant.Type.OBJECT||v===null||v instanceof Array;
};
qxp.util.Validation.isValidNode=function(v){return typeof v===qxp.constant.Type.OBJECT&&v!==null;
};
qxp.util.Validation.isInvalidNode=function(v){return typeof v!==qxp.constant.Type.OBJECT||v===null;
};
qxp.util.Validation.isValidElement=function(v){return typeof v===qxp.constant.Type.OBJECT&&v!==null||v.nodeType!==1;
};
qxp.util.Validation.isInvalidElement=function(v){return typeof v!==qxp.constant.Type.OBJECT||v===null||v.nodeType!==1;
};
qxp.util.Validation.isValidFunction=function(v){return typeof v===qxp.constant.Type.FUNCTION;
};
qxp.util.Validation.isInvalidFunction=function(v){return typeof v!==qxp.constant.Type.FUNCTION;
};
qxp.util.Validation.isValidBoolean=function(v){return typeof v===qxp.constant.Type.BOOLEAN;
};
qxp.util.Validation.isInvalidBoolean=function(v){return typeof v!==qxp.constant.Type.BOOLEAN;
};
qxp.util.Validation.isValidStringOrNumber=function(v){switch(typeof v){case qxp.constant.Type.STRING:return v!==qxp.constant.Core.EMPTY;
case qxp.constant.Type.NUMBER:return !isNaN(v);
}return false;
};
qxp.util.Validation.isInvalidStringOrNumber=function(v){switch(typeof v){case qxp.constant.Type.STRING:return v===qxp.constant.Core.EMPTY;
case qxp.constant.Type.NUMBER:return isNaN(v);
}return false;
};




/* ID: qxp.lang.Array */
qxp.OO.defineClass("qxp.lang.Array");
qxp.lang.Array.fromArguments=function(args){return Array.prototype.slice.call(args,0);
};
qxp.lang.Array.fromShortHand=function(params){var l=params.length;
if(l>4){throw new Error("Invalid number of arguments!");
}var v;
var list=[];
for(var i=0;i<l;i++){v=params[i];
if(qxp.util.Validation.isValidNumber(v)){list.push(v);
}else if(qxp.util.Validation.isInvalidString(v)){list.push(null);
}else{throw new Error("Invalid shorthand value: "+v);
}}switch(l){case 1:list[1]=list[2]=list[3]=list[0];
break;
case 2:list[2]=list[0];
case 3:list[3]=list[1];
}return list;
};
qxp.lang.Array.copy=function(arr){return arr.concat();
};
qxp.lang.Array.clone=function(arr){return arr.concat();
};
qxp.lang.Array.getLast=function(arr){return arr[arr.length-1];
};
qxp.lang.Array.getFirst=function(arr){return arr[0];
};
qxp.lang.Array.insertAt=function(arr,obj,i){arr.splice(i,0,obj);
return arr;
};
qxp.lang.Array.insertBefore=function(arr,obj,obj2){var i=arr.indexOf(obj2);
if(i==-1){arr.push(obj);
}else{arr.splice(i,0,obj);
}return arr;
};
qxp.lang.Array.insertAfter=function(arr,o,o2){var i=arr.indexOf(o2);
if(i==-1||i==(arr.length-1)){arr.push(o);
}else{arr.splice(i+1,0,o);
}return arr;
};
qxp.lang.Array.removeAt=function(arr,i){return arr.splice(i,1);
};
qxp.lang.Array.removeAll=function(arr){return arr.splice(0,arr.length);
};
qxp.lang.Array.append=function(arr,a){Array.prototype.push.apply(arr,a);
};
qxp.lang.Array.remove=function(arr,obj){var i=arr.indexOf(obj);
if(i!=-1){return arr.splice(i,1);
}};
qxp.lang.Array.contains=function(arr,obj){return arr.indexOf(obj)!=-1;
};




/* ID: qxp.lang.Object */
qxp.OO.defineClass("qxp.lang.Object");
qxp.Class.isEmpty=function(h){for(var s in h){return false;
}return true;
};
qxp.Class.hasMinLength=function(h,j){var i=0;
for(var s in h){if((++i)>=j){return true;
}}return false;
};
qxp.Class.getLength=function(h){var i=0;
for(var s in h){i++;
}return i;
};
qxp.Class.getKeys=function(h){var r=[];
for(var s in h){r.push(s);
}return r;
};
qxp.Class.getKeysAsString=function(h){return qxp.lang.Object.getKeys(h).join(", ");
};
qxp.Class.getValues=function(h){var r=[];
for(var s in h){r.push(h[s]);
}return r;
};
qxp.Class.mergeWith=function(vObjectA,vObjectB){for(var vKey in vObjectB){vObjectA[vKey]=vObjectB[vKey];
}return vObjectA;
};
qxp.Class.carefullyMergeWith=function(vObjectA,vObjectB){for(vKey in vObjectB){if(typeof vObjectA[vKey]===qxp.constant.Type.UNDEFINED){vObjectA[vKey]=vObjectB[vKey];
}}return vObjectA;
};
qxp.Class.merge=function(vObjectA){var vLength=arguments.length;
for(var i=1;i<vLength;i++){qxp.lang.Object.mergeWith(vObjectA,arguments[i]);
}return vObjectA;
};
qxp.Class.copy=function(vObject){return qxp.lang.Object.mergeWith({},vObject);
};




/* ID: qxp.lang.Core */
qxp.OO.defineClass("qxp.lang.Core");
if(!Error.prototype.toString){Error.prototype.toString=function(){return this.message;
};
}qxp.Class.closure=function(fun,obj){if(!window.__objs){window.__objs=[];
window.__funs=[];
}var objId=obj.__objId;
if(!objId){__objs[objId=obj.__objId=__objs.length]=obj;
}var funId=fun.__funId;
if(!funId){__funs[funId=fun.__funId=__funs.length]=fun;
}if(!obj.__closures){obj.__closures=[];
}var closure=obj.__closures[funId];
if(closure){return closure;
}obj=null;
fun=null;
return __objs[objId].__closures[funId]=function(){return __funs[funId].apply(__objs[objId],arguments);
};
};
if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=0;
}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);
}
for(var i=fromIndex;i<this.length;i++){if(this[i]===obj){return i;
}}return -1;
};
}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(obj,fromIndex){if(fromIndex==null){fromIndex=this.length-1;
}else if(fromIndex<0){fromIndex=Math.max(0,this.length+fromIndex);
}
for(var i=fromIndex;i>=0;i--){if(this[i]===obj){return i;
}}return -1;
};
}qxp.Class.forEach=function(arr,f,obj){for(var i=0,l=arr.length;i<l;i++){f.call(obj,arr[i],i,arr);
}};
qxp.Class.filter=function(arr,f,obj){var l=arr.length;
var res=[];
for(var i=0;i<l;i++){if(f.call(obj,arr[i],i,arr)){res.push(arr[i]);
}}return res;
};
qxp.Class.map=function(arr,f,obj){var l=arr.length;
var res=[];
for(var i=0;i<l;i++){res.push(f.call(obj,arr[i],i,arr));
}return res;
};
qxp.Class.some=function(arr,f,obj){var l=arr.length;
for(var i=0;i<l;i++){if(f.call(obj,arr[i],i,arr)){return true;
}}return false;
};
qxp.Class.every=function(arr,f,obj){var l=arr.length;
for(var i=0;i<l;i++){if(!f.call(obj,arr[i],i,arr)){return false;
}}return true;
};




/* ID: qxp.util.Return */
qxp.OO.defineClass("qxp.util.Return");
qxp.util.Return.returnTrue=function(){return true;
};
qxp.util.Return.returnFalse=function(){return false;
};
qxp.util.Return.returnNull=function(){return null;
};
qxp.util.Return.returnThis=function(){return this;
};
qxp.util.Return.returnInstance=function(){if(!this._instance){this._instance=new this;
}return this._instance;
};
qxp.util.Return.returnZero=function(){return 0;
};
qxp.util.Return.returnNegativeIndex=function(){return -1;
};




/* ID: qxp.core.Object */
qxp.OO.defineClass("qxp.core.Object",Object,function(vAutoDispose){this._hashCode=qxp.core.Object._counter++;
if(vAutoDispose!==false){qxp.core.Object._db[this._hashCode]=this;
}});
qxp.Settings.setDefault("enableDisposerDebug",false);
qxp.Class._counter=0;
qxp.Class._db=[];
qxp.Class._disposeAll=false;
qxp.Class.toHashCode=function(o){if(o._hashCode!=null){return o._hashCode;
}return o._hashCode=qxp.core.Object._counter++;
};
qxp.Class.dispose=function(){qxp.core.Object._disposeAll=true;
var vObject;
for(var i=qxp.core.Object._db.length-1;i>=0;i--){vObject=qxp.core.Object._db[i];
if(vObject&&vObject._disposed===false){vObject.dispose();
}}};
qxp.Class.summary=function(){var vData={};
var vCounter=0;
for(var i=qxp.core.Object._db.length-1;i>=0;i--){vObject=qxp.core.Object._db[i];
if(vObject&&vObject._disposed===false){if(vData[vObject.classname]==null){vData[vObject.classname]=1;
}else{vData[vObject.classname]++;
}vCounter++;
}}var vArrData=[];
for(var vClassName in vData){vArrData.push({classname:vClassName,number:vData[vClassName]});
}vArrData.sort(function(a,b){return b.number-a.number;
});
var vMsg="Summary: ("+vCounter+" Objects)\n\n";
for(var i=0;i<vArrData.length;i++){vMsg+=vArrData[i].number+": "+vArrData[i].classname+"\n";
}alert(vMsg);
};
qxp.OO.addProperty({name:"enabled",type:qxp.constant.Type.BOOLEAN,defaultValue:true,getAlias:"isEnabled"});
qxp.Proto.toString=function(){if(this.classname){return "[object "+this.classname+"]";
}return "[object Object]";
};
qxp.Proto.toHashCode=function(){return this._hashCode;
};
qxp.Proto.getDisposed=function(){return this._disposed;
};
qxp.Proto.isDisposed=function(){return this._disposed;
};
qxp.Proto.getSetting=function(vKey){return qxp.Settings.getValueOfClass(this.classname,vKey);
};
qxp.Proto.getLogger=function(){return qxp.dev.log.Logger.getClassLogger(this.constructor);
};
qxp.Proto.debug=function(msg,exc){this.getLogger().debug(msg,this._hashCode,exc);
};
qxp.Proto.info=function(msg,exc){this.getLogger().info(msg,this._hashCode,exc);
};
qxp.Proto.warn=function(msg,exc){this.getLogger().warn(msg,this._hashCode,exc);
};
qxp.Proto.error=function(msg,exc){this.getLogger().error(msg,this._hashCode,exc);
};
qxp.Proto.set=function(propertyValues){if(typeof propertyValues!==qxp.constant.Type.OBJECT){throw new Error("Please use a valid hash of property key-values pairs.");
}
for(var prop in propertyValues){try{this[qxp.OO.setter[prop]](propertyValues[prop]);
}catch(ex){this.error("Setter of property "+prop+" returned with an error",ex);
}}return this;
};
qxp.Proto.get=function(propertyNames,outputHint){switch(typeof propertyNames){case qxp.constant.Type.STRING:return this[qxp.constant.Core.GET+qxp.lang.String.toFirstUp(propertyNames)]();
case qxp.constant.Type.OBJECT:if(typeof propertyNames.length===qxp.constant.Type.NUMBER){if(outputHint=="hash"){var h={};
propertyLength=propertyNames.length;
for(var i=0;i<propertyLength;i++){try{h[propertyNames[i]]=this[qxp.constant.Core.GET+qxp.lang.String.toFirstUp(propertyNames[i])]();
}catch(ex){throw new Error("Could not get a valid value from property: "+propertyNames[i]+"! Is the property existing? ("+ex+")");
}}return h;
}else{propertyLength=propertyNames.length;
for(var i=0;i<propertyLength;i++){try{propertyNames[i]=this[qxp.constant.Core.GET+qxp.lang.String.toFirstUp(propertyNames[i])]();
}catch(ex){throw new Error("Could not get a valid value from property: "+propertyNames[i]+"! Is the property existing? ("+ex+")");
}}return propertyNames;
}}else{for(var i in propertyNames){propertyNames[i]=this[qxp.constant.Core.GET+qxp.lang.String.toFirstUp(i)]();
}return propertyNames;
}default:throw new Error("Please use a valid array, hash or string as parameter!");
}};
qxp.Proto.setUserData=function(vKey,vValue){if(!this._userData){this._userData={};
}this._userData[vKey]=vValue;
};
qxp.Proto.getUserData=function(vKey){if(!this._userData){return null;
}return this._userData[vKey];
};
qxp.Proto._disposed=false;
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}if(this._userData){for(var vKey in this._userData){this._userData[vKey]=null;
}this._userData=null;
}if(this._objectproperties){var a=this._objectproperties.split(qxp.constant.Core.COMMA);
var d=qxp.OO.values;
for(var i=0,l=a.length;i<l;i++){this[d[a[i]]]=null;
}this._objectproperties=null;
}
if(this.getSetting("enableDisposerDebug")){for(var vKey in this){if(this[vKey]!==null&&typeof this[vKey]===qxp.constant.Type.OBJECT){this.debug("Missing class implementation to dispose: "+vKey);
delete this[vKey];
}}}if(this._hashCode!=null){if(qxp.core.Object._disposeAll){qxp.core.Object._db[this._hashCode]=null;
}else{delete qxp.core.Object._db[this._hashCode];
}}this._disposed=true;
};




/* ID: qxp.dev.log.LogEventProcessor */
qxp.OO.defineClass("qxp.dev.log.LogEventProcessor",qxp.core.Object,function(){qxp.core.Object.call(this);
});
qxp.Proto.addFilter=function(filter){if(this._filterArr==null){this._filterArr=[];
}this._filterArr.push(filter);
};
qxp.Proto.clearFilters=function(){this._filterArr=null;
};
qxp.Proto.getHeadFilter=function(){return (this._filterArr==null||this._filterArr.length==0)?null:this._filterArr[0];
};
qxp.Proto._getDefaultFilter=function(){var headFilter=this.getHeadFilter();
if(!(headFilter instanceof qxp.dev.log.DefaultFilter)){this.clearFilters();
headFilter=new qxp.dev.log.DefaultFilter();
this.addFilter(headFilter);
}return headFilter;
};
qxp.Proto.setEnabled=function(enabled){this._getDefaultFilter().setEnabled(enabled);
};
qxp.Proto.setMinLevel=function(minLevel){this._getDefaultFilter().setMinLevel(minLevel);
};
qxp.Proto.decideLogEvent=function(evt){var NEUTRAL=qxp.dev.log.Filter.NEUTRAL;
if(this._filterArr!=null){for(var i=0;i<this._filterArr.length;i++){var decision=this._filterArr[i].decide(evt);
if(decision!=NEUTRAL){return decision;
}}}return NEUTRAL;
};
qxp.Proto.handleLogEvent=function(evt){throw new Error("handleLogEvent is abstract");
};




/* ID: qxp.dev.log.Filter */
qxp.OO.defineClass("qxp.dev.log.Filter",qxp.core.Object,function(){qxp.core.Object.call(this);
});
qxp.Proto.decide=function(evt){throw new Error("decide is abstract");
};
qxp.Class.ACCEPT=1;
qxp.Class.DENY=2;
qxp.Class.NEUTRAL=3;




/* ID: qxp.dev.log.DefaultFilter */
qxp.OO.defineClass("qxp.dev.log.DefaultFilter",qxp.dev.log.Filter,function(){qxp.dev.log.Filter.call(this);
});
qxp.OO.addProperty({name:"enabled",type:qxp.constant.Type.BOOLEAN,defaultValue:true,allowNull:false,getAlias:"isEnabled"});
qxp.OO.addProperty({name:"minLevel",type:qxp.constant.Type.NUMBER,defaultValue:null});
qxp.Proto.decide=function(evt){var Filter=qxp.dev.log.Filter;
if(!this.isEnabled()){return Filter.DENY;
}else if(this.getMinLevel()==null){return Filter.NEUTRAL;
}else{return (evt.level>=this.getMinLevel())?Filter.ACCEPT:Filter.DENY;
}};




/* ID: qxp.dev.log.Appender */
qxp.OO.defineClass("qxp.dev.log.Appender",qxp.dev.log.LogEventProcessor,function(){qxp.dev.log.LogEventProcessor.call(this);
});
qxp.OO.addProperty({name:"useLongFormat",type:qxp.constant.Type.BOOLEAN,defaultValue:true,allowNull:false});
qxp.Proto.handleLogEvent=function(evt){if(this.decideLogEvent(evt)!=qxp.dev.log.Filter.DENY){this.appendLogEvent(evt);
}};
qxp.Proto.appendLogEvent=function(evt){throw new Error("appendLogEvent is abstract");
};
qxp.Proto.formatLogEvent=function(evt){var Logger=qxp.dev.log.Logger;
var text="";
var time=new String(new Date().getTime()-qxp._LOADSTART);
while(time.length<6){time=qxp.constant.Core.ZERO+time;
}text+=time;
if(this.getUseLongFormat()){switch(evt.level){case Logger.LEVEL_DEBUG:text+=" DEBUG: ";
break;
case Logger.LEVEL_INFO:text+=" INFO:  ";
break;
case Logger.LEVEL_WARN:text+=" WARN:  ";
break;
case Logger.LEVEL_ERROR:text+=" ERROR: ";
break;
case Logger.LEVEL_FATAL:text+=" FATAL: ";
break;
}}else{text+=": ";
}var indent="";
for(var i=0;i<evt.indent;i++){indent+="  ";
}text+=indent;
if(this.getUseLongFormat()){text+=evt.logger.getName();
if(evt.instanceId!=null){text+="["+evt.instanceId+"]";
}text+=": ";
}if(typeof evt.message=="string"){text+=evt.message;
}else{var obj=evt.message;
if(obj==null){text+="Object is null";
}else{text+="--- Object: "+obj+" ---\n";
var attrArr=new Array();
try{for(var attr in obj){attrArr.push(attr);
}}catch(exc){text+=indent+"  [not readable: "+exc+"]\n";
}attrArr.sort();
for(var i=0;i<attrArr.length;i++){try{text+=indent+"  "+attrArr[i]+"="+obj[attrArr[i]]+"\n";
}catch(exc){text+=indent+"  "+attrArr[i]+"=[not readable: "+exc+"]\n";
}}text+=indent+"--- End of object ---";
}}if(evt.throwable!=null){var thr=evt.throwable;
if(thr.name==null){text+=": "+thr;
}else{text+=": "+thr.name;
}
if(thr.message!=null){text+=" - "+thr.message;
}
if(thr.number!=null){text+=" (#"+thr.number+")";
}
if(thr.stack!=null){text+="\n"+this._beautyStackTrace(thr.stack);
}}return text;
};
qxp.Proto._beautyStackTrace=function(stack){var lineRe=/@(.+):(\d+)$/gm;
var hit;
var out="";
var scriptDir="/script/";
while((hit=lineRe.exec(stack))!=null){var url=hit[1];
var jsPos=url.indexOf(scriptDir);
var className=(jsPos==-1)?url:url.substring(jsPos+scriptDir.length).replace(/\//g,".");
var lineNumber=hit[2];
out+="  at "+className+":"+lineNumber+"\n";
}return out;
};




/* ID: qxp.dev.log.WindowAppender */
qxp.OO.defineClass("qxp.dev.log.WindowAppender",qxp.dev.log.Appender,function(name){qxp.dev.log.Appender.call(this);
this._id=qxp.dev.log.WindowAppender.register(this);
this._name=(name==null)?"qx_log":name;
this._logWindowOpened=false;
});
qxp.OO.addProperty({name:"maxMessages",type:qxp.constant.Type.NUMBER,defaultValue:500});
qxp.OO.addProperty({name:"popUnder",type:qxp.constant.Type.BOOLEAN,defaultValue:false,allowNull:false});
qxp.Proto.openWindow=function(){if(this._logWindowOpened){return ;
}var winWidth=600;
var winHeight=350;
var winLeft=window.screen.width-winWidth;
var winTop=window.screen.height-winHeight;
var params="toolbar=no,scrollbars=yes,resizable=yes,"+"width="+winWidth+",height="+winHeight+",left="+winLeft+",top="+winTop;
this._logWindow=window.open("",this._name,params);
if(!this._logWindow||this._logWindow.closed){if(!this._popupBlockerWarning){alert("Couldn't open debug window. Please disable your popup blocker!");
}this._popupBlockerWarning=true;
return;
}this._popupBlockerWarning=false;
this._logWindowOpened=true;
if(this.getPopUnder()){this._logWindow.blur();
window.focus();
}var logDocument=this._logWindow.document;
logDocument.open();
logDocument.write("<html><head><title>"+this._name+"</title></head>"+'<body onload="qxp = opener.qxp;" onunload="qxp.dev.log.WindowAppender._registeredAppenders['+this._id+'].closeWindow()">'+'<pre id="log" wrap="wrap" style="font-size:11"></pre></body></html>');
logDocument.close();
this._logElem=logDocument.getElementById("log");
if(this._logEventQueue!=null){for(var i=0;i<this._logEventQueue.length;i++){this.appendLogEvent(this._logEventQueue[i]);
}this._logEventQueue=null;
}};
qxp.Proto.closeWindow=function(){if(this._logWindow!=null){this._logWindow.close();
this._logWindow=null;
this._logElem=null;
this._logWindowOpened=false;
}};
qxp.Proto.appendLogEvent=function(evt){if(!this._logWindowOpened){this._logEventQueue=[];
this._logEventQueue.push(evt);
this.openWindow();
if(!this._logWindowOpened){return;
}}else if(this._logElem==null){this._logEventQueue.push(evt);
}else{var divElem=this._logWindow.document.createElement("div");
if(evt.level==qxp.dev.log.Logger.LEVEL_ERROR){divElem.style.backgroundColor="#FFEEEE";
}else if(evt.level==qxp.dev.log.Logger.LEVEL_DEBUG){divElem.style.color="gray";
}divElem.innerHTML=this.formatLogEvent(evt).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/  /g," &#160;").replace(/[\n]/g,"<br>");
this._logElem.appendChild(divElem);
while(this._logElem.childNodes.length>this.getMaxMessages()){this._logElem.removeChild(this._logElem.firstChild);
if(this._removedMessageCount==null){this._removedMessageCount=1;
}else{this._removedMessageCount++;
}}
if(this._removedMessageCount!=null){this._logElem.firstChild.innerHTML="("+this._removedMessageCount+" messages removed)";
}this._logWindow.scrollTo(0,this._logElem.offsetHeight);
}};
qxp.Proto.dispose=function(){if(this.getDisposed()){return true;
}this.closeWindow();
return qxp.dev.log.Appender.prototype.dispose.call(this);
};
qxp.Class._nextId=1;
qxp.Class._registeredAppenders={};
qxp.Class.register=function(appender){var WindowAppender=qxp.dev.log.WindowAppender;
var id=WindowAppender._nextId++;
WindowAppender._registeredAppenders[id]=appender;
return id;
};
qxp.Class.getAppender=function(id){return qxp.dev.log.WindowAppender._registeredAppenders[id];
};




/* ID: qxp.dev.log.Logger */
qxp.OO.defineClass("qxp.dev.log.Logger",qxp.dev.log.LogEventProcessor,function(name,parentLogger){qxp.dev.log.LogEventProcessor.call(this);
this._name=name;
this._parentLogger=parentLogger;
});
qxp.Proto.getName=function(){return this._name;
};
qxp.Proto.getParentLogger=function(){return this._parentLogger;
};
qxp.Proto.indent=function(){qxp.dev.log.Logger._indent++;
};
qxp.Proto.unindent=function(){qxp.dev.log.Logger._indent--;
};
qxp.Proto.addAppender=function(appender){if(this._appenderArr==null){this._appenderArr=[];
}this._appenderArr.push(appender);
};
qxp.Proto.removeAppender=function(appender){if(this._appenderArr!=null){this._appenderArr.remove(appender);
}};
qxp.Proto.removeAllAppenders=function(){this._appenderArr=null;
};
qxp.Proto.handleLogEvent=function(evt){var Filter=qxp.dev.log.Filter;
var decision=Filter.NEUTRAL;
var logger=this;
while(decision==Filter.NEUTRAL&&logger!=null){decision=logger.decideLogEvent(evt);
logger=logger.getParentLogger();
}
if(decision!=Filter.DENY){this.appendLogEvent(evt);
}};
qxp.Proto.appendLogEvent=function(evt){if(this._appenderArr!=null&&this._appenderArr.length!=0){for(var i=0;i<this._appenderArr.length;i++){this._appenderArr[i].handleLogEvent(evt);
}}else if(this._parentLogger!=null){this._parentLogger.appendLogEvent(evt);
}};
qxp.Proto.log=function(level,msg,instanceId,exc){var evt={logger:this,level:level,message:msg,throwable:exc,indent:qxp.dev.log.Logger._indent,instanceId:instanceId};
this.handleLogEvent(evt);
};
qxp.Proto.debug=function(msg,instanceId,exc){this.log(qxp.dev.log.Logger.LEVEL_DEBUG,msg,instanceId,exc);
};
qxp.Proto.info=function(msg,instanceId,exc){this.log(qxp.dev.log.Logger.LEVEL_INFO,msg,instanceId,exc);
};
qxp.Proto.warn=function(msg,instanceId,exc){this.log(qxp.dev.log.Logger.LEVEL_WARN,msg,instanceId,exc);
};
qxp.Proto.error=function(msg,instanceId,exc){this.log(qxp.dev.log.Logger.LEVEL_ERROR,msg,instanceId,exc);
};
qxp.Proto.fatal=function(msg,instanceId,exc){this.log(qxp.dev.log.Logger.LEVEL_FATAL,msg,instanceId,exc);
};
qxp.Proto.measureReset=function(){if(this._totalMeasureTime!=null){this.debug("Measure reset. Total measure time: "+this._totalMeasureTime+" ms");
}this._lastMeasureTime=null;
this._totalMeasureTime=null;
};
qxp.Proto.measure=function(msg,instanceId,exc){if(this._lastMeasureTime==null){msg="(measure start) "+msg;
}else{var delta=new Date().getTime()-this._lastMeasureTime;
if(this._totalMeasureTime==null){this._totalMeasureTime=0;
}this._totalMeasureTime+=delta;
msg="(passed time: "+delta+" ms) "+msg;
}this.debug(msg,instanceId,exc);
this._lastMeasureTime=new Date().getTime();
};
qxp.Proto.printStackTrace=function(){try{forced_exception.go;
}catch(exc){this.debug("Current stack trace","",exc);
}};
qxp.Class.getClassLogger=function(clazz){var logger=clazz._logger;
if(logger==null){var classname=clazz.classname;
var splits=classname.split(".");
var currPackage=window;
var currPackageName="";
var parentLogger=qxp.dev.log.Logger.ROOT_LOGGER;
for(var i=0;i<splits.length-1;i++){currPackage=currPackage[splits[i]];
currPackageName+=((i!=0)?".":"")+splits[i];
if(currPackage._logger==null){currPackage._logger=new qxp.dev.log.Logger(currPackageName,parentLogger);
}parentLogger=currPackage._logger;
}logger=new qxp.dev.log.Logger(classname,parentLogger);
clazz._logger=logger;
}return logger;
};
qxp.Class._indent=0;
qxp.Class.LEVEL_ALL=0;
qxp.Class.LEVEL_DEBUG=200;
qxp.Class.LEVEL_INFO=500;
qxp.Class.LEVEL_WARN=600;
qxp.Class.LEVEL_ERROR=700;
qxp.Class.LEVEL_FATAL=800;
qxp.Class.LEVEL_OFF=1000;
qxp.Class.ROOT_LOGGER=new qxp.dev.log.Logger("root",null);
qxp.Class.ROOT_LOGGER.setMinLevel(qxp.dev.log.Logger.LEVEL_DEBUG);
qxp.Class.ROOT_LOGGER.addAppender(new qxp.dev.log.WindowAppender);




/* ID: qxp.core.Target */
qxp.OO.defineClass("qxp.core.Target",qxp.core.Object,function(vAutoDispose){qxp.core.Object.call(this,vAutoDispose);
});
qxp.Class.EVENTPREFIX="evt";
qxp.Proto.addEventListener=function(vType,vFunction,vObject){if(this._disposed){return;
}
if(typeof vFunction!==qxp.constant.Type.FUNCTION){throw new Error("qxp.core.Target: addEventListener("+vType+"): '"+vFunction+"' is not a function!");
}if(typeof this._listeners===qxp.constant.Type.UNDEFINED){this._listeners={};
this._listeners[vType]={};
}else if(typeof this._listeners[vType]===qxp.constant.Type.UNDEFINED){this._listeners[vType]={};
}var vKey=qxp.core.Target.EVENTPREFIX+qxp.core.Object.toHashCode(vFunction)+(vObject?qxp.constant.Core.UNDERLINE+qxp.core.Object.toHashCode(vObject):qxp.constant.Core.EMPTY);
this._listeners[vType][vKey]={handler:vFunction,object:vObject};
};
qxp.Proto.removeEventListener=function(vType,vFunction,vObject){if(this._disposed){return;
}var vListeners=this._listeners;
if(!vListeners||typeof vListeners[vType]===qxp.constant.Type.UNDEFINED){return;
}
if(typeof vFunction!==qxp.constant.Type.FUNCTION){throw new Error("qxp.core.Target: removeEventListener("+vType+"): '"+vFunction+"' is not a function!");
}var vKey=qxp.core.Target.EVENTPREFIX+qxp.core.Object.toHashCode(vFunction)+(vObject?qxp.constant.Core.UNDERLINE+qxp.core.Object.toHashCode(vObject):qxp.constant.Core.EMPTY);
delete this._listeners[vType][vKey];
};
qxp.Proto.hasEventListeners=function(vType){return this._listeners&&typeof this._listeners[vType]!==qxp.constant.Type.UNDEFINED&&!qxp.lang.Object.isEmpty(this._listeners[vType]);
};
qxp.Proto.createDispatchEvent=function(vType){if(this.hasEventListeners(vType)){this.dispatchEvent(new qxp.event.type.Event(vType),true);
}};
qxp.Proto.createDispatchDataEvent=function(vType,vData){if(this.hasEventListeners(vType)){this.dispatchEvent(new qxp.event.type.DataEvent(vType,vData),true);
}};
qxp.Proto.dispatchEvent=function(vEvent,vEnableDispose){if(this.getDisposed()){return;
}
if(vEvent.getTarget()==null){vEvent.setTarget(this);
}
if(vEvent.getCurrentTarget()==null){vEvent.setCurrentTarget(this);
}this._dispatchEvent(vEvent,vEnableDispose);
return !vEvent._defaultPrevented;
};
qxp.Proto._dispatchEvent=function(vEvent,vEnableDispose){if(this.getDisposed()){return;
}var vListeners=this._listeners;
if(vListeners){vEvent.setCurrentTarget(this);
var vTypeListeners=vListeners[vEvent.getType()];
if(vTypeListeners){var vFunction,vObject;
for(var vHashCode in vTypeListeners){vFunction=vTypeListeners[vHashCode].handler;
vObject=vTypeListeners[vHashCode].object;
try{if(typeof vFunction===qxp.constant.Type.FUNCTION){vFunction.call(qxp.util.Validation.isValid(vObject)?vObject:this,vEvent);
}}catch(ex){this.error("Could not dispatch event of type \""+vEvent.getType()+"\"",ex);
}}}}var vParent=this.getParent();
if(vEvent.getBubbles()&&!vEvent.getPropagationStopped()&&vParent&&!vParent.getDisposed()&&vParent.getEnabled()){vParent._dispatchEvent(vEvent,false);
}vEnableDispose&&vEvent.dispose();
};
qxp.Proto.getParent=function(){return null;
};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}
if(typeof this._listeners===qxp.constant.Type.OBJECT){for(var vType in this._listeners){var listener=this._listeners[vType];
for(var vKey in listener){listener[vKey]=null;
}this._listeners[vType]=null;
}}this._listeners=null;
return qxp.core.Object.prototype.dispose.call(this);
};




/* ID: qxp.event.type.Event */
qxp.OO.defineClass("qxp.event.type.Event",qxp.core.Object,function(vType){qxp.core.Object.call(this,false);
this.setType(vType);
});
qxp.OO.addFastProperty({name:"type",setOnlyOnce:true});
qxp.OO.addFastProperty({name:"originalTarget",setOnlyOnce:true});
qxp.OO.addFastProperty({name:"target",setOnlyOnce:true});
qxp.OO.addFastProperty({name:"relatedTarget",setOnlyOnce:true});
qxp.OO.addFastProperty({name:"currentTarget"});
qxp.OO.addFastProperty({name:"bubbles",defaultValue:false,noCompute:true});
qxp.OO.addFastProperty({name:"propagationStopped",defaultValue:true,noCompute:true});
qxp.OO.addFastProperty({name:"defaultPrevented",defaultValue:false,noCompute:true});
qxp.Proto.preventDefault=function(){this.setDefaultPrevented(true);
};
qxp.Proto.stopPropagation=function(){this.setPropagationStopped(true);
};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}this._valueOriginalTarget=null;
this._valueTarget=null;
this._valueRelatedTarget=null;
this._valueCurrentTarget=null;
return qxp.core.Object.prototype.dispose.call(this);
};




/* ID: qxp.event.type.DataEvent */
qxp.OO.defineClass("qxp.event.type.DataEvent",qxp.event.type.Event,function(vType,vData){qxp.event.type.Event.call(this,vType);
this.setData(vData);
});
qxp.OO.addFastProperty({name:"propagationStopped",defaultValue:false});
qxp.OO.addFastProperty({name:"data"});
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}this._valueData=null;
return qxp.event.type.Event.prototype.dispose.call(this);
};




/* ID: qxp.sys.Client */
qxp.OO.defineClass("qxp.sys.Client",Object,function(){var vRunsLocally=window.location.protocol==="file:";
var vBrowserUserAgent=navigator.userAgent;
var vBrowserVendor=navigator.vendor;
var vBrowserProduct=navigator.product;
var vBrowserPlatform=navigator.platform;
var vBrowserModeHta=false;
var vBrowser;
var vEngine=null;
var vEngineVersion=null;
var vEngineVersionMajor=0;
var vEngineVersionMinor=0;
var vEngineVersionRevision=0;
var vEngineVersionBuild=0;
var vEngineEmulation=null;
var vVersionHelper;
if(window.opera&&/Opera[\s\/]([0-9\.]*)/.test(vBrowserUserAgent)){vEngine="opera";
vEngineVersion=RegExp.$1;
vEngineVersion=vEngineVersion.substring(0,3)+"."+vEngineVersion.substring(3);
vEngineEmulation=vBrowserUserAgent.indexOf("MSIE")!==-1?"mshtml":vBrowserUserAgent.indexOf("Mozilla")!==-1?"gecko":null;
}else if(typeof vBrowserVendor==="string"&&vBrowserVendor==="KDE"&&/KHTML\/([0-9-\.]*)/.test(vBrowserUserAgent)){vEngine="khtml";
vBrowser="konqueror";
vEngineVersion=RegExp.$1;
}else if(vBrowserUserAgent.indexOf("AppleWebKit")!=-1&&/AppleWebKit\/([0-9-\.]*)/.test(vBrowserUserAgent)){vEngine="webkit";
vEngineVersion=RegExp.$1;
if(vBrowserUserAgent.indexOf("Safari")!=-1){if(vBrowserUserAgent.indexOf("Mobile")!=-1){vBrowser="mobile safari";
}else{vBrowser="safari";
}}else if(vBrowserUserAgent.indexOf("Omni")!=-1){vBrowser="omniweb";
}else{vBrowser="other webkit";
}}else if(window.controllers&&typeof vBrowserProduct==="string"&&vBrowserProduct==="Gecko"&&/rv\:([^\);]+)(\)|;)/.test(vBrowserUserAgent)){vEngine="gecko";
vEngineVersion=RegExp.$1;
if(vBrowserUserAgent.indexOf("Firefox")!=-1){vBrowser="firefox";
}else if(vBrowserUserAgent.indexOf("Camino")!=-1){vBrowser="camino";
}else if(vBrowserUserAgent.indexOf("Galeon")!=-1){vBrowser="galeon";
}else{vBrowser="other gecko";
}}else if(/MSIE\s+([^\);]+)(\)|;)/.test(vBrowserUserAgent)){vEngine="mshtml";
vEngineVersion=RegExp.$1;
vBrowserModeHta=!window.external;
}
if(vEngineVersion){vVersionHelper=vEngineVersion.split(".");
vEngineVersionMajor=vVersionHelper[0]||0;
vEngineVersionMinor=vVersionHelper[1]||0;
vEngineVersionRevision=vVersionHelper[2]||0;
vEngineVersionBuild=vVersionHelper[3]||0;
}var vEngineBoxSizingAttr=vEngine=="gecko"?"-moz-box-sizing":vEngine=="mshtml"?null:"box-sizing";
var vEngineQuirksMode=document.compatMode!=="CSS1Compat";
var vDefaultLocale="en";
var vBrowserLocale=(vEngine=="mshtml"?navigator.userLanguage:navigator.language).toLowerCase();
var vBrowserLocaleVariant=null;
var vBrowserLocaleVariantIndex=vBrowserLocale.indexOf("-");
if(vBrowserLocaleVariantIndex!=-1){vBrowserLocaleVariant=vBrowserLocale.substr(vBrowserLocaleVariantIndex+1);
vBrowserLocale=vBrowserLocale.substr(0,vBrowserLocaleVariantIndex);
}var vPlatform="none";
var vPlatformWindows=false;
var vPlatformMacintosh=false;
var vPlatformUnix=false;
var vPlatformOther=false;
if(vBrowserPlatform.indexOf("Windows")!=-1||vBrowserPlatform.indexOf("Win32")!=-1||vBrowserPlatform.indexOf("Win64")!=-1){vPlatformWindows=true;
vPlatform="win";
}else if(vBrowserPlatform.indexOf("Macintosh")!=-1||vBrowserPlatform.indexOf("MacPPC")!=-1||vBrowserPlatform.indexOf("MacIntel")!=-1){vPlatformMacintosh=true;
vPlatform="mac";
}else if(vBrowserPlatform.indexOf("X11")!=-1||vBrowserPlatform.indexOf("Linux")!=-1||vBrowserPlatform.indexOf("BSD")!=-1){vPlatformUnix=true;
vPlatform="unix";
}else{vPlatformOther=true;
vPlatform="other";
}var vGfxVml=false;
var vGfxSvg=false;
var vGfxSvgBuiltin=false;
var vGfxSvgPlugin=false;
if(vEngine=="mshtml"){vGfxVml=true;
}if(document.implementation&&document.implementation.hasFeature){if(document.implementation.hasFeature("org.w3c.dom.svg","1.0")){vGfxSvg=vGfxSvgBuiltin=true;
}}this._runsLocally=vRunsLocally;
this._engineName=vEngine;
this._engineNameMshtml=vEngine==="mshtml";
this._engineNameGecko=vEngine==="gecko";
this._engineNameOpera=vEngine==="opera";
this._engineNameKhtml=vEngine==="khtml";
this._engineNameWebkit=vEngine==="webkit";
this._engineVersion=parseFloat(vEngineVersion);
this._engineVersionMajor=parseInt(vEngineVersionMajor);
this._engineVersionMinor=parseInt(vEngineVersionMinor);
this._engineVersionRevision=parseInt(vEngineVersionRevision);
this._engineVersionBuild=parseInt(vEngineVersionBuild);
this._engineQuirksMode=vEngineQuirksMode;
this._engineBoxSizingAttribute=vEngineBoxSizingAttr;
this._engineEmulation=vEngineEmulation;
this._defaultLocale=vDefaultLocale;
this._browserPlatform=vPlatform;
this._browserPlatformWindows=vPlatformWindows;
this._browserPlatformMacintosh=vPlatformMacintosh;
this._browserPlatformUnix=vPlatformUnix;
this._browserPlatformOther=vPlatformOther;
this._browserModeHta=vBrowserModeHta;
this._browserLocale=vBrowserLocale;
this._browserLocaleVariant=vBrowserLocaleVariant;
this._browser=vBrowser;
this._gfxVml=vGfxVml;
this._gfxSvg=vGfxSvg;
this._gfxSvgBuiltin=vGfxSvgBuiltin;
this._gfxSvgPlugin=vGfxSvgPlugin;
});
qxp.Proto.getRunsLocally=function(){return this._runsLocally;
};
qxp.Proto.getEngine=function(){return this._engineName;
};
qxp.Proto.getVersion=function(){return this._engineVersion;
};
qxp.Proto.getMajor=function(){return this._engineVersionMajor;
};
qxp.Proto.getMinor=function(){return this._engineVersionMinor;
};
qxp.Proto.getRevision=function(){return this._engineVersionRevision;
};
qxp.Proto.getBuild=function(){return this._engineVersionBuild;
};
qxp.Proto.getEmulation=function(){return this._engineEmulation;
};
qxp.Proto.isMshtml=function(){return this._engineNameMshtml;
};
qxp.Proto.isGecko=function(){return this._engineNameGecko;
};
qxp.Proto.isOpera=function(){return this._engineNameOpera;
};
qxp.Proto.isKhtml=function(){return this._engineNameKhtml;
};
qxp.Proto.isWebkit=function(){return this._engineNameWebkit;
};
qxp.Proto.isMobileSafari=function(){return (this._browser=="mobile safari");
};
qxp.Proto.isInQuirksMode=function(){return this._engineQuirksMode;
};
qxp.Proto.getLocale=function(){return this._browserLocale;
};
qxp.Proto.getLocaleVariant=function(){return this._browserLocaleVariant;
};
qxp.Proto.getDefaultLocale=function(){return this._defaultLocale;
};
qxp.Proto.usesDefaultLocale=function(){return this._browserLocale===this._defaultLocale;
};
qxp.Proto.getEngineBoxSizingAttribute=function(){return this._engineBoxSizingAttribute;
};
qxp.Proto.getPlatform=function(){return this._browserPlatform;
};
qxp.Proto.runsOnWindows=function(){return this._browserPlatformWindows;
};
qxp.Proto.runsOnMacintosh=function(){return this._browserPlatformMacintosh;
};
qxp.Proto.runsOnUnix=function(){return this._browserPlatformUnix;
};
qxp.Proto.supportsVml=function(){return this._gfxVml;
};
qxp.Proto.supportsSvg=function(){return this._gfxSvg;
};
qxp.Proto.usesSvgBuiltin=function(){return this._gfxSvgBuiltin;
};
qxp.Proto.usesSvgPlugin=function(){return this._gfxSvgPlugin;
};
qxp.Class.getInstance=qxp.util.Return.returnInstance;




/* ID: qxp.dom.DomEventRegistration */
qxp.OO.defineClass("qxp.dom.DomEventRegistration");
if(qxp.sys.Client.getInstance().isMshtml()){qxp.dom.DomEventRegistration.addEventListener=function(vElement,vType,vFunction){vElement.attachEvent(qxp.constant.Core.ON+vType,vFunction);
};
qxp.dom.DomEventRegistration.removeEventListener=function(vElement,vType,vFunction){vElement.detachEvent(qxp.constant.Core.ON+vType,vFunction);
};
}else{qxp.dom.DomEventRegistration.addEventListener=function(vElement,vType,vFunction){vElement.addEventListener(vType,vFunction,false);
};
qxp.dom.DomEventRegistration.removeEventListener=function(vElement,vType,vFunction){vElement.removeEventListener(vType,vFunction,false);
};
}



/* ID: qxp.core.Init */
qxp.OO.defineClass("qxp.core.Init",qxp.core.Target,function(){qxp.core.Target.call(this,false);
var o=this;
this.__onload=function(e){return o._onload(e);
};
this.__onbeforeunload=function(e){return o._onbeforeunload(e);
};
this.__onunload=function(e){return o._onunload(e);
};
qxp.dom.DomEventRegistration.addEventListener(window,"load",this.__onload);
qxp.dom.DomEventRegistration.addEventListener(window,"beforeunload",this.__onbeforeunload);
qxp.dom.DomEventRegistration.addEventListener(window,"unload",this.__onunload);
});
qxp.Settings.setDefault("component","qxp.component.init.InterfaceInitComponent");
qxp.OO.addProperty({name:"component",type:qxp.constant.Type.OBJECT,instance:"qxp.component.init.BasicInitComponent"});
qxp.OO.addProperty({name:"application",type:qxp.constant.Type.FUNCTION});
qxp.Proto._modifyApplication=function(propValue){if(propValue){this._applicationInstance=new propValue;
}};
qxp.Proto.getApplicationInstance=function(){if(!this.getApplication()){this.setApplication(qxp.component.DummyApplication);
}return this._applicationInstance;
};
qxp.Proto.defineInitialize=function(vFunc){this.getApplicationInstance().initialize=vFunc;
};
qxp.Proto.defineMain=function(vFunc){this.getApplicationInstance().main=vFunc;
};
qxp.Proto.defineFinalize=function(vFunc){this.getApplicationInstance().finalize=vFunc;
};
qxp.Proto.defineClose=function(vFunc){this.getApplicationInstance().close=vFunc;
};
qxp.Proto.defineTerminate=function(vFunc){this.getApplicationInstance().terminate=vFunc;
};
qxp.Proto._onload=function(e){this.debug("qooxdoo "+qxp.core.Version.toString());
this.debug("loaded "+qxp.lang.Object.getLength(qxp.OO.classes)+" classes");
var cl=qxp.sys.Client.getInstance();
this.debug("client: "+cl.getEngine()+"-"+cl.getMajor()+"."+cl.getMinor()+"/"+cl.getPlatform()+"/"+cl.getLocale());
if(cl.isMshtml()&&!cl.isInQuirksMode()){this.warn("Wrong box sizing: Please modify the document's DOCTYPE!");
}this.setComponent(new qxp.OO.classes[this.getSetting("component")](this));
return this.getComponent()._onload(e);
};
qxp.Proto._onbeforeunload=function(e){if(this.getComponent()){return this.getComponent()._onbeforeunload(e);
}};
qxp.Proto._onunload=function(e){if(this.getComponent()){this.getComponent()._onunload(e);
}qxp.core.Object.dispose();
};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}qxp.dom.DomEventRegistration.removeEventListener(window,"load",this.__onload);
qxp.dom.DomEventRegistration.removeEventListener(window,"beforeunload",this.__onbeforeunload);
qxp.dom.DomEventRegistration.removeEventListener(window,"unload",this.__onunload);
this.__onload=this.__onbeforeunload=this.__onunload=null;
if(this._applicationInstance){this._applicationInstance.dispose();
this._applicationInstance=null;
}qxp.core.Target.prototype.dispose.call(this);
};
qxp.Class.getInstance=qxp.util.Return.returnInstance;
qxp.Class.getInstance();




/* ID: qxp.component.AbstractComponent */
qxp.OO.defineClass("qxp.component.AbstractComponent",qxp.core.Target,function(){qxp.core.Target.call(this);
});
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}return qxp.core.Target.prototype.dispose.call(this);
};




/* ID: qxp.component.init.AbstractInitComponent */
qxp.OO.defineClass("qxp.component.init.AbstractInitComponent",qxp.component.AbstractComponent,function(){qxp.component.AbstractComponent.call(this);
});
qxp.Proto.initialize=function(e){return qxp.core.Init.getInstance().getApplicationInstance().initialize(e);
};
qxp.Proto.main=function(e){return qxp.core.Init.getInstance().getApplicationInstance().main(e);
};
qxp.Proto.finalize=function(e){return qxp.core.Init.getInstance().getApplicationInstance().finalize(e);
};
qxp.Proto.close=function(e){return qxp.core.Init.getInstance().getApplicationInstance().close(e);
};
qxp.Proto.terminate=function(e){return qxp.core.Init.getInstance().getApplicationInstance().terminate(e);
};




/* ID: qxp.component.init.BasicInitComponent */
qxp.OO.defineClass("qxp.component.init.BasicInitComponent",qxp.component.init.AbstractInitComponent,function(){qxp.component.init.AbstractInitComponent.call(this);
});
qxp.Proto._onload=function(e){this.initialize(e);
this.main(e);
this.finalize(e);
};
qxp.Proto._onbeforeunload=function(e){this.close(e);
};
qxp.Proto._onunload=function(e){this.terminate(e);
};




/* ID: qxp.component.AbstractApplication */
qxp.OO.defineClass("qxp.component.AbstractApplication",qxp.component.AbstractComponent,function(){qxp.component.AbstractComponent.call(this);
});
qxp.Proto.initialize=function(){};
qxp.Proto.main=function(){};
qxp.Proto.finalize=function(){};
qxp.Proto.close=function(){};
qxp.Proto.terminate=function(){};




/* ID: qxp.component.DummyApplication */
qxp.OO.defineClass("qxp.component.DummyApplication",qxp.component.AbstractApplication,function(){qxp.component.AbstractApplication.call(this);
});
qxp.Class.getInstance=qxp.util.Return.returnInstance;




/* ID: qxp.core.Version */
qxp.OO.defineClass("qxp.core.Version",{major:0,minor:6,revision:2,state:"pre",svn:Number("$Rev: 4314 $".match(/[0-9]+/)[0]),toString:function(){with(qxp.core.Version){return major+"."+minor+(revision==0?"":"."+revision)+(state==""?"":"-"+state)+" (r"+svn+")";
}}});




/* ID: qxp.io.remote.Rpc */
qxp.OO.defineClass("qxp.io.remote.Rpc",qxp.core.Target,function(url,serviceName){qxp.core.Target.call(this);
this.setUrl(url);
if(serviceName!=null){this.setServiceName(serviceName);
}this._previousServerSuffix=null;
this._currentServerSuffix=null;
if(qxp.core.ServerSettings){this._currentServerSuffix=qxp.core.ServerSettings.serverPathSuffix;
}});
qxp.OO.addProperty({name:"timeout",type:qxp.constant.Type.NUMBER});
qxp.OO.addProperty({name:"crossDomain",type:qxp.constant.Type.BOOLEAN,defaultValue:false});
qxp.OO.addProperty({name:"url",type:qxp.constant.Type.STRING,defaultValue:null});
qxp.OO.addProperty({name:"serviceName",type:qxp.constant.Type.STRING,defaultValue:null});
qxp.OO.addProperty({name:"serverData",type:qxp.constant.Type.OBJECT,defaultValue:undefined});
qxp.OO.addProperty({name:"username",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"password",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"useBasicHttpAuth",type:qxp.constant.Type.BOOLEAN});
qxp.io.remote.Rpc.origin={server:1,application:2,transport:3,local:4};
qxp.io.remote.Rpc.localError={timeout:1,abort:2};
qxp.Proto._callInternal=function(args,async,refreshSession){var self=this;
var offset=0;
var handler=args[0];
if(async){offset=1;
}var whichMethod=(refreshSession?"refreshSession":args[offset]);
var argsArray=[];
for(var i=offset+1;i<args.length;++i){argsArray.push(args[i]);
}var req=new qxp.io.remote.RemoteRequest(this.getUrl(),qxp.constant.Net.METHOD_POST,qxp.constant.Mime.JSON);
var requestObject={"service":(refreshSession?null:this.getServiceName()),"method":whichMethod,"id":req.getSequenceNumber(),"params":argsArray};
var serverData=this.getServerData();
if(serverData!==undefined){requestObject.server_data=serverData;
}req.setCrossDomain(this.getCrossDomain());
if(this.getUsername()){req.setUseBasicHttpAuth(this.getUseBasicHttpAuth());
req.setUsername(this.getUsername());
req.setPassword(this.getPassword());
}req.setTimeout(this.getTimeout());
var ex=null;
var id=null;
var result=null;
var handleRequestFinished=function(){if(async){handler(result,ex,id);
}};
var addToStringToObject=function(obj){obj.toString=function(){switch(obj.origin){case qxp.io.remote.Rpc.origin.server:return "Server error "+obj.code+": "+obj.message;
case qxp.io.remote.Rpc.origin.application:return "Application error "+obj.code+": "+obj.message;
case qxp.io.remote.Rpc.origin.transport:return "Transport error "+obj.code+": "+obj.message;
case qxp.io.remote.Rpc.origin.local:return "Local error "+obj.code+": "+obj.message;
default:return "UNEXPECTED origin "+obj.origin+" error "+obj.code+": "+obj.message;
}};
};
var makeException=function(origin,code,message){var ex=new Object();
ex.origin=origin;
ex.code=code;
ex.message=message;
addToStringToObject(ex);
return ex;
};
req.addEventListener("failed",function(evt){var code=evt.getData().getStatusCode();
ex=makeException(qxp.io.remote.Rpc.origin.transport,code,qxp.io.remote.RemoteExchange.statusCodeToString(code));
id=this.getSequenceNumber();
handleRequestFinished();
});
req.addEventListener("timeout",function(evt){ex=makeException(qxp.io.remote.Rpc.origin.local,qxp.io.remote.Rpc.localError.timeout,"Local time-out expired");
id=this.getSequenceNumber();
handleRequestFinished();
});
req.addEventListener("aborted",function(evt){ex=makeException(qxp.io.remote.Rpc.origin.local,qxp.io.remote.Rpc.localError.abort,"Aborted");
id=this.getSequenceNumber();
handleRequestFinished();
});
req.addEventListener("completed",function(evt){result=evt.getData().getContent();
id=result["id"];
var exTest;
if(id!=this.getSequenceNumber()){exTest=new Error("Received id ("+id+") does not match requested id ("+this.getSequenceNumber+")!");
}else{exTest=result["error"];
}
if(exTest!=null){result=null;
addToStringToObject(exTest);
ex=exTest;
}else{result=result["result"];
if(refreshSession){result=eval("("+result+")");
var newSuffix=qxp.core.ServerSettings.serverPathSuffix;
if(self._currentServerSuffix!=newSuffix){self._previousServerSuffix=self._currentServerSuffix;
self._currentServerSuffix=newSuffix;
}self.setUrl(self.fixUrl(self.getUrl()));
}}handleRequestFinished();
});
req.setData(qxp.io.Json.stringify(requestObject));
req.setAsynchronous(async);
if(req.getCrossDomain()){req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}else{req.setRequestHeader("Content-Type",qxp.constant.Mime.JSON);
}req.send();
if(!async){if(ex!=null){var error=new Error(ex.toString());
error.rpcdetails=ex;
throw error;
}return result;
}else{return req;
}};
qxp.Proto.fixUrl=function(url){if(this._previousServerSuffix==null||this._currentServerSuffix==null||this._previousServerSuffix==""||this._previousServerSuffix==this._currentServerSuffix){return url;
}var index=url.indexOf(this._previousServerSuffix);
if(index==-1){return url;
}return url.substring(0,index)+this._currentServerSuffix+url.substring(index+this._previousServerSuffix.length);
};
qxp.Proto.callSync=function(methodName){return this._callInternal(arguments,false);
};
qxp.Proto.callAsync=function(handler,methodName){return this._callInternal(arguments,true);
};
qxp.Proto.refreshSession=function(handler){if(this.getCrossDomain()){if(qxp.core.ServerSettings&&qxp.core.ServerSettings.serverPathSuffix){var timeDiff=(new Date()).getTime()-qxp.core.ServerSettings.lastSessionRefresh;
if(timeDiff/1000>(qxp.core.ServerSettings.sessionTimeoutInSeconds-30)){this._callInternal([handler],true,true);
}else{handler(true);
}}else{handler(false);
}}else{handler(true);
}};
qxp.Proto.abort=function(opaqueCallRef){opaqueCallRef.abort();
};
qxp.Class.makeServerURL=function(instanceId){var retVal=null;
if(qxp.core.ServerSettings){retVal=qxp.core.ServerSettings.serverPathPrefix+"/.qxrpc"+qxp.core.ServerSettings.serverPathSuffix;
if(instanceId!=null){retVal+="?instanceId="+instanceId;
}}return retVal;
};




/* ID: qxp.constant.Mime */
qxp.OO.defineClass("qxp.constant.Mime",{JAVASCRIPT:"text/javascript",JSON:"application/json",XML:"application/xml",TEXT:"text/plain",HTML:"text/html"});




/* ID: qxp.constant.Net */
qxp.OO.defineClass("qxp.constant.Net",{STATE_CREATED:"created",STATE_CONFIGURED:"configured",STATE_QUEUED:"queued",STATE_SENDING:"sending",STATE_RECEIVING:"receiving",STATE_COMPLETED:"completed",STATE_ABORTED:"aborted",STATE_FAILED:"failed",STATE_TIMEOUT:"timeout",PROTOCOL_HTTP:"http",PROTOCOL_HTTPS:"https",PROTOCOL_FTP:"ftp",PROTOCOL_FILE:"file",URI_HTTP:"http:/"+"/",URI_HTTPS:"https:/"+"/",URI_FTP:"ftp:/"+"/",URI_FILE:"file:/"+"/",METHOD_GET:"GET",METHOD_POST:"POST",METHOD_PUT:"PUT",METHOD_HEAD:"HEAD",METHOD_DELETE:"DELETE"});




/* ID: qxp.io.remote.RemoteRequest */
qxp.OO.defineClass("qxp.io.remote.RemoteRequest",qxp.core.Target,function(vUrl,vMethod,vResponseType){qxp.core.Target.call(this);
this._requestHeaders={};
this._parameters={};
this.setUrl(vUrl);
this.setMethod(vMethod||qxp.constant.Net.METHOD_GET);
this.setResponseType(vResponseType||qxp.constant.Mime.TEXT);
this.setProhibitCaching(true);
this.setRequestHeader("X-Requested-With","qooxdoo");
this.setRequestHeader("X-Qooxdoo-Version",qxp.core.Version.toString());
this._seqNum=++qxp.io.remote.RemoteRequest._seqNum;
});
qxp.OO.addProperty({name:"url",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"method",type:qxp.constant.Type.STRING,possibleValues:[qxp.constant.Net.METHOD_GET,qxp.constant.Net.METHOD_POST,qxp.constant.Net.METHOD_PUT,qxp.constant.Net.METHOD_HEAD,qxp.constant.Net.METHOD_DELETE]});
qxp.OO.addProperty({name:"asynchronous",type:qxp.constant.Type.BOOLEAN,defaultValue:true,getAlias:"isAsynchronous"});
qxp.OO.addProperty({name:"data",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"username",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"password",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"state",type:qxp.constant.Type.STRING,possibleValues:[qxp.constant.Net.STATE_CONFIGURED,qxp.constant.Net.STATE_QUEUED,qxp.constant.Net.STATE_SENDING,qxp.constant.Net.STATE_RECEIVING,qxp.constant.Net.STATE_COMPLETED,qxp.constant.Net.STATE_ABORTED,qxp.constant.Net.STATE_TIMEOUT,qxp.constant.Net.STATE_FAILED],defaultValue:qxp.constant.Net.STATE_CONFIGURED});
qxp.OO.addProperty({name:"responseType",type:qxp.constant.Type.STRING,possibleValues:[qxp.constant.Mime.TEXT,qxp.constant.Mime.JAVASCRIPT,qxp.constant.Mime.JSON,qxp.constant.Mime.XML,qxp.constant.Mime.HTML]});
qxp.OO.addProperty({name:"timeout",type:qxp.constant.Type.NUMBER});
qxp.OO.addProperty({name:"prohibitCaching",type:qxp.constant.Type.BOOLEAN});
qxp.OO.addProperty({name:"crossDomain",type:qxp.constant.Type.BOOLEAN,defaultValue:false});
qxp.OO.addProperty({name:"transport",type:qxp.constant.Type.OBJECT,instance:"qxp.io.remote.RemoteExchange"});
qxp.OO.addProperty({name:"useBasicHttpAuth",type:qxp.constant.Type.BOOLEAN});
qxp.Proto.send=function(){qxp.io.remote.RemoteRequestQueue.getInstance().add(this);
};
qxp.Proto.abort=function(){qxp.io.remote.RemoteRequestQueue.getInstance().abort(this);
};
qxp.Proto.reset=function(){switch(this.getState()){case qxp.constant.Net.STATE_SENDING:case qxp.constant.Net.STATE_RECEIVING:this.error("Aborting already sent request!");
case qxp.constant.Net.STATE_QUEUED:this.abort();
break;
}};
qxp.Proto.isConfigured=function(){return this.getState()===qxp.constant.Net.STATE_CONFIGURED;
};
qxp.Proto.isQueued=function(){return this.getState()===qxp.constant.Net.STATE_QUEUED;
};
qxp.Proto.isSending=function(){return this.getState()===qxp.constant.Net.STATE_SENDING;
};
qxp.Proto.isReceiving=function(){return this.getState()===qxp.constant.Net.STATE_RECEIVING;
};
qxp.Proto.isCompleted=function(){return this.getState()===qxp.constant.Net.STATE_COMPLETED;
};
qxp.Proto.isAborted=function(){return this.getState()===qxp.constant.Net.STATE_ABORTED;
};
qxp.Proto.isTimeout=function(){return this.getState()===qxp.constant.Net.STATE_TIMEOUT;
};
qxp.Proto.isFailed=function(){return this.getState()===qxp.constant.Net.STATE_FAILED;
};
qxp.Proto._onqueued=function(e){this.setState(qxp.constant.Net.STATE_QUEUED);
this.dispatchEvent(e);
};
qxp.Proto._onsending=function(e){this.setState(qxp.constant.Net.STATE_SENDING);
this.dispatchEvent(e);
};
qxp.Proto._onreceiving=function(e){this.setState(qxp.constant.Net.STATE_RECEIVING);
this.dispatchEvent(e);
};
qxp.Proto._oncompleted=function(e){this.setState(qxp.constant.Net.STATE_COMPLETED);
this.dispatchEvent(e);
this.dispose();
};
qxp.Proto._onaborted=function(e){this.setState(qxp.constant.Net.STATE_ABORTED);
this.dispatchEvent(e);
this.dispose();
};
qxp.Proto._ontimeout=function(e){this.setState(qxp.constant.Net.STATE_TIMEOUT);
this.dispatchEvent(e);
this.dispose();
};
qxp.Proto._onfailed=function(e){this.setState(qxp.constant.Net.STATE_FAILED);
this.dispatchEvent(e);
this.dispose();
};
qxp.Proto._modifyState=function(propValue){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("State: "+propValue);
}};
qxp.Proto._modifyProhibitCaching=function(propValue){propValue?this.setParameter("nocache",new Date().valueOf()):this.removeParameter("nocache");
};
qxp.Proto._modifyMethod=function(propValue){if(propValue===qxp.constant.Net.METHOD_POST){this.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}};
qxp.Proto._modifyResponseType=function(propValue){this.setRequestHeader("X-Qooxdoo-Response-Type",propValue);
};
qxp.Proto.setRequestHeader=function(vId,vValue){this._requestHeaders[vId]=vValue;
};
qxp.Proto.removeRequestHeader=function(vId){delete this._requestHeaders[vId];
};
qxp.Proto.getRequestHeader=function(vId){return this._requestHeaders[vId]||null;
};
qxp.Proto.getRequestHeaders=function(){return this._requestHeaders;
};
qxp.Proto.setParameter=function(vId,vValue){this._parameters[vId]=vValue;
};
qxp.Proto.removeParameter=function(vId){delete this._parameters[vId];
};
qxp.Proto.getParameter=function(vId){return this._parameters[vId]||null;
};
qxp.Proto.getParameters=function(){return this._parameters;
};
qxp.io.remote.RemoteRequest._seqNum=0;
qxp.Proto.getSequenceNumber=function(){return this._seqNum;
};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}this._requestHeaders=null;
this._parameters=null;
this.setTransport(null);
return qxp.core.Target.prototype.dispose.call(this);
};




/* ID: qxp.io.remote.RemoteExchange */
qxp.OO.defineClass("qxp.io.remote.RemoteExchange",qxp.core.Target,function(vRequest){qxp.core.Target.call(this);
this.setRequest(vRequest);
vRequest.setTransport(this);
});
qxp.Settings.setDefault("enableDebug",false);
qxp.io.remote.RemoteExchange.typesOrder=["qxp.io.remote.XmlHttpTransport","qxp.io.remote.IframeTransport","qxp.io.remote.ScriptTransport"];
qxp.io.remote.RemoteExchange.typesReady=false;
qxp.io.remote.RemoteExchange.typesAvailable={};
qxp.io.remote.RemoteExchange.typesSupported={};
qxp.io.remote.RemoteExchange.registerType=function(vClass,vId){qxp.io.remote.RemoteExchange.typesAvailable[vId]=vClass;
};
qxp.io.remote.RemoteExchange.initTypes=function(){if(qxp.io.remote.RemoteExchange.typesReady){return;
}
for(var vId in qxp.io.remote.RemoteExchange.typesAvailable){vTransporterImpl=qxp.io.remote.RemoteExchange.typesAvailable[vId];
if(vTransporterImpl.isSupported()){qxp.io.remote.RemoteExchange.typesSupported[vId]=vTransporterImpl;
}}qxp.io.remote.RemoteExchange.typesReady=true;
if(qxp.lang.Object.isEmpty(qxp.io.remote.RemoteExchange.typesSupported)){throw new Error("No supported transport types were found!");
}};
qxp.io.remote.RemoteExchange.canHandle=function(vImpl,vNeeds,vResponseType){if(!qxp.lang.Array.contains(vImpl.handles.responseTypes,vResponseType)){return false;
}
for(var vKey in vNeeds){if(!vImpl.handles[vKey]){return false;
}}return true;
};
qxp.io.remote.RemoteExchange._nativeMap={0:qxp.constant.Net.STATE_CREATED,1:qxp.constant.Net.STATE_CONFIGURED,2:qxp.constant.Net.STATE_SENDING,3:qxp.constant.Net.STATE_RECEIVING,4:qxp.constant.Net.STATE_COMPLETED};
qxp.io.remote.RemoteExchange.wasSuccessful=function(vStatusCode,vReadyState,vIsLocal){if(vIsLocal){switch(vStatusCode){case null:case 0:return true;
case -1:return vReadyState<4;
default:return typeof vStatusCode===qxp.constant.Type.UNDEFINED;
}}else{switch(vStatusCode){case -1:if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")&&vReadyState>3){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.RemoteExchange).debug("Failed with statuscode: -1 at readyState "+vReadyState);
}return vReadyState<4;
case 200:case 304:return true;
case 201:case 202:case 203:case 204:case 205:return true;
case 206:if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")&&vReadyState===4){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.RemoteExchange).debug("Failed with statuscode: 206 (Partial content while being complete!)");
}return vReadyState!==4;
case 300:case 301:case 302:case 303:case 305:case 400:case 401:case 402:case 403:case 404:case 405:case 406:case 407:case 408:case 409:case 410:case 411:case 412:case 413:case 414:case 415:case 500:case 501:case 502:case 503:case 504:case 505:if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.RemoteExchange).debug("Failed with typical HTTP statuscode: "+vStatusCode);
}return false;
case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.RemoteExchange).debug("Failed with MSHTML specific HTTP statuscode: "+vStatusCode);
}return false;
default:if(vStatusCode>206&&vStatusCode<300){return true;
}qxp.dev.log.Logger.getClassLogger(qxp.io.remote.RemoteExchange).debug("Unknown status code: "+vStatusCode+" ("+vReadyState+")");
throw new Error("Unknown status code: "+vStatusCode);
}}};
qxp.io.remote.RemoteExchange.statusCodeToString=function(vStatusCode){switch(vStatusCode){case -1:return "Not available";
case 200:return "Ok";
case 304:return "Not modified";
case 206:return "Partial content";
case 204:return "No content";
case 300:return "Multiple choices";
case 301:return "Moved permanently";
case 302:return "Moved temporarily";
case 303:return "See other";
case 305:return "Use proxy";
case 400:return "Bad request";
case 401:return "Unauthorized";
case 402:return "Payment required";
case 403:return "Forbidden";
case 404:return "Not found";
case 405:return "Method not allowed";
case 406:return "Not acceptable";
case 407:return "Proxy authentication required";
case 408:return "Request time-out";
case 409:return "Conflict";
case 410:return "Gone";
case 411:return "Length required";
case 412:return "Precondition failed";
case 413:return "Request entity too large";
case 414:return "Request-URL too large";
case 415:return "Unsupported media type";
case 500:return "Server error";
case 501:return "Not implemented";
case 502:return "Bad gateway";
case 503:return "Out of resources";
case 504:return "Gateway time-out";
case 505:return "HTTP version not supported";
case 12002:return "Server timeout";
case 12029:return "Connection dropped";
case 12030:return "Connection dropped";
case 12031:return "Connection dropped";
case 12152:return "Connection closed by server";
case 13030:return "MSHTML-specific HTTP status code";
default:return "Unknown status code";
}};
qxp.OO.addProperty({name:"request",type:qxp.constant.Type.OBJECT,instance:"qxp.io.remote.RemoteRequest"});
qxp.OO.addProperty({name:"implementation",type:qxp.constant.Type.OBJECT});
qxp.OO.addProperty({name:"state",type:qxp.constant.Type.STRING,possibleValues:[qxp.constant.Net.STATE_CONFIGURED,qxp.constant.Net.STATE_SENDING,qxp.constant.Net.STATE_RECEIVING,qxp.constant.Net.STATE_COMPLETED,qxp.constant.Net.STATE_ABORTED,qxp.constant.Net.STATE_TIMEOUT,qxp.constant.Net.STATE_FAILED],defaultValue:qxp.constant.Net.STATE_CONFIGURED});
qxp.Proto.send=function(){var vRequest=this.getRequest();
if(!vRequest){return this.error("Please attach a request object first");
}qxp.io.remote.RemoteExchange.initTypes();
var vUsage=qxp.io.remote.RemoteExchange.typesOrder;
var vSupported=qxp.io.remote.RemoteExchange.typesSupported;
var vResponseType=vRequest.getResponseType();
var vNeeds={};
if(vRequest.getAsynchronous()){vNeeds.asynchronous=true;
}else{vNeeds.synchronous=true;
}
if(vRequest.getCrossDomain()){vNeeds.crossDomain=true;
}var vTransportImpl,vTransport;
for(var i=0,l=vUsage.length;i<l;i++){vTransportImpl=vSupported[vUsage[i]];
if(vTransportImpl){if(!qxp.io.remote.RemoteExchange.canHandle(vTransportImpl,vNeeds,vResponseType)){continue;
}
try{if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Using implementation: "+vTransportImpl.classname);
}vTransport=new vTransportImpl;
this.setImplementation(vTransport);
vTransport.setUseBasicHttpAuth(vRequest.getUseBasicHttpAuth());
vTransport.send();
return true;
}catch(ex){return this.error("Request handler throws error",ex);
}}}this.error("There is no transport implementation available to handle this request: "+vRequest);
};
qxp.Proto.abort=function(){var vImplementation=this.getImplementation();
if(vImplementation){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Abort: implementation "+vImplementation.toHashCode());
}vImplementation.abort();
}else{if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Abort: forcing state to be aborted");
}this.setState(qxp.constant.Net.STATE_ABORTED);
}};
qxp.Proto.timeout=function(){var vImplementation=this.getImplementation();
if(vImplementation){this.warn("Timeout: implementation "+vImplementation.toHashCode());
vImplementation.timeout();
}else{this.warn("Timeout: forcing state to timeout");
this.setState(qxp.constant.Net.STATE_TIMEOUT);
}if(this.getRequest()){this.getRequest().setTimeout(0);
}};
qxp.Proto._onsending=function(e){this.setState(qxp.constant.Net.STATE_SENDING);
};
qxp.Proto._onreceiving=function(e){this.setState(qxp.constant.Net.STATE_RECEIVING);
};
qxp.Proto._oncompleted=function(e){this.setState(qxp.constant.Net.STATE_COMPLETED);
};
qxp.Proto._onabort=function(e){this.setState(qxp.constant.Net.STATE_ABORTED);
};
qxp.Proto._onfailed=function(e){this.setState(qxp.constant.Net.STATE_FAILED);
};
qxp.Proto._ontimeout=function(e){this.setState(qxp.constant.Net.STATE_TIMEOUT);
};
qxp.Proto._modifyImplementation=function(propValue,propOldValue){if(propOldValue){propOldValue.removeEventListener(qxp.constant.Event.SENDING,this._onsending,this);
propOldValue.removeEventListener(qxp.constant.Event.RECEIVING,this._onreceiving,this);
propOldValue.removeEventListener(qxp.constant.Event.COMPLETED,this._oncompleted,this);
propOldValue.removeEventListener(qxp.constant.Event.ABORTED,this._onabort,this);
propOldValue.removeEventListener(qxp.constant.Event.TIMEOUT,this._ontimeout,this);
propOldValue.removeEventListener(qxp.constant.Event.FAILED,this._onfailed,this);
}
if(propValue){var vRequest=this.getRequest();
propValue.setUrl(vRequest.getUrl());
propValue.setMethod(vRequest.getMethod());
propValue.setAsynchronous(vRequest.getAsynchronous());
propValue.setUsername(vRequest.getUsername());
propValue.setPassword(vRequest.getPassword());
propValue.setParameters(vRequest.getParameters());
propValue.setRequestHeaders(vRequest.getRequestHeaders());
propValue.setData(vRequest.getData());
propValue.setResponseType(vRequest.getResponseType());
propValue.addEventListener(qxp.constant.Event.SENDING,this._onsending,this);
propValue.addEventListener(qxp.constant.Event.RECEIVING,this._onreceiving,this);
propValue.addEventListener(qxp.constant.Event.COMPLETED,this._oncompleted,this);
propValue.addEventListener(qxp.constant.Event.ABORTED,this._onabort,this);
propValue.addEventListener(qxp.constant.Event.TIMEOUT,this._ontimeout,this);
propValue.addEventListener(qxp.constant.Event.FAILED,this._onfailed,this);
}};
qxp.Proto._modifyState=function(propValue,propOldValue){var vRequest=this.getRequest();
if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("State: "+propOldValue+" => "+propValue);
}
switch(propValue){case qxp.constant.Net.STATE_SENDING:this.createDispatchEvent(qxp.constant.Event.SENDING);
break;
case qxp.constant.Net.STATE_RECEIVING:this.createDispatchEvent(qxp.constant.Event.RECEIVING);
break;
case qxp.constant.Net.STATE_COMPLETED:case qxp.constant.Net.STATE_ABORTED:case qxp.constant.Net.STATE_TIMEOUT:case qxp.constant.Net.STATE_FAILED:var vImpl=this.getImplementation();
if(!vImpl){break;
}var vResponse=new qxp.io.remote.RemoteResponse;
if(propValue==qxp.constant.Net.STATE_COMPLETED){var vContent=vImpl.getResponseContent();
vResponse.setContent(vContent);
if(vContent===null){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Altered State: "+propValue+" => failed");
}propValue=qxp.constant.Net.STATE_FAILED;
}}vResponse.setStatusCode(vImpl.getStatusCode());
vResponse.setResponseHeaders(vImpl.getResponseHeaders());
var vEventType;
switch(propValue){case qxp.constant.Net.STATE_COMPLETED:vEventType=qxp.constant.Event.COMPLETED;
break;
case qxp.constant.Net.STATE_ABORTED:vEventType=qxp.constant.Event.ABORTED;
break;
case qxp.constant.Net.STATE_TIMEOUT:vEventType=qxp.constant.Event.TIMEOUT;
break;
case qxp.constant.Net.STATE_FAILED:vEventType=qxp.constant.Event.FAILED;
break;
}this.setImplementation(null);
vImpl.dispose();
this.createDispatchDataEvent(vEventType,vResponse);
vResponse.dispose();
break;
}};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}var vImpl=this.getImplementation();
if(vImpl){this.setImplementation(null);
vImpl.dispose();
}this.setRequest(null);
return qxp.core.Target.prototype.dispose.call(this);
};




/* ID: qxp.io.remote.AbstractRemoteTransport */
qxp.OO.defineClass("qxp.io.remote.AbstractRemoteTransport",qxp.core.Target,function(){qxp.core.Target.call(this);
});
qxp.OO.addProperty({name:"url",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"method",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"asynchronous",type:qxp.constant.Type.BOOLEAN});
qxp.OO.addProperty({name:"data",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"username",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"password",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"state",type:qxp.constant.Type.STRING,possibleValues:[qxp.constant.Net.STATE_CREATED,qxp.constant.Net.STATE_CONFIGURED,qxp.constant.Net.STATE_SENDING,qxp.constant.Net.STATE_RECEIVING,qxp.constant.Net.STATE_COMPLETED,qxp.constant.Net.STATE_ABORTED,qxp.constant.Net.STATE_TIMEOUT,qxp.constant.Net.STATE_FAILED],defaultValue:qxp.constant.Net.STATE_CREATED});
qxp.OO.addProperty({name:"requestHeaders",type:qxp.constant.Type.OBJECT});
qxp.OO.addProperty({name:"parameters",type:qxp.constant.Type.OBJECT});
qxp.OO.addProperty({name:"responseType",type:qxp.constant.Type.STRING});
qxp.OO.addProperty({name:"useBasicHttpAuth",type:qxp.constant.Type.BOOLEAN});
qxp.Proto.send=function(){throw new Error("send is abstract");
};
qxp.Proto.abort=function(){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Aborting...");
}this.setState(qxp.constant.Net.STATE_ABORTED);
};
qxp.Proto.timeout=function(){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Timeout...");
}this.setState(qxp.constant.Net.STATE_TIMEOUT);
};
qxp.Proto.failed=function(){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Failed...");
}this.setState(qxp.constant.Net.STATE_FAILED);
};
qxp.Proto.setRequestHeader=function(vLabel,vValue){throw new Error("setRequestHeader is abstract");
};
qxp.Proto.getResponseHeader=function(vLabel){throw new Error("getResponseHeader is abstract");
};
qxp.Proto.getResponseHeaders=function(){throw new Error("getResponseHeaders is abstract");
};
qxp.Proto.getStatusCode=function(){throw new Error("getStatusCode is abstract");
};
qxp.Proto.getStatusText=function(){throw new Error("getStatusText is abstract");
};
qxp.Proto.getResponseText=function(){throw new Error("getResponseText is abstract");
};
qxp.Proto.getResponseXml=function(){throw new Error("getResponseXml is abstract");
};
qxp.Proto.getFetchedLength=function(){throw new Error("getFetchedLength is abstract");
};
qxp.Proto._modifyState=function(propValue){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("State: "+propValue);
}
switch(propValue){case qxp.constant.Net.STATE_CREATED:this.createDispatchEvent(qxp.constant.Event.CREATED);
break;
case qxp.constant.Net.STATE_CONFIGURED:this.createDispatchEvent(qxp.constant.Event.CONFIGURED);
break;
case qxp.constant.Net.STATE_SENDING:this.createDispatchEvent(qxp.constant.Event.SENDING);
break;
case qxp.constant.Net.STATE_RECEIVING:this.createDispatchEvent(qxp.constant.Event.RECEIVING);
break;
case qxp.constant.Net.STATE_COMPLETED:this.createDispatchEvent(qxp.constant.Event.COMPLETED);
break;
case qxp.constant.Net.STATE_ABORTED:this.createDispatchEvent(qxp.constant.Event.ABORTED);
break;
case qxp.constant.Net.STATE_FAILED:this.createDispatchEvent(qxp.constant.Event.FAILED);
break;
case qxp.constant.Net.STATE_TIMEOUT:this.createDispatchEvent(qxp.constant.Event.TIMEOUT);
break;
}};




/* ID: qxp.constant.Event */
qxp.OO.defineClass("qxp.constant.Event",{MOUSEOVER:"mouseover",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",CLICK:"click",DBLCLICK:"dblclick",CONTEXTMENU:"contextmenu",KEYDOWN:"keydown",KEYPRESS:"keypress",KEYUP:"keyup",BLUR:"blur",FOCUS:"focus",FOCUSIN:"focusin",FOCUSOUT:"focusout",SELECT:"select",SCROLL:"scroll",INPUT:"input",CHANGE:"change",RESIZE:"resize",CHANGESELECTION:"changeSelection",INTERVAL:"interval",EXECUTE:"execute",CREATE:"create",LOAD:"load",ERROR:"error",SUBMIT:"submit",UNLOAD:"unload",BEFOREUNLOAD:"beforeunload",TREEOPENWITHCONTENT:"treeOpenWithContent",TREEOPENWHILEEMPTY:"treeOpenWhileEmpty",TREECLOSE:"treeClose",BEFOREAPPEAR:"beforeAppear",APPEAR:"appear",BEFOREDISAPPEAR:"beforeDisappear",DISAPPEAR:"disappear",BEFOREINSERTDOM:"beforeInsertDom",INSERTDOM:"insertDom",BEFOREREMOVEDOM:"beforeRemoveDom",REMOVEDOM:"removeDom",DRAGDROP:"dragdrop",DRAGOVER:"dragover",DRAGOUT:"dragout",DRAGMOVE:"dragmove",DRAGSTART:"dragstart",DRAGEND:"dragend",CREATED:"created",CONFIGURED:"configured",QUEUED:"queued",SENDING:"sending",RECEIVING:"receiving",COMPLETED:"completed",ABORTED:"aborted",FAILED:"failed",TIMEOUT:"timeout",DIALOGOK:"dialogok",DIALOGCANCEL:"dialogcancel",DIALOGCLOSE:"dialogclose",DIALOGPREVIOUS:"dialogprevious",DIALOGNEXT:"dialognext",DIALOGFIRST:"dialogfirst",DIALOGLAST:"dialoglast"});




/* ID: qxp.io.remote.XmlHttpTransport */
qxp.OO.defineClass("qxp.io.remote.XmlHttpTransport",qxp.io.remote.AbstractRemoteTransport,function(){qxp.io.remote.AbstractRemoteTransport.call(this);
this._req=qxp.io.remote.XmlHttpTransport.createRequestObject();
var o=this;
this._req.onreadystatechange=function(e){return o._onreadystatechange(e);
};
});
qxp.io.remote.RemoteExchange.registerType(qxp.io.remote.XmlHttpTransport,"qxp.io.remote.XmlHttpTransport");
qxp.io.remote.XmlHttpTransport.handles={synchronous:true,asynchronous:true,crossDomain:false,fileUpload:false,responseTypes:[qxp.constant.Mime.TEXT,qxp.constant.Mime.JAVASCRIPT,qxp.constant.Mime.JSON,qxp.constant.Mime.XML,qxp.constant.Mime.HTML]};
qxp.io.remote.XmlHttpTransport.requestObjects=[];
qxp.io.remote.XmlHttpTransport.requestObjectCount=0;
qxp.io.remote.XmlHttpTransport.isSupported=function(){if(window.XMLHttpRequest){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.XmlHttpTransport).debug("Using XMLHttpRequest");
}qxp.io.remote.XmlHttpTransport.createRequestObject=qxp.io.remote.XmlHttpTransport._createNativeRequestObject;
return true;
}
if(window.ActiveXObject){var vServers=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
var vObject;
var vServer;
for(var i=0,l=vServers.length;i<l;i++){vServer=vServers[i];
try{vObject=new ActiveXObject(vServer);
break;
}catch(ex){vObject=null;
}}
if(vObject){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){qxp.dev.log.Logger.getClassLogger(qxp.io.remote.XmlHttpTransport).debug("Using ActiveXObject: "+vServer);
}qxp.io.remote.XmlHttpTransport._activeXServer=vServer;
qxp.io.remote.XmlHttpTransport.createRequestObject=qxp.io.remote.XmlHttpTransport._createActiveXRequestObject;
return true;
}}return false;
};
qxp.io.remote.XmlHttpTransport.createRequestObject=function(){throw new Error("XMLHTTP is not supported!");
};
qxp.io.remote.XmlHttpTransport._createNativeRequestObject=function(){return new XMLHttpRequest;
};
qxp.io.remote.XmlHttpTransport._createActiveXRequestObject=function(){return new ActiveXObject(qxp.io.remote.XmlHttpTransport._activeXServer);
};
qxp.Proto._localRequest=false;
qxp.Proto._lastReadyState=0;
qxp.Proto.getRequest=function(){return this._req;
};
qxp.Proto.send=function(){this._lastReadyState=0;
var vRequest=this.getRequest();
var vMethod=this.getMethod();
var vAsynchronous=this.getAsynchronous();
var vUrl=this.getUrl();
var vLocalRequest=(qxp.sys.Client.getInstance().getRunsLocally()&&!(/^http(s){0,1}\:/.test(vUrl)));
this._localRequest=vLocalRequest;
var vParameters=this.getParameters();
var vParametersList=[];
for(var vId in vParameters){var value=vParameters[vId];
if(value instanceof Array){for(var i=0;i<value.length;i++){vParametersList.push(encodeURIComponent(vId)+qxp.constant.Core.EQUAL+encodeURIComponent(value[i]));
}}else{vParametersList.push(encodeURIComponent(vId)+qxp.constant.Core.EQUAL+encodeURIComponent(value));
}}
if(vParametersList.length>0){vUrl+=(vUrl.indexOf(qxp.constant.Core.QUESTIONMARK)>=0?qxp.constant.Core.AMPERSAND:(qxp.constant.Core.QUESTIONMARK)+vParametersList.join(qxp.constant.Core.AMPERSAND));
}var encode64=function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var output="";
var chr1,chr2,chr3;
var enc1,enc2,enc3,enc4;
var i=0;
do{chr1=input.charCodeAt(i++);
chr2=input.charCodeAt(i++);
chr3=input.charCodeAt(i++);
enc1=chr1>>2;
enc2=((chr1&3)<<4)|(chr2>>4);
enc3=((chr2&15)<<2)|(chr3>>6);
enc4=chr3&63;
if(isNaN(chr2)){enc3=enc4=64;
}else if(isNaN(chr3)){enc4=64;
}output+=keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);
}while(i<input.length);
return output;
};
if(this.getUsername()){if(this.getUseBasicHttpAuth()){vRequest.open(vMethod,vUrl,vAsynchronous);
vRequest.setRequestHeader('Authorization','Basic '+encode64(this.getUsername()+':'+this.getPassword()));
}else{vRequest.open(vMethod,vUrl,vAsynchronous,this.getUsername(),this.getPassword());
}}else{vRequest.open(vMethod,vUrl,vAsynchronous);
}var vRequestHeaders=this.getRequestHeaders();
for(var vId in vRequestHeaders){vRequest.setRequestHeader(vId,vRequestHeaders[vId]);
}try{if(!qxp.sys.Client.getInstance().isWebkit()){vRequest.setRequestHeader("Referer",window.location.href);
}var vResponseType=this.getResponseType();
if(vResponseType&&vRequest.overrideMimeType){vRequest.overrideMimeType(vResponseType);
}vRequest.send(this.getData());
}catch(ex){if(vLocalRequest){this.failedLocally();
}else{this.error("Failed to send data: "+ex,"send");
this.failed();
}return;
}if(!vAsynchronous){this._onreadystatechange();
}};
qxp.Proto.failedLocally=function(){if(this.getState()===qxp.constant.Net.STATE_FAILED){return;
}this.warn("Could not load from file: "+this.getUrl());
this.failed();
};
qxp.Proto._onreadystatechange=function(e){switch(this.getState()){case qxp.constant.Net.STATE_COMPLETED:case qxp.constant.Net.STATE_ABORTED:case qxp.constant.Net.STATE_FAILED:case qxp.constant.Net.STATE_TIMEOUT:if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Ignore Ready State Change");
}return;
}var vReadyState=this.getReadyState();
if(vReadyState==4){if(!qxp.io.remote.RemoteExchange.wasSuccessful(this.getStatusCode(),vReadyState,this._localRequest)){return this.failed();
}}while(this._lastReadyState<vReadyState){this.setState(qxp.io.remote.RemoteExchange._nativeMap[++this._lastReadyState]);
}};
qxp.Proto.getReadyState=function(){var vReadyState=null;
try{vReadyState=this._req.readyState;
}catch(ex){}return vReadyState;
};
qxp.Proto.setRequestHeader=function(vLabel,vValue){this._req.setRequestHeader(vLabel,vValue);
};
qxp.Proto.getResponseHeader=function(vLabel){var vResponseHeader=null;
try{this.getRequest().getResponseHeader(vLabel)||null;
}catch(ex){}return vResponseHeader;
};
qxp.Proto.getStringResponseHeaders=function(){var vSourceHeader=null;
try{var vLoadHeader=this._req.getAllResponseHeaders();
if(vLoadHeader){vSourceHeader=vLoadHeader;
}}catch(ex){}return vSourceHeader;
};
qxp.Proto.getResponseHeaders=function(){var vSourceHeader=this.getStringResponseHeaders();
var vHeader={};
if(vSourceHeader){var vValues=vSourceHeader.split(/[\r\n]+/g);
for(var i=0,l=vValues.length;i<l;i++){var vPair=vValues[i].match(/^([^:]+)\s*:\s*(.+)$/i);
if(vPair){vHeader[vPair[1]]=vPair[2];
}}}return vHeader;
};
qxp.Proto.getStatusCode=function(){var vStatusCode=-1;
try{vStatusCode=this.getRequest().status;
}catch(ex){}return vStatusCode;
};
qxp.Proto.getStatusText=function(){var vStatusText=qxp.constant.Core.EMPTY;
try{vStatusText=this.getRequest().statusText;
}catch(ex){}return vStatusText;
};
qxp.Proto.getResponseText=function(){var vResponseText=null;
var vStatus=this.getStatusCode();
var vReadyState=this.getReadyState();
if(qxp.io.remote.RemoteExchange.wasSuccessful(vStatus,vReadyState,this._localRequest)){try{vResponseText=this.getRequest().responseText;
}catch(ex){}}return vResponseText;
};
qxp.Proto.getResponseXml=function(){var vResponseXML=null;
var vStatus=this.getStatusCode();
var vReadyState=this.getReadyState();
if(qxp.io.remote.RemoteExchange.wasSuccessful(vStatus,vReadyState,this._localRequest)){try{vResponseXML=this.getRequest().responseXML;
}catch(ex){}}return vResponseXML;
};
qxp.Proto.getFetchedLength=function(){var vText=this.getResponseText();
return qxp.util.Validation.isValidString(vText)?vText.length:0;
};
qxp.Proto.getResponseContent=function(){if(this.getState()!==qxp.constant.Net.STATE_COMPLETED){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Transfer not complete, ignoring content!");
}return null;
}
if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Returning content for responseType: "+this.getResponseType());
}var vText=this.getResponseText();
switch(this.getResponseType()){case qxp.constant.Mime.TEXT:case qxp.constant.Mime.HTML:return vText;
case qxp.constant.Mime.JSON:try{return vText&&vText.length>0?qxp.io.Json.parseQx(vText):null;
}catch(ex){this.error("Could not execute json: ["+vText+"]",ex);
return "<pre>Could not execute json: \n"+vText+"\n</pre>";
}case qxp.constant.Mime.JAVASCRIPT:try{return vText&&vText.length>0?window.eval(vText):null;
}catch(ex){return this.error("Could not execute javascript: ["+vText+"]",ex);
}case qxp.constant.Mime.XML:return this.getResponseXml();
default:this.warn("No valid responseType specified ("+this.getResponseType()+")!");
return null;
}};
qxp.Proto._modifyState=function(propValue){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("State: "+propValue);
}
switch(propValue){case qxp.constant.Net.STATE_CREATED:this.createDispatchEvent(qxp.constant.Event.CREATED);
break;
case qxp.constant.Net.STATE_CONFIGURED:this.createDispatchEvent(qxp.constant.Event.CONFIGURED);
break;
case qxp.constant.Net.STATE_SENDING:this.createDispatchEvent(qxp.constant.Event.SENDING);
break;
case qxp.constant.Net.STATE_RECEIVING:this.createDispatchEvent(qxp.constant.Event.RECEIVING);
break;
case qxp.constant.Net.STATE_COMPLETED:this.createDispatchEvent(qxp.constant.Event.COMPLETED);
break;
case qxp.constant.Net.STATE_FAILED:this.createDispatchEvent(qxp.constant.Event.FAILED);
break;
case qxp.constant.Net.STATE_ABORTED:this.getRequest().abort();
this.createDispatchEvent(qxp.constant.Event.ABORTED);
break;
case qxp.constant.Net.STATE_TIMEOUT:this.getRequest().abort();
this.createDispatchEvent(qxp.constant.Event.TIMEOUT);
break;
}};
qxp.Proto.doNothing=function(){};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}var vRequest=this.getRequest();
if(vRequest){vRequest.onreadystatechange=this.doNothing;
switch(vRequest.readyState){case 1:case 2:case 3:vRequest.abort();
}this._req=null;
}return qxp.io.remote.AbstractRemoteTransport.prototype.dispose.call(this);
};




/* ID: qxp.io.Json */
qxp.OO.defineClass("qxp.io.Json");
qxp.Settings.setDefaultOfClass("qxp.io.Json","encodeUndefined",true);
qxp.Settings.setDefaultOfClass("qxp.io.Json","enableDebug",false);
qxp.io.Json=function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={'boolean':function(x){return String(x);
},number:function(x){return isFinite(x)?String(x):'null';
},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];
if(c){return c;
}c=b.charCodeAt();
return '\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}return '"'+x+'"';
},object:function(x){if(x){var a=[],b,f,i,l,v;
if(x instanceof Array){var beautify=qxp.io.Json._beautify;
a[0]='[';
if(beautify){qxp.io.Json._indent+=qxp.io.Json.BEAUTIFYING_INDENT;
a.push(qxp.io.Json._indent);
}l=x.length;
for(i=0;i<l;i+=1){v=x[i];
f=s[typeof v];
if(f){v=f(v);
if(typeof v=='string'){if(b){a[a.length]=',';
if(beautify){a.push(qxp.io.Json._indent);
}}a[a.length]=v;
b=true;
}}}
if(beautify){qxp.io.Json._indent=qxp.io.Json._indent.substring(0,qxp.io.Json._indent.length-qxp.io.Json.BEAUTIFYING_INDENT.length);
a.push(qxp.io.Json._indent);
}a[a.length]=']';
}else if(x instanceof Date){var dateParams=x.getUTCFullYear()+","+x.getUTCMonth()+","+x.getUTCDate()+","+x.getUTCHours()+","+x.getUTCMinutes()+","+x.getUTCSeconds()+","+x.getUTCMilliseconds();
return "new Date(Date.UTC("+dateParams+"))";
}else if(x instanceof Object){var beautify=qxp.io.Json._beautify;
a[0]='{';
if(beautify){qxp.io.Json._indent+=qxp.io.Json.BEAUTIFYING_INDENT;
a.push(qxp.io.Json._indent);
}
for(i in x){v=x[i];
f=s[typeof v];
if(f){v=f(v);
if(typeof v=='string'){if(b){a[a.length]=',';
if(beautify){a.push(qxp.io.Json._indent);
}}a.push(s.string(i),':',v);
b=true;
}}}
if(beautify){qxp.io.Json._indent=qxp.io.Json._indent.substring(0,qxp.io.Json._indent.length-qxp.io.Json.BEAUTIFYING_INDENT.length);
a.push(qxp.io.Json._indent);
}a[a.length]='}';
}else{return;
}return a.join('');
}return 'null';
},undefined:function(x){if(qxp.Settings.getValueOfClass("qxp.io.Json","encodeUndefined"))return 'null';
}};
return {copyright:'(c)2005 JSON.org',license:'http://www.JSON.org/license.html',stringify:function(v,beautify){this._beautify=beautify;
this._indent=this.BEAUTIFYING_LINE_END;
var f=s[typeof v];
var ret=null;
if(f){v=f(v);
if(typeof v=='string'){ret=v;
}}if(qxp.Settings.getValueOfClass("qxp.io.Json","enableDebug")){var logger=qxp.dev.log.Logger.getClassLogger(qxp.core.Object);
logger.debug("JSON request: "+ret);
}return ret;
},parse:function(text){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+text+')');
}catch(e){return false;
}}};
}();
qxp.io.Json.parseQx=function(text){if(qxp.Settings.getValueOfClass("qxp.io.Json","enableDebug")){var logger=qxp.dev.log.Logger.getClassLogger(qxp.core.Object);
logger.debug("JSON response: "+text);
}var obj=(text&&text.length>0)?eval('('+text+')'):null;
return obj;
};
qxp.io.Json.BEAUTIFYING_INDENT="  ";
qxp.io.Json.BEAUTIFYING_LINE_END="\n";




/* ID: qxp.io.remote.ScriptTransport */
qxp.OO.defineClass("qxp.io.remote.ScriptTransport",qxp.io.remote.AbstractRemoteTransport,function(){qxp.io.remote.AbstractRemoteTransport.call(this);
var vUniqueId=++qxp.io.remote.ScriptTransport._uniqueId;
if(vUniqueId>=2000000000){qxp.io.remote.ScriptTransport._uniqueId=vUniqueId=1;
}this._element=null;
this._uniqueId=vUniqueId;
});
qxp.Class._uniqueId=0;
qxp.Class._instanceRegistry={};
qxp.Class.ScriptTransport_PREFIX="_ScriptTransport_";
qxp.Class.ScriptTransport_ID_PARAM=qxp.Class.ScriptTransport_PREFIX+"id";
qxp.Class.ScriptTransport_DATA_PARAM=qxp.Class.ScriptTransport_PREFIX+"data";
qxp.Proto._lastReadyState=0;
qxp.io.remote.RemoteExchange.registerType(qxp.io.remote.ScriptTransport,"qxp.io.remote.ScriptTransport");
qxp.io.remote.ScriptTransport.handles={synchronous:false,asynchronous:true,crossDomain:true,fileUpload:false,responseTypes:[qxp.constant.Mime.TEXT,qxp.constant.Mime.JAVASCRIPT,qxp.constant.Mime.JSON]};
qxp.io.remote.ScriptTransport.isSupported=function(){return true;
};
qxp.Proto.send=function(){var vUrl=this.getUrl();
vUrl+=(vUrl.indexOf(qxp.constant.Core.QUESTIONMARK)>=0?qxp.constant.Core.AMPERSAND:qxp.constant.Core.QUESTIONMARK)+qxp.io.remote.ScriptTransport.ScriptTransport_ID_PARAM+qxp.constant.Core.EQUAL+this._uniqueId;
var vParameters=this.getParameters();
var vParametersList=[];
for(var vId in vParameters){if(vId.indexOf(qxp.io.remote.ScriptTransport.ScriptTransport_PREFIX)==0){this.error("Illegal parameter name. The following prefix is used internally by qooxdoo): "+qxp.io.remote.ScriptTransport.ScriptTransport_PREFIX);
}var value=vParameters[vId];
if(value instanceof Array){for(var i=0;i<value.length;i++){vParametersList.push(encodeURIComponent(vId)+qxp.constant.Core.EQUAL+encodeURIComponent(value[i]));
}}else{vParametersList.push(encodeURIComponent(vId)+qxp.constant.Core.EQUAL+encodeURIComponent(value));
}}
if(vParametersList.length>0){vUrl+=qxp.constant.Core.AMPERSAND+vParametersList.join(qxp.constant.Core.AMPERSAND);
}vData=this.getData();
if(vData!=null){vUrl+=qxp.constant.Core.AMPERSAND+qxp.io.remote.ScriptTransport.ScriptTransport_DATA_PARAM+qxp.constant.Core.EQUAL+encodeURIComponent(vData);
}qxp.io.remote.ScriptTransport._instanceRegistry[this._uniqueId]=this;
this._element=document.createElement("script");
this._element.charset="utf-8";
this._element.src=vUrl;
document.body.appendChild(this._element);
};
qxp.io.remote.ScriptTransport._numericMap={"uninitialized":1,"loading":2,"loaded":2,"interactive":3,"complete":4};
qxp.Proto._switchReadyState=function(vReadyState){switch(this.getState()){case qxp.constant.Net.STATE_COMPLETED:case qxp.constant.Net.STATE_ABORTED:case qxp.constant.Net.STATE_FAILED:case qxp.constant.Net.STATE_TIMEOUT:this.warn("Ignore Ready State Change");
return;
}while(this._lastReadyState<vReadyState){this.setState(qxp.io.remote.RemoteExchange._nativeMap[++this._lastReadyState]);
}};
qxp.Class._requestFinished=function(id,content){var vInstance=qxp.io.remote.ScriptTransport._instanceRegistry[id];
if(vInstance==null){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Request finished for an unknown instance (probably aborted or timed out before)");
}}else{vInstance._responseContent=content;
vInstance._switchReadyState(qxp.io.remote.ScriptTransport._numericMap.complete);
}};
qxp.Proto.setRequestHeader=function(vLabel,vValue){};
qxp.Proto.getResponseHeader=function(vLabel){return null;
};
qxp.Proto.getResponseHeaders=function(){return {};
};
qxp.Proto.getStatusCode=function(){return 200;
};
qxp.Proto.getStatusText=function(){return qxp.constant.Core.EMPTY;
};
qxp.Proto.getFetchedLength=function(){return 0;
};
qxp.Proto.getResponseContent=function(){if(this.getState()!==qxp.constant.Net.STATE_COMPLETED){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.warn("Transfer not complete, ignoring content!");
}return null;
}
if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Returning content for responseType: "+this.getResponseType());
}
switch(this.getResponseType()){case qxp.constant.Mime.TEXT:case qxp.constant.Mime.JSON:case qxp.constant.Mime.JAVASCRIPT:return this._responseContent;
default:this.warn("No valid responseType specified ("+this.getResponseType()+")!");
return null;
}};
qxp.Proto.dispose=function(){if(this.getDisposed()){return true;
}
if(this._element!=null){delete qxp.io.remote.ScriptTransport._instanceRegistry[this._uniqueId];
document.body.removeChild(this._element);
this._element=null;
}return qxp.io.remote.AbstractRemoteTransport.prototype.dispose.call(this);
};




/* ID: qxp.io.remote.RemoteResponse */
qxp.OO.defineClass("qxp.io.remote.RemoteResponse",qxp.core.Target,function(){qxp.core.Target.call(this);
});
qxp.OO.addProperty({name:"state",type:qxp.constant.Type.NUMBER});
qxp.OO.addProperty({name:"statusCode",type:qxp.constant.Type.NUMBER});
qxp.OO.addProperty({name:"content"});
qxp.OO.addProperty({name:"responseHeaders",type:qxp.constant.Type.OBJECT});
qxp.Proto.getResponseHeader=function(vHeader){var vAll=this.getResponseHeaders();
if(vAll){return vAll[vHeader]||null;
}return null;
};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}return qxp.core.Target.prototype.dispose.call(this);
};




/* ID: qxp.io.remote.RemoteRequestQueue */
qxp.OO.defineClass("qxp.io.remote.RemoteRequestQueue",qxp.core.Target,function(){qxp.core.Target.call(this);
this._queue=[];
this._active=[];
this._totalRequests=0;
this._timer=new qxp.client.Timer(50);
this._timer.addEventListener(qxp.constant.Event.INTERVAL,this._oninterval,this);
});
qxp.OO.addProperty({name:"maxTotalRequests",type:qxp.constant.Type.NUMBER});
qxp.OO.addProperty({name:"maxConcurrentRequests",type:qxp.constant.Type.NUMBER,defaultValue:3});
qxp.OO.addProperty({name:"defaultTimeout",type:qxp.constant.Type.NUMBER,defaultValue:5000});
qxp.Proto._debug=function(){var vText=this._active.length+"/"+(this._queue.length+this._active.length);
if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this.debug("Progress: "+vText);
window.status="Request-Queue Progress: "+vText;
}};
qxp.Proto._check=function(){this._debug();
if(this._queue.length==0){if(this._active.length==0){this._timer.stop();
}return ;
}var haveSyncRequest=!this._queue[0].isAsynchronous();
if(!haveSyncRequest){if(this._active.length>=this.getMaxConcurrentRequests()){return;
}if(this.getMaxTotalRequests()!=null&&this._totalRequests>=this.getMaxTotalRequests()){return;
}}var vRequest=this._queue.shift();
var vTransport=new qxp.io.remote.RemoteExchange(vRequest);
this._totalRequests++;
this._active.push(vTransport);
this._debug();
vTransport.addEventListener(qxp.constant.Event.SENDING,vRequest._onsending,vRequest);
vTransport.addEventListener(qxp.constant.Event.RECEIVING,vRequest._onreceiving,vRequest);
vTransport.addEventListener(qxp.constant.Event.COMPLETED,vRequest._oncompleted,vRequest);
vTransport.addEventListener(qxp.constant.Event.ABORTED,vRequest._onaborted,vRequest);
vTransport.addEventListener(qxp.constant.Event.TIMEOUT,vRequest._ontimeout,vRequest);
vTransport.addEventListener(qxp.constant.Event.FAILED,vRequest._onfailed,vRequest);
vTransport.addEventListener(qxp.constant.Event.SENDING,this._onsending,this);
vTransport.addEventListener(qxp.constant.Event.COMPLETED,this._oncompleted,this);
vTransport.addEventListener(qxp.constant.Event.ABORTED,this._oncompleted,this);
vTransport.addEventListener(qxp.constant.Event.TIMEOUT,this._oncompleted,this);
vTransport.addEventListener(qxp.constant.Event.FAILED,this._oncompleted,this);
vTransport._start=(new Date).valueOf();
vTransport.send();
if(this._queue.length>0){this._check();
}};
qxp.Proto._remove=function(vTransport){var vRequest=vTransport.getRequest();
vTransport.removeEventListener(qxp.constant.Event.SENDING,vRequest._onsending,vRequest);
vTransport.removeEventListener(qxp.constant.Event.RECEIVING,vRequest._onreceiving,vRequest);
vTransport.removeEventListener(qxp.constant.Event.COMPLETED,vRequest._oncompleted,vRequest);
vTransport.removeEventListener(qxp.constant.Event.ABORTED,vRequest._onaborted,vRequest);
vTransport.removeEventListener(qxp.constant.Event.TIMEOUT,vRequest._ontimeout,vRequest);
vTransport.removeEventListener(qxp.constant.Event.FAILED,vRequest._onfailed,vRequest);
vTransport.removeEventListener(qxp.constant.Event.SENDING,this._onsending,this);
vTransport.removeEventListener(qxp.constant.Event.COMPLETED,this._oncompleted,this);
vTransport.removeEventListener(qxp.constant.Event.ABORTED,this._oncompleted,this);
vTransport.removeEventListener(qxp.constant.Event.TIMEOUT,this._oncompleted,this);
vTransport.removeEventListener(qxp.constant.Event.FAILED,this._oncompleted,this);
qxp.lang.Array.remove(this._active,vTransport);
vTransport.dispose();
this._check();
};
qxp.Proto._activeCount=0;
qxp.Proto._onsending=function(e){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){this._activeCount++;
e.getTarget()._counted=true;
this.debug("ActiveCount: "+this._activeCount);
}};
qxp.Proto._oncompleted=function(e){if(qxp.Settings.getValueOfClass("qxp.io.remote.RemoteExchange","enableDebug")){if(e.getTarget()._counted){this._activeCount--;
this.debug("ActiveCount: "+this._activeCount);
}}this._remove(e.getTarget());
};
qxp.Proto._oninterval=function(e){var vActive=this._active;
if(vActive.length==0){this._timer.stop();
return;
}var vCurrent=(new Date).valueOf();
var vTransport;
var vRequest;
var vDefaultTimeout=this.getDefaultTimeout();
var vTimeout;
var vTime;
for(var i=vActive.length-1;i>=0;i--){vTransport=vActive[i];
vRequest=vTransport.getRequest();
if(vRequest.isAsynchronous()){vTimeout=vRequest.getTimeout();
if(vTimeout==0){continue;
}
if(vTimeout==null){vTimeout=vDefaultTimeout;
}vTime=vCurrent-vTransport._start;
if(vTime>vTimeout){this.warn("Timeout: transport "+vTransport.toHashCode());
this.warn(vTime+"ms > "+vTimeout+"ms");
vTransport.timeout();
}}}};
qxp.Proto.add=function(vRequest){vRequest.setState(qxp.constant.Event.QUEUED);
if(vRequest.isAsynchronous()){this._queue.push(vRequest);
}else{this._queue.splice(0,0,vRequest);
}this._check();
this._timer.start();
};
qxp.Proto.abort=function(vRequest){var vTransport=vRequest.getTransport();
if(vTransport){vTransport.abort();
}else if(qxp.lang.Array.contains(this._queue,vRequest)){qxp.lang.Array.remove(this._queue,vRequest);
}};
qxp.Proto.dispose=function(){if(this.getDisposed()){return true;
}
if(this._active){for(var i=0,a=this._active,l=a.length;i<l;i++){this._remove(a[i]);
}this._active=null;
}
if(this._timer){this._timer.stop();
this._timer.removeEventListener(qxp.constant.Event.INTERVAL,this._oninterval,this);
this._timer=null;
}this._queue=null;
return qxp.core.Target.prototype.dispose.call(this);
};
qxp.Class.getInstance=qxp.util.Return.returnInstance;




/* ID: qxp.client.Timer */
qxp.OO.defineClass("qxp.client.Timer",qxp.core.Target,function(vInterval){qxp.core.Target.call(this);
this.setEnabled(false);
if(qxp.util.Validation.isValidNumber(vInterval)){this.setInterval(vInterval);
}var o=this;
this.__oninterval=function(){o._oninterval();
};
});
qxp.OO.addProperty({name:"interval",type:qxp.constant.Type.NUMBER,defaultValue:1000});
qxp.Proto._intervalHandle=null;
qxp.Proto._modifyEnabled=function(propValue,propOldValue){if(propOldValue){window.clearInterval(this._intervalHandle);
this._intervalHandle=null;
}else if(propValue){this._intervalHandle=window.setInterval(this.__oninterval,this.getInterval());
}};
qxp.Proto.start=function(){this.setEnabled(true);
};
qxp.Proto.startWith=function(vInterval){this.setInterval(vInterval);
this.start();
};
qxp.Proto.stop=function(){this.setEnabled(false);
};
qxp.Proto.restart=function(){this.stop();
this.start();
};
qxp.Proto.restartWith=function(vInterval){this.stop();
this.startWith(vInterval);
};
qxp.Proto._oninterval=function(){if(this.getEnabled()){this.createDispatchEvent(qxp.constant.Event.INTERVAL);
}};
qxp.Proto.dispose=function(){if(this.getDisposed()){return;
}this.stop();
if(this._intervalHandler){window.clearInterval(this._intervalHandle);
this._intervalHandler=null;
}this.__oninterval=null;
return qxp.core.Target.prototype.dispose.call(this);
};
qxp.client.Timer.once=function(vFunction,vObject,vTimeout){var vTimer=new qxp.client.Timer(vTimeout);
vTimer.addEventListener(qxp.constant.Event.INTERVAL,function(e){vFunction.call(vObject,e);
vTimer.dispose();
vObject=null;
},vObject);
vTimer.start();
};

