joo.classLoader.prepare("package joo.html",[

"import joo.lang.JOObject",
"import joo.html.EventType",
"import joo.html.Offset",
"import joo.util.FunctionUtil",""],







"public class Event2 extends JOObject",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Browser,Node,EventType);},

"public static function createAfterDispatchHandler",function(handler){
return function(event){
if(Browser.ENGINE==Browser.ENGINE_IE6||Browser.ENGINE==Browser.ENGINE_IE7){

event.clonePeer();
}
FunctionUtil.invokeLater(handler,[event]);
};
},








"public function Event2",function(ownerDocument,event,time){this[$super]();
if(!event)
throw new Error("Wrapped event must be defined, not "+event+".");
switch(event.type){
case"focusin":this[$type]=EventType.FOCUS;break;
case"focusout":this[$type]=EventType.BLUR;break;
default:
this[$type]=EventType.fromString(event.type);
if(!this[$type])
throw new Error("Unknown event type "+event.type+".");
}
this[$ownerDocument]=ownerDocument;
this[$peer]=event;
this[$time]=time;
},

"public function getPeer",function(){
return this[$peer];
},

"public function getOwnerDocument",function(){
return this[$ownerDocument];
},

"public function getType",function(){
return this[$type];
},

"public function getTime",function(){
return this[$time];
},

"public function getTarget",function(){
if(!this[$target]){
var target=this[$peer].target||this[$peer].srcElement;
if(!target)
return null;
if(target.nodeType==Node.TEXT_NODE){
target=target.parentNode;
}
this[$target]=this[$ownerDocument].getElement(target);
}
return this[$target];
},

"public function getClientX",function(){
return this[$peer].clientX;
},

"public function getClientY",function(){
return this[$peer].clientY;
},

"public function getScreenX",function(){
return this[$peer].screenX;
},

"public function getScreenY",function(){
return this[$peer].screenY;
},

"public function getPageX",function(){
return this[$peer].clientX+this[$ownerDocument].scrollContainer.scrollLeft;
},

"public function getPageY",function(){
return this[$peer].clientY+this[$ownerDocument].scrollContainer.scrollTop;
},

"public function getPageOffset",function(){
return new Offset(this.getPageX(),this.getPageY());
},

"public function getKeyCode",function(){
return this[$peer].keyCode;
},

"public function isCtrlKeyPressed",function(){
return this[$peer].ctrlKey;
},

"public function isAltKeyPressed",function(){
return this[$peer].altKey;
},

"public function isMetaKeyPressed",function(){
return this[$peer].metaKey;
},


"public function isCtrlLeftPressed",function(){
return this[$peer].ctrlLeft;
},

"public function isShiftKeyPressed",function(){
return this[$peer].shiftKey;
},

"public function isShiftLeftPressed",function(){
return this[$peer].shiftLeft;
},





"public function preventDefault",function(){
if(typeof this[$peer].preventDefault=="function"){
this[$peer].preventDefault();
}else{
this[$peer].returnValue=false;
}
},




"public function stopPropagation",function(){
if(typeof this[$peer].preventDefault=="function"){
this[$peer].stopPropagation();
}else{
this[$peer].cancelBubble=true;
}
},

"internal function clonePeer",function(){
var peer={};
for(var m in this[$peer]){
var propValue=this[$peer][m];
if(typeof propValue!="function"){
peer[m]=propValue;
}
}
this[$peer]=peer;
},

"public override function toString",function(){
return this.constructor["$class"]["fullClassName"]+"[peer: "+this[$peer]+
", time: "+this.getTime()+
", target: "+this.getTarget()+
", key: "+String.fromCharCode(this.getKeyCode())+
", keycode: "+this.getKeyCode()+
", type: "+this.getType()+
", shift: "+this.isShiftKeyPressed()+
", ctrl: "+this.isCtrlKeyPressed()+
", alt: "+this.isAltKeyPressed();
},

"private var",{ownerDocument: undefined},
"private var",{peer: undefined},
"private var",{time: undefined},
"private var",{type: undefined},
"private var",{target: undefined},
];},["createAfterDispatchHandler"]
);joo.classLoader.prepare("package joo.css",[""],

"public class URL",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"private static const",{NONE_STRING:"none"},
"public static const",{NONE:function(){return(new URL(null));}},

"private static const",{TO_STRING:function(){return(["url(",")"]);}},
"private static const",{REG_EXP:/url\(("|')?([^"]*)("|')?\)/},

"public static function fromString",function(string){
if(!string||string==NONE_STRING)
return NONE;
var match=string.match(REG_EXP);
return match?new URL(match[2]):undefined;
},

"public static function asString",function(url){
return url?TO_STRING.join(url):NONE_STRING;
},

"public function URL",function(url){this[$super]();
this.url=url;
},

"public function toString",function(){
return this.url?TO_STRING.join(this.url):NONE_STRING;
},

"public var",{url: undefined},
];},["fromString","asString"]
);joo.classLoader.prepare("package joo.css",[""],

"public class PrimitiveValue",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"private static const",{PRIMITIVE_TYPE_NAMES:function(){return([
"[UNKNOWN]",
"",
"%",
"em",
"ex",
"px",
"cm",
"mm",
"in",
"pt",
"pc",
"deg",
"rad",
"grad",
"ms",
"s",
"hz",
"khz",
"dimension",
"string",
"url(\"{0}\")",
"ident",
"attr",
"counter",
"rect({0} {1} {2} {3})",
"rgb({0},{1},{2})"
]);}},

"private static const",{PRIMITIVE_TYPE_BY_NAME:function(){return((function(){
var ptbn={};
for(var i=0;i<PRIMITIVE_TYPE_NAMES.length;++i){
ptbn[PRIMITIVE_TYPE_NAMES[i]]=i;
}
return ptbn;
})());}},

"public static function getPrimitiveTypeFromUnit",function(unit){
return PRIMITIVE_TYPE_BY_NAME[unit];
},

"public static const",{AUTO:"auto"},

"public static const",{INHERIT:"inherit"},

"public function PrimitiveValue",function(primitiveType){this[$super]();
this.primitiveType=primitiveType;
},

"public function getPrimitiveType",function(){
return this.primitiveType;
},

"public function getUnit",function(){
return PRIMITIVE_TYPE_NAMES[this.primitiveType];
},

"public var",{primitiveType: undefined},
];},["getPrimitiveTypeFromUnit"]
);joo.classLoader.prepare("package joo.css.webkit",[

"import joo.util.RegExpUtil",
"import joo.css.FloatValue",""],




"public class Scale",function($jooPublic,$jooPrivate){with(joo.css.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(FloatValue);},

"public static const",{NAME:"scale"},
"public static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+NAME+"\\("+FloatValue.REG_EXP_STR+"(,\\s*"+FloatValue.REG_EXP_STR+")?\\),?"));}},

"public static function fromMatch",function(match){
return new Scale(Number(match[1]),match[3]?Number(match[3]):undefined);
},

"public var",{sx: undefined},
"public var",{sy: undefined},

"public function Scale",function(sx,sy){this[$super]();
this.sx=sx;
this.sy=sy||sx;
},

"public function toString",function(){
var sb=[NAME,"(",this.sx];
if(this.sy!=this.sx){
sb.push(",",this.sy);
}
sb.push(")");
return sb.join("");
},

];},["fromMatch"]
);joo.classLoader.prepare("package joo.html.webkit",[

"import joo.html.Event2",
"import joo.html.Document2",
"import joo.html.webkit.WebKitEventType",""],

"public class WebKitEvent2 extends Event2",function($jooPublic,$jooPrivate){with(joo.html.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(WebKitEventType);},

"public function WebKitEvent2",function(ownerDocument,event,time){
this[$super](ownerDocument,event,time);
},

"public function getIdentifier",function(){
return this.getPeer()["identifier"];
},

"public function getTouchCount",function(){
return this.getPeer().touches.length;
},

"public function getTouch",function(index){
if(index<this.getTouchCount()){
var touch=this.getPeer().touches[index];
touch["type"]=WebKitEventType.TOUCH.toString();
return new WebKitEvent2(this.getOwnerDocument(),touch,this.getTime());
}
return null;
},

"public function getScale",function(){
return this.getPeer()["scale"];
},

"public function getRotation",function(){
return this.getPeer()["rotation"];
},
];},[]
);joo.classLoader.prepare("package joo.html",[""],

"public class Offset",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static var",{HOME:function(){return(new Offset(0,0));}},

"public function Offset",function(left,top){this[$super]();
this.left=left;
this.top=top;
},

"public static function getOffset",function(offsetOrLeft,top){
if(typeof top=="number"){
return new Offset(offsetOrLeft,top);
}
return offsetOrLeft;
},

"public function clone",function(){
return new Offset(this.left,this.top);
},

"public function plusOffset",function(offset){
return new Offset(this.left+offset.left,this.top+offset.top);
},

"public function plus",function(left,top){
return new Offset(this.left+left,this.top+top);
},

"public function minusOffset",function(offset){
return new Offset(this.left-offset.left,this.top-offset.top);
},

"public function minus",function(left,top){
return new Offset(this.left-left,this.top-top);
},

"public function getDistance",function(){
return Math.sqrt(this.left*this.left+this.top*this.top);
},

"public function scale",function(factor){
return new Offset(this.left*factor,this.top*factor);
},

"public function isHome",function(){
return this.left==0&&this.top==0;
},

"public function toString",function(){
return[this.left,"px ",this.top,"px"].join("");
},

"public var",{left: undefined},
"public var",{top: undefined},
];},["getOffset"]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class Cursor extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},





"public static const",{AUTO:function(){return(new Cursor("auto"));}},



"public static const",{DEFAULT:function(){return(new Cursor("default"));}},



"public static const",{POINTER:function(){return(new Cursor("pointer"));}},



"public static const",{NONE:function(){return(new Cursor("none"));}},



"public static const",{CROSSHAIR:function(){return(new Cursor("crosshair"));}},



"public static const",{TEXT:function(){return(new Cursor("text"));}},



"public static function fromString",function(string){
return ITEMS[string];
},

