/** I-Framework 0.4.1 **/
var J={
"def":function(name,body){if(typeof(body)=="object"){JClass.extend(body,JObject);}
var _classes=name.split(".");var parent=window;for(var i=0;i<_classes.length;i++){var _class=_classes[i];if(typeof(parent[_class])=="undefined"){parent[_class]=new Object();}
if(i==_classes.length-1){parent[_class]=body;}
else{parent=parent[_class];}}
},
"defined":function(varname){try{return(typeof(varname)=="undefined")?false:true;} catch(e){return false;}},
"eval":function(statement){eval(statement);},
"isNull":function(varname){if(!J.defined(varname)||varname==null){return true;}
return false;},
"debug":function(object){try{var win=window.open("",win,"width=320,height=240,scrollbars=yes");win.document.open();win.document.write("<ul>");for(var i in object){win.document.write("<li>"+i+"="+object[i]+"</li>")}
win.document.write("</ul>");win.document.close();} catch(e){alert(e);}},
"getVersion":function(){return JConfig.version;},
"getSessionId":function(){return "JSSESSID"+Math.random().toString().replace(".","").toUpperCase();},"x":{},"g":{}};
var JObject={
"getClass":function(){return this.constructor;},
"lookup":function(){var object=this;try{var win=window.open("",win,"width=320,height=240,scrollbars=yes");win.document.open();win.document.write("<ul>");for(var i in object){win.document.write("<li>"+i+"="+object[i]+"</li>")}
win.document.write("</ul>");win.document.close();} catch(e){alert(e);}},
"clone":function(){return JClass.extend({},this);},
"methods":function(){var array=new JArray();for(var _var in this){if(typeof(this[_var])=="function"){array.push(this[_var]);}}
return array;},
"inherited":function(body){return JClass.extend(body,this);},
"mixIn":function(other){JClass.extend(this,other);},
"toMap":function(){return new JMap(this);}};