"public function Cursor",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.html.Browser",
"import joo.util.PropertyAware",
"import joo.css.Background",
"import joo.css.BackgroundRepeat",
"import joo.css.BackgroundPosition",
"import joo.css.Color",
"import joo.css.Colors",
"import joo.css.Overflow",
"import joo.css.Border",
"import joo.css.BorderStyle",
"import joo.css.BorderStyles",
"import joo.css.Cursor",
"import joo.css.Length",
"import joo.css.Display",
"import joo.css.Position",
"import joo.css.URL",
"import joo.css.Widths",""],

"public class Style2",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Browser);},

"public function Style2",function(style){
this[$super]();
this.style=style;
},

"public function getDisplay",function(){
return Display.fromString(this.style.display);
},

"public function setDisplay",function(display){
this.style.display=display.toString();
return this;
},

"public function getColor",function(){
return Color.fromString(this.style.color);
},

"public function setColor",function(color){
this.style.color=color?color.toString():"";
return this;
},

"public function getBackground",function(){
return Background.fromString(this.style.background);
},

"public function setBackground",function(background){
this.style.background=background.toString();
return this;
},

"public function getBackgroundColor",function(){
return Color.fromString(this.style.backgroundColor);
},

"public function setBackgroundColor",function(backgroundColor){
this.style.backgroundColor=backgroundColor?backgroundColor.toString():"";
return this;
},

"public function getBackgroundImage",function(){
return URL.fromString(this.style.backgroundImage);
},

"public function setBackgroundImage",function(backgroundImage){
this.style.backgroundImage=backgroundImage.toString();
return this;
},

"public function getBackgroundRepeat",function(){
return BackgroundRepeat.fromString(this.style.backgroundRepeat);
},

"public function setBackgroundRepeat",function(backgroundRepeat){
this.style.backgroundRepeat=backgroundRepeat.toString();
return this;
},

"public function getBackgroundPosition",function(){
return BackgroundPosition.fromString(this.style.backgroundPosition);
},

"public function setBackgroundPosition",function(backgroundPosition){
this.style.backgroundPosition=backgroundPosition.toString();
return this;
},

"public function getBorder",function(){
return Border.fromString(this.style.border);
},

"public function setBorder",function(border){
this.style.border=border.toString();
return this;
},

"public function getBorderWidth",function(){
return Length.fromString(this.style.borderWidth);
},

"public function setBorderWidth",function(borderWidth){
this.style.borderWidth=borderWidth.toString();
return this;
},

"public function getBorderWidths",function(){
return Widths.fromString(this.style.borderWidth);
},

"public function setBorderWidths",function(borderWidth){
this.style.borderWidth=borderWidth.toString();
return this;
},

"public function getBorderColor",function(){
return Color.fromString(this.style.borderColor);
},

"public function setBorderColor",function(borderColor){
this.style.borderColor=borderColor?borderColor.toString():"";
return this;
},

"public function getBorderColors",function(){
return Colors.fromString(this.style.borderColor);
},

"public function setBorderColors",function(borderColor){
this.style.borderColor=borderColor.toString();
return this;
},

"public function getBorderStyle",function(){
return BorderStyle.fromString(this.style.borderStyle);
},

"public function setBorderStyle",function(borderStyle){
this.style.borderStyle=borderStyle.toString();
return this;
},

"public function getBorderStyles",function(){
return BorderStyles.fromString(this.style.borderStyle);
},

"public function setBorderStyles",function(borderStyles){
this.style.borderStyle=borderStyles.toString();
return this;
},

"public function getCursor",function(){
return Cursor.fromString(this.style.cursor);
},

"public function setCursor",function(cursor){
this.style.cursor=cursor.toString();
return this;
},

"public function getOverflow",function(){
return Overflow.fromString(this.style.overflow);
},

"public function setOverflow",function(overflow){
this.style.overflow=overflow.toString();
},

"private static const",{IE_ALPHA_REG_EXP:/progid:DXImageTransform.Microsoft.Alpha\(opacity=([0-9]+)\)/},

"public function getOpacity",function(){
if(Browser.SUPPORTS_OPACITY){
var opacity=this.style.opacity;
if(opacity){
return Number(opacity);
}
}else if(Browser.SUPPORTS_FILTERS){
var match=this.style.filter.match(IE_ALPHA_REG_EXP);
if(match){
return Number(match[0])/100;
}
}
return 1;
},

"public function setOpacity",function(opacity){
if(Browser.SUPPORTS_OPACITY){
this.style.opacity=String(opacity);
}else if(Browser.SUPPORTS_FILTERS){
opacity=Math.round(opacity*100);





this.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+")";

}
return this;
},

"public function getPosition",function(){
return Position.fromString(this.style.position);
},

"public function setPosition",function(position){
this.style.position=position.toString();
return this;
},

"public function getTop",function(){
return Length.fromString(this.style.top);
},

"public function setTop",function(top){
this.style.top=top.toString();
return this;
},

"public function getLeft",function(){
return Length.fromString(this.style.left);
},

"public function setLeft",function(left){
this.style.left=left.toString();
return this;
},

"public function getWidth",function(){
return Length.fromString(this.style.width);
},

"public function setWidth",function(width){
this.style.width=width.toString();
return this;
},

"public function getHeight",function(){
return Length.fromString(this.style.height);
},

"public function setHeight",function(height){
this.style.height=height.toString();
return this;
},

"public function setLineHeight",function(lineHeight){
this.style.lineHeight=lineHeight.toString();
return this;
},

"public function getMarginTop",function(){
return Length.fromString(this.style.marginTop);
},

"public function setMarginTop",function(marginTop){
this.style.marginTop=marginTop.toString();
return this;
},

"public function getFontSize",function(){
return Length.fromString(this.style.fontSize);
},

"public function setFontSize",function(fontSize){
this.style.fontSize=fontSize.toString();
return this;
},

"public function getZIndex",function(){
return this.style.zIndex==""?undefined:parseInt(this.style.zIndex);
},

"public function setZIndex",function(zIndex){
this.style.zIndex=String(zIndex);
return this;
},

"public function getAttribute",function(name){
return PropertyAware.getProperty(this,name);
},

"public function setAttribute",function(name,value){
this.style[name]=String(value);
return this;
},

"public function removeAttribute",function(name){
delete this.style[name];
return this;
},

"public function setAttributes",function(styleAttributes){
for(var s in styleAttributes){
this.style[s]=styleAttributes[s];
}
return this;
},

"public function populate",function(element){
if("cssText"in element.style){
element.style.cssText=this.toString();
}else{
element.setAttribute("style",this.toString());
}
return this;
},

"private static const",{PROP2ATTR:/([A-Z])/g},
"private static function prop2Attr",function(c){
return"-"+c.toLowerCase();
},

"public function toString",function(){
if("cssText"in this.style){
return this.style.cssText;
}
var sb=[];
for(var s in this.style){
if(s!="cssText"){
var attr=s.replace(PROP2ATTR,prop2Attr);
sb.push(attr,":",this.style[s],";");
}
}
return sb.join("");
},

"internal static function fillInProperties",function(string,bean,property2Class){
var parts=string.split(" ");
for(var i=0;i<parts.length;++i){
var part=parts[i];
for(var property in property2Class){
var value=property2Class[property]["fromString"](part);
if(typeof value!="undefined"){
bean[property]=value;
break;
}
}
}
},

"internal static function propertiesToString",function(){
var result=[];
for(var i=0;i<arguments.length;++i){
if(arguments[i])
result.push(arguments[i]);
}
return result.join(" ");
},

"protected var",{style: undefined},

];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.NodeList2",""],

"public class DelegatingNodeList2 implements NodeList2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"private var",{ownerDocument: undefined},
"private var",{nodes: undefined},

"public function DelegatingNodeList2",function(ownerDocument,nodes){this[$super]();
this[$ownerDocument]=ownerDocument;
this[$nodes]=nodes;
},

"public function getLength",function(){
return this[$nodes].length;
},

"public function item",function(index){
return this[$ownerDocument].getNode(this[$nodes].item(index));
},
];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.Document2",
"import joo.html.EventType",""],

"public class Window2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(EventType);},

"public static const",{INSTANCE:function(){return(new Window2(window));}},

"public static function getInstance",function(currentWindow){
if(!currentWindow||currentWindow==window){
return INSTANCE;
}
return new Window2(currentWindow);
},

"private var",{peer: undefined},

"public function Window2",function(window){this[$super]();
this[$peer]=window;
},

"public function getPeer",function(){
return this[$peer];
},

"public function getDocument",function(){
return Document2.getInstance(this[$peer].document);
},

"public function getParent",function(){
return getInstance(this[$peer].parent);
},

"public function getTop",function(){
return getInstance(this[$peer].top);
},

"public function getFrameElement",function(){
return this[$peer].frameElement
?Document2.getInstance(this[$peer].parent.document).getElement(this[$peer].frameElement)
:null;
},

"public function getStatus",function(){
return this[$peer].status;
},

"public function setStatus",function(status){
this[$peer].status=status;
return this;
},

"public function focus",function(){
this[$peer].focus();
return this;
},
"public function addEventListener",function(eventType,listener,capture){
var peer=this[$peer];
listener=this.getDocument().createEventHandler(listener);
if(typeof peer.addEventListener=="function"){
peer.addEventListener(eventType.toString(),listener,capture);
}else{

var attachee=peer;
if(eventType===EventType.FOCUS||eventType===EventType.BLUR){

eventType=eventType===EventType.FOCUS?"focusin":"focusout";
attachee=peer.document;
}
attachee["attachEvent"]("on"+eventType,listener);
}
},


];},["getInstance"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.Length",""],

"public class Widths",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static function fromString",function(string){
var parts=string.split(" ");
for(var i=0;i<parts.length;++i){
parts[i]=Length.fromString(parts[i]);
}
switch(parts.length){
case 1:return new Widths(parts[0],parts[0],parts[0],parts[0]);
case 2:return new Widths(parts[0],parts[1],parts[0],parts[1]);
case 4:return new Widths(parts[0],parts[1],parts[2],parts[3]);
}
return undefined;
},

"public var",{top: undefined},
"public var",{right: undefined},
"public var",{bottom: undefined},
"public var",{left: undefined},

"public function Widths",function(
top,
right,
bottom,
left
){this[$super]();
this.top=top;
this.right=right;
this.bottom=bottom;
this.left=left;
},

"public function toString",function(){
return[this.top,this.right,this.bottom,this.left].join(" ");
},
];},["fromString"]
);joo.classLoader.prepare("package joo.html",[""],
"public interface NodeList2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

,

,
];},[]
);joo.classLoader.prepare("package joo.html",[""],
"public class Browser",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static const",{USER_AGENT:function(){return(window.navigator["userAgent"]);}},
"public static const",{ENGINE_IE6:"ie6"},
"public static const",{ENGINE_IE7:"ie7"},
"public static const",{ENGINE_GECKO:"gecko"},
"public static const",{ENGINE_OPERA:"opera"},
"public static const",{ENGINE_WEBKIT419:"webkit419"},
"public static const",{ENGINE_WEBKIT420:"webkit420"},
"public static const",{ENGINE_UNKNOWN:"unknown"},
"public static const",{ENGINE:function(){

if("ActiveXObject"in window){
return"XMLHttpRequest"in window?ENGINE_IE7:ENGINE_IE6;
}
if("childNodes"in window.document&&!window.document["all"]&&!("taintEnabled"in window.navigator))
return"xpath"in window?ENGINE_WEBKIT420:ENGINE_WEBKIT419;
if(window.document["getBoxObjectFor"]!=null)
return ENGINE_GECKO;
if("opera"in window)
return ENGINE_OPERA;
return ENGINE_UNKNOWN;
}},
"public static const",{IS_MOBILE:function(){return(USER_AGENT.indexOf("Mobile/")>=0);}},
"private static const",{BODY:function(){return(window.document.getElementsByTagName("body")[0]);}},
"public static const",{SUPPORTS_CSS_TEXT:function(){return(typeof BODY.style.cssText=="string");}},
"public static const",{SUPPORTS_OPACITY:function(){return(typeof BODY.style.opacity=="string");}},
"public static const",{SUPPORTS_FILTERS:function(){return(typeof BODY.style.filter=="string");}},
];},[]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.FloatValue",
"import joo.css.PrimitiveValue",
"import joo.util.RegExpUtil",
"import CSSPrimitiveValue",""],

"public class Length extends FloatValue",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(PrimitiveValue,CSSPrimitiveValue,FloatValue);},




"public static const",{AUTO:function(){return(new Length(Number.NaN,-1));}},



"public static const",{INHERIT:function(){return(new Length(Number.NaN,-2));}},

"public static const",{PERCENT_0:function(){return(percent(0));}},
"public static const",{PERCENT_50:function(){return(percent(50));}},
"public static const",{PERCENT_100:function(){return(percent(100));}},

"public static const",{PX_0:function(){return(px(0));}},

"public static const",{UNITS:function(){return(["px","in","cm","mm","pt","pc","em","ex","%"]);}},
"public static const",{REG_EXP_STR:function(){return(FloatValue.REG_EXP_STR+"("+UNITS.join("|")+")");}},
"private static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+REG_EXP_STR));}},

"public static function fromString",function(string){
switch(string){
case PrimitiveValue.AUTO:return AUTO;
case PrimitiveValue.INHERIT:return INHERIT;
}
var match=string.match(REG_EXP);
if(match){
return fromStrings(match[1],match[2]);
}
return null;
},

"public static function fromStrings",function(number,unit){

return new Length(PrimitiveValue.getPrimitiveTypeFromUnit(unit),Number(number));
},

"public static function px",function(value){
return new Length(CSSPrimitiveValue.CSS_PX,Math.round(value));
},

"public static function em",function(value){
return new Length(CSSPrimitiveValue.CSS_EMS,value);
},

"public static function percent",function(value){
return new Length(CSSPrimitiveValue.CSS_PERCENTAGE,value);
},

"public function Length",function(primitiveType,floatValue){
this[$super](primitiveType,floatValue);
},

];},["fromString","fromStrings","px","em","percent"]
);joo.classLoader.prepare("package joo.html",[

"import joo.lang.Enum",""],

"public class EventType extends Enum",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},




"public static const",{CLICK:function(){return(new EventType(ITEMS,"click",true));}},
"public static const",{CHANGE:function(){return(new EventType(ITEMS,"change",true));}},
"public static const",{DBLCLICK:function(){return(new EventType(ITEMS,"dblclick",true));}},
"public static const",{CONTEXTMENU:function(){return(new EventType(ITEMS,"contextmenu",true));}},
"public static const",{MOUSEOVER:function(){return(new EventType(ITEMS,"mouseover",true));}},
"public static const",{MOUSEOUT:function(){return(new EventType(ITEMS,"mouseout",true));}},
"public static const",{MOUSEDOWN:function(){return(new EventType(ITEMS,"mousedown",true));}},
"public static const",{MOUSEUP:function(){return(new EventType(ITEMS,"mouseup",true));}},
"public static const",{MOUSEMOVE:function(){return(new EventType(ITEMS,"mousemove",true));}},
"public static const",{DRAG:function(){return(new EventType(ITEMS,"drag",true));}},
"public static const",{DRAGSTART:function(){return(new EventType(ITEMS,"dragstart",true));}},
"public static const",{DRAGEND:function(){return(new EventType(ITEMS,"dragend",true));}},
"public static const",{DROP:function(){return(new EventType(ITEMS,"drop",true));}},
"public static const",{DRAGLEAVE:function(){return(new EventType(ITEMS,"dragleave",true));}},
"public static const",{DRAGENTER:function(){return(new EventType(ITEMS,"dragenter",true));}},
"public static const",{DRAGOVER:function(){return(new EventType(ITEMS,"dragover",true));}},
"public static const",{KEYDOWN:function(){return(new EventType(ITEMS,"keydown",true));}},
"public static const",{KEYUP:function(){return(new EventType(ITEMS,"keyup",true));}},
"public static const",{KEYPRESS:function(){return(new EventType(ITEMS,"keypress",true));}},




"public static const",{FOCUS:function(){return(new EventType(ITEMS,"focus",false));}},
"public static const",{BLUR:function(){return(new EventType(ITEMS,"blur",false));}},
"public static const",{SCROLL:function(){return(new EventType(ITEMS,"scroll",false));}},
"public static const",{LOAD:function(){return(new EventType(ITEMS,"load",false));}},
"public static const",{UNLOAD:function(){return(new EventType(ITEMS,"unload",false));}},
"public static const",{RESIZE:function(){return(new EventType(ITEMS,"resize",false));}},
"public static const",{RESIZESTART:function(){return(new EventType(ITEMS,"resizestart",false));}},
"public static const",{SUBMIT:function(){return(new EventType(ITEMS,"submit",false));}},
"public static const",{SELECT:function(){return(new EventType(ITEMS,"select",false));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"private var",{bubbling: undefined},

"public function EventType",function(items,name,bubbling){
this[$super](items,name);
this[$bubbling]=! !bubbling;
},

"public function isBubbling",function(){
return this[$bubbling];
},

];},["fromString"]
);joo.classLoader.prepare("package joo.css.webkit",[

"import joo.util.RegExpUtil",
"import joo.css.Angle",""],




"public class Rotate",function($jooPublic,$jooPrivate){with(joo.css.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Angle);},

"public static const",{NAME:"rotate"},
"public static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+NAME+"\\("+Angle.REG_EXP_STR+"\\),?"));}},

"public static function fromMatch",function(match){
return new Rotate(Angle.fromStrings(match[1],match[2]));
},

"public var",{angle: undefined},

"public function Rotate",function(angle){this[$super]();
this.angle=angle;
},

"public function toString",function(){
return[NAME,"(",this.angle,")"].join("");
},

];},["fromMatch"]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class Overflow extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{VISIBLE:function(){return(new Overflow("visible"));}},
"public static const",{HIDDEN:function(){return(new Overflow("hidden"));}},
"public static const",{INHERIT:function(){return(new Overflow("inherit"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function Overflow",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.Length",""],

"public class BackgroundPosition",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Length);},

"public static const",{HOME:function(){return(new BackgroundPosition(Length.PERCENT_0,Length.PERCENT_0));}},

"private static const",{KEYWORD_TO_PERCENT:function(){return({
left:Length.PERCENT_0,
top:Length.PERCENT_0,
center:Length.PERCENT_50,
right:Length.PERCENT_100,
bottom:Length.PERCENT_100
});}},

"public static function fromString",function(string){
var parts=string.split(" ");
if(parts.length==0||parts.length>2){
return undefined;
}
var xstr=parts[0];
var ystr=parts.length==1?"50%":parts[1];
if(xstr=="top"||xstr=="bottom"){

xstr=ystr;
ystr=parts[0];
}
var x=KEYWORD_TO_PERCENT[xstr];
if(!x){
if(!(x=Length.fromString(xstr))){
return undefined;
}
}
var y=KEYWORD_TO_PERCENT[ystr];
if(!y){
if(!(y=Length.fromString(ystr))){
return undefined;
}
}
return new BackgroundPosition(x,y);
},

"public var",{x: undefined},
"public var",{y: undefined},

"public function BackgroundPosition",function(x,y){this[$super]();
this.x=x;
this.y=y;
},

"public function toString",function(){
return this.x+" "+this.y;
},

];},["fromString"]
);joo.classLoader.prepare("package joo.html.webkit",[

"import joo.html.Browser",
"import joo.html.Document2",
"import joo.html.Element2",
"import joo.html.webkit.WebKitEvent2",
"import joo.html.webkit.MultitouchFake",
"import joo.css.webkit.WebKitStyle2",""],

"public class WebKit",function($jooPublic,$jooPrivate){with(joo.html.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Browser,Element2,Document2,WebKitEvent2,WebKitStyle2);},

"public static function init",function(){
if(typeof window.document.documentElement.style.WebkitTransform!="string"){
throw new Error("This browser does not support the '-webkit-transform' CSS attribute, so this application will not work.");
}
Document2.EVENT2_CONSTRUCTOR=WebKitEvent2;
Element2.STYLE2_CONSTRUCTOR=WebKitStyle2;
if(!Browser.IS_MOBILE){
MultitouchFake.init();
}
},
];},["init"]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.Window2",
"import joo.html.Document2",
"import joo.html.DocumentOrElement2",
"import joo.html.Dimensions",
"import joo.html.Offset",
"import joo.html.InputElementType",
"import joo.css.Style2",""],