function JArray(){JClass.extend(this,JObject);var array=new Array();if(arguments.length==0){array=new Array();}
else if(arguments.length==1&&typeof(arguments[0])=="object"){for(var i=0;i<arguments[0].length;i++){array.push(arguments[0][i]);}} else{for(var i=0;i<arguments.length;i++){array.push(arguments[i]);}}

this.contains=function(value,strict){var keys=this.keys(value,strict);return(keys.length==0)?false:true;};
this.keys=function(value,strict){var keys=new Array();if(!J.defined(strict)){strict=false;}
for(var i=0;i<array.length;i++){if((strict&&value===array[i])||(!strict&&value==array[i])){keys.push(i);}}
return keys;};
this.push=function(value){array.push(value);if(arguments.length>1){for(var i=1;i<arguments.length;i++){array.push(arguments[i]);}}
};
this.pop=function(){return array.pop();};
this.remove=function(index){var index=JInteger.parseInt(index);var _array=new JArray();if(array.length>=index+1&&index>-1){var j=0;for(var i=0;i<array.length;i++){if(i!=index){_array.push(array[i]);}}
}
else{_array=this;}
array=_array.values();};
this.values=function(){return array;};
this.length=function(){return array.length;};
this.get=function(index){if(index>this.length()){return null;}
return array[index];};
this.set=function(index,value){array[index]=value;};
this.sort=function(sortFunction){if(!J.defined(sortFunction)){var sortFunction=function(v1,v2){if(v1>v2){return 1;}
else if(v1==v2){return 0;}
else{return-1;}};}
array.sort(sortFunction);};
this.rsort=function(sortFunction){this.sort(sortFunction);this.reverse();};
this.asort=function(sortFunction){var indexes=new JArray();for(var i=0;i<array.length;i++){indexes.push(i);}
if(!J.defined(sortFunction)){sortFunction=function(e1,e2){if(e1<e2)return-1;if(e1>e2)return 1;return 0;};}
for(var i=0;i<array.length;i++){for(j=0;j<array.length;j++){if(j>0&&sortFunction(array[j-1],array[j])>0){this.swap(j,j-1);indexes.swap(j,j-1);}}
}
return indexes;};
this.arsort=function(sortFunction){var indexes=this.asort(sortFunction);this.reverse();indexes.reverse();return indexes;};
this.reverse=function(){array=array.reverse();return this;};
this.swap=function(index1,index2){var value1=this.get(index1);var value2=this.get(index2);this.set(index1,value2);this.set(index2,value1);};
this.clear=function(){array=new Array();};
this.toString=function(){return array.toString();};
this.unique=function(strict){var _array=new JArray();for(var i=0;i<array.length;i++){if(!_array.contains(array[i],strict)){_array.push(array[i]);}}
return _array;};
this.copy=function(){return new JArray(array);};
this.max=function(sortFunction){if(this.length()>0){var _array=this.copy();_array.rsort(sortFunction);return _array.get(0);}
return null;};
this.min=function(sortFunction){if(this.length()>0){var _array=this.copy();_array.sort(sortFunction);return _array.get(0);}
return null;};
this.empty=function(){return(array.length>0)?false:true;};
this.concat=function(){for(var i=0;i<arguments.length;i++){if(arguments[i] instanceof Array){array=array.concat(arguments[i]);}
else if(arguments[i] instanceof JArray){array=array.concat(arguments[i].values());}
else{array=array.concat(arguments[i]);}}
};
this.join=function(separator){return array.join(separator);};
this.shift=function(){return array.shift();};
this.unshift=function(){for(var i=0;i<arguments.length;i++){array.unshift(arguments[i]);}};
this.slice=function(start,length){if(!J.defined(length)){length=array.length;}
if(length<0){length=0;}
if(start<0){var newArray=array.slice(start).slice(0,length);}
else{var newArray=array.slice(start,start+length);}
return new JArray(newArray);};
this.splice=function(start,deleteCount){return new JArray(array.splice.apply(array,arguments));};
this.splice$=function(start,deleteCount){var array2=this.copy();array2.splice.apply(array2.values(),arguments);return array2;};
this.toMap=function(){var map=new JMap(array);return map;};
this.diff=function(array2){var _array=new JArray();this.each(function(k,v){if(!array2.include(v)){_array.push(v);}});return _array;};
this.intersect=function(array2){var _array=new JArray();this.each(function(k,v){if(array2.include(v)){_array.push(v);}});return _array;};};
JArray.range=function(start,end,step){return(new JRange(start,end,step)).toArray();};
var JClass={
"extend":function(jObject){var classNum=arguments.length-1;if(classNum>=1){for(var i=1;i<=classNum;i++){var source=arguments[i];if(typeof(source)=="object"){for(var property in source){try{jObject[property]=source[property];} catch(e){throw new Error("JClass.extend:get a error when set property:"+property);}}
}}
}
return jObject;},
"overload":function(obj,constructors){var o=new constructors();var types=new Array();var args=JClass.overload.caller.arguments;for(var i=0;i<args.length;i++){var matches=args[i].constructor.toString().match(/function([^\(]+)/);types.push(matches[1].toString().toJString().trim());}
var func=types.join("_");if(J.defined(o[func])){o[func].apply(obj,args);}},"$loadedClasses":{},
"importClass":function(_class,refresh){if(!J.defined(refresh)){refresh=false;}
if(!refresh&&J.defined(JClass.$loadedClasses[_class])){eval(JClass.$loadedClasses[_class]);return;}
var path="/"+_class.split("\.").join("/")+".js";var http=new JHttp(function(response){if(response.getState()==4){if(response.getCode()==200){eval(response.getText());JClass.$loadedClasses[_class]=response.getText();}}
});http.get(path,false);}};JClass.extend(JClass,JObject);

function JEntry(key,value){JClass.extend(this,JObject);
this.getKey=function(){return key;};
this.getValue=function(){return value;};};

Error.prototype.getMessage=function(){return this.message;};
Error.prototype.getLine=function(){if(J.defined(this.lineNumber)){return this.lineNumber;}
if(J.defined(this.number)){return this.number;}
return 0;};
Error.prototype.getType=function(){return this.name;};
Error.prototype.getFile=function(){if(J.defined(this.fileName)){return this.fileName;}
else{return window.location.toString();}};
Error.prototype.getStackTrace=function(){if(J.defined(this.stack)){return this.stack;}};
Error.prototype.toString=function(){return this.getType()+":"+this.getMessage();};var JException=Error;

function JFloat(number){JClass.extend(this,JObject);this.mixIn(JNumeric);if(!J.defined(number)){number=0.00;}
if(isNaN(number)){number=parseFloat(number);}

this.toString=function(){return number.toString();};
this.toNumber=function(){return number;};
this.toInt=function(){return parseInt(number,10);};};
JFloat.parseFloat=function(s){var s=parseFloat(s);if(isNaN(s))s=0;return s;};

function JInteger(number,radix){JClass.extend(this,JObject);this.mixIn(JNumeric);if(!J.defined(number)){number=0;}
if(!J.defined(radix)){radix=10;}
number=JInteger.parseInt(number,radix);
this.getNumber=function(){return number;};
this.times=function(func){var times=JInteger.parseInt(number);if(times<0){throw new Error("JInteger.times must be a number which greater than 0");return false;}
for(var i=1;i<=times;i++){func.call(i);}
return true;};
this.toString=function(){return this.getNumber().toString();};
this.toNumber=function(){return this.getNumber();};}

JInteger.rand=function(min,max){var _min=Math.min(min,max);var _max=Math.max(min,max);return _min+Math.floor(Math.random()*(_max+1-_min))};
JInteger.parseInt=function(s,radix){if(!J.defined(radix)){radix=10;}
var s=parseInt(s,radix);if(isNaN(s))s=0;return s;};
JInteger.parse=function(number,radix){return new JInteger(number,radix);};

Number.prototype.times=function(func){return JInteger.parse(this).times(func);};
Number.prototype.toInt=function(){return JInteger.parseInt(this);};
J.def("JIteratorBreak",function(){});J.def("JIteratorContinue",function(){});
function continue_i(){throw new JIteratorContinue();};
function break_i(){throw new JIteratorBreak();};var JIterator=JObject.inherited({
"each":function(iterator){if(typeof(iterator)!="function"){throw new Error(this.toString()+" each:iterator is not a function.");}
if(this instanceof JMap){var map=this;}
else{var map=this.toMap();}
var inner=map.getContainer();for(var k in inner){try{iterator.call(this,k,inner[k]);}
catch(e){if(e instanceof JIteratorBreak){break;}
else if(e instanceof JIteratorContinue){continue;}
else{throw e;}}
}},
"all":function(iterator){var flg=true;this.each(function(k,v){if(!iterator(k,v)){flg=false;break_i();}});return flg;},
"any":function(iterator){var flg=false;this.each(function(k,v){if(iterator(k,v)){flg=true;break_i();}});return flg;},
"collect":function(iterator){var array=new JArray();this.each(function(k,v){array.push(iterator(k,v));});return array;},
"find":function(iterator){var temp=null;this.each(function(k,v){if(iterator(k,v)){temp=new JEntry(k,v);break_i();}});return temp;},
"entries":function(){var entries=new JArray();this.each(function(k,v){entries.push(new JEntry(k,v));});return entries;},
"findAll":function(iterator){var entries=new JArray();this.each(function(k,v){if(iterator(k,v)){entries.push(new JEntry(k,v));}});return entries;},
"reject":function(iterator){var entries=new JArray();this.each(function(k,v){if(!iterator(k,v)){entries.push(new JEntry(k,v));}});return entries;},
"include":function(value){var entry=this.find(function(k,v){if(v==value){return true;}});return(entry==null)?false:true;},
"grep":function(pattern){if(!(pattern instanceof RegExp)){pattern=new RegExp(pattern);}
return this.findAll(function(k,v){return pattern.test(v);});},
"inject":function(memo,iterator){this.each(function(k,v){memo=iterator(memo,k,v);});return memo;}});JObject.mixIn(JIterator);

function JMap(object){JClass.extend(this,JObject);var inner={};if(typeof(object)=="object"){inner=object;}

this.put=function(key,value){inner[key]=value;};
this.get=function(key){if(J.defined(inner[key])){return inner[key];}
return null;};
this.clear=function(){inner={};};
this.isEmpty=function(){return(this.size()==0)?true:false;};this.empty=function(){return this.isEmpty();};
this.remove=function(key){if(J.defined(inner[key])){var _inner={};for(var p in inner){if(p!=key){_inner[p]=inner[p];}}
inner=_inner;}};
this.keySet=function(value,isStrict){if(!J.defined(isStrict)){isStrict=false;}
var set=new Array();for(var p in inner){if(!J.defined(value)){set.push(p);}
else{if((isStrict&&value===inner[p])||(!isStrict&&value==inner[p])){set.push(p);}}
}
return new JArray(set);};this.keys=function(value,isStrict){return this.keySet(value,isStrict);}

this.putAll=function(sourceMap){var set=sourceMap.keySet();for(var i=0;i<set.length;i++){this.put(set[i],sourceMap.get(set[i]));}};
this.size=function(){return this.keySet().length();};this.length=function(){return this.size();};
this.containsKey=function(key){var array=new JArray(this.keySet());return array.contains(key);};
this.getContainer=function(){return inner;};
this.toString=function(){return JSON.encode(inner);};
this.values=function(){var array=new JArray();this.each(function(k,v){array.push(v);});return array;};
this.shift=function(){var keys=this.keys();var shiftKey=keys.shift();return new JEntry(shiftKey,this.get(shiftKey));};
this.sort=function(sortFunction){var values=this.values();var keys=this.keys();var _keys=values.asort(sortFunction);var map=this;var _map=new JMap();_keys.each(function(k,v){var key=keys.get(v);var value=map.get(key);_map.put(key,value);});inner=_map.getContainer();};
this.reverse=function(){var keys=this.keys().reverse();var map=this;var _map=new JMap();keys.each(function(k,key){var value=map.get(key);_map.put(key,value);});inner=_map.getContainer();};
this.rsort=function(sortFunction){this.sort(sortFunction);this.reverse();};};
var JNumeric=JObject.inherited({
"ceil":function(){return Math.ceil(this.toNumber());},
"abs":function(){return Math.abs(this.toNumber());},
"floor":function(){return Math.floor(this.toNumber());},
"round":function(precision){var precision=JInteger.parseInt(precision);var number=this.toNumber();if(!J.defined(precision)||precision<=0){return Math.round(number);}
var re=new RegExp("([0-9]+).([0-9]{"+precision+"})([0-9])");var arr;if(arr=re.exec(number)){var _n=JInteger.parseInt(arr[3]);number=parseFloat(arr[1]+"."+arr[2]);if(_n>=5){number+=1/Math.pow(10,precision);}}
return number;},
"zero":function(){if(this.toNumber()==0){return true;}
return false;},
"step":function(end,step,iterator){(new JRange(this.toNumber(),end,step)).each(iterator);},
"isFinite":function(){return isFinite(this.toNumber());}});

function JRange(start,end,step){JClass.extend(this,JObject);if(!J.defined(step)){step=1;}
step=JInteger.parseInt(step);if(step<1){throw new SyntaxError("JRange:step is lower then 1");}
var type=typeof(start);var array=new JArray();if(typeof(end)!=type){throw new SyntaxError("JRange:arguments' type error");return array;}
if(type!="number"&&type!="string"){throw new SyntaxError("JRange:arguments' type is either number nor char");return array;}
if(type=="number"){if(start<end){for(var i=start;i<=end;i+=step){array.push(i);}}
else{for(var i=start;i>=end;i-=step){array.push(i);}}
}
if(type=="string"){if(start.length!=1||end.length!=1){throw new SyntaxError("JRange:arguments' type is either number nor char");return array;}
var code1=start.charCodeAt(0);var code2=end.charCodeAt(0);if(code1<code2){for(var i=code1;i<=code2;i+=step){array.push(String.fromCharCode(i));}}
else{for(var i=code1;i>=code2;i-=step){array.push(String.fromCharCode(i));}}
}

this.toMap=function(){return array.toMap();};
this.toString=function(){return array.toString();};
this.toArray=function(){return array;};
this.begin=function(){return start;};
this.end=function(){return end;};};

function JString(s){JClass.extend(this,JObject);var string=new String(s);
this.trim=function(){return this.replaceAll("(^\\s+)|(\\s+$)","");};
this.rtrim=function(){return this.replaceAll("(\\s+$)","");};
this.ltrim=function(){return this.replaceAll("(^\\s+)","");};
this.toString=function(){return string.toString();};
this.replaceAll=function(regexp,rep,mode){if(typeof rep=="undefined")rep="";if(typeof mode=="undefined")mode="g";var re=new RegExp(regexp,mode);var s=string.replace(re,rep);return new JString(s);};
this.urlEncode=function(){return new JString(encodeURIComponent(string));};
this.urlDecode=function(){return new JString(decodeURIComponent(string));};
this.nl2br=function(){return new JString(string.split("\n").join("<br \/>\n"));};
this.match=function(regexp,mode){if(typeof mode=="undefined")mode="g";var re=new RegExp(regexp,mode);var arr=re.exec(string);return new JArray(arr);};
this.length=function(flag){if(!J.defined(flag))flag=false;if(flag){return string.replace(/[^\x00-\xff]/g,"##").length;}
else{return string.length;}};
this.htmlEncode=function(){string=string.replace(/&/g,"&amp;");string=string.replace(/"/g,"&quot;");string=string.replace(/</g,"&lt;");string=string.replace(/>/g,"&gt;");string=string.replace(/'/g,"&#39;");return this;};
this.equals=function(jString){if(jString.toString()==this.toString()){return true;}
return false;};
this.append=function(s){string+=s;return this;};
this.clear=function(){string="";return this;};
this.insert=function(index,s){string=string.substr(0,index)+s+string.substr(index);return this;};
this.getChars=function(){return new JArray(string.split(""));};
this.substr=function(start,length){if(this.length()==0){return "";}
if(!J.defined(length)){length=this.length();}
if(start<0){if(Math.abs(start)>this.length()){start %=this.length();}
start+=this.length();}
return new JString(string.substr(start,length));};
this.startsWith=function(prefix){return(this.substr(0,prefix.length).toString()==prefix)?true:false;};
this.endsWith=function(suffix){return(this.substr(-suffix.length).toString()==suffix)?true:false;};
this.toMap=function(){return this.getChars().toMap();};};
JString.TRIM=1;
JString.RTRIM=2;
JString.LTRIM=3;

String.prototype.toJString=function(){return new JString(this);};
var JConfig=JObject.inherited({
"version":"J-Framework v0.4.1"
});

function JCookie(_name,_value){JClass.extend(this,JObject);var name=_name;var value=_value;var expiry=0;var path="";var domain="";var secure=false;
this.getName=function(){return name;};
this.getValue=function(){return value;};
this.getMaxAge=function(){return expiry;};
this.getDomain=function(){return domain;};
this.getPath=function(){return path;};
this.getSecure=function(){return secure;};
this.setValue=function(_value){value=_value;};
this.setMaxAge=function(_expiry){expiry=JInteger.parseInt(_expiry);};
this.setPath=function(_path){path=_path;};
this.setDomain=function(_domain){domain=_domain;};
this.setSecure=function(flag){secure=flag;};
this.add=function(){document.cookie=this.toString(true);};
this.toString=function(isEscape){if(!J.defined(isEscape)){isEscape=false;}
var _name=name;var _value=value;if(isEscape){_name=escape(name);_value=escape(value);}
var s="";if(expiry!=0){var date=new Date();date.setTime(date.getTime()+expiry*1000);s=";expires="+date.toGMTString();}
if(!path){path="/";}
var str="";if(!J.isNull(domain)&&domain!=""){str=_name+"="+_value+s+";domain="+domain+";path="+path+";";}
else{str=_name+"="+_value+s+";path="+path;}
if(secure){str+=";secure";}
return str;};
this.destroy=function(){this.setMaxAge(-1);this.add();};};

function JDate(format,time){JClass.extend(this,JObject);var date=new Date();if(!J.defined(format)){format="r";}
if(J.defined(time)){time=JInteger.parseInt(time);date.setTime(time);}
this.get=function(chr){if((chr>="a"&&chr<="z")||(chr>="A"&&chr<="Z")){var func="_parse_"+chr;if(this[func]){return this[func]();}}
return chr;};
this.parse=function(format){var result="";if(format.length>0){for(var i=0;i<format.length;i++){var chr=format.charAt(i);result+=this.get(chr);}}
return result;};
this.set=function(type,value){value=JInteger.parseInt(value);switch(type){case "d":date.setDate(value);break;case "Y":date.setFullYear(value);break;case "H":case "G":date.setHours(value);break;case "i":date.setMinutes(value);break;case "s":date.setSeconds(value);break;case "m":case "n":date.setMonth(value-1);break;}};this._parse_O=function(){var hours=(Math.abs(date.getTimezoneOffset()/60)).toString();if(hours.length==1){hours="0"+hours;}
return "+"+hours+"00";};this._parse_r=function(){return this.parse("D,d M Y H:i:s O");};this._parse_Y=function(){return date.getFullYear().toString();};this._parse_y=function(){var y=this._parse_Y();return y.substr(2);};this._parse_L=function(){var y=parseInt(this.parse("Y"));if(y%4==0&&(y%100>0||y%400==0)){return "1";}
return "0";};this._parse_m=function(){var n=this._parse_n();if(n.length<2){n="0"+n;}
return n;};this._parse_n=function(){return(date.getMonth()+1).toString();};this._parse_t=function(){var t=32-new Date(this.get("Y"),this.get("m")-1,32).getDate();return t;};this._parse_F=function(){var n=parseInt(this.parse("n"));var months=["","January","February","March","April","May","June","July","August","September","October","November","December"];return months[n];};this._parse_M=function(){var n=parseInt(this.parse("n"));var months=["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return months[n];};this._parse_w=function(){return date.getDay().toString();};this._parse_D=function(){var w=parseInt(this._parse_w());var days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return days[w];};this._parse_l=function(){var w=parseInt(this._parse_w());var days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return days[w];};this._parse_d=function(){var j=this._parse_j();if(j.length<2){j="0"+j;}
return j;};this._parse_j=function(){return date.getDate().toString();};this._parse_W=function(){var _date=new JDate();_date.set("m",1);_date.set("d",1);var w=parseInt(_date.parse("w"));var m=parseInt(this.parse("m"),10);var total=0;for(var i=1;i<m;i++){var date2=new JDate();date2.set("m",i);var t=parseInt(date2.parse("t"));total+=t;}
total+=parseInt(this.parse("d"),10);var w2=parseInt(this.parse("w"));total=total-w2+(w-1);if(w2!=0){var weeks=(total/7+1).toString();}
else{var weeks=(total/7).toString();}
if(weeks.length==1){weeks="0"+weeks;}
return weeks;};this._parse_z=function(){var m=parseInt(this.parse("m"),10);var total=0;for(var i=1;i<m;i++){var date2=new JDate();date2.set("m",i);var t=parseInt(date2.parse("t"));total+=t;}
total+=parseInt(this.parse("d"),10)-1;return total;};this._parse_i=function(){var i=date.getMinutes().toString();if(i.length<2){i="0"+i;}
return i;};this._parse_s=function(){var s=date.getSeconds().toString();if(s.length<2){s="0"+s;}
return s;};this._parse_H=function(){var H=this._parse_G();if(H.length<2){H="0"+H;}
return H;};this._parse_G=function(){return date.getHours().toString();};this._parse_h=function(){var h=this._parse_g();if(h.length<2){h="0"+h;}
return h;};this._parse_g=function(){var g=JInteger.parseInt(this._parse_G());if(g>12){g=g-12;}
return g.toString();};this._parse_U=function(){return this.getTime().toString();};this._parse_a=function(){var hour=this.parse("H");return(hour<12)?"am":"pm";};this._parse_A=function(){return this.parse("a").toUpperCase();};
this.getTime=function(){return Math.round(date.getTime()/1000);};
this.toString=function(){return this.parse(format);};};JDate.toTime=function(dateStr){if(arguments.length==1){return Date.parse(dateStr);} else if(arguments.length==3){arguments[1]=JInteger.parseInt(arguments[1])-1;return(new Date(arguments[0],arguments[1],arguments[2])).getTime();}};

function JEvent(event){JClass.extend(this,JObject);if(typeof(event)!="object"){if(J.defined(window.event)){event=window.event;}
else{return null;}}

this.getX=function(){return JInteger.parseInt(event.clientX)+JBody.getScrollX();};
this.getY=function(){return JInteger.parseInt(event.clientY)+JBody.getScrollY();};
this.getSource=function(){var targetElement=null;if(J.defined(event.target)){targetElement=event.target;}
else{targetElement=event.srcElement;}
if(targetElement==null){return null;}
while(targetElement.nodeType==3&&targetElement.parentNode!=null){targetElement=targetElement.parentNode;}
return targetElement;};
this.getKeyCode=function(){return event.keyCode;};
this.stop=function(){if(typeof event.stopPropagation!="undefined"){event.stopPropagation();}
else{event.cancelBubble=true;}};
this.isCtrlDown=function(){if(event.modifiers){return event.modifiers&Event.CONTROL_MASK;}
else{return event.ctrlKey;}};
this.isAltDown=function(){if(event.modifiers){return event.modifiers&Event.ALT_MASK;}
else{return event.altKey;}};
this.isShiftDown=function(){if(event.modifiers){return event.modifiers&Event.SHIFT_MASK;}
else{return event.shiftKey;}};
this.isMetaDown=function(){if(event.modifiers){return event.modifiers&Event.META_MASK;}
else{return false;}};};

function JListener(){var list=new JMap();var listeners=new JArray();
this.addActionListener=function(action,listener){var rawListener=function(event){if(typeof(JEvent)!="undefined"){var event=new JEvent(event);return listener.call(event.getSource(),event);}};list.put(listener,rawListener);this._addListener(listener);var object=this.getElement();if(object==null){object=this;}
if(J.defined(object.addEventListener)){object.addEventListener(action,rawListener,false);}
else if(J.defined(object.attachEvent)){object.attachEvent("on"+action,rawListener);}
else{eval("object."+"on"+action+"=rawListener");}};
this.removeActionListener=function(action,listener){var rawListener=list.get(listener);var object=this.getElement();if(object==null){object=this;}
if(rawListener!=null){if(J.defined(object.removeEventListener)){object.removeEventListener(action,rawListener,false);}
else if(J.defined(object.detachEvent)){object.detachEvent("on"+action,rawListener);}
else{object["on"+action]=null;}}
};
this.getListeners=function(){return listeners;};this._addListener=function(listener){if(!listeners.contains(listener)){listeners.push(listener);}};
this.registerEvent=function(events){var jobject=this;if(typeof(events)=="object"){var map=new JMap(events);map.each(function(k,v){var k=k.toLowerCase();if(k.substr(0,2)=="on"){k=k.substr(2);}
jobject.addActionListener(k,v);});}};};

function JHttp(listener){JClass.extend(this,JObject);if(!J.defined(listener)){listener=null;}
var stateListeners=null;this.http=null;
this.getHttp=function(){var http=null;if(typeof(XMLHttpRequest)!="undefined"){http=new XMLHttpRequest();}
if(typeof(ActiveXObject)!="undefined"){try{http=new ActiveXObject("Msxml2.XMLHTTP.4.0");} catch(e){try{http=new ActiveXObject("MSXML2.XMLHTTP");} catch(e){http=new ActiveXObject("Microsoft.XMLHTTP");}}
}
this.http=http;return http;};
this.register=function(_listeners){stateListeners=_listeners;};
this.addListener=function(_listener){listener=_listener;};this._listenResponse=function(response){if(typeof(stateListeners)!="object"||stateListeners==null){return false;}
var states=["uninitialized","loading","loaded","interactive","completed"];if(J.defined(stateListeners[states[response.getState()]])){stateListeners[states[response.getState()]](response);}};
this.post=function(url,args,async){var http=this.getHttp();var jhttp=this;if(!J.defined(args)){var args=null;}
if(!J.defined(async)){async=true;}
if(http!=null){http.onreadystatechange=function(){var response=jhttp.getResponse(http);if(listener!=null){listener(response);}
jhttp._listenResponse(response);}
http.open("post",url,async);http.setRequestHeader("Method","POST "+url+" HTTP/1.1");http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.send(args);}};
this.get=function(url,async){var http=this.getHttp();var jhttp=this;if(!J.defined(async)){async=true;}
if(http!=null){http.onreadystatechange=function(){var response=jhttp.getResponse(http);if(listener!=null){listener(response);}
jhttp._listenResponse(response);}
http.open("get",url,async);http.send(null);}};
this.abort=function(){if(this.http!=null){this.http.abort();}};
this.getResponse=function(http){return new JHttpResponse(http);};}


function JHttpResponse(http){
this.getState=function(){if(J.defined(http.readyState)){return http.readyState;}
return null;};
this.getCode=function(){if(this.getState()>2){return http.status;}
return null;};
this.getHeader=function(){if(J.defined(http.statusText)){return this.getCode()+" "+http.statusText;}
return null;};
this.getBody=function(format){if(!J.defined(format)){format="text";}
if(J.defined(http)){switch(format){case "text":return http.responseText;case "byte":return http.responseBody;case "stream":if(J.defined(http.responseStream)){return http.responseStream;}
return null;case "xml":return http.responseXML;}}
return null;};
this.getText=function(){return this.getBody("text");};};

function JHttpFramework(application){var keyword="do";var method="get";var gcKeys=new JArray();
this.setKeyword=function(_keyword){keyword=_keyword;};
this.setMethod=function(_method){method=_method.toLowerCase();};
this.loadModule=function(_application){application=_application;this.reset();this.init();};this.generateMethods=function(o){return function(url,args,asyc){var http=new JHttp(o);if(method=="post"){http.post(url,args,asyc);}
else{http.get(url,args,asyc);}}
};this.init=function(){for(var n in application){var o=application[n];if(typeof(o)=="function"&&(new JString(n.toLowerCase())).startsWith(keyword)){this[n]=this.generateMethods(o);gcKeys.push(n);}}
};
this.reset=function(){var framework=this;gcKeys.each(function(k,v){delete framework[v];});};};
var JRequest=JObject.inherited({
"getCookie":function(name){var cookies=this.getCookies();return cookies.get(name);},
"getCookies":function(){var cookies=document.cookie.split(";");var map=new JMap();for(var i=0;i<cookies.length;i++){var cookie=cookies[i].toJString().trim().toString();var pairs=cookie.split("=",2);var name=unescape(pairs[0]);var value=unescape(pairs[1]);map.put(name,new JCookie(name,value));}
return map;},
"getParameter":function(varName){var query=window.location.search;if(query!=null||query!=""){query=query.replace(/^\?+/,"");var qArray=query.split(/(&)|(&amp;)/);var len=qArray.length;if(len>0){for(var i=0;i<len;i++){var sArray=qArray[i].split("=",2);if(sArray[0]&&sArray[1]&&sArray[0]==varName){return unescape(sArray[1]);}}
}}
return null;},
"getRequestURL":function(){return document.URL;}});
var JResponse=JObject.inherited({
"addCookie":function(jCookie){jCookie.add();},
"sendRedirect":function(url){window.location=url;}});
var JSON=JObject.inherited({
"encode":function(s){switch(typeof(s)){case "string":return this._encodeString(s);case "number":return isFinite(s)? String(s):"null";case "boolean":return String(s);case "object":return this._encodeObject(s);}},
"decode":function(s,filter){try{if(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(s)){var j=eval("("+s+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==='object'){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i]);}}
}
return filter(k,v);}
return walk("",j);}
return j;}} catch(e){throw new SyntaxError("JSON.decode:the input is not a JSON string.");}},"_encodeString":function(s){var spChars={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'
};if(/["\\\x00-\x1f]/.test(s)){return '"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=spChars[b];if(c){return c;}
c=b.charCodeAt();return '\\u00'+Math.floor(c / 16).toString(16)+(c % 16).toString(16);})+'"';}
return '"'+s+'"';},"_encodeObject":function(s){switch(s.constructor){case Array:return this._encodeArray(s);case JArray:return this._encodeArray(s.values());case JMap:s=s.getContainer();return this._encodeObject(s);break;case JString:case String:s=s.toString();return this._encodeString(s);break;default:}
var a=['{'],b,i,v;function p(s){if(b){a.push(',');}
a.push(JSON.encode(i),':',s);b=true;}
for(i in s){if(s.hasOwnProperty(i)){v=s[i];switch(typeof v){case 'undefined':case 'function':case 'unknown':break;case 'object':if(v){if(JSON.encode(v)!="undefined"){p(JSON.encode(v));}} else{p("null");}
break;default:p(JSON.encode(v));}}
}
a.push('}');return a.join('');},"_encodeArray":function(s){var a=['['],b,i,l=s.length,v;function p(s){if(b){a.push(',');}
a.push(s);b=true;}
for(i=0;i<l;i+=1){v=s[i];switch(typeof v){case 'undefined':case 'function':case 'unknown':break;case 'object':if(v){if(JSON.encode(v)!="undefined"){p(JSON.encode(v));}} else{p("null");}
break;default:p(JSON.encode(v));}}
a.push(']');return a.join('');}});	
function $(id){return JElement.get(id);}