"public class Element2 extends DocumentOrElement2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Style2);},

"public static const",{XHTML_NAMESPACE_URI:"http://www.w3.org/1999/xhtml"},

"public static var",{STYLE2_CONSTRUCTOR:function(){return(Style2);}},








"public function Element2",function(ownerDocument,peer){
this[$super](ownerDocument,peer);
},

"public function getPeer",function(){
return this.getPeerNode();
},

"public function findNamespaceURIDefinition",function(scopeName){
if(scopeName=="HTML")
return XHTML_NAMESPACE_URI;
var xmlns="xmlns:"+scopeName;
var namespaceURI;
var element=this.getPeer();
do{
try{
namespaceURI=element.getAttribute(xmlns);
if(namespaceURI)
break;
}catch(e){if(is(e,Error)){


}}
element=element.parentNode;
}while(element!=this.ownerDocument);
return namespaceURI;
},

"public override function getNamespaceURI",function(){
var namespaceURI=this[$getNamespaceURI]();
if(!namespaceURI){
var element=this.getPeer();
if(element.scopeName){
namespaceURI=this.findNamespaceURIDefinition(element.scopeName);


}
if(!namespaceURI){


namespaceURI=XHTML_NAMESPACE_URI;
}
}
return namespaceURI;
},

"public function getId",function(){
return this.getPeer().id;
},

"public function setId",function(id){
this.getPeer().id=id;
return this;
},

"public function getClassName",function(){
return this.getPeer().className;
},

"public function setClassName",function(className){
this.getPeer().className=className;
return this;
},

"public function getCssText",function(){
var element=this.getPeer();
return"cssText"in element.style
?element.style.cssText
:element.getAttribute("style");
},

"public function setCssText",function(cssText){
var element=this.getPeer();
if("cssText"in element.style){
element.style.cssText=cssText;
}else{
element.setAttribute("style",cssText);
}
return this;
},

"public function getSrc",function(){
return this.getPeer().src;
},

"public function setSrc",function(url){
this.getPeer().src=url;
return this;
},

"public function getFor",function(){
return this.getPeer().htmlFor;
},

"public function setFor",function(htmlFor){
this.getPeer().htmlFor=htmlFor;
return this;
},

"public function getContentWindow",function(){
var contentWindowPeer=this.getPeer().contentWindow;
return contentWindowPeer?Window2.getInstance(contentWindowPeer):null;
},

"public function getContentDocument",function(){

var contentWindowPeer=this.getPeer().contentWindow;
return contentWindowPeer?Document2.getInstance(contentWindowPeer.document):null;
},

"public function isDisabled",function(){
return! !this.getPeer().disabled;
},

"public function isChecked",function(){
return! !this.getPeer().checked;
},

"public function getType",function(){
return InputElementType.fromString(this.getPeer().type);
},

"public function setType",function(type){
return this.getPeer().setAttribute("type",type.toString());
},

"public function getValue",function(){
return this.getPeer().value;
},

"public function setValue",function(value){
this.getPeer().value=String(value);
return this;
},

"public function getSelectedIndex",function(){
return this.getPeer().selectedIndex;
},

"public function setSelectedIndex",function(selectedIndex){
this.getPeer().selectedIndex=selectedIndex;
return this;
},

"public function setAttributes",function(attributes){
var className=attributes["className"];
if(className){
this.setClassName(className);
delete attributes["className"];
}
var style=attributes["style"];
if(style){
this.setStyle(style);
delete attributes["style"];
}
for(var a in attributes){
var value=attributes[a];
if(typeof value=="number"){
value=String(Math.round(Number(value)));
}
this.getPeer().setAttribute(a,value);
}
return this;
},

"public function getAttribute",function(name){
return this.getPeer().getAttribute(name);
},

"public function setAttribute",function(name,value){
this.getPeer().setAttribute(name,value);
return this;
},

"public function setBooleanAttribute",function(name,value){
var peer=this.getPeer();
if(name=="checked"&&"defaultChecked"in peer){

peer.defaultChecked=value;
}
if(value){
peer.setAttribute(name,name);
}else{
peer.removeAttribute(name);
}
peer[name]=value;
return this;
},

"public function removeAttribute",function(name){
this.getPeer().removeAttribute(name);
return this;
},

"private static function convertToString",function(value){
switch(typeof value){
case"string":
return value;
case"number":
return Math.round(value)+"px";
case"object":
if(value!=null&&value.constructor==Array){
var result=[];
var i;
for(i=0;i<value.length;++i){
result.push(convertToString(value[i]));
}
return result.join(" ");
}
}
return String(value);
},

"public function getStyle",function(){
if(!this[$style2]){
this[$style2]=new STYLE2_CONSTRUCTOR(this.getPeer().style);
}
return this[$style2];
},









"public function setStyle",function(styleAttributes){
this.setCssText(
typeof styleAttributes=="string"
?styleAttributes
:(styleAttributes.constructor==Style2?styleAttributes:new Style2(styleAttributes)).toString()
);
return this;
},

"public function getOffset",function(){
return new Offset(this.getPeer().offsetLeft,this.getPeer().offsetTop);
},

"public function setOffsetLeft",function(left){

this.getPeer().style.left=left+"px";
return this;
},

"public function setOffsetTop",function(top){

this.getPeer().style.top=top+"px";
return this;
},

"public function setOffset",function(offset){
var style=this.getPeer().style;
style.left=offset.left+"px";
style.top=offset.top+"px";
return this;
},

"public function getAbsoluteOffset",function(){
var thisPeer=this.getPeer();
var offset=new Offset(0,0);
do{
offset.left+=thisPeer.offsetLeft;
offset.top+=thisPeer.offsetTop;
thisPeer=thisPeer.offsetParent;
}while(thisPeer);
return offset;
},




"public function getDimensions",function(){
var thisPeer=this.getPeer();
return new Dimensions(thisPeer.offsetWidth,thisPeer.offsetHeight);
},

"public function focus",function(){
this.getPeer().focus();
return this;
},

"public function select",function(){
this.getPeer().select();
return this;
},

"public function getInnerHTML",function(){
return this.getPeer().innerHTML;
},

"public function setInnerHTML",function(html){
this.getPeer().innerHTML=html;
return this;
},

"override public function toString",function(){
return this.getPeer().id||this.getPeer().nodeName;
},

"private var",{style2: undefined},

];},[]
);joo.classLoader.prepare("package joo.html.webkit",[

"import joo.html.EventType",""],

"public class WebKitEventType extends EventType",function($jooPublic,$jooPrivate){with(joo.html.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(EventType);},

"public static const",{ITEMS:function(){return([]);}},




"public static const",{TOUCHSTART:function(){return(new WebKitEventType("touchstart",true));}},
"public static const",{TOUCHMOVE:function(){return(new WebKitEventType("touchmove",true));}},
"public static const",{TOUCHEND:function(){return(new WebKitEventType("touchend",true));}},
"public static const",{TOUCHCANCEL:function(){return(new WebKitEventType("touchcancel",true));}},
"public static const",{TOUCH:function(){return(new WebKitEventType("touch",true));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"private static function init",function(){

var EventType_fromString=EventType.fromString;
EventType.fromString=function(string){
return EventType_fromString(string)||fromString(string);
};
},function()

{init();},

"public function WebKitEventType",function(name,bubbling){
this[$super](ITEMS,name,bubbling);
},

];},["fromString"]
);joo.classLoader.prepare("package joo.html",[""],
"public class Dimensions",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public function Dimensions",function(width,height){this[$super]();
this.width=width;
this.height=height;
},

"public var",{width: undefined},
"public var",{height: undefined},
];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.lang.Enum",""],

"public class InputElementType extends Enum",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{TEXT:function(){return(new InputElementType("text"));}},
"public static const",{PASSWORD:function(){return(new InputElementType("password"));}},
"public static const",{RADIO:function(){return(new InputElementType("radio"));}},
"public static const",{CHECKBOX:function(){return(new InputElementType("checkbox"));}},
"public static const",{BUTTON:function(){return(new InputElementType("button"));}},
"public static const",{FILE:function(){return(new InputElementType("file"));}},
"public static const",{HIDDEN:function(){return(new InputElementType("hidden"));}},
"public static const",{SUBMIT:function(){return(new InputElementType("submit"));}},
"public static const",{RESET:function(){return(new InputElementType("reset"));}},
"public static const",{IMAGE:function(){return(new InputElementType("image"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function InputElementType",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.BorderStyle",""],

"public class BorderStyles",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static function fromString",function(string){
var parts=string.split(" ");
for(var i=0;i<parts.length;++i){
parts[i]=BorderStyle.fromString(parts[i]);
}
switch(parts.length){
case 1:return new BorderStyles(parts[0],parts[0],parts[0],parts[0]);
case 2:return new BorderStyles(parts[0],parts[1],parts[0],parts[1]);
case 4:return new BorderStyles(parts[0],parts[1],parts[2],parts[3]);
}
return undefined;
},

"public var",{top: undefined},
"public var",{right: undefined},
"public var",{bottom: undefined},
"public var",{left: undefined},

"public function BorderStyles",function(
top,
right,
bottom,
left
){this[$super]();
this.top=top;
this.right=right;
this.bottom=bottom;
this.left=left;
},

"public function toString",function(){
return[this.top,this.right,this.left,this.bottom].join(" ");
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.JOObject",
"import joo.lang.JsonBuilder",
"import joo.util.Arrays",""],

"public class Color extends JOObject",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{TRANSPARENT:function(){return(new Color(-1,-1,-1));}},
"public static const",{WHITE:function(){return(new Color(255,255,255));}},
"public static const",{BLACK:function(){return(new Color(0,0,0));}},
"public static const",{GRAY:function(){return(new Color(128,128,128));}},
"public static const",{RED:function(){return(new Color(255,0,0));}},
"public static const",{GREEN:function(){return(new Color(0,255,0));}},
"public static const",{BLUE:function(){return(new Color(0,0,255));}},
"public static const",{YELLOW:function(){return(new Color(255,255,0));}},
"public static const",{DARK_BLUE:function(){return(new Color(0,0,128));}},
"public static const",{LIGHT_BLUE:function(){return(new Color(128,128,255));}},

"private static const",{TRANSPARENT_STRING:"transparent"},
"private static const",{FACTOR:0.7},

"public static function fromHSV",function(h,s,v){
var r;
var g;
var b;

var i=Math.floor(h*6);
var f=h*6-i;
var p=v*(1-s);
var q=v*(1-f*s);
var t=v*(1-(1-f)*s);

switch(i%6){
case 0:r=v;g=t;b=p;break;
case 1:r=q;g=v;b=p;break;
case 2:r=p;g=v;b=t;break;
case 3:r=p;g=q;b=v;break;
case 4:r=t;g=p;b=v;break;
case 5:r=v;g=p;b=q;break;
}

var c=new Color(r*255,g*255,b*255);
c["1hue"]=h;
c["1saturation"]=s;
c["1value"]=v;
return c;
},

"public function Color",function(red,green,blue){
this[$super]();
this[$red]=red;
this[$green]=green;
this[$blue]=blue;
this[$init]();
},

"private function init",function(){
if(isNaN(this[$hue])&&this[$red]>=0){
var r=this[$red]/255;
var g=this[$green]/255;
var b=this[$blue]/255;
var max=Math.max(r,g,b);
var min=Math.min(r,g,b);
this[$value]=max;

var d=max-min;
this[$saturation]=max==0?0:d/max;

if(max==min){
this[$hue]=0;
}else{
switch(max){
case r:this[$hue]=(g-b)/d+(g<b?6:0);break;
case g:this[$hue]=(b-r)/d+2;break;
case b:this[$hue]=(r-g)/d+4;break;
}
this[$hue]/=6;
}
}
this[$asString]=this[$red]<0
?TRANSPARENT_STRING
:["rgb(",Math.round(this[$red]),",",Math.round(this[$green]),",",Math.round(this[$blue]),")"].join("");
},

"public function clone",function(){
return new Color(this[$red],this[$green],this[$blue]);
},

"public function getHue",function(){
return this[$hue];
},

"public function getSaturation",function(){
return this[$saturation];
},

"public function getValue",function(){
return this[$value];
},

"public function getDarker",function(){
return this.darker();
},

"public function darker",function(factor){if(arguments.length<1){factor=FACTOR;}
if(!factor)
factor=FACTOR;
if(factor==FACTOR&&this[$darkerColor]){
return this[$darkerColor];
}
var dc=new Color(
this[$red]*factor,
this[$green]*factor,
this[$blue]*factor
);
if(factor==FACTOR)
this[$darkerColor]=dc;
return dc;
},

"public function getBrighter",function(){
return this.brighter();
},

"public function brighter",function(factor){if(arguments.length<1){factor=FACTOR;}
if(arguments.length<1)
factor=FACTOR;
if(factor==FACTOR&&this[$brighterColor]){
return this[$brighterColor];
}
var bc;
var r=this[$red];
var g=this[$green];
var b=this[$blue];

var i=1/(1-factor);
if(r==0&&g==0&&b==0){
bc=new Color(i,i,i);
}else{
if(r>0&&r<i)r=i;
if(g>0&&g<i)g=i;
if(b>0&&b<i)b=i;

bc=new Color(Math.min(r/factor,255),
Math.min(g/factor,255),
Math.min(b/factor,255));
}
if(factor==FACTOR)
this[$brighterColor]=bc;
return bc;
},

"override public function hashCode",function(){
return this[$asString];
},

"override public function equals",function(color){
return color&&this[$asString]==color.toString();
},

"private static const",{JSON_PROPERTIES:function(){return(["1red","1green","1blue"]);}},

"override protected function isJsonProperty",function(property){
return Arrays.contains(JSON_PROPERTIES,property);
},

"override protected function addPropertiesFromJson",function(json,jsonBuilder){
this[$addPropertiesFromJson](json,jsonBuilder);
this[$init]();
},

"override public function toString",function(){
return this[$asString];
},

"private var",{red: undefined},
"private var",{green: undefined},
"private var",{blue: undefined},
"private var",{hue: undefined},
"private var",{saturation: undefined},
"private var",{value: undefined},
"private var",{asString: undefined},
"private var",{brighterColor: undefined},
"private var",{darkerColor: undefined},

"private static const",{REG_EXP:/rgb\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)/},

"public static function fromString",function(colorStr){
if(!colorStr){
return null;
}
if(colorStr==TRANSPARENT_STRING){
return TRANSPARENT;
}
if(colorStr.charAt(0)=="#"){
var rgb=parseInt(colorStr.substring(1),16);
if(colorStr.length==4){
return new Color(Math.floor(rgb/256)*17,Math.floor(rgb%256/16)*17,rgb%16*17);
}
return new Color(Math.floor(rgb/65536),Math.floor(rgb%65536/256),rgb%256);
}
var match=colorStr.match(REG_EXP);
if(match){
return new Color(Number(match[1]),Number(match[2]),Number(match[3]));
}
return null;
},


];},["fromHSV","fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.PrimitiveValue",
"import joo.util.RegExpUtil",
"import CSSPrimitiveValue",""],

"public class FloatValue extends PrimitiveValue",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(PrimitiveValue,CSSPrimitiveValue);},




"public static const",{AUTO:function(){return(new FloatValue(Number.NaN,-1));}},



"public static const",{INHERIT:function(){return(new FloatValue(Number.NaN,-2));}},

"public static const",{REG_EXP_STR:"(-?[0-9]*\\.?[0-9]+)"},
"private static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+REG_EXP_STR));}},

"public static function fromString",function(string){
switch(string){
case PrimitiveValue.AUTO:return AUTO;
case PrimitiveValue.INHERIT:return INHERIT;
}
var match=string.match(REG_EXP);
if(match){
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,Number(match[1]));
}
return undefined;
},

"public function FloatValue",function(primitiveType,floatValue){
this[$super](primitiveType);
this.floatValue=floatValue;
},

"public function toString",function(){
return this.floatValue+this.getUnit();
},

"public var",{floatValue: undefined},
];},["fromString"]
);joo.classLoader.prepare("package joo.html",[

"import joo.lang.Enum",""],

"public class NodeType extends Enum",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{ELEMENT_NODE:function(){return(new NodeType("ELEMENT_NODE",1));}},
"public static const",{ATTRIBUTE_NODE:function(){return(new NodeType("ATTRIBUTE_NODE",2));}},
"public static const",{TEXT_NODE:function(){return(new NodeType("TEXT_NODE",3));}},


"public static function fromString",function(string){
return ITEMS[string];
},

"public static function fromOrdinal",function(ordinal){
return ITEMS[ordinal];
},

"public function NodeType",function(name,ordinal){
this[$super](ITEMS,name,ordinal);
},

];},["fromString","fromOrdinal"]

);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class Position extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{STATIC:function(){return(new Position("static"));}},
"public static const",{ABSOLUTE:function(){return(new Position("absolute"));}},
"public static const",{RELATIVE:function(){return(new Position("relative"));}},
"public static const",{FIXED:function(){return(new Position("fixed"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function Position",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.Color",""],

"public class Colors",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static function fromString",function(string){
var parts=string.split(" ");
for(var i=0;i<parts.length;++i){
parts[i]=Color.fromString(parts[i]);
}
switch(parts.length){
case 1:return new Colors(parts[0],parts[0],parts[0],parts[0]);
case 2:return new Colors(parts[0],parts[1],parts[0],parts[1]);
case 4:return new Colors(parts[0],parts[1],parts[2],parts[3]);
}
return undefined;
},

"public var",{top: undefined},
"public var",{right: undefined},
"public var",{bottom: undefined},
"public var",{left: undefined},

"public function Colors",function(
top,
right,
bottom,
left
){this[$super]();
this.top=top;
this.right=right;
this.bottom=bottom;
this.left=left;
},

"public function toString",function(){
return[this.top,this.right,this.bottom,this.left].join(" ");
},
];},["fromString"]
);joo.classLoader.prepare("package joo.http",[

"import joo.util.PropertyAware",""],








"public class Cookie extends PropertyAware",function($jooPublic,$jooPrivate){with(joo.http)with($jooPublic)with($jooPrivate)return[











"public function Cookie",function(key,properties){
this[$key]=key;
this[$super](properties);
},







"public function setDocument",function(document){
this[$document]=document;
return this;
},






"public function getDocument",function(){
return this[$document]||window.document;
},







"public function setDomain",function(domain){
this[$domain]=domain;
return this;
},







"public function setPath",function(path){
this[$path]=path;
return this;
},






"public function setDuration",function(duration){
this[$duration]=duration;
return this;
},






"public function setSecure",function(secure){
this[$secure]=secure;
return this;
},









"public function save",function(value){
var cookie=[this[$key],"=",encodeURIComponent(value)];
if(this[$domain]){
cookie.push("; domain=",this[$domain]);
}
if(this[$path]){
cookie.push("; path=",this[$path]);
}
if(this[$duration]){
var date=new Date();
date.setTime(date.getTime()+this[$duration]*24*60*60*1000);
cookie.push("; expires=",date.toGMTString());
}
if(this[$secure]){
cookie.push("; secure");
}
this.getDocument().cookie=cookie.join("");
return this.load(null)==(this[$duration]<0?null:value);
},





"public function load",function(){

var cookieKey=this[$key].replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");
var match=this.getDocument().cookie.match("(?:^|;)\\s*"+cookieKey+"=([^;]*)");
return match?decodeURIComponent(match[1]):null;
},











"public function remove",function(){
this[$duration]=-1;
return this.save("");
},

"private var",{document: undefined},
"private var",{key: undefined},
"private var",{domain: undefined},
"private var",{path: undefined},
"private var",{duration: undefined},
"private var",{secure:false},
];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.lang.JOObject",
"import joo.html.NodeType",
"import joo.html.DelegatingNodeList2",""],

"public class Node2 extends JOObject",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public function Node2",function(ownerDocument,peer){
this[$super]();
this.ownerDocument=ownerDocument;
this[$peer]=peer;
},

"public function getPeerNode",function(){
return this[$peer];
},