var JElement=JObject.inherited({
"get":function(id){var element=document.getElementById(id);if(typeof(element)=="object"){return element;}
return null;},
"create":function(tagName,id){var element=document.createElement(tagName);if(J.defined(id)){element.id=id;}
return element;},
"group":function(name){return new JArray(document.getElementsByName(name));},
"COM":function(input){if(typeof(input)=="string"){input=JElement.get(input);}
if(input==null){return null;}
if(typeof(input)=="object"&&J.defined(input.parentComponent)){return input;}
if(input!=null){var jObject=JObject.inherited({"object":null,"setElement":function(_object){this.object=_object;},"getElement":function(){return input;}});jObject.mixIn(JComponent);return jObject;}
return null;},
"is":function(object){if(typeof(object)=="object"){return true;}
return false;},
"getStyle":function(object,styleProp){var css=null;if(object.currentStyle){css=object.currentStyle;}
else if(window.getComputedStyle){css=document.defaultView.getComputedStyle(object,null);}
if(css!=null&&J.defined(css[styleProp])){return css[styleProp];}
return null;},
"getX":function(object){var positionX=0;var element=object;positionX+=element.offsetLeft;var parent=element.offsetParent;while(parent!=null){if(parent.tagName!="BODY"){positionX+=parent.offsetLeft+JInteger.parseInt(JElement.getStyle(parent,"borderLeftWidth"));}
parent=parent.offsetParent;}
return positionX;},
"getY":function(object){var positionY=0;var element=object;positionY+=element.offsetTop;var parent=element.offsetParent;while(parent!=null){if(parent.tagName!="BODY"){positionY+=parent.offsetTop+JInteger.parseInt(JElement.getStyle(parent,"borderTopWidth"));}
parent=parent.offsetParent;}
return positionY;},"getOffsetParent":function(object){if(JBrowser.isIE()){return object.parentElement;} else{return object.offsetParent;}},
"setEnabled":function(object,enabled){object.disabled=!enabled;},
"isEnabled":function(object){return!object.disabled;},
"setId":function(object,id){if(J.defined(id)){object.id=id;}},
"getId":function(object){if(object==null){return null;}
if(J.defined(object.id)){return object.id;}
return null;},
"setName":function(object,name){object.name=name;},
"getName":function(object){if(J.defined(object.name)){return object.name;}
return null;},
"setVisible":function(object,visibility){switch(visibility){case true:visibility="visible";this.setDisplay(object,true);break;case false:visibility="hidden";break;default:}
this.setStyle(object,"visibility",visibility);},
"setDisplay":function(object,display){switch(display){case true:display="";break;case false:display="none";break;default:}
this.setStyle(object,"display",display);},
"setStyle":function(object,attrName,property){var styleAttr="object.style."+attrName;try{eval("if(J.defined("+styleAttr+")){"+styleAttr+"=\""+property+"\";}");} catch(e){}},
"add":function(object,component,beforeElement){if(J.defined(component.getElement)&&(this.getId(object)==""||component.getId()==""||this.getId(object)!=component.getId())){if(!J.defined(beforeElement)){element=null;} else{element=beforeElement.getElement();}
if(component.getElement()==null){throw new Error("JElement.add:unvaliable component");}
object.insertBefore(component.getElement(),element);}},
"destroy":function(object){if(object==null){return;}
if(J.defined(object.parentNode)&&object.parentNode!=null){object.parentNode.removeChild(object);}},
"getText":function(object){if(J.defined(object.text))return object.text;if(J.defined(object.innerText))return object.innerText;if(J.defined(object.textContent))return object.textContent;return null;},
"setText":function(object,text){if(J.defined(object.text)){object.text=text;return true;}
if(J.defined(object.innerText)){object.innerText=text;return true;}
if(J.defined(object.textContent)){object.textContent=text;return true;}
return false;},
"getHTML":function(object){return object.innerHTML;},
"setHTML":function(object,html){try{object.innerHTML=html;} catch(e){}
return true;},
"appendText":function(object,text){object.appendChild(document.createTextNode(text));},
"getParent":function(object){return JElement.getOffsetParent(object);},
"setX":function(object,x){var x=JInteger.parseInt(x);var parent=this.getParent(object);if(parent!=null){var posStyle=JElement.getStyle(parent,"position").toString().toLowerCase();if(posStyle=="relative"||posStyle=="absolute"){var parentX=JElement.getX(parent)+JInteger.parseInt(JElement.getStyle(parent,"borderLeftWidth"));x=x-parentX;}}
this.setStyle(object,"left",x+"px");this.setStyle(object,"margin","0 0 0 0");},
"setY":function(object,y){var y=JInteger.parseInt(y);var parent=this.getParent(object);if(parent!=null){var posStyle=JElement.getStyle(parent,"position").toString().toLowerCase();if(posStyle=="relative"||posStyle=="absolute"){var parentY=JElement.getY(parent)+JInteger.parseInt(JElement.getStyle(parent,"borderTopWidth"));y=y-parentY;}}
this.setStyle(object,"top",y+"px");this.setStyle(object,"margin","0 0 0 0");},
"setWidth":function(object,width){this.setStyle(object,"width",JInteger.parseInt(width)+"px");},
"getWidth":function(object){return object.offsetWidth;},
"setHeight":function(object,height){this.setStyle(object,"height",JInteger.parseInt(height)+"px");},
"getHeight":function(object){return object.offsetHeight;},
"setLocation":function(object,x,y){if(!J.isNull(x)){this.setX(object,x);}
if(!J.isNull(y)){this.setY(object,y);}},
"getLocation":function(object){var x=this.getX(object);var y=this.getY(object);return {"x":x,"y":y};},
"setSize":function(object,width,height){if(!J.isNull(width)){this.setStyle(object,"width",JInteger.parseInt(width)+"px");}
if(!J.isNull(height)){this.setStyle(object,"height",JInteger.parseInt(height)+"px");}},
"getSize":function(object){var width=this.getWidth(object);var height=this.getHeight(object);return {"width":width,"height":height};},
"setBounds":function(object,x,y,width,height){this.setLocation(object,x,y);this.setSize(object,width,height);},
"getBounds":function(object){var x=this.getX(object);var y=this.getY(object);var width=this.getWidth(object);var height=this.getHeight(object);return {"x":x,"y":y,"width":width,"height":height};},
"setAbsolutePosition":function(object,absolute){if(absolute){this.setStyle(object,"position","absolute");}
else{this.setStyle(object,"position","relative");}},
"getAttribute":function(object,sName){return object.getAttribute(sName);},
"setAttribute":function(object,sName,vValue){object.setAttribute(sName,vValue);},
"getChilds":function(object){var nodes=object.childNodes;var _nodes=new JArray();for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType==1){_nodes.push(nodes[i]);}}
return _nodes;},
"getNextElement":function(object,element){if(!J.defined(element)){element=object;}
var s=element.nextSibling;if(J.defined(s)&&s.nodeType==1){return s;} else{return this.getNextElement(object,s);}},
"getPrevElement":function(object,element){if(!J.defined(element)){element=object;}
var s=element.previousSibling;if(J.defined(s)&&s.nodeType==1){return s;} else{return this.getPrevElement(object,s);}},
"clone":function(object,cloneChildren){var copy=new Object();if(!J.defined(cloneChildren)){cloneChildren=true;}
JClass.extend(copy,JComponent);copy.object=object.cloneNode(cloneChildren);return copy;},
"setTitle":function(object,title){object.title=title;},
"setFocus":function(object){object.focus();},
"getClass":function(object){return object.className;},
"setClass":function(object,className,isOverWrite){if(!J.defined(isOverWrite)||isOverWrite==true){object.className=className;}
else{var _className=this.getClass(object)+" "+className;object.className=_className;}},
"getScrollX":function(object){return JInteger.parseInt(object.scrollLeft);},
"getScrollY":function(object){return JInteger.parseInt(object.scrollTop);},
"getScrollWidth":function(object){return JInteger.parseInt(object.scrollWidth);},
"getScrollHeight":function(object){return JInteger.parseInt(object.scrollHeight);},
"scrollRight":function(object,x){if(!J.defined(x)){x=this.getWidth(object);}
object.scrollLeft=this.getScrollWidth(object)-x;},
"scrollDown":function(object,y){if(!J.defined(y)){y=this.getHeight(object);}
object.scrollTop=this.getScrollHeight(object)-y;},
"getCollection":function(object,type,value){switch(type){case "name":return new JArray(object.getElementsByName(value));case "tagName":return new JArray(object.getElementsByTagName(value));}},
"clear":function(object){var childs=JElement.getChilds(object);childs.each(function(k,child){object.removeChild(child);});JElement.setHTML(object,"");},
"clearHTML":function(object){JElement.clear(object);},
"containsPoint":function(object,x,y){var bounds=JElement.getBounds(object);if(bounds.x<=x&&bounds.x+bounds.width>=x&&bounds.y<=y&&bounds.y+bounds.height>=y){return true;}
return false;}});
var JElementFinder={
"getById":function(id){var _class=this;var object=JElement.get(id);if(object==null){return null;}
return new _class(object);},
"get":function(id){return this.getById(id);}};
var JComponent=JObject.inherited({"parentComponent":null,
"setEnabled":function(enabled){JElement.setEnabled(this.getElement(),enabled);},
"isEnabled":function(){return JElement.isEnabled(this.getElement());},
"setId":function(id){var object=JElement.get(id);if(object==null){JElement.setId(this.getElement(),id);}
else{this.setElement(object);}},
"getId":function(){return JElement.getId(this.getElement());},
"setName":function(name){JElement.setName(this.getElement(),name);},
"getName":function(){return JElement.getName(this.getElement());},
"setVisible":function(visibility){JElement.setVisible(this.getElement(),visiblility);},
"setDisplay":function(display){JElement.setDisplay(this.getElement(),display);},
"setStyle":function(attrName,property){JElement.setStyle(this.getElement(),attrName,property);},
"getStyle":function(styleProp){return JElement.getStyle(this.getElement(),styleProp);},
"add":function(component,beforeElement){JElement.add(this.getElement(),component,beforeElement);component.setParentComponent(this);if(J.defined(component.isAdded)){component.isAdded();}},
"destroy":function(){JElement.destroy(this.getElement());},
"getText":function(){return JElement.getText(this.getElement());},
"setText":function(text){return JElement.setText(this.getElement(),text);},
"appendText":function(text){return JElement.appendText(this.getElement(),text);},
"getHTML":function(){return JElement.getHTML(this.getElement());},
"setHTML":function(html){return JElement.setHTML(this.getElement(),html);},
"getParent":function(){return JElement.getParent(this.getElement());},
"setX":function(x){JElement.setX(this.getElement(),x);},
"getX":function(){return JElement.getX(this.getElement());},
"setY":function(y){JElement.setY(this.getElement(),y);},
"getY":function(){return JElement.getY(this.getElement());},
"setWidth":function(width){JElement.setWidth(this.getElement(),width);},
"getWidth":function(){return JElement.getWidth(this.getElement());},
"setHeight":function(height){JElement.setHeight(this.getElement(),height);},
"getHeight":function(){return JElement.getHeight(this.getElement());},
"setLocation":function(x,y){JElement.setLocation(this.getElement(),x,y);},
"getLocation":function(){return JElement.getLocation(this.getElement());},
"setSize":function(width,height){JElement.setSize(this.getElement(),width,height);},
"getSize":function(){return JElement.getSize(this.getElement());},
"setBounds":function(x,y,width,height){JElement.setBounds(this.getElement(),x,y,width,height);},
"getBounds":function(){return JElement.getBounds(this.getElement());},
"setAbsolutePosition":function(absolute){JElement.setAbsolutePosition(this.getElement(),absolute);},
"getAttribute":function(sName){return JElement.getAttribute(this.getElement(),sName);},
"setAttribute":function(sName,vValue){JElement.setAttribute(this.getElement(),sName,vValue);},
"getChilds":function(){return JElement.getChilds(this.getElement());},
"getNextElement":function(){return JElement.getNextElement(this.getElement());},
"getPrevElement":function(){return JElement.getPrevElement(this.getElement(),element);},
"clone":function(cloneChildren){return JElement.clone(this.getElement(),cloneChildren);},
"setTitle":function(title){JElement.setTitle(this.getElement(),title);},
"setFocus":function(){JElement.setFocus(this.getElement());},
"getClass":function(){return JElement.getClass(this.getElement());},
"setClass":function(className,isOverWrite){JElement.setClass(this.getElement(),className,isOverWrite);},
"getObject":function(){return this.getElement();},
"setObject":function(object){this.setElement(object);},
"getScrollX":function(){return JElement.getScrollX(this.getElement());},
"getScrollY":function(){return JElement.getScrollY(this.getElement());},
"getScrollWidth":function(){return JElement.getScrollWidth(this.getElement());},
"getScrollHeight":function(){return JElement.getScrollHeight(this.getElement());},
"scrollRight":function(x){JElement.scrollRight(this.getElement(),x);},
"scrollDown":function(y){JElement.scrollDown(this.getElement(),y);},
"getCollection":function(type,value){return JElement.getCollection(this.getElement(),type,value);},
"clearHTML":function(){JElement.clear(this.getElement());},
"clear":function(){this.clearHTML();},"setParentComponent":function(object){this.parentComponent=object;},
"getParentComponent":function(){return this.parentComponent;},
"containsPoint":function(x,y){return JElement.containsPoint(this.getElement(),x,y);}});JComponent.mixIn(new JListener());
var JBody=JComponent.inherited({
"getVisibleWidth":function(){var width1=100000,width2=100000,width3=100000;if(document.documentElement&&document.documentElement.clientWidth){width1=JInteger.parseInt(document.documentElement.clientWidth);}
if(window.innerWidth){width2=JInteger.parseInt(window.innerWidth);}
if(document.body&&document.body.clientWidth){width3=JInteger.parseInt(document.body.clientWidth);}
return Math.min(width1,width2,width3);},
"getVisibleHeight":function(){var height1=100000,height2=100000,height3=100000;if(document.documentElement&&document.documentElement.clientHeight){height1=JInteger.parseInt(document.documentElement.clientHeight);}
if(window.innerHeight){height2=JInteger.parseInt(window.innerHeight);}
if(document.body&&document.body.clientHeight){height3=JInteger.parseInt(document.body.clientHeight);}
return Math.min(height1,height2,height3);},
"getElement":function(){if(J.defined(document.compatMode)&&document.compatMode!="BackCompat"){return document.documentElement;}
else{return document.body;}},"setElement":function(element){}});
var JBrowser=JObject.inherited({
"isIE":function(){var ua=navigator.userAgent;var s="MSIE";var i;if((i=ua.indexOf(s))>=0){return true;}
return false;},
"isNS":function(){var ua=navigator.userAgent;var i;var s="Netscape6/";if((i=ua.indexOf(s))>=0){return true;}
s="Gecko";if((i=ua.indexOf(s))>=0){return true;}
return false;},
"getVersion":function(){var ua=navigator.userAgent;var s;var version;s="MSIE";if((i=ua.indexOf(s))>=0){version=parseFloat(ua.substr(i+s.length));return version;}
s="Netscape6/";if((i=ua.indexOf(s))>=0){version=parseFloat(ua.substr(i+s.length));return version;}
s="Gecko";if((i=ua.indexOf(s))>=0){return 6.1;}}
});
var JDocument=JObject.inherited({
"getElement":function(){return document;},"setElement":function(element){},
"getDomain":function(){return document.domain;}});JDocument.mixIn(new JListener());
var JWindow=JObject.inherited({
"getElement":function(){return window;},
"setElement":function(element){}});JWindow.mixIn(new JListener());