"public function getNodeType",function(){
return NodeType.fromOrdinal(this[$peer].nodeType);
},

"public function getNodeName",function(){
return this[$peer].nodeName;
},

"public function getLocalName",function(){
var peer=this[$peer];
return peer.localName?peer.localName:peer.nodeName;
},

"public function getNamespaceURI",function(){
var namespaceURI=this[$peer].namespaceURI;

return namespaceURI?String(namespaceURI):undefined;
},

"public function getFirstChild",function(){
return this.ownerDocument.getNode(this.getPeerNode().firstChild);
},

"public function getLastChild",function(){
return this.ownerDocument.getNode(this.getPeerNode().lastChild);
},

"public function getChildNodes",function(){
if(!this[$childNodes]){
this[$childNodes]=new DelegatingNodeList2(this.ownerDocument,this[$peer].childNodes);
}
return this[$childNodes];
},

"public function getChildCount",function(){
return this[$peer].childNodes.length;
},

"public function getChildNode",function(index){
return this.ownerDocument.getNode(this.getPeerNode().childNodes[index]);
},

"public function getPreviousSibling",function(){
return this.ownerDocument.getNode(this.getPeerNode().previousSibling);
},

"public function getNextSibling",function(){
return this.ownerDocument.getNode(this.getPeerNode().nextSibling);
},

"public function removeChild",function(node){
this[$peer].removeChild(node.getPeerNode());
return node;
},

"public function replaceChild",function(newChild,oldChild){
this[$peer].replaceChild(newChild.getPeerNode(),oldChild.getPeerNode());
return oldChild;
},

"public function remove",function(){
this[$peer].parentNode.removeChild(this[$peer]);
return this;
},

"public function replace",function(node){
this[$peer].parentNode.replaceChild(node.getPeerNode(),this[$peer]);
return this;
},

"public function appendChild",function(node){
this.getPeerNode().appendChild(node.getPeerNode());
return node;
},

"public function insertBefore",function(node,referenceNode){
this.getPeerNode().insertBefore(node.getPeerNode(),referenceNode.getPeerNode());
return node;
},

"public function getParentNode",function(){
return this.ownerDocument.getNode(this.getPeerNode().parentNode);
},







"public function getParentElement",function(){
return this.getParentNode();
},

"public override function equals",function(joobject){

return this[$peer]==(joobject).getPeerNode();
},

"public var",{ownerDocument: undefined},
"private var",{peer: undefined},
"private var",{childNodes: undefined},
];},[]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class BackgroundAttachment extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{SCROLL:function(){return(new BackgroundAttachment("scroll"));}},
"public static const",{FIXED:function(){return(new BackgroundAttachment("fixed"));}},
"public static const",{INHERIT:function(){return(new BackgroundAttachment("inherit"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function BackgroundAttachment",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.DocumentOrElement2",
"import joo.html.Browser",
"import joo.html.Window2",
"import joo.html.Node2",
"import joo.html.TextNode2",
"import joo.html.Element2",
"import joo.html.Event2",
"import Node",""],

"public class Document2 extends DocumentOrElement2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Browser,Node,Event2);},

"private static var",{INSTANCE: undefined},

"public static function getInstance",function(document){
if(!document||document==window.document){
if(!INSTANCE){
INSTANCE=new Document2(window.document);
}
return INSTANCE;
}
return new Document2(document);
},

"public static var",{EVENT2_CONSTRUCTOR:function(){return(Event2);}},

"public function Document2",function(document){
this[$super](this,document);
this.scrollContainer=this.isCSS1Compat()
?document.documentElement
:document["body"];
},

"public function getPeer",function(){
return this.getPeerNode();
},

"public function getWindow",function(){
if(!this.ownerWindow){
var doc=this.getPeer();


















this.ownerWindow=Window2.getInstance(doc.defaultView||doc.parentWindow);
}
return this.ownerWindow;
},

"public function isCSS1Compat",function(){
return this.getPeer().compatMode=="CSS1Compat";
},

"public function setDesignMode",function(designMode){
this.getPeer().designMode=designMode?"on":"off";
return this;
},

"public function isDesignMode",function(){
return this.getPeer().designMode.toLowerCase()=="on";
},

"public function createElement",function(elementName,type){
var element;
var doc=this.getPeer();
if(type&&(Browser.ENGINE===Browser.ENGINE_IE6||Browser.ENGINE===Browser.ENGINE_IE7)){

element=doc.createElement("<"+elementName+" type='"+type+"'>");
}else{
element=doc.createElement(elementName);
if(type){
element.setAttribute("type",type.toString());
}
}
return new Element2(this,element);
},

"public function createInput",function(type){
return this.createElement("input",type);
},

"public function createButton",function(type){
return this.createElement("button",type);
},

"public function createTextNode",function(text){
return this.getTextNode(this.getPeer().createTextNode(text));
},

"internal function createEventHandler",function(listener){
var self=this;
return(function(event){
return listener(new EVENT2_CONSTRUCTOR(self,event||self.getWindow().getPeer().event,new Date().getTime()));
});
},

"public function getNode",function(node){
if(!node)
return null;
switch(node.nodeType){
case Node.ELEMENT_NODE:return this.getElement(node);
case Node.TEXT_NODE:return this.getTextNode(node);
default:throw new Error("Unsupported node type "+node.nodeType);
}
},

"public function getTextNode",function(textNode){
return textNode?new TextNode2(this,textNode):null;
},

"public function getElementById",function(id){
return this.getElement(this.getPeer().getElementById(id));
},

"public function getElement",function(element){
return element?new Element2(this,element):null;
},

"public function getDocumentElement",function(){
return this.getElement(this.getPeer().documentElement);
},

"public function getHead",function(){
if(!this[$head]){
this[$head]=this.getElement(this.getPeer().getElementsByTagName("head")[0]);
}
return this[$head];
},

"public function getBody",function(){
if(!this[$body]){
this[$body]=this.getElement(this.getPeer().getElementsByTagName("body")[0]);
}
return this[$body];
},

"public function write",function(text){
this.getPeer().write(text);
},

"public function close",function(){
this.getPeer().close();
},

"override public function toString",function(){
return"Document2["+this.getPeer()+"]";
},

"public var",{ownerWindow: undefined},
"private var",{head: undefined},
"private var",{body: undefined},
"internal var",{scrollContainer: undefined},

];},["getInstance"]
);joo.classLoader.prepare(





























"package joo.html.webkit",[""],




"public class MultitouchFake",function($jooPublic,$jooPrivate){with(joo.html.webkit)with($jooPublic)with($jooPrivate)return[

"private static var",{dot:null},
"private static var",{touchId:1},
"private static var",{touchA:null},
"private static var",{touchB:null},
"private static var",{touchBStart:null},
"private static var",{mouseIsDown:false},

"private static var",{mouse2TouchMap:function(){return({
"mouseup":"touchend",
"mousedown":"touchstart",
"mousemove":"touchmove"
});}},

"public static function init",function(){
window.document.addEventListener("mousedown",fakeTouchHandler,false);
window.document.addEventListener("mousemove",fakeTouchHandler,false);
window.document.addEventListener("mouseup",fakeTouchHandler,false);
},

"private static function fakeTouchHandler",function(e){
e.preventDefault();
e.stopPropagation();

if(e.type=="mousedown")
touchId++;

var touch={
identifier:touchId,
target:e.target,
clientX:e.clientX,
clientY:e.clientY,
pageX:e.clientX,
pageY:e.clientY,
screenX:e.screenX,
screenY:e.screenY
};

if(e.type=="mouseup"){
touchA=touchB;
mouseIsDown=false;
}
if(e.type=="mousedown"){
touchBStart=touch;
mouseIsDown=true;
}
touchB=touch;

if(e.type=="mousemove"&&!mouseIsDown)
return;

var scale=1.0;
var rotation=0.0;

var touches=[];
if(touchA){
touches.push(touchA);

if(!dot){
dot=window.document.createElement("div");
window.document.body.appendChild(dot);
}
dot.setAttribute("style","position: absolute; z-index: 10000; width: 20px; height: 20px; -webkit-border-radius: 10px; background-color: rgba(255,255,0,0.25); top: "+(touchA.clientY-10)+"px; left: "+(touchA.clientX-10)+"px; ");

var x1=touchA.clientX-touchBStart.clientX;
var y1=touchA.clientY-touchBStart.clientY;
var x2=touchA.clientX-touchB.clientX;
var y2=touchA.clientY-touchB.clientY;

scale=Math.sqrt(x2*x2+y2*y2)/Math.sqrt(x1*x1+y1*y1);

rotation=Math.atan(x1/y1)-Math.atan(x2/y2);
if((y1>0&&y2<0)||(y1<0&&y2>0))
rotation+=Math.PI;
rotation*=(180/Math.PI);
}
touches.push(touchB);

var touchEvent=window.document.createEvent("MouseEvents");
touchEvent.initMouseEvent(
mouse2TouchMap[e.type],
true,
true,
e["view"],
e["detail"],
e.screenX,
e.screenY,
e.clientX,
e.clientY,
e.ctrlKey,
e.altKey,
e.shiftKey,
e.metaKey,
0,
null
);
touchEvent["touches"]=touches;
touchEvent["targetTouches"]=touches;
touchEvent["changedTouches"]=touches;
touchEvent["scale"]=scale;
touchEvent["rotation"]=rotation;

window.document.dispatchEvent(touchEvent);
},


];},["init"]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class BorderStyle extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{INHERIT:function(){return(new BorderStyle("inherit"));}},



"public static const",{NONE:function(){return(new BorderStyle("none"));}},



"public static const",{HIDDEN:function(){return(new BorderStyle("hidden"));}},



"public static const",{DOTTED:function(){return(new BorderStyle("dotted"));}},



"public static const",{DASHED:function(){return(new BorderStyle("dashed"));}},



"public static const",{SOLID:function(){return(new BorderStyle("solid"));}},



"public static const",{DOUBLE:function(){return(new BorderStyle("double"));}},



"public static const",{GROOVE:function(){return(new BorderStyle("groove"));}},



"public static const",{RIDGE:function(){return(new BorderStyle("ridge"));}},



"public static const",{INSET:function(){return(new BorderStyle("inset"));}},



"public static const",{OUTSET:function(){return(new BorderStyle("outset"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function BorderStyle",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.Color",
"import joo.css.URL",
"import joo.css.BackgroundRepeat",
"import joo.css.BackgroundAttachment",
"import joo.css.BackgroundPosition",
"import joo.css.Style2",""],

"public class Background",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(BackgroundAttachment,BackgroundRepeat,URL,BackgroundPosition,Color);},

"private static const",{PROPERTY_TO_CLASS:function(){return({
repeat:BackgroundRepeat,
attachment:BackgroundAttachment,
image:URL,
color:Color,
position:BackgroundPosition
});}},

"public static function fromString",function(string){
var background=new Background(undefined,undefined,undefined,undefined,undefined);
Style2.fillInProperties(string,background,PROPERTY_TO_CLASS);
return background;
},

"public var",{color: undefined},
"public var",{image: undefined},
"public var",{repeat: undefined},
"public var",{attachment: undefined},
"public var",{position: undefined},

"public function Background",function(color,image,repeat,attachment,position){this[$super]();
this.color=color||Color.TRANSPARENT;
this.image=image||URL.NONE;
this.repeat=repeat||BackgroundRepeat.REPEAT;
this.attachment=attachment||BackgroundAttachment.SCROLL;
this.position=position||BackgroundPosition.HOME;
},

"public function getAttachment",function(){
return this.attachment;
},

"public function setAttachment",function(attachment){
this.attachment=attachment;
return this;
},

"public function getImage",function(){
return this.image;
},

"public function setImageUrl",function(url){
this.image=url;
return this;
},

"public function getRepeat",function(){
return this.repeat;
},

"public function setRepeat",function(repeat){
this.repeat=repeat;
},

"public function getPosition",function(){
return this.position;
},

"public function setPosition",function(position){
this.position=position;
return this;
},

"public function toString",function(){
return[this.color,this.image,this.repeat,this.attachment,this.position].join(" ");
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css.webkit",[

"import joo.util.RegExpUtil",
"import joo.css.Length",""],




"public class Translate",function($jooPublic,$jooPrivate){with(joo.css.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Length);},

"public static const",{NAME:"translate"},

"public static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+NAME+"\\("+Length.REG_EXP_STR+",\\s*"+Length.REG_EXP_STR+"\\),?"));}},

"public static function fromMatch",function(match){
return new Translate(Length.fromStrings(match[1],match[2]),Length.fromStrings(match[3],match[4]));
},

"public var",{tx: undefined},
"public var",{ty: undefined},

"public function Translate",function(tx,ty){this[$super]();
this.tx=tx;
this.ty=ty;
},

"public function toString",function(){
var sb=[NAME,"(",this.tx];
if(this.ty){
sb.push(",",this.ty);
}
sb.push(")");
return sb.join("");
},

];},["fromMatch"]
);joo.classLoader.prepare("package joo.html.slant",[

"import joo.html.Document2",
"import joo.html.Node2",
"import joo.html.Element2",
"import joo.html.Browser",
"import joo.css.Color",""],

"public class SlantCanvas extends Element2",function($jooPublic,$jooPrivate){with(joo.html.slant)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Browser);},

"public function SlantCanvas",function(document,canvas){
this[$super](document,canvas);
this.setAttributes({className:"canvas"});
},

"override public function appendChild",function(child){
this[$nextFreeDiv]=null;
return this[$appendChild](child);
},

"private static function rectCssText",function(color,
x0,y0,x1,y1,
borderColor,borderWidth){
var width=x1-x0;
var height=y1-y0;
if(borderWidth){
if(borderWidth<0){

var doubleBW=-2*borderWidth;
if(width>=doubleBW&&height>=doubleBW){
borderWidth=-borderWidth;
width-=doubleBW;
height-=doubleBW;
}else{

color=borderColor;
borderWidth=0;
}
}else{

x0-=borderWidth;
y0-=borderWidth;
}
}

var rect=["background-color:",color,
";left:",x0,"px;top:",y0,"px;width:",width,"px;height:",height,"px;"];
if(borderWidth){
rect.push("border-color:",borderColor,";border-width:",borderWidth,"px;");
}
return rect;
},

"private static function zIndexAndOpacityCssText",function(zIndex,opacity){
var cssText=[];
if(zIndex>=0){
cssText.push("z-index:",zIndex,";");
}
if(opacity<1){
if(Browser.SUPPORTS_OPACITY){
cssText.push("opacity:",opacity,";");
}else if(Browser.SUPPORTS_FILTERS){
cssText.push("filter:progid:DXImageTransform.Microsoft.Alpha(opacity=",Math.round(opacity*100),");");
}
}
return cssText.join("");
},

"private function add",function(cssText,zIndexAndOpacityCssText){
cssText.push(zIndexAndOpacityCssText);
var cssString=cssText.join("");
var div=this[$nextFreeDiv];
if(div){
this[$nextFreeDiv]=div.nextSibling;
if(this[$lastFreeDiv]===div){
this[$lastFreeDiv]=this[$nextFreeDiv];
}
}else{
div=this.ownerDocument.createElement("div").setClassName("slant").getPeer();
this.getPeer().appendChild(div);
}
if(Browser.SUPPORTS_CSS_TEXT){
div.style.cssText=cssString;
}else{
div.setAttribute("style",cssString);
}
return div;
},














"public function addRect",function(color,
x0,y0,x1,y1,
zIndex,opacity,
borderColor,borderWidth){
return this[$add](rectCssText(color.toString(),Math.round(x0),Math.round(y0),Math.round(x1),Math.round(y1),String(borderColor),borderWidth),zIndexAndOpacityCssText(zIndex,opacity));
},































"public function addSlant",function(slantColor,
x00,y00,x01,y01,
x10,y10,x11,y11,
zIndex,opacity,
borderColor,borderWidth){
var color=slantColor.toString();
x00=Math.round(x00);
y00=Math.round(y00);
x10=Math.round(x10);
y10=Math.round(y10);
x01=Math.round(x01);
y01=Math.max(y00,Math.round(y01));
x11=Math.round(x11);
y11=Math.max(y10,Math.round(y11));
var dx0=x00-x01;
var dx1=x10-x11;
var dy0=y00-y10;
var dy1=y01-y11;
var cssText=null;
var dx10=x10-x00;
var d_t;
var d_b;
var y_t;
var y_b;
var x_l;
var x_r;
var y;
var x;
var d_x;
var zIndexAndOpacity=zIndexAndOpacityCssText(zIndex,opacity);
if(dx0==0&&dx1==0){
if(dy0==0&&dy1==0){

cssText=rectCssText(color,x00,y00,x11,y11,String(borderColor),borderWidth);
}else if(dy0>=0){
if(y00>y11&&dx10>0&&dy1!=0){

d_t=-dy0/dx10;
d_b=-dy1/dx10;
y=y_t=y00;
y_b=y01;
x_l=x00;
do{
x=Math.round((y-y01)/d_b);

y=d_t*x+y00;
x_r=x00+x;
d_x=x_r-x_l;
if(d_x<0)
break;
if(d_x==0){
++x_r;
d_x=1;
}
if(d_x==1){
this[$add](["left:",x_l,"px;top:",Math.round(y),"px;background-color:",color,
";height:",y_b-Math.round(y),"px;width:1px;"],zIndexAndOpacity);
y_b=y_t;
y_t=Math.round(y);
}else{
this[$add](["left:",x_l,"px;top:",y_t,"px;border-left-color:",color,
";border-width:0 0 ",y_b-y_t,"px ",d_x,"px;"],zIndexAndOpacity);
y_b=y_t;
y_t=Math.round(y);
this[$add](["left:",x_l,"px;top:",y_t,"px;border-right-color:",color,
";border-width:",y_b-y_t,"px ",d_x,"px 0 0;"],zIndexAndOpacity);
}
x_l=x_r;
}while(y_t>y11);
y00=y_t;
y01=y_b;
dy0=y00-y10;
dy1=y01-y11;
x00=x01=x_r;

}

cssText=["left:",x00,"px;top:",y10,"px;border-right-color:",color,
";border-width:",dy0,"px ",x11-x00,"px ",Math.max(-dy1,0),"px 0;height:",Math.min(y01,y11)-y00,"px;"];
if(dy1>0){

this[$add](["left:",x00,"px;top:",y11,"px;border-left-color:",color,
";border-width:0 0 ",dy1,"px ",x11-x00,"px;"],zIndexAndOpacity);
}
}else if(dy0<=0){
if(y10>y01&&dx10>0&&dy1!=0){

d_t=-dy0/dx10;
d_b=-dy1/dx10;
y=y_t=y10;
y_b=y11;
x_r=x10;
do{
x_l=x10+Math.round((y-y11)/d_b);

d_x=x_r-x_l;
if(d_x<0)
break;
if(d_x==0){
--x_l;
d_x=1;
}
this[$add](["left:",x_l,"px;top:",y_t,"px;border-right-color:",color,
";border-width:0 ",d_x,"px ",y_b-y_t,"px 0;"],zIndexAndOpacity);
y_b=y_t;
y=d_t*(x_l-x10)+y10;
y_t=Math.round(y);
this[$add](["left:",x_l,"px;top:",y_t,"px;border-left-color:",color,
";border-width:",y_b-y_t,"px 0 0 ",d_x,"px;"],zIndexAndOpacity);
x_r=x_l;
}while(y_t>y01);
y10=y_t;
y11=y_b;
dy0=y00-y10;
dy1=y01-y11;
x10=x11=x_l;

}

cssText=["left:",x00,"px;top:",y00,"px;border-left-color:",color,
";border-width:",-dy0,"px 0 ",Math.max(dy1,0),"px ",x11-x00,"px;height:",Math.min(y01,y11)-y10,"px;"];
if(dy1<0){

this[$add](["left:",x00,"px;top:",y01,"px;border-right-color:",color,
";border-width:0 ",x11-x00,"px ",-dy1,"px 0;"],zIndexAndOpacity);
}
}
}else if(dx0<=0&&dx1>=0){

cssText=["left:",x00,"px;top:",y00,"px;border-top-color:",color,
";border-width:",y11-y00,"px ",dx1,"px 0 ",-dx0,"px;width:",x11-x01,"px;"];
}else if(dx0>=0&&dx1<=0){

cssText=["left:",x01,"px;top:",y00,"px;border-bottom-color:",color,
";border-width:0 ",-dx1,"px ",y11-y00,"px ",dx0,"px;width:",x10-x00,"px;"];
}
if(cssText===null){
throw new Error(["Unsupported Slant coordinates ",x00,"|",y00," ",x10,"|",y10," ",x01,"|",y01," ",x11,"|",y11,"."].join(""));
}
return this[$add](cssText,zIndexAndOpacity);
},

"public function rewind",function(offset){if(arguments.length<1){offset=0;}
this[$nextFreeDiv]=this.getPeer().childNodes[offset];
},

"public function clearRest",function(){
var child=this[$nextFreeDiv];
while(child!=this[$lastFreeDiv]){
child.style.display="none";
child=child.nextSibling;
}
this[$lastFreeDiv]=this[$nextFreeDiv];
},

"public override function getLastChild",function(){
return this[$nextFreeDiv]
?this.ownerDocument.getElement(this[$nextFreeDiv].previousSibling)
:this[$getLastChild]();
},

"public function getChildElement",function(index){
return this.getChildNode(index);
},

"private var",{nextFreeDiv: undefined},
"private var",{lastFreeDiv: undefined},
];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.NodeList2",""],

"public class NodeList2Impl implements NodeList2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"private var",{nodes:function(){return([]);}},

"public function push",function(node){
this[$nodes].push(node);
return this;
},

"public function getLength",function(){
return this[$nodes].length;
},

"public function item",function(index){
return this[$nodes][index];
},
];},[]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.Node2",
"import joo.html.NodeList2Impl",
"import joo.html.DelegatingNodeList2",""],

"public class DocumentOrElement2 extends Node2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public function DocumentOrElement2",function(ownerDocument,peer){
this[$super](ownerDocument,peer);
},

"public function getPeerDocumentOrElement",function(){
return this.getPeerNode();
},

"public function addEventListener",function(eventType,listener,capture){if(arguments.length<3){capture=false;}
listener=this.ownerDocument.createEventHandler(listener);
var thisPeer=this.getPeerDocumentOrElement();
if(typeof thisPeer.addEventListener=="function"){
thisPeer.addEventListener(eventType.toString(),listener,capture);
}else{

thisPeer.attachEvent("on"+eventType,listener);
}
},

"public function getElementsByTagName",function(tagName){
return new DelegatingNodeList2(this.ownerDocument,this.getPeerDocumentOrElement().getElementsByTagName(tagName));
},

"public function getElementsByTagNameNS",function(namespaceURI,tagName){
var target=this.getPeerDocumentOrElement();
if(typeof target.getElementsByTagNameNS=="function"){
return new DelegatingNodeList2(this.ownerDocument,target.getElementsByTagNameNS(namespaceURI,tagName));
}
var elements=target.getElementsByTagName(tagName);
var elements2=new NodeList2Impl();
for(var i=0;i<elements.length;++i){
var element=this.ownerDocument.getElement(elements.item(i));
if(element.getNamespaceURI()==namespaceURI){
elements2.push(element);
}
}
return elements2;
},

];},[]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.Style2",
"import joo.css.Length",
"import joo.css.Color",
"import joo.css.BorderStyle",""],




"public class Border",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(BorderStyle,Length,Color);},

"private static const",{PROPERTY_TO_CLASS:function(){return({
width:Length,
style:BorderStyle,
color:Color
});}},

"public static function fromString",function(string){
var border=new Border(undefined,undefined,undefined);
Style2.fillInProperties(string,border,PROPERTY_TO_CLASS);
return border;
},

"public var",{width: undefined},
"public var",{style: undefined},
"public var",{color: undefined},

"public function Border",function(width,style,color){this[$super]();
this.width=width;
this.style=style;
this.color=color;
},

"public function toString",function(){
return Style2.propertiesToString(this.width,this.style,this.color);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.html",[""],

"public class Command",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[

"public static const",{BOLD:function(){return(new Command("bold"));}},
"public static const",{ITALIC:function(){return(new Command("italic"));}},
"public static function createLink",function(uri){
return new Command("createLink",uri);
},

"private var",{name: undefined},
"private var",{argument: undefined},

"public function Command",function(name,argument){this[$super]();
this[$name]=name;
this[$argument]=argument;
},

"public function execute",function(document){
document.getPeer().execCommand(this.getName(),false,this.getArgument());
},

"public function getName",function(){
return this[$name];
},

"public function getArgument",function(){
return this[$argument];
},
];},["createLink"]

);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class Display extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{INLINE:function(){return(new Display("inline"));}},
"public static const",{BLOCK:function(){return(new Display("block"));}},
"public static const",{NONE:function(){return(new Display("none"));}},
"public static const",{INHERIT:function(){return(new Display("inherit"));}},


"public static function fromString",function(string){
return ITEMS[string];
},

"public function Display",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css.webkit",[

"import joo.css.webkit.Transform",
"import joo.css.Style2",""],

"public class WebKitStyle2 extends Style2",function($jooPublic,$jooPrivate){with(joo.css.webkit)with($jooPublic)with($jooPrivate)return[

"public function WebKitStyle2",function(style){
this[$super](style);
},

"public function getWebKitTransform",function(){
return Transform.fromString(this.style.WebkitTransform);
},

"public function setWebKitTransform",function(transform){
this.style.WebkitTransform=transform.toString();
return this;
},
];},[]
);joo.classLoader.prepare("package joo.css.webkit",[

"import joo.css.webkit.Rotate",
"import joo.css.webkit.Scale",
"import joo.css.webkit.Translate",""],






"public class Transform",function($jooPublic,$jooPrivate){with(joo.css.webkit)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(Translate,Rotate,Scale);},

"private static const",{TRANSFORMATION_CLASSES:function(){return([Rotate,Scale,Translate]);}},

"public static function fromString",function(string){
var transformations=[];
var match;
while(string){
for(var i=0;i<TRANSFORMATION_CLASSES.length;++i){
var transformationClass=TRANSFORMATION_CLASSES[i];
match=string.match(transformationClass["REG_EXP"]);
if(match){
var transformation=transformationClass["fromMatch"](match);
transformations.push(transformation);
string=string.substring(match[0].length+1);
break;
}
}
if(!match){
throw new Error("Cannot parse: "+string);
}
}
return new Transform(transformations);
},

"private var",{transformations: undefined},

"public function Transform",function(transformations){this[$super]();
this[$transformations]=transformations;
},

"public function addTransformation",function(transformation){
this[$transformations].push(transformation);
return this;
},

"public function item",function(index){
return this[$transformations][index];
},

"public function getTransformation",function(clazz){

for(var t=0;t<this[$transformations].length;++t){
if(this[$transformations][t].constructor==clazz){
return this[$transformations][t];
}
}
return undefined;
},

"public function getTranslate",function(){
return this.getTransformation(Translate);
},

"public function getRotate",function(){
return this.getTransformation(Rotate);
},

"public function getScale",function(){
return this.getTransformation(Scale);
},

"public function getTransformationCount",function(){
return this[$transformations].length;
},

"public function toString",function(){
if(this[$transformations].length==0){
return"none";
}
return this[$transformations].join(" ");
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.lang.Enum",""],

"public class BackgroundRepeat extends Enum",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[

"public static const",{ITEMS:function(){return([]);}},

"public static const",{REPEAT:function(){return(new BackgroundRepeat("repeat"));}},
"public static const",{REPEAT_X:function(){return(new BackgroundRepeat("repeat-x"));}},
"public static const",{REPEAT_Y:function(){return(new BackgroundRepeat("repeat-y"));}},
"public static const",{NO_REPEAT:function(){return(new BackgroundRepeat("no-repeat"));}},
"public static const",{INHERIT:function(){return(new BackgroundRepeat("inherit"));}},

"public static function fromString",function(string){
return ITEMS[string];
},

"public function BackgroundRepeat",function(name){
this[$super](ITEMS,name);
},
];},["fromString"]
);joo.classLoader.prepare("package joo.css",[

"import joo.css.FloatValue",
"import joo.css.PrimitiveValue",
"import joo.util.RegExpUtil",
"import CSSPrimitiveValue",""],

"public class Angle extends FloatValue",function($jooPublic,$jooPrivate){with(joo.css)with($jooPublic)with($jooPrivate)return[function(){joo.classLoader.init(PrimitiveValue,CSSPrimitiveValue,FloatValue);},




"public static const",{INHERIT:function(){return(new Angle(Number.NaN,-2));}},

"public static const",{UNITS:function(){return(["deg","rad","grad"]);}},
"public static const",{REG_EXP_STR:function(){return(FloatValue.REG_EXP_STR+"("+UNITS.join("|")+")");}},
"private static const",{REG_EXP:function(){return(RegExpUtil.compile("^"+REG_EXP_STR));}},

"public static function fromString",function(string){
switch(string){
case PrimitiveValue.INHERIT:return INHERIT;
}
var match=string.match(REG_EXP);
if(match){
return fromStrings(match[1],match[2]);
}
return null;
},

"public static function fromStrings",function(number,unit){

return new Angle(PrimitiveValue.getPrimitiveTypeFromUnit(unit),Number(number));
},

"public static function deg",function(value){
return new Angle(CSSPrimitiveValue.CSS_DEG,value);
},

"public function Angle",function(primitiveType,floatValue){
this[$super](primitiveType,floatValue);
},

];},["fromString","fromStrings","deg"]
);joo.classLoader.prepare("package joo.html",[

"import joo.html.Node2",""],




"public class TextNode2 extends Node2",function($jooPublic,$jooPrivate){with(joo.html)with($jooPublic)with($jooPrivate)return[








"public function TextNode2",function(ownerDocument,peer){
this[$super](ownerDocument,peer);
},

"public function getPeer",function(){
return this.getPeerNode();
},

"public function getData",function(){
return this.getPeer().data;
},

"public function setData",function(data){
this.getPeer().data=data;
return this;
},

"override public function toString",function(){
return this.getData();
},

];},[]
);