diff --git a/README.md b/README.md deleted file mode 100644 index b1ebe21..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -**dat.gui** is a lightweight controller library for JavaScript. It allows you to easily manipulate variables and fire functions on the fly. - -Check the [index page](http://dataarts.github.com/dat.gui/) for usage. - -Initiated by [George Michael Brower](http://georgemichaelbrower.com/) and [Jono Brandel](http://jonobr1.com/) of the Data Arts Team, Google Creative Lab. \ No newline at end of file diff --git a/docs/RequestAnimationFrame.js b/docs/RequestAnimationFrame.js deleted file mode 100644 index 77f85c5..0000000 --- a/docs/RequestAnimationFrame.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Provides requestAnimationFrame in a cross browser way. - * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - */ - -if ( !window.requestAnimationFrame ) { - - window.requestAnimationFrame = ( function() { - - return window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { - - window.setTimeout( callback, 1000 / 60 ); - - }; - - } )(); - -} diff --git a/docs/assets/arrow.png b/docs/assets/arrow.png deleted file mode 100644 index 17bcdf4..0000000 Binary files a/docs/assets/arrow.png and /dev/null differ diff --git a/docs/assets/favicon.ai b/docs/assets/favicon.ai deleted file mode 100644 index d34d98b..0000000 --- a/docs/assets/favicon.ai +++ /dev/null @@ -1,188 +0,0 @@ -%PDF-1.5 % -1 0 obj <>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <>stream - - - - - Adobe Illustrator CS4 - 2011-01-27T09:49:50-07:00 - 2011-01-27T09:49:50-07:00 - 2011-01-27T09:49:50-07:00 - - - - 256 - 256 - JPEG - /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgBAAEAAwER AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE 1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp 0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo +DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FVG8vbSytnubuZI LeMVeWQhVH0nJ48cpmoiy15csMcTKZEYjveceYfzmt4maHQrYTkbfW7iqof9WMUY/SR8s3+l7BJ3 ymvIfreS13tXEGsEb/pHl8uf3MD1Lz35t1Fj6+pzKh/3XCfRWnhSPjX6c3WLs7Bj5RHx3+95rUds arL9U5fDb7kjllllfnK7SOerMST95zMEQOTrZSMjZNrcKHYqwTPOn7wdirsVdirsVdirsVdiqUZu Hwl2KuxV2KuxV2KuxVfB/fR/6w/XglyLVn+iXuL1/OOfAHYqujllibnG7Iw6MpIP3jFlGRibBpOd O86+aLAj0NRlZR/uuY+qtPCknKn0ZZHLIdXZaftvV4fpyS+Pq+9m2g/m7BIyw61b+iTt9agqU/2U Zqw+gn5ZkQ1Pe9VoPa+Mjw548P8ASjy+XP5W9BtLy1vLdLi1lWeCQVSRCGU/SMyQQeT2OHNDJESg RKJ6hVwtjsVdiqVeZPMmm+X9Na9vWPXjDCv25H/lX+JzJ0mknnnwx/scLX6/HpcfHP4DqS8H80eb tX8xXfrXj8YEJ+r2iE+nGPl3bxY/q2ztdHoseCNR59T1L5n2j2nl1U7mfT0j0H470lzLde7FXYq7 FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV2KuxVfB/fR/6w/XglyLVn+iXuL1/OOf AHYq7FXYq7FU48t+adV0C69W0flAxHr2rf3bj+B8GGThkMTs7Ls3tXNpJ3A+nrHof2+b2zy95h0/ XdPW8s2PXjLE3243/lb+BzYQmJCw+pdndo49Xj44fEdQUzybnqN7eW1laTXdy4jt4EMkrnsqipye PGZyERzLXlyxxwM5GoxFvnjzd5ou/MWrveTVSBapaW9do467f7I9WP8ACmd3otHHBj4Rz6nvL5V2 n2jPVZTM/T/CO4fjmkuZbr3Yq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV 2KuxVfB/fR/6w/XglyLVn+iXuL1/OOfAHYq7FXYq7FXYqnHlbzJdaBqqXcVWgb4bqCuzx/1HVTk8 czE27LsrtKekzCY+n+Id4/X3PerO7t7y1iurdxJBOoeNx3VhUZsgbFvruHNHJATibjIWHm/5zeYW it7bQoWoZx9Yu6d0U0jX6WBP0DOj7B0tk5T02H6XkvavXERjgHXeXu6fb9zyXOneHdirsVdirsVd irsVYJnnT94OxV2KuxV2KuxV2KuxVKM3D4S7FXYq7FXYq7FXYqvg/vo/9YfrwS5Fqz/RL3F6/nHP gDsVdirsVdirsVdir1H8oteaSC40WZqmH9/a1/kJpIv0MQfpOZmmn0e+9kNeZRlgl/D6o+7r9u/x eeee9SbUfNupz1qizGGPw4w/uxT58a56N2di8PBEeV/Pd57tjUeLqpy/pV8tkhzNdY7FXYq7FXYq 7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV2KuxVfB/fR/wCsP14Jci1Z/ol7i9fz jnwB2KuxV2KuxV2KuxVO/JWomw80adPWitKIZPDjL+7NflyrlmKVSDtOxNR4Orxy/pV/ptmLSyvL K8r7vIxZj7k1OetRFCnGlIyJJ6rcKHYq7FXYq7FXYq7FWCZ50/eDsVdirsVdirsVdirsVSjNw+Eu xV2KuxV2KuxV2Kr4P76P/WH68EuRas/0S9xev5xz4A7FXYq7FXYq7FXYquikaKVJE2ZGDKfcGoxZ RkYkEdEtz19yHYq7FXYq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV2KuxV fB/fR/6w/XglyLVn+iXuL1/OOfAHYq7FXYq7FXYq7FXYql+evuU7FXYq7FXYq7FXYq7FWCZ50/eD sVdirsVdirsVdirsVSjNw+EuxV2KuxV2KuxV2Kr4P76P/WH68EuRas/0S9xev5xz4A7FXYq7FXYq 7FXYq7FUvz19ynYq7FXYq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV2Kux VfB/fR/6w/XglyLVn+iXuL1/OOfAHYq7FXYq7FXYq7FXYql+evuU7FXYq7FXYq7FXYq7FWCZ50/e DsVdirsVdirsVdirsVSjNw+EuxV2KuxV2KuxV2Kr4P76P/WH68EuRas/0S9xev5xz4A7FXYq7FXY q7FXYq7FUvz19ynYq7FXYq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl2KuxV2KuxV2Ku xVfB/fR/6w/XglyLVn+iXuL1/OOfAHYq7FXYq7FXYq7FXYql+evuU7FXYq7FXYq7FXYq7FWCZ50/ eDsVdirsVdirsVdirsVSjNw+EuxV2KuxV2KuxV2Kr4P76P8A1h+vBLkWrP8ARL3F6/nHPgDsVdir sVdirsVdirsVS/PX3KdirsVdirsVdirsVdirBM86fvB2KuxV2KuxV2KuxV2KpRm4fCXYq7FXYq7F XYq7FV8H99H/AKw/XglyLVn+iXuL1/OOfAHYq7FXYq7FXYq7FXYql+evuU7FXYq7FXYq7FXYq7FW CZ50/eDsVdirsVdirsVdirsVSjNw+EuxV2KuxV2KuxV2Kr4P76P/AFh+vBLkWrP9EvcXr+cc+AOx V2KuxV2KuxV2KuxVL89fcp2KuxV2KuxV2KuxV2KsEzzp+8HYq7FXYq7FXYq7FXYqlGbh8JdirsVd irsVdirsVXwf30f+sP14Jci1Z/ol7i9fzjnwB2KuxV2KuxV2KuxV2Kpfnr7lOxV2KuxV2KuxV2Ku xVgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/1h+vBLkWrP9EvcXr+cc+AO xV2KuxV2KuxV2KuxVL89fcp2KuxV2KuxV2KuxV2KsEzzp+8HYq7FXYq7FXYq7FXYqlGbh8JdirsV dirsVdirsVXwf30f+sP14Jci1Z/ol7i9fzjnwB2KuxV2KuxV2KuxV2Kpfnr7lOxV2KuxV2KuxV2K uxVgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/1h+vBLkWrP9EvcXr+cc+A OxV2KuxV2KuxV2KuxVL89fcp2KuxV2KuxV2KuxV2KsEzzp+8HYq7FXYq7FXYq7FXYqlGbh8Jdirs VdirsVdirsVXwf30f+sP14Jci1Z/ol7i9fzjnwB2KuxV2KuxV2KuxV2Kpfnr7lOxV2KuxV2KuxV2 KuxVgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/ANYfrwS5Fqz/AES9xev5 xz4A7FXYq7FXYq7FXYq7FUvz19ynYq7FXYq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl 2KuxV2KuxV2KuxVfB/fR/wCsP14Jci1Z/ol7i9fzjnwB2KuxV2KuxV2KuxV2Kpfnr7lOxV2KuxV2 KuxV2KuxVgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/wBYfrwS5Fqz/RL3 F6/nHPgDsVdirsVdirsVdirsVS/PX3KdirsVdirsVdirsVdirBM86fvB2KuxV2KuxV2KuxV2KpRm 4fCXYq7FXYq7FXYq7FV8H99H/rD9eCXItWf6Je4vX8458AdirsVdirsVdirsVdiqX56+5TsVdirs VdirsVdirsVYJnnT94OxV2KuxV2KuxV2KuxVKM3D4S7FXYq7FXYq7FXYqvg/vo/9YfrwS5Fqz/RL 3F6/nHPgDsVdirsVdirsVdirsVS/PX3KdirsVdirsVdirsVdirBM86fvB2KuxV2KuxV2KuxV2KpR m4fCXYq7FXYq7FXYq7FV8H99H/rD9eCXItWf6Je4vX8458AdirsVdirsVdirsVdiqX56+5TsVdir sVdirsVdirsVYJnnT94OxV2KuxV2KuxV2KuxVKM3D4S7FXYq7FXYq7FXYqvg/vo/9YfrwS5Fqz/R L3F6/nHPgDsVdirsVdirsVdirsVQMsTxSvE+zxsVYe4NDnr0TYty5RMSQei3Ch2KuxV2KuxV2Kux VgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/wBYfrwS5Fqz/RL3F6/nHPgD sVdirsVdirsVdiq6KNpZUjTdnYKo9yaDFlGJkQB1RnnvTW07zbqcFKI0xmj8OM37wU+XKmepdnZf EwRPlXy2d32xp/C1U4/0r+e6Q5musdirsVdirsVdirsVYJnnT94OxV2KuxV2KuxV2KuxVKM3D4S7 FXYq7FXYq7FXYqvg/vo/9YfrwS5Fqz/RL3F6/nHPgDsVdirsVdirsVdiqd+StON/5o06ClVWUTSe HGL94a/PjTLMUbkHadiafxtXjj/Sv/S7sv8Azm8vNLb22uwrUwD6vd07IxrG30MSPpGdp2DqqJxH ruP0vXe1ehJjHOOm0vd0+373kudO8O7FXYq7FXYq7FXYqwTPOn7wdirsVdirsVdirsVdiqUZuHwl 2KuxV2KuxV2KuxVfB/fR/wCsP14Jci1Z/ol7i9fzjnwB2KuxV2KuxV2KuxV6j+UWgtHBca1MtDN+ 4ta/yA1kb6WAH0HMzTQ6vfeyGgMYyzy/i9Mfd1+3b4PQL2ztr20mtLlBJbzoY5UPdWFDmbjyGEhI cw9jlxRyQMJC4yFPnjzd5Xu/LurvZzVeBqvaXFNpI67f7IdGH8KZ3ei1kc+PiHPqO4vlXafZ09Ll MD9P8J7x+OaS5luvdirsVdirsVdirBM86fvB2KuxV2KuxV2KuxV2KpRm4fCXYq7FXYq7FXYq7FV8 H99H/rD9eCXItWf6Je4vX8458AdirsVdirsVdiqceVvLd1r+qpaRVWBfiup6bJH/AFPRRk8cDI07 Lsrs2erzCA+n+I9w/X3PerO0t7O1itbdBHBAoSNB2VRQZsgKFPruHDHHAQiKjEUFXC2JV5k8t6b5 g01rK9U9eUMy/bjf+Zf4jMnSaueCfFH+1wtfoMeqx8E/geoLwfzR5R1fy7d+jeJygcn6vdoD6cg+ fZvFT+rfO10etx543Hn1HUPmfaPZmXSzqY9PSXQ/juSXMt17sVdirsVdirBM86fvB2KuxV2KuxV2 KuxV2KpRm4fCXYq7FXYq7FXYq7FV8H99H/rD9eCXItWf6Je4vX8458AdirsVdirsVTjy35W1XX7r 0rROMCkevdN/doP4nwUZOGMyOzsuzeys2rnUB6esug/b5PbPL3l7T9C09bOzU9eUsrfbkf8Amb+A zYQgIig+pdndnY9Jj4IfE9SUzybnuxV2KqN5ZWl7bPbXcKT28go8UgDKfoOTx5JQNxNFry4oZImM wJRPe848w/kzbys02hXIgJ3+qXFWQf6sgqw+kH55v9L28RtlF+Y/U8lrvZSJN4JV/RPL58/vYHqX kTzbpzH19MmZB/uyEestPGsfKn05usXaODJykPjt97zWo7H1WL6oS+G/3JHLFLE/CVGjcdVYEH7j mYJA8nWyiYmiKW4UOxVgmedP3g7FXYq7FXYq7FXYq7FUozcPhLsVdirsVdirsVdiq+D++j/1h+vB LkWrP9EvcXr+cc+AOxVdHFLK3CNGdj0VQSfuGLKMTI0Bac6d5K80X5HoadKqn/dkw9JaeNZONfoy yOKR6Oy0/YmrzfTjl8fT97NtB/KKCNlm1q49Yjf6rBUJ/spDRj9AHzzIhpu96rQeyEYnizy4v6Me Xz5/KnoNpZ2tnbpb2sSwQRiiRoAqj6BmSAByexw4YY4iMAIxHQKuFsdir//Z - - - - - - 1 - False - False - - 15.999512 - 15.999512 - Pixels - - - - Cyan - Magenta - Yellow - Black - - - - - - Default Swatch Group - 0 - - - - - - Document - - - application/pdf - - - favicon - - - - - proof:pdf - uuid:49276370-8c95-2b47-8deb-60ea744d1636 - uuid:1a81c092-427b-5c4c-9f84-f9c4574519a1 - - - Adobe PDF library 9.00 - - - - - - - - - - - - - - - - - - - - - - - - - endstream endobj 3 0 obj <> endobj 7 0 obj <>/Resources<>/Properties<>>>/Thumb 11 0 R/TrimBox[0.0 0.0 15.9995 15.9995]/Type/Page>> endobj 8 0 obj <>stream -HlP +z6quO,0MOlAA< }av?Z\oFXNw#yɚnp{|>stream -8;Z%&&7>J<]`>_~> endstream endobj 12 0 obj [/Indexed/DeviceRGB 255 13 0 R] endobj 13 0 obj <>stream -8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 -b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` -E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn -6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( -l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 5 0 obj <> endobj 14 0 obj [/View/Design] endobj 15 0 obj <>>> endobj 10 0 obj <> endobj 9 0 obj <> endobj 16 0 obj <> endobj 17 0 obj <>stream -%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 14.0 %%AI8_CreatorVersion: 14.0.0 %%For: (Jono Brandel) () %%Title: (favicon.gif) %%CreationDate: 1/27/11 9:49 AM %%Canvassize: 16383 %%BoundingBox: 375 306 391 323 %%HiResBoundingBox: 375 306.3755 390.9995 322.375 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 10.0 %AI12_BuildNumber: 367 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Registration]) %AI3_Cropmarks: 375 306.3755 390.9995 322.375 %AI3_TemplateBox: 400 300 400 300 %AI3_TileBox: -13 8.375 779 620.375 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 1 %AI9_OpenToView: 315.25 351.75 8 1172 657 26 1 0 66 129 0 0 0 1 1 0 1 1 0 %AI5_OpenViewLayers: 7 %%PageOrigin:0 0 %AI7_GridSettings: 100 10 100 10 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 18 0 obj <>stream -%%BoundingBox: 375 306 391 323 %%HiResBoundingBox: 375 306.3755 390.9995 322.375 %AI7_Thumbnail: 128 128 8 %%BeginData: 29410 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FD11FFAF8B613D151B151B151B151B151B14B6FD1FB14D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D %181E181D181E18413A668AAFFD1FFFA961141B1415141B1415141B141514 %1B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C4C2E181D1818181D1818181D18181718183B5FAFFD1AFFAF3D %1B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D %181D181D181D181D181D181D1865AEFD16FFA9611415141B1415141B1415 %141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C %224C284C224C284C224C284C2252FD121817185FFD14FFAF3D151B151B15 %1B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E18 %1D181E181D181E181D181E181D18AFFD11FF8515141B1415141B1415141B %1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C22521818181D1818181D1818181D1818 %181D1818181D1818188AFD0FFF611B151B151B151B151B151B151B151B15 %1B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D18 %1D181D181D181D188AFD0DFF6115141B1415141B1415141B1415141B1415 %141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C %224C284C224C284C224C222E181DFD1618178AFD0BFF851B151B151B151B %151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E %181D181E181D181E181D181E181D181E181D181E188AFD09FFA91B141514 %1B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D18 %18181D1818181D1818181D1818181D1818181D1818181D18AEFD08FF3D15 %1B151B151B151B151B151B151B151B151B151B151B151B151B15B1B0FD1E %B14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D281D181D181D181D181D181D181D181D181D181D181D181D181D181D %3AFD07FF611415141B1415141B1415141B1415141B1415141B1415141B14 %1514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C28 %4C224C284C2252FD1C185FFD06FF151B151B151B151B151B151B151B151B %151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E %181D181E181D181E181D181E181D181E181DAEFD04FF3C151415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C22521818181D %1818181D1818181D1818181D1818181D1818181D1818181D1865FFFFFFAF %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B14 %B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D18FFFFFF851415141B1415141B1415141B1415141B1415141B %1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C %284C224C284C224C284C224C222E181DFD1C185FFFFF3D1B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E %181D181E181D181E181D181E181D181E181D181E181D181E181D181E1841 %FFA91B1415141B1415141B1415141B1415141B1415141B1415141B141514 %1B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D18 %18181D1818181D18AF8B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D8A3C15141B1415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C %224C284C224C284C224C284C224C284C224C284C224C284C2252FD1E1817 %653D151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D %181E181D181E181D181D3B1415141B1415141B1415141B1415141B141514 %1B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C28 %4C284C284C284C284C284C284C284C22521818181D1818181D1818181D18 %18181D1818181D1818181D1818181D1818181D1B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D %181D181D181D181D181D181D181D181D181D181D181D181D181D181D1814 %1B1415141B1415141B1415141B1415141B1415141B1415141B1415141B14 %158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B1224C284C224C284C224C284C224C284C224C284C224C284C224C28 %4C224C222E181DFD1E181B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D18 %1E181D181E181D181E181D181E181D181E181D18141B1415141B1415141B %1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D1818 %181D1818181D1818181D1818181D1818181D1818181D1818181D18181B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D281D181D181D181D181D181D181D181D181D181D181D181D %181D181D181D181D181415141B1415141B1415141B1415141B1415141B14 %15141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C2252FD20181B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E18 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E181415 %141B1415141B1415141B1415141B1415141B1415141B1415141B14151415 %8EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B14C4C284C284C284C284C284C284C284C284C284C284C284C284C284C %284C22521818181D1818181D1818181D1818181D1818181D1818181D1818 %181D1818181D1B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D18141B1415141B1415141B1415141B %1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C %284C224C284C224C284C224C284C224C284C224C222E181DFD1E181B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6 %FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E181D181E %181D181E181D18141B1415141B1415141B1415141B1415141B1415141B14 %15141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C28 %4C284C284C284C284C284C4C2E181D1818181D1818181D1818181D181818 %1D1818181D1818181D1818181D18181B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181415141B %1415141B1415141B1415141B1415141B1415141B1415141B141514158EB1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B1 %4C4C224C284C224C284C224C284C224C284C224C284C224C284C224C284C %2252FD20181B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D %181E181D181E181D181E181D181E181415141B1415141B1415141B141514 %1B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C28 %4C284C284C284C284C284C284C284C284C284C22521818181D1818181D18 %18181D1818181D1818181D1818181D1818181D1818181D1B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %281D181D181D181D181D181D181D181D181D181D181D181D181D181D181D %181D18141B1415141B1415141B1415141B1415141B1415141B1415141B14 %15141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C224C28 %4C224C284C224C222E181DFD1E181B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D18 %1E181D181E181D181E181D181E181D181E181D181E181D18141B1415141B %1415141B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C %284C284C284C284C284C284C284C284C284C284C284C284C284C284C4C2E %181D1818181D1818181D1818181D1818181D1818181D1818181D1818181D %18181B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D281D181D181D181D181D181D181D181D181D181D %181D181D181D181D181D181D181415141B1415141B1415141B1415141B14 %15141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C2252FD20181B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B15B6FD1FB14D28 %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D28 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E181D18 %1E181415141B1415141B1415141B1415141B1415141B1415141B1415141B %141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C284C %284C284C284C22521818181D1818181D1818181D1818181D1818181D1818 %181D1818181D1818181D1B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D18141B1415141B1415141B %1415141B1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C %284C224C284C224C284C224C284C224C284C224C284C224C222E181DFD1E %181B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E %181D181E181D181E181D18141B1415141B1415141B1415141B1415141B14 %15141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C28 %4C284C284C284C284C284C284C284C4C2E181D1818181D1818181D181818 %1D1818181D1818181D1818181D1818181D18181B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %14158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C284C %224C284C2252FD20181B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D %181E181D181E181D181E181D181E181D181E181415141B1415141B141514 %1B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C22521818181D18 %18181D1818181D1818181D1818181D1818181D1818181D1818181D1B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6 %FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D181D %181D181D181D18141B1415141B1415141B1415141B1415141B1415141B14 %15141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C28 %4C224C284C224C284C224C222E181DFD1E181B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D18 %1E181D181E181D181E181D181E181D181E181D181E181D181E181D18141B %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1515 %8EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1284C284C284C284C284C284C284C284C284C284C284C284C284C284C %284C4C2E181D1818181D1818181D1818181D1818181D1818181D1818181D %1818181D18181B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D181415141B1415141B1415141B14 %15141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C28 %4C224C284C224C284C224C284C224C284C224C284C2252FD20181B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B15B6FD %1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D281D181E181D181E181D181E181D181E181D181E181D181E181D18 %1E181D181E181415141B1415141B1415141B1415141B1415141B1415141B %1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C %284C284C284C284C284C22521818181D1818181D1818181D1818181D1818 %181D1818181D1818181D1818181D1B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D18141B1415141B %1415141B1415141B1415141B1415141B1415141B1415141B14158DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C %284C224C284C224C284C224C284C224C284C224C284C224C284C224C222E %181DFD1E181B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E %181D181E181D181E181D181E181D18141B1415141B1415141B1415141B14 %15141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C28 %4C284C284C284C284C284C284C284C284C284C4C2E181D1818181D181818 %1D1818181D1818181D1818181D1818181D1818181D18181B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B151B15B1B0FD1EB1 %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D281D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181415141B1415141B1415141B1415141B1415141B1415141B1415 %141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C224C284C %224C284C224C284C2252FD20181B151B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D %181E181D181E181D181E181D181E181D181E181D181E181415141B141514 %1B1415141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C284C225218 %18181D1818181D1818181D1818181D1818181D1818181D1818181D181818 %1D1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D %181D181D181D181D181D18141B1415141B1415141B1415141B1415141B14 %15141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C222E181DFD1E181B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D28 %1E181D181E181D181E181D181E181D181E181D181E181D181E181D181E18 %1D18141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C %284C284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D %1818181D1818181D18181B151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D %181D181D181D181D181D181D181D181D181D181D181415141B1415141B14 %15141B1415141B1415141B1415141B1415141B141514158EB18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C28 %4C224C284C224C284C224C284C224C284C224C284C224C284C2252FD2018 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D18 %1E181D181E181D181E181415141B1415141B1415141B1415141B1415141B %1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C22521818181D1818181D1818181D1818 %181D1818181D1818181D1818181D1818181D1B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4C284D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D181D18 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D18141B %1415141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B1224C284C224C284C224C284C224C284C224C284C224C284C224C284C %224C222E181DFD1E181B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E181D181E %181D181E181D181E181D181E181D181E181D18141B1415141B1415141B14 %15141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C28 %4C284C284C284C284C284C284C284C284C284C284C284C4C2E181D181818 %1D1818181D1818181D1818181D1818181D1818181D1818181D18181B151B %151B151B151B151B151B151B151B151B151B151B151B151B151B151B15B1 %B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D181D181415141B1415141B1415141B1415141B1415141B1415 %141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C224C284C %224C284C224C284C224C284C2252FD20181B151B151B151B151B151B151B %151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D %181E181D181E181D181E181D181E181D181E181D181E181D181E18141514 %1B1415141B1415141B1415141B1415141B1415141B1415141B141514158E %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B14C4C284C284C284C284C284C284C284C284C284C284C284C284C284C28 %4C22521818181D1818181D1818181D1818181D1818181D1818181D181818 %1D1818181D1B151B151B151B151B151B151B151B151B151B151B151B151B %151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D181D %181D181D181D181D181D181D181D18141B1415141B1415141B1415141B14 %15141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C224C222E181DFD1E181B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B14B6FD %1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D281E181D181E181D181E181D181E181D181E181D181E181D181E18 %1D181E181D18141B1415141B1415141B1415141B1415141B1415141B1415 %141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C284C284C %284C284C284C284C284C4C2E181D1818181D1818181D1818181D1818181D %1818181D1818181D1818181D18181B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D %181D181D181D181D181D181D181D181D181D181D181D181D181415141B14 %15141B1415141B1415141B1415141B1415141B1415141B141514158EB18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C %4C224C284C224C284C224C284C224C284C224C284C224C284C224C284C22 %52FD20181B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E181D181E181D18 %1E181D181E181D181E181D181E181415141B1415141B1415141B1415141B %1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C %284C284C284C284C284C284C284C284C284C22521818181D1818181D1818 %181D1818181D1818181D1818181D1818181D1818181D1B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C %4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %1D181D181D181D181D181D181D181D181D181D181D181D181D181D181D18 %1D18141B1415141B1415141B1415141B1415141B1415141B1415141B1415 %141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C224C284C %224C284C224C222E181DFD1E181B151B151B151B151B151B151B151B151B %151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E181D181E181D181E %181D181E181D181E181D181E181D181E181D181E181D18141B1415141B14 %15141B1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C28 %4C284C284C284C284C284C284C284C284C284C284C284C284C284C4C2E18 %1D1818181D1818181D1818181D1818181D1818181D1818181D1818181D18 %181B151B151B151B151B151B151B151B151B151B151B151B151B151B151B %151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C28 %4D4C4C284D4C4C284D281D181D181D181D181D181D181D181D181D181D18 %1D181D181D181D181D181D181415141B1415141B1415141B1415141B1415 %141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18DB1 %B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C284C %224C284C224C284C224C284C224C284C2252FD20181B151B151B151B151B %151B151B151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D %181E181D181E181D181E181D181E181D181E181D181E181D181E181D181E %181415141B1415141B1415141B1415141B1415141B1415141B1415141B14 %1514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C284C28 %4C284C284C22521818181D1818181D1818181D1818181D1818181D181818 %1D1818181D1818181D1B151B151B151B151B151B151B151B151B151B151B %151B151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D181D18141B1415141B1415141B14 %15141B1415141B1415141B1415141B1415141B14158DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C28 %4C224C284C224C284C224C284C224C284C224C284C224C222E181DFD1E18 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %1B14B6FD1FB14D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D281E181D181E181D181E181D181E181D181E181D181E18 %1D181E181D181E181D18141B1415141B1415141B1415141B1415141B1415 %141B1415141B1415141B15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C284C284C284C284C284C %284C284C284C284C284C284C284C4C2E181D1818181D1818181D1818181D %1818181D1818181D1818181D1818181D18183D151B151B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D %181D181D181D181D181D181D181D181D181D181D181D181D181D181D1836 %15141B1415141B1415141B1415141B1415141B1415141B1415141B141514 %158EB18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0 %B1B0B14C4C224C284C224C284C224C284C224C284C224C284C224C284C22 %4C284C2252FD1E18174161151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D181E181D181E18 %1D181E181D181E181D181E181D181E181D181D656115141B1415141B1415 %141B1415141B1415141B1415141B1415141B141514158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B14C4C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C22521818181D %1818181D1818181D1818181D1818181D1818181D1818181D1818178AAF15 %1B151B151B151B151B151B151B151B151B151B151B151B151B151B151B14 %B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C %4C284D4C4C281D181D181D181D181D181D181D181D181D181D181D181D18 %1D181D181D181DAEFF3D1415141B1415141B1415141B1415141B1415141B %1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C %284C224C284C224C284C224C222E181DFD1D18FFFF611B151B151B151B15 %1B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E18 %1D181E181D181E181D181E181D181E181D181E181D181E181D181E188AFF %FFAF1415141B1415141B1415141B1415141B1415141B1415141B1415141B %15158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1284C284C284C284C284C284C284C284C284C284C284C284C284C %284C284C4C2E181D1818181D1818181D1818181D1818181D1818181D1818 %181D1818181DAEFFFFFF61151B151B151B151B151B151B151B151B151B15 %1B151B151B151B151B15B1B0FD1EB14C284D4C4C284D4C4C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D181D181D181D181D %181D181D181D181D181D181D181D181D3BFD04FFA81B1415141B1415141B %1415141B1415141B1415141B1415141B141514158EB18DB1B0B18DB1B0B1 %8DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C %284C224C284C224C284C224C284C224C284C224C284C2252FD1D18AFFD05 %FF611B151B151B151B151B151B151B151B151B151B151B151B151B151B15 %B6FD1FB14D284D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C %4D4C4D4C4D281D181E181D181E181D181E181D181E181D181E181D181E18 %1D181E188AFD07FF1515141B1415141B1415141B1415141B1415141B1415 %141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C284C284C %284C284C284C284C22521818181D1818181D1818181D1818181D1818181D %1818181D18181741FD08FFAF151B151B151B151B151B151B151B151B151B %151B151B151B151B14B6FD1FB14D4C4C284D4C4C284D4C4C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C281D181D181D181D181D181D181D181D %181D181D181D181D181D181DAEFD09FF8B1415141B1415141B1415141B14 %15141B1415141B1415141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1224C284C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C222E181DFD181883FD0BFF8B151B15 %1B151B151B151B151B151B151B151B151B151B151B14B6FD1FB14D4C4D4C %4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281E18 %1D181E181D181E181D181E181D181E181D181E181D181D65FD0DFF85141B %1415141B1415141B1415141B1415141B1415141B15158EB1B0B1B0B1B0B1 %B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1284C284C284C %284C284C284C284C284C284C284C284C284C284C284C284C4C2E181D1818 %181D1818181D1818181D1818181D1818181D18185FFD0FFF8B151B151B15 %1B151B151B151B151B151B151B151B151B15B1B0FD1EB14C284D4C4C284D %4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D281D181D181D %181D181D181D181D181D181D181D181D181D8AFD11FFAF14151415141B14 %15141B1415141B1415141B141514158EB18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B18DB1B0B18DB1B0B1B0B14C4C224C284C224C284C224C28 %4C224C284C224C284C224C284C224C284C2252FD1418173A84FD14FF611B %151B151B151B151B151B151B151B151B151B15B6FD1FB14D284D4C4D4C4D %4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D4C4D281D181E181D %181E181D181E181D181E181D181D188AFD17FFA96114151415141B141514 %1B1415141B141514158EB1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0B1B0 %B1B0B1B0B1B0B1B0B1B0B14C4C284C284C284C284C284C284C284C284C28 %4C284C284C284C284C284C22521818181D1818181D1818181D1818181D18 %183BAFFD1BFF613D151B151B151B151B151B151B151B14B6FD1FB14D4C4C %284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C284D4C4C281D %181D181D181D181D181D181D181D3A8AAEFD1FFFAF6161141B1415141B14 %15141B14158DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18DB1B0B18D %B1B0B18DB1B0B1224C284C224C284C224C284C224C284C224C284C224C28 %4C224C284C224C222E181DFD09183B3B8AAEFD10FFFF %%EndData endstream endobj 19 0 obj <>stream -%AI12_CompressedDataxݽ~8(`@،ٳ5 IHȾN 6ٯ$ol=or%RTRENp d6sHH&+[zFSUSURTo~.@c@-#C/Q |:G~wL R="O'w9՗"A5Kk` /tI)q8yR$N/_פwoi$O0r;Qnıp5 JD#}!S鄧CP/ܵ,," m㋱ٖ -G׵j[fUq4~(s'5@(Z˂֟<6=aoڢ #Gդo/hCK(b:vo \SH@5;|0F%<@aIj(}:V(8i/1.}.~K\" h*K rE PDBΐN!S2 qg >uҠ_4H{xj# lc[mAr?u+V7ւS 'gf<"z!x ^R}5u'튡H7m4 G}:p=$iʰ7$ rꡢo@,>V TgEu.} 0c?ait}v Va@oq45*`;c3 f$ f̚v\!e(hk/iDLBз~3/uXh8TpKreXb__/a? Ѱ΋K_I>Oiɲ,f_Á2&?;dX*r3??RYHaΟz8Tdc=Y@Kzt 3˨f~:TK@f)zgJqi4X~Xm7~4Ơ[h,k}9cu"p}&ϒ7800m66SN6}k6͙@3g{[P{#O?']-i@EQ^ ea2-*&7*<T$z'yUk&p4 ]6vgS%!5 -ҩǩ9j׿{ȀU3Cy9kFΤp.f<X:Sp=wp&kr {<5 ϼ`$"XDغԿ 9D"Iu-U7;q1&`T=0`8T|{awFֵqH$k@a\}0D+c6Zc*~H\[՝R1nc:ޫt> iȊ٧ݔUCIdbQ"}\GٵaտQ%*1ƜIm n֦ѰWEˆH9vW/~.-\\US!Zڧn!1$kp<7VTrs~5+N0R]ƽ>3V9'*gKmڔiTB`|s}U<>sU-X>2I}!q)x#2=ѫ oD_P&Yҙwu+xMw&M}#DHqnaVtz&NZrӹy/q&ua~^;QOUfo26;"K tLn B. ڳK@6YCG2PS1 I;g*'G9P52ˆK˚8kdvة]{mum4|:bNW6ɽP8G6TBG#buLS|{Śu_c*\3C9 TVPyuä1CchKY5W6wNFo}jűOz"p }Cx96kG-?BG(͈2 uǕ^YzҿG`2QR}:wsÜR7ʺk@I&,z=z*MF?tJǪJA hw5H_)*>u# |yBXK F)!Q=sTYRKjjȣ/j7KӳXm,R(Aȋݣ(G ?qS?E f%kAXR $f@K,㠂<>T -Xs TPmq<6O*Džޤ:)NA]coGD?Nqz\uȄ9bf2;50ק̀Av<#5ɳ /Yjy{w?BGP?6M Ӱ.rݺh`ʶ3g!n}MwbA嵴L'þ"DMR3A a$<z ]hiH>*9`Q <C71a@SUq i#lO:F|lIןX<0kzb2FEbBWN[xYekg3 Uƚ|DY =h6u#C}O)w'gsԽ -sZ8;<4`)Us92jzj67uxʰur=E1׃5u4q<.sվro{J)[*<wo xv)ԕӲW:ڹK5m]y~kn?yXd.hU WP**Tj^F|:чaL-5[UZ Vy45hh^j_ZjJ?ۿ|Ps6=_m_[ǯ)bkPլhaxڌ G5Qȍ3Ϲakn4U7gIJϨP'7{ѕƠb礱j9<57WoFXfɃ^ꞈ_bhBov[ P{u>J~NaYM=vϪqhN!םbE)YoVT^#Fx%6diO2y;+QuUoH,Bjo{v笮unmrrtEJCݎ|o;FCSZXݐ>.(# u^nΠ_<FP=V`4-tZ_z篆c|멞'5+G?jku7z |uFb|gKRQ\>M>Flߦ6z|tR!5 -9nܗ^iN;Am+#Si#h(B);Pݏݾ޽m<6jw?_Mb/Z5 -X{Z {Cn <UWlW@Ap(|wηF\4), V`}Wqmjh4y5*lEd6 -?u>eh=Boq7m8o힀V@YVxI[@Qe3ݺL9GztSF7juIڰQ~{4*pg7G;J 䇛 |*wF)ˈj{T -fG*k5XJ0GqXY9T:V/GyW5GV=_.ꗔRmdU%/H+O)tRz*&nj)Ic-~͚liaF|QJw՝WVenMV(_%3k7KϯDvqJ﬚(?rK*K^څ+1KEݳ_wnM~H(ݕDAØtV.$Ưbirp Je{d.QX-*oX:Ä~٨Ko[N ` 66EIlgb&I핏~!֬Hښ;v&]݅`_\O)|jg5<]+tP{vxlGhvI;Vn/4:|SY6vIc&"xo5 ɷ]}ro6{7xMR*%]YG6yzͦ`5lh0}6m~up^\aWFA+ۣsY!Mȍ荮4>xǪt6FnzFEjPo[Ա"(GnhM؍څsY$GODOL.V%ڧ\ 3Sݯ--nvZD4^sS1&f߼8>Ky|Cp_K\멽SxUݒ&j?ZYt kS-YՀ:#m}0da?fct?G"$Fم5Z|=y?סnzwJuuեpu+5M*2؋mHG=9a|i|>BGfО% z!Hc#F5;c0@vK'Pmd?eӕ1䌸q4mJ^=!/dXCbf=o"Z_Ԧ"KF`tPʈ|y]gpW;SۦuhٵV9UTk^7ps*FEfSL aϵXAN;uu|?-=y>ļoEiR"Fq`02(6ؽ םaXwޫQذ*Q2QOʌdˮjJ  .W2TH]W%oPz& yJqU|}xZVӄX{AL~:M'WR(p~JyȂKv!+0tUZ:T`醧A?}KTeMJ^`C{+aL|AZ0 bc̰l&T΍\*ڱWd|8ВUEflpމ/*?i4FY?͝Im?b؉-gl(cSm@[/ suDה],qsoٛ1@ET徛 '׏4-Çm _hM Ũq6۰jB@X4-_Kb`|Ao]y<Ĉf -L &3 37Iۓ:3+ ƺĩc_YejXdʰ.8BeKzwo$ ~b쉭L@DYɌXü}K](BId` Xk+bhAt 6`fqR27* ]y*}VEic.WĝIiMNb0܋[KX/n8o]Q~^95:2 (M.7V\n>x CB!K1EN 0^uNJLx h|O^v_r_{iOQ6f`q#Xb! ?r}|)Œta葏>f0.͆Ah96^÷'XUW}ӜA^9}GD橺[^7nNO`AS,j166]o\ Nn qoM}!͠.X`ڌ;Ol=9!g+.ئ7pfB @!Fk޾A:1p5 NJ~RUƁ=iD8> M1sei{ K4:Eik~>w 󍉡#/zdJ`N ƞ}v-0F? - /Eb燈g )0Q2t&|27΢,ON`hVuHN $/S&1-Z/./#C_;Ζq"(~INlz :x]~e0>f,x< zp y2x.)W_<FPpno(op{G!%1x8l^p%bchI/& fHtݒ'rKbxx=dBpq#lo@ vF|;Vha&~DMFaZmj0-+挰s֨3 u#Z].aSFN(ɝhn]`L>L5z[j7 笮OF6n^ʻ]:dߒ-:rnE%mj֭c3[hϮVE~y_%>sETǟڽ.-)N2\z6w4>;<-)u|o]5tWJ]jc_/}$wWt~taEӑnYtX:0Dӑl`4)nTO\hqV/)tM=DMG:d咢Ht%Dӑ,{MGۻeEysh:R,wtt$ft.o6^<4H !4DofA#[.3.掦R[v4ݼ MGaMGbMGZz4d~h:R,{x4)|y2h:R,[,MGB#[R"MGǷp?ZSЕ_G`  N-tbH].W]7H-,ď 6iv5ܩ.1r%ݻ!O$G -/'u:";"S$ܬ=,s' FNsM%aN·YyDr1 l$[p@'SE[ܱXOZ=ݱ*UܙoAVM|4@\MNgu]8gr%+Sß t!CkTDLa)NdTӟY2l!9O -:P#o[(A^3sEW ݴHa.?#;ֺ[9]o)~+ Vixt<1EE/iӅJ|JbnjΝg'N {d[ZC(+y+S})ѐDuN`Q1|*"hkzSzvjD϶Fǘ;GdhG=\-xǞDSԳ?G{aj^>&IafRUQ3=Dz׵ǺrpxT>VRj>n)x"#g +dD E`pړG˭6NJxv܌e';Jc67+FC=%n+]5Sԭ.܉rmJJL2 <1o,+ ϕ]9'ȿoauF[֨DjV:"?5) ݍ^F1dan>6kmbzlJpL'O;IyM\YeV1/Ts+ zHkNr6A>$תձie$7.h SGT Zyr4?MdqS %'i 3ٽ=+n'^<:UJ9~H`2ɑ\lz|aE-ָ:%E#֗p}쵾{k=e;Z_%05^wѽXc. fŕY9LO.k`f47>siK:]Lvc^ie n}4=c@39}ρ=c75lƮDAǻ4㧴@(C9]\C?Gmripr匮7|RX&ƲX -l&\xV;gVR>UaI3-#)GXIIb xs$#Yᖟ3?Ғ\ )ê;=S:uqL귌`^Dr-n9lۖ*D+*]Yʝ*D݉G!#ny(y~ޞ!j~ \KGr̹|Y0fWΗ;\@yDP ׏8M޷ϑr;G#L[(CP<8KH+@0w^Y78<4wxϛ\k޼~sKwIvvFΟ5o枫9y#ȶh^?ϵv)yyO[g>YGsyӽmyg[NTF(~n/yyg[ _' || _ce[J>>߽4 ysq[8YC ȋojRs~)y׏-uѼ~ sE70ϑ?U -㖳@y(|Pf؜yflJs0e[ 7qd[{M!F#_^?o:I\0w@-Տ͕K uecaIwV?yO's^?o`hJ25#Z9.rauTv>fEx [t\yzXo !P% aSlN7RVyͬREPÛe:ZޝyƑT*o?=Xq^yx-luVkq!}NHSS.?v2ptLMoXۭc.I@S"膢d+$#vտgѽ\qMQ͗YX\]o|SQIen${pa#r-?) 7~[**\!KT8l5vwv -H=F犌Q&Yzr0.O㤱#6#iw'o\yC4=ד/@8N dyD˅\OU|EF*T' {k-}p<7Bpd!WZ+u;;9x>?<*FyjP}9Y=B#*񺾬ѩ^. -Z"2mD3׭P:89z̧ᅭBhO5_+eoVRW7fOs1`@?'8@p6D)k;;on=8nS ~flH*XMf`w -kǟfy 4lֻ8՛U4'[<|6DBKߙBK?v5bUz 2ɗ5@,Q2W%.Ol))|Ou:JXaBulxaԉ6$`:CE;ݫ4 ^(DI;mw;?, j=v¡AOROlb9=aBhjw:u NEx PrmP]ICyDB|L;[w;2`-j{޼m~AExgP~bf,.@b3006퀧:G6D6kPɷ nyxCܬtF"I -~>4m g('ʻ ~7u#tr2CX8 -醚#n}1H΢o& Lb3 Ea,ƭ.N>UBίhe$^uGշP'7bpr^U)ĒiDK`~?. H#i/+bCNs C?$Iaiz|}0rp]"DM0^ 8]RVڎ"˕Esr>JQD֍:Tx lOX߉C7.!M`,󁰩 .Zg3v֋ć.l꽸1ҘǨb Ҙ' -y V|46 ؜à:{ K|DfĦM}pKM*M Hdش%7r-L"o+ѶO% SCWׅ{mcv͝\[nԅRvI||ZBjx>JUIF_t!"DM dL(U m%dGfZP" =Y?oM}re)_YE -S`вf&𘬥ŝMc:{*~ -&ԛI\j66`7l}&1i77FUp&A8).=#al{7i{|:yZ -{cKĬ4!4~]!It&~ާ o>ڔ6[{FoY0vk8-|og?lbڦ-So| )os)of )o˔H*˙T+?HR.p%Bۡq&s3 Eܟ~Kc҇q)_@PCF-$qr v^n~^튵wa!)S+`v±r89Eop| 'k$&@A<Gl- ߏ;ɷ\vowս]!?n#.YEbh͞ԃJ}@/ ~݇up4)?a F G{9PF\̈ZK67wk}0l.IUe#kEyMCeV-(aj -Q[8墘D[f&& ၘYp )ez`0QZNZsB_*VJ*yCTuҬTWS[Apa"^]ۯc'RC~<7]QhDlO@߷-(斄HZ?o'OZ $-)"h@Ws`7cdA{ -AT+}7QX<:7z0Dەªg1QYN( " Sͷb ~a`\'oB> s"ڎrg`[.,,JTBD3k6cKdgKWжlTYNl}v^ ފ {.ئ鄽ll@'e`#<ㄽllnr^ ҝ.ء {.z {.hg\V^e[BE{mB%{mBd[*1ګE!R>HHHt+c8n$%x[,s 1p_ endstream endobj 6 0 obj [5 0 R] endobj 20 0 obj <> endobj xref 0 21 0000000000 65535 f -0000000016 00000 n -0000000144 00000 n -0000012831 00000 n -0000000000 00000 f -0000014219 00000 n -0000062939 00000 n -0000012882 00000 n -0000013220 00000 n -0000014518 00000 n -0000014405 00000 n -0000013504 00000 n -0000013658 00000 n -0000013706 00000 n -0000014289 00000 n -0000014320 00000 n -0000014591 00000 n -0000014765 00000 n -0000015774 00000 n -0000045382 00000 n -0000062962 00000 n -trailer <<0DCD76651D6844A9B966BF9A0DD8BEC0>]>> startxref 63133 %%EOF \ No newline at end of file diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png deleted file mode 100644 index 1126a7a..0000000 Binary files a/docs/assets/favicon.png and /dev/null differ diff --git a/docs/assets/itgivesyouthis.jpg b/docs/assets/itgivesyouthis.jpg deleted file mode 100644 index 026ba26..0000000 Binary files a/docs/assets/itgivesyouthis.jpg and /dev/null differ diff --git a/docs/assets/profile.png b/docs/assets/profile.png deleted file mode 100644 index 4e8f686..0000000 Binary files a/docs/assets/profile.png and /dev/null differ diff --git a/docs/demo.js b/docs/demo.js deleted file mode 100644 index 359e637..0000000 --- a/docs/demo.js +++ /dev/null @@ -1,231 +0,0 @@ -function FizzyText(message) { - - var that = this; - - // These are the variables that we manipulate with gui-dat. - // Notice they're all defined with "this". That makes them public. - // Otherwise, gui-dat can't see them. - - this.growthSpeed = 0.2; // how fast do particles change size? - this.maxSize = 5.59; // how big can they get? - this.noiseStrength = 10; // how turbulent is the flow? - this.speed = 0.4; // how fast do particles move? - this.displayOutline = false; // should we draw the message as a stroke? - this.framesRendered = 0; - - // __defineGetter__ and __defineSetter__ makes JavaScript believe that - // we've defined a variable 'this.message'. This way, whenever we - // change the message variable, we can call some more functions. - - this.__defineGetter__("message", function () { - return message; - }); - - this.__defineSetter__("message", function (m) { - message = m; - createBitmap(message); - }); - - // We can even add functions to the DAT.GUI! As long as they have - // 0 arguments, we can call them from the dat-gui panel. - - this.explode = function() { - var mag = Math.random() * 30 + 30; - for (var i in particles) { - var angle = Math.random() * Math.PI * 2; - particles[i].vx = Math.cos(angle) * mag; - particles[i].vy = Math.sin(angle) * mag; - } - }; - - //////////////////////////////////////////////////////////////// - - var _this = this; - - var width = 550; - var height = 200; - var textAscent = 101; - var textOffsetLeft = 80; - var noiseScale = 300; - var frameTime = 30; - - var colors = ["#00aeff", "#0fa954", "#54396e", "#e61d5f"]; - - // This is the context we use to get a bitmap of text using - // the getImageData function. - var r = document.createElement('canvas'); - var s = r.getContext('2d'); - - // This is the context we actually use to draw. - var c = document.createElement('canvas'); - var g = c.getContext('2d'); - - r.setAttribute('width', width); - c.setAttribute('width', width); - r.setAttribute('height', height); - c.setAttribute('height', height); - - // Add our demo to the HTML - document.getElementById('helvetica-demo').appendChild(c); - - // Stores bitmap image - var pixels = []; - - // Stores a list of particles - var particles = []; - - // Set g.font to the same font as the bitmap canvas, incase we - // want to draw some outlines. - s.font = g.font = "800 82px helvetica, arial, sans-serif"; - - // Instantiate some particles - for (var i = 0; i < 1000; i++) { - particles.push(new Particle(Math.random() * width, Math.random() * height)); - } - - // This function creates a bitmap of pixels based on your message - // It's called every time we change the message property. - var createBitmap = function (msg) { - - s.fillStyle = "#fff"; - s.fillRect(0, 0, width, height); - - s.fillStyle = "#222"; - s.fillText(msg, textOffsetLeft, textAscent); - - // Pull reference - var imageData = s.getImageData(0, 0, width, height); - pixels = imageData.data; - - }; - - // Called once per frame, updates the animation. - var render = function () { - - that.framesRendered ++; - - g.clearRect(0, 0, width, height); - - if (_this.displayOutline) { - g.globalCompositeOperation = "source-over"; - g.strokeStyle = "#000"; - g.lineWidth = .5; - g.strokeText(message, textOffsetLeft, textAscent); - } - - g.globalCompositeOperation = "darker"; - - for (var i = 0; i < particles.length; i++) { - g.fillStyle = colors[i % colors.length]; - particles[i].render(); - } - - }; - - // Returns x, y coordinates for a given index in the pixel array. - var getPosition = function (i) { - return { - x: (i - (width * 4) * Math.floor(i / (width * 4))) / 4, - y: Math.floor(i / (width * 4)) - }; - }; - - // Returns a color for a given pixel in the pixel array. - var getColor = function (x, y) { - var base = (Math.floor(y) * width + Math.floor(x)) * 4; - var c = { - r: pixels[base + 0], - g: pixels[base + 1], - b: pixels[base + 2], - a: pixels[base + 3] - }; - - return "rgb(" + c.r + "," + c.g + "," + c.b + ")"; - }; - - // This calls the setter we've defined above, so it also calls - // the createBitmap function. - this.message = message; - - var loop = function() { - - requestAnimationFrame(loop); - - // Don't render if we don't see it. - // Would be cleaner if I dynamically acquired the top of the canvas. - if (document.body.scrollTop < height + 20) { - render(); - } - - } - - // This calls the render function every 30 milliseconds. - loop(); - - // This class is responsible for drawing and moving those little - // colored dots. - function Particle(x, y, c) { - - // Position - this.x = x; - this.y = y; - - // Size of particle - this.r = 0; - - // This velocity is used by the explode function. - this.vx = 0; - this.vy = 0; - - // Called every frame - this.render = function () { - - // What color is the pixel we're sitting on top of? - var c = getColor(this.x, this.y); - - // Where should we move? - var angle = noise(this.x / noiseScale, this.y / noiseScale) * _this.noiseStrength; - - // Are we within the boundaries of the image? - var onScreen = this.x > 0 && this.x < width && - this.y > 0 && this.y < height; - - var isBlack = c != "rgb(255,255,255)" && onScreen; - - // If we're on top of a black pixel, grow. - // If not, shrink. - if (isBlack) { - this.r += _this.growthSpeed; - } else { - this.r -= _this.growthSpeed; - } - - // This velocity is used by the explode function. - this.vx *= 0.5; - this.vy *= 0.5; - - // Change our position based on the flow field and our - // explode velocity. - this.x += Math.cos(angle) * _this.speed + this.vx; - this.y += -Math.sin(angle) * _this.speed + this.vy; - - this.r = DAT.GUI.constrain(this.r, 0, _this.maxSize); - - // If we're tiny, keep moving around until we find a black - // pixel. - if (this.r <= 0) { - this.x = Math.random() * width; - this.y = Math.random() * height; - return; // Don't draw! - } - - // Draw the circle. - g.beginPath(); - g.arc(this.x, this.y, this.r, 0, Math.PI * 2, false); - g.fill(); - - } - - } - -} diff --git a/docs/docs.css b/docs/docs.css deleted file mode 100644 index 54eb50f..0000000 --- a/docs/docs.css +++ /dev/null @@ -1,265 +0,0 @@ -* { - padding: 0px; - margin: 0px; -} - -body { - font: 9.5px/13px Lucida Grande, sans-serif; - padding: 0 20px 20px 20px; -} - -#container { - max-width: 530px; -} - -h1, h2, h3, h4, h5, h6 { - font-family: "Helvetica Neue", helvetica, arial, sans-serif; - color: #222; -} - -hr { - border: 0; - height: 0; - border-top: 1px dotted #ccc; -} - -h1 { - font-size: 80px; - font-weight: 800; - text-transform: lowercase; - line-height: 80px; - margin: 39px 0 20px 0; -} - -h1 a:link, h1 a:visited, h1 a:hover, h1 a:active { - text-decoration: none; - margin-right: 7px; -} - -h1 img { - width: 45px; - height: 45px; - margin-bottom: 8px; -} - -h2 { - margin-top: 30px; - font-size: 18px; - margin-bottom: 24px; -} - -h2.section { - margin: 0; - padding: 20px 0px 20px 0px; - cursor: pointer; - border-top: 1px dotted #ccc; - -webkit-transition: color 0.15s linear; -} - -h2.section:hover { - color: #00aeff; -} - -div.collapsed h2, div.expanded h2 { - - float: left; - clear: both; - width: 100%; - cursor: pointer; -} - -.last { - margin-bottom: 0px !important; -} - -.first { - margin-top: 0px; -} - -div.trans { - border-top: 1px dotted #ccc; - margin: 0px 0px 20px 0px; -} - -ol#secrets { - padding: 0px; - margin: 0px; -} - -div.expanded h2:before { - content: '-'; -} - -div.collapsed h2:before { - content: '+'; -} - -div.expanded h2:before, div.collapsed h2:before { - font-weight: normal; - line-height: 2px; - float: left; - margin-top: 6px; - margin-right: 6px; - font-size: 9px; - font-family: Monaco, monospace; -} - -div.collapsable>div { - padding-bottom: 10px; -} - -div.collapsable { - overflow: hidden; - clear: both; - -moz-transition: height .2s ease-out; - -webkit-transition: height .2s ease-out; - transition: height .2s ease-out; -} - -div.collapsable div { - padding-bottom: 20px; - margin-bottom: -20px; - height: auto; -} - -div.collapsed .collapsable { - overflow: hidden; - clear: both; - height: 0; -} - -div.expanded { - cursor: pointer; -} - -#helvetica-demo { - position: absolute; - left: 0; - top: 0; - width: 800; - height: 300; - z-index: -1; -} - -#notifier { - position: fixed; - right: 0; - top: 230px; - width: 271px; - height: 142px; - background: url("assets/itgivesyouthis.jpg") center 0 no-repeat; - z-index: -2; - margin: 30px 22px 0 0; -} - -pre { - margin: 20px 0 20px 0; - padding: 15px; - background-color: #222; - max-width: 500px; - font: 10px Monaco, monospace; - clear: both; -} - -p, ul, ol { - font-size: 125%; - clear: both; - line-height: 18px; - margin-bottom: 24px; -} - -li { - margin-left: 22px; -} - -ul#desc { - list-style: circle; - font-size: 100%; - max-width: 380px; -} - -a:link { - color: #00aeff; -} - -a:visited { - color: #0fa954; -} - -a:hover { - color: #e61d5f; -} - -a:active { - color: #54396e; -} - -footer { - margin-top: 20px; - background-color: #eee; - width: 510px; - padding: 10px; - clear: both; - color: #444; - -} - -pre a:link, -pre a:visited, -pre a:active, -pre a:hover { - color: #ccc; -} - -code { - font: 10px Monaco, monospace; -} - -code strong { - font-weight: normal; - color: #e61d5f; -} - -.str { - color: #0fa954; -} - -.kwd { - color: #e61d5f; -} - -.com { - color: #555; -} - -.typ { - color: #ccc; -} - -.lit { - color: #00aeff; -} - -.pun, .opn, .clo { - color: #777; -} - -.pln { - color: #ccc; -} - -.tag { - color: #555; -} - -.atn { - color: #555; -} - -.atv { - color: #777; -} - -.dec { - color: #606; -} \ No newline at end of file diff --git a/docs/improvedNoise.js b/docs/improvedNoise.js deleted file mode 100644 index 0947d32..0000000 --- a/docs/improvedNoise.js +++ /dev/null @@ -1,181 +0,0 @@ -// http://mrl.nyu.edu/~perlin/noise/ - -var ImprovedNoise = function () { - - var p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10, - 23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87, - 174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211, - 133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208, - 89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5, - 202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119, - 248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232, - 178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249, - 14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205, - 93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180]; - - for ( var i = 0; i < 256 ; i++ ) { - - p[ 256 + i ] = p[ i ]; - - } - - function fade( t ) { - - return t * t * t * ( t * ( t * 6 - 15 ) + 10 ); - - } - - function lerp( t, a, b ) { - - return a + t * ( b - a ); - - } - - function grad( hash, x, y, z ) { - - var h = hash & 15; - var u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z; - return ( ( h & 1 ) == 0 ? u : -u ) + ( ( h & 2 ) == 0 ? v : -v ); - - } - - return { - - noise: function ( x, y, z ) { - - var floorX = Math.floor( x ), floorY = Math.floor( y ), floorZ = Math.floor( z ); - - var X = floorX & 255, Y = floorY & 255, Z = floorZ & 255; - - x -= floorX; - y -= floorY; - z -= floorZ; - - var xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1; - - var u = fade( x ), v = fade( y ), w = fade( z ); - - var A = p[ X ] + Y, AA = p[ A ] + Z, AB = p[ A + 1 ] + Z, B = p[ X + 1 ] + Y, BA = p[ B ] + Z, BB = p[ B + 1 ] + Z; - - return lerp( w, lerp( v, lerp( u, grad( p[ AA ], x, y, z ), - grad( p[ BA ], xMinus1, y, z ) ), - lerp( u, grad( p[ AB ], x, yMinus1, z ), - grad( p[ BB ], xMinus1, yMinus1, z ) ) ), - lerp( v, lerp( u, grad( p[ AA + 1 ], x, y, zMinus1 ), - grad( p[ BA + 1 ], xMinus1, y, z - 1 ) ), - lerp( u, grad( p[ AB + 1 ], x, yMinus1, zMinus1 ), - grad( p[ BB + 1 ], xMinus1, yMinus1, zMinus1 ) ) ) ); - - } - } -} - -var currentRandom = Math.random; - -// Pseudo-random generator -function Marsaglia(i1, i2) { - // from http://www.math.uni-bielefeld.de/~sillke/ALGORITHMS/random/marsaglia-c - var z=i1 || 362436069, w= i2 || 521288629; - var nextInt = function() { - z=(36969*(z&65535)+(z>>>16)) & 0xFFFFFFFF; - w=(18000*(w&65535)+(w>>>16)) & 0xFFFFFFFF; - return (((z&0xFFFF)<<16) | (w&0xFFFF)) & 0xFFFFFFFF; - }; - - this.nextDouble = function() { - var i = nextInt() / 4294967296; - return i < 0 ? 1 + i : i; - }; - this.nextInt = nextInt; -} -Marsaglia.createRandomized = function() { - var now = new Date(); - return new Marsaglia((now / 60000) & 0xFFFFFFFF, now & 0xFFFFFFFF); -}; - -// Noise functions and helpers -function PerlinNoise(seed) { - var rnd = seed !== undefined ? new Marsaglia(seed) : Marsaglia.createRandomized(); - var i, j; - // http://www.noisemachine.com/talk1/17b.html - // http://mrl.nyu.edu/~perlin/noise/ - // generate permutation - var p = new Array(512); - for(i=0;i<256;++i) { p[i] = i; } - for(i=0;i<256;++i) { var t = p[j = rnd.nextInt() & 0xFF]; p[j] = p[i]; p[i] = t; } - // copy to avoid taking mod in p[0]; - for(i=0;i<256;++i) { p[i + 256] = p[i]; } - - function grad3d(i,x,y,z) { - var h = i & 15; // convert into 12 gradient directions - var u = h<8 ? x : y, - v = h<4 ? y : h===12||h===14 ? x : z; - return ((h&1) === 0 ? u : -u) + ((h&2) === 0 ? v : -v); - } - - function grad2d(i,x,y) { - var v = (i & 1) === 0 ? x : y; - return (i&2) === 0 ? -v : v; - } - - function grad1d(i,x) { - return (i&1) === 0 ? -x : x; - } - - function lerp(t,a,b) { return a + t * (b - a); } - - this.noise3d = function(x, y, z) { - var X = Math.floor(x)&255, Y = Math.floor(y)&255, Z = Math.floor(z)&255; - x -= Math.floor(x); y -= Math.floor(y); z -= Math.floor(z); - var fx = (3-2*x)*x*x, fy = (3-2*y)*y*y, fz = (3-2*z)*z*z; - var p0 = p[X]+Y, p00 = p[p0] + Z, p01 = p[p0 + 1] + Z, p1 = p[X + 1] + Y, p10 = p[p1] + Z, p11 = p[p1 + 1] + Z; - return lerp(fz, - lerp(fy, lerp(fx, grad3d(p[p00], x, y, z), grad3d(p[p10], x-1, y, z)), - lerp(fx, grad3d(p[p01], x, y-1, z), grad3d(p[p11], x-1, y-1,z))), - lerp(fy, lerp(fx, grad3d(p[p00 + 1], x, y, z-1), grad3d(p[p10 + 1], x-1, y, z-1)), - lerp(fx, grad3d(p[p01 + 1], x, y-1, z-1), grad3d(p[p11 + 1], x-1, y-1,z-1)))); - }; - - this.noise2d = function(x, y) { - var X = Math.floor(x)&255, Y = Math.floor(y)&255; - x -= Math.floor(x); y -= Math.floor(y); - var fx = (3-2*x)*x*x, fy = (3-2*y)*y*y; - var p0 = p[X]+Y, p1 = p[X + 1] + Y; - return lerp(fy, - lerp(fx, grad2d(p[p0], x, y), grad2d(p[p1], x-1, y)), - lerp(fx, grad2d(p[p0 + 1], x, y-1), grad2d(p[p1 + 1], x-1, y-1))); - }; - - this.noise1d = function(x) { - var X = Math.floor(x)&255; - x -= Math.floor(x); - var fx = (3-2*x)*x*x; - return lerp(fx, grad1d(p[X], x), grad1d(p[X+1], x-1)); - }; -} - -// these are lifted from Processing.js -// processing defaults -var noiseProfile = { generator: undefined, octaves: 4, fallout: 0.5, seed: undefined}; - -function noise(x, y, z) { - if(noiseProfile.generator === undefined) { - // caching - noiseProfile.generator = new PerlinNoise(noiseProfile.seed); - } - var generator = noiseProfile.generator; - var effect = 1, k = 1, sum = 0; - for(var i=0; i - * - * For a fairly comprehensive set of languages see the - * README - * file that came with this source. At a minimum, the lexer should work on a - * number of languages including C and friends, Java, Python, Bash, SQL, HTML, - * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk - * and a subset of Perl, but, because of commenting conventions, doesn't work on - * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. - *

- * Usage:

    - *
  1. include this source file in an html page via - * {@code } - *
  2. define style rules. See the example page for examples. - *
  3. mark the {@code
    } and {@code } tags in your source with
    - *    {@code class=prettyprint.}
    - *    You can also use the (html deprecated) {@code } tag, but the pretty
    - *    printer needs to do more substantial DOM manipulations to support that, so
    - *    some css styles may not be preserved.
    - * </ol>
    - * That's it.  I wanted to keep the API as simple as possible, so there's no
    - * need to specify which language the code is in, but if you wish, you can add
    - * another class to the {@code <pre>} or {@code <code>} element to specify the
    - * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    - * starts with "lang-" followed by a file extension, specifies the file type.
    - * See the "lang-*.js" files in this directory for code that implements
    - * per-language file handlers.
    - * <p>
    - * Change log:<br>
    - * cbeust, 2006/08/22
    - * <blockquote>
    - *   Java annotations (start with "@") are now captured as literals ("lit")
    - * </blockquote>
    - * @requires console
    - */
    -
    -// JSLint declarations
    -/*global console, document, navigator, setTimeout, window */
    -
    -/**
    - * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    - * UI events.
    - * If set to {@code false}, {@code prettyPrint()} is synchronous.
    - */
    -window['PR_SHOULD_USE_CONTINUATION'] = true;
    -
    -/** the number of characters between tab columns */
    -window['PR_TAB_WIDTH'] = 8;
    -
    -/** Walks the DOM returning a properly escaped version of innerHTML.
    -  * @param {Node} node
    -  * @param {Array.<string>} out output buffer that receives chunks of HTML.
    -  */
    -window['PR_normalizedHtml']
    -
    -/** Contains functions for creating and registering new language handlers.
    -  * @type {Object}
    -  */
    -  = window['PR']
    -
    -/** Pretty print a chunk of code.
    -  *
    -  * @param {string} sourceCodeHtml code as html
    -  * @return {string} code as html, but prettier
    -  */
    -  = window['prettyPrintOne']
    -/** Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    -  * {@code class=prettyprint} and prettify them.
    -  * @param {Function?} opt_whenDone if specified, called when the last entry
    -  *     has been finished.
    -  */
    -  = window['prettyPrint'] = void 0;
    -
    -/** browser detection. @extern @returns false if not IE, otherwise the major version. */
    -window['_pr_isIE6'] = function () {
    -  var ieVersion = navigator && navigator.userAgent &&
    -      navigator.userAgent.match(/\bMSIE ([678])\./);
    -  ieVersion = ieVersion ? +ieVersion[1] : false;
    -  window['_pr_isIE6'] = function () { return ieVersion; };
    -  return ieVersion;
    -};
    -
    -
    -(function () {
    -  // Keyword lists for various languages.
    -  var FLOW_CONTROL_KEYWORDS =
    -      "break continue do else for if return while ";
    -  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
    -      "double enum extern float goto int long register short signed sizeof " +
    -      "static struct switch typedef union unsigned void volatile ";
    -  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
    -      "new operator private protected public this throw true try typeof ";
    -  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
    -      "concept concept_map const_cast constexpr decltype " +
    -      "dynamic_cast explicit export friend inline late_check " +
    -      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
    -      "template typeid typename using virtual wchar_t where ";
    -  var JAVA_KEYWORDS = COMMON_KEYWORDS +
    -      "abstract boolean byte extends final finally implements import " +
    -      "instanceof null native package strictfp super synchronized throws " +
    -      "transient ";
    -  var CSHARP_KEYWORDS = JAVA_KEYWORDS +
    -      "as base by checked decimal delegate descending dynamic event " +
    -      "fixed foreach from group implicit in interface internal into is lock " +
    -      "object out override orderby params partial readonly ref sbyte sealed " +
    -      "stackalloc string select uint ulong unchecked unsafe ushort var ";
    -  var COFFEE_KEYWORDS = "all and by catch class else extends false finally " +
    -      "for if in is isnt loop new no not null of off on or return super then " +
    -      "true try unless until when while yes ";
    -  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
    -      "debugger eval export function get null set undefined var with " +
    -      "Infinity NaN ";
    -  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
    -      "goto if import last local my next no our print package redo require " +
    -      "sub undef unless until use wantarray while BEGIN END ";
    -  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
    -      "elif except exec finally from global import in is lambda " +
    -      "nonlocal not or pass print raise try with yield " +
    -      "False True None ";
    -  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
    -      " defined elsif end ensure false in module next nil not or redo rescue " +
    -      "retry self super then true undef unless until when yield BEGIN END ";
    -  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
    -      "function in local set then until ";
    -  var ALL_KEYWORDS = (
    -      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
    -      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
    -
    -  // token style names.  correspond to css classes
    -  /** token style for a string literal */
    -  var PR_STRING = 'str';
    -  /** token style for a keyword */
    -  var PR_KEYWORD = 'kwd';
    -  /** token style for a comment */
    -  var PR_COMMENT = 'com';
    -  /** token style for a type */
    -  var PR_TYPE = 'typ';
    -  /** token style for a literal value.  e.g. 1, null, true. */
    -  var PR_LITERAL = 'lit';
    -  /** token style for a punctuation string. */
    -  var PR_PUNCTUATION = 'pun';
    -  /** token style for a punctuation string. */
    -  var PR_PLAIN = 'pln';
    -
    -  /** token style for an sgml tag. */
    -  var PR_TAG = 'tag';
    -  /** token style for a markup declaration such as a DOCTYPE. */
    -  var PR_DECLARATION = 'dec';
    -  /** token style for embedded source. */
    -  var PR_SOURCE = 'src';
    -  /** token style for an sgml attribute name. */
    -  var PR_ATTRIB_NAME = 'atn';
    -  /** token style for an sgml attribute value. */
    -  var PR_ATTRIB_VALUE = 'atv';
    -
    -  /**
    -   * A class that indicates a section of markup that is not code, e.g. to allow
    -   * embedding of line numbers within code listings.
    -   */
    -  var PR_NOCODE = 'nocode';
    -
    -  /** A set of tokens that can precede a regular expression literal in
    -    * javascript.
    -    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
    -    * list, but I've removed ones that might be problematic when seen in
    -    * languages that don't support regular expression literals.
    -    *
    -    * <p>Specifically, I've removed any keywords that can't precede a regexp
    -    * literal in a syntactically legal javascript program, and I've removed the
    -    * "in" keyword since it's not a keyword in many languages, and might be used
    -    * as a count of inches.
    -    *
    -    * <p>The link a above does not accurately describe EcmaScript rules since
    -    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    -    * very well in practice.
    -    *
    -    * @private
    -    */
    -  var REGEXP_PRECEDER_PATTERN = function () {
    -      var preceders = [
    -          "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
    -          "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
    -          "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
    -          "<", "<<", "<<=", "<=", "=", "==", "===", ">",
    -          ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
    -          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
    -          "||=", "~" /* handles =~ and !~ */,
    -          "break", "case", "continue", "delete",
    -          "do", "else", "finally", "instanceof",
    -          "return", "throw", "try", "typeof"
    -          ];
    -      var pattern = '(?:^^|[+-]';
    -      for (var i = 0; i < preceders.length; ++i) {
    -        pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
    -      }
    -      pattern += ')\\s*';  // matches at end, and matches empty string
    -      return pattern;
    -      // CAVEAT: this does not properly handle the case where a regular
    -      // expression immediately follows another since a regular expression may
    -      // have flags for case-sensitivity and the like.  Having regexp tokens
    -      // adjacent is not valid in any language I'm aware of, so I'm punting.
    -      // TODO: maybe style special characters inside a regexp as punctuation.
    -    }();
    -
    -  // Define regexps here so that the interpreter doesn't have to create an
    -  // object each time the function containing them is called.
    -  // The language spec requires a new object created even if you don't access
    -  // the $1 members.
    -  var pr_amp = /&/g;
    -  var pr_lt = /</g;
    -  var pr_gt = />/g;
    -  var pr_quot = /\"/g;
    -  /** like textToHtml but escapes double quotes to be attribute safe. */
    -  function attribToHtml(str) {
    -    return str.replace(pr_amp, '&amp;')
    -        .replace(pr_lt, '&lt;')
    -        .replace(pr_gt, '&gt;')
    -        .replace(pr_quot, '&quot;');
    -  }
    -
    -  /** escapest html special characters to html. */
    -  function textToHtml(str) {
    -    return str.replace(pr_amp, '&amp;')
    -        .replace(pr_lt, '&lt;')
    -        .replace(pr_gt, '&gt;');
    -  }
    -
    -
    -  var pr_ltEnt = /&lt;/g;
    -  var pr_gtEnt = /&gt;/g;
    -  var pr_aposEnt = /&apos;/g;
    -  var pr_quotEnt = /&quot;/g;
    -  var pr_ampEnt = /&amp;/g;
    -  var pr_nbspEnt = /&nbsp;/g;
    -  /** unescapes html to plain text. */
    -  function htmlToText(html) {
    -    var pos = html.indexOf('&');
    -    if (pos < 0) { return html; }
    -    // Handle numeric entities specially.  We can't use functional substitution
    -    // since that doesn't work in older versions of Safari.
    -    // These should be rare since most browsers convert them to normal chars.
    -    for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0;) {
    -      var end = html.indexOf(';', pos);
    -      if (end >= 0) {
    -        var num = html.substring(pos + 3, end);
    -        var radix = 10;
    -        if (num && num.charAt(0) === 'x') {
    -          num = num.substring(1);
    -          radix = 16;
    -        }
    -        var codePoint = parseInt(num, radix);
    -        if (!isNaN(codePoint)) {
    -          html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
    -                  html.substring(end + 1));
    -        }
    -      }
    -    }
    -
    -    return html.replace(pr_ltEnt, '<')
    -        .replace(pr_gtEnt, '>')
    -        .replace(pr_aposEnt, "'")
    -        .replace(pr_quotEnt, '"')
    -        .replace(pr_nbspEnt, ' ')
    -        .replace(pr_ampEnt, '&');
    -  }
    -
    -  /** is the given node's innerHTML normally unescaped? */
    -  function isRawContent(node) {
    -    return 'XMP' === node.tagName;
    -  }
    -
    -  var newlineRe = /[\r\n]/g;
    -  /**
    -   * Are newlines and adjacent spaces significant in the given node's innerHTML?
    -   */
    -  function isPreformatted(node, content) {
    -    // PRE means preformatted, and is a very common case, so don't create
    -    // unnecessary computed style objects.
    -    if ('PRE' === node.tagName) { return true; }
    -    if (!newlineRe.test(content)) { return true; }  // Don't care
    -    var whitespace = '';
    -    // For disconnected nodes, IE has no currentStyle.
    -    if (node.currentStyle) {
    -      whitespace = node.currentStyle.whiteSpace;
    -    } else if (window.getComputedStyle) {
    -      // Firefox makes a best guess if node is disconnected whereas Safari
    -      // returns the empty string.
    -      whitespace = window.getComputedStyle(node, null).whiteSpace;
    -    }
    -    return !whitespace || whitespace === 'pre';
    -  }
    -
    -  function normalizedHtml(node, out, opt_sortAttrs) {
    -    switch (node.nodeType) {
    -      case 1:  // an element
    -        var name = node.tagName.toLowerCase();
    -
    -        out.push('<', name);
    -        var attrs = node.attributes;
    -        var n = attrs.length;
    -        if (n) {
    -          if (opt_sortAttrs) {
    -            var sortedAttrs = [];
    -            for (var i = n; --i >= 0;) { sortedAttrs[i] = attrs[i]; }
    -            sortedAttrs.sort(function (a, b) {
    -                return (a.name < b.name) ? -1 : a.name === b.name ? 0 : 1;
    -              });
    -            attrs = sortedAttrs;
    -          }
    -          for (var i = 0; i < n; ++i) {
    -            var attr = attrs[i];
    -            if (!attr.specified) { continue; }
    -            out.push(' ', attr.name.toLowerCase(),
    -                     '="', attribToHtml(attr.value), '"');
    -          }
    -        }
    -        out.push('>');
    -        for (var child = node.firstChild; child; child = child.nextSibling) {
    -          normalizedHtml(child, out, opt_sortAttrs);
    -        }
    -        if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
    -          out.push('<\/', name, '>');
    -        }
    -        break;
    -      case 3: case 4: // text
    -        out.push(textToHtml(node.nodeValue));
    -        break;
    -    }
    -  }
    -
    -  /**
    -   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    -   * matches the union o the sets o strings matched d by the input RegExp.
    -   * Since it matches globally, if the input strings have a start-of-input
    -   * anchor (/^.../), it is ignored for the purposes of unioning.
    -   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    -   * @return {RegExp} a global regex.
    -   */
    -  function combinePrefixPatterns(regexs) {
    -    var capturedGroupIndex = 0;
    -
    -    var needToFoldCase = false;
    -    var ignoreCase = false;
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.ignoreCase) {
    -        ignoreCase = true;
    -      } else if (/[a-z]/i.test(regex.source.replace(
    -                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    -        needToFoldCase = true;
    -        ignoreCase = false;
    -        break;
    -      }
    -    }
    -
    -    function decodeEscape(charsetPart) {
    -      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
    -      switch (charsetPart.charAt(1)) {
    -        case 'b': return 8;
    -        case 't': return 9;
    -        case 'n': return 0xa;
    -        case 'v': return 0xb;
    -        case 'f': return 0xc;
    -        case 'r': return 0xd;
    -        case 'u': case 'x':
    -          return parseInt(charsetPart.substring(2), 16)
    -              || charsetPart.charCodeAt(1);
    -        case '0': case '1': case '2': case '3': case '4':
    -        case '5': case '6': case '7':
    -          return parseInt(charsetPart.substring(1), 8);
    -        default: return charsetPart.charCodeAt(1);
    -      }
    -    }
    -
    -    function encodeEscape(charCode) {
    -      if (charCode < 0x20) {
    -        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    -      }
    -      var ch = String.fromCharCode(charCode);
    -      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
    -        ch = '\\' + ch;
    -      }
    -      return ch;
    -    }
    -
    -    function caseFoldCharset(charSet) {
    -      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    -          new RegExp(
    -              '\\\\u[0-9A-Fa-f]{4}'
    -              + '|\\\\x[0-9A-Fa-f]{2}'
    -              + '|\\\\[0-3][0-7]{0,2}'
    -              + '|\\\\[0-7]{1,2}'
    -              + '|\\\\[\\s\\S]'
    -              + '|-'
    -              + '|[^-\\\\]',
    -              'g'));
    -      var groups = [];
    -      var ranges = [];
    -      var inverse = charsetParts[0] === '^';
    -      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    -        var p = charsetParts[i];
    -        switch (p) {
    -          case '\\B': case '\\b':
    -          case '\\D': case '\\d':
    -          case '\\S': case '\\s':
    -          case '\\W': case '\\w':
    -            groups.push(p);
    -            continue;
    -        }
    -        var start = decodeEscape(p);
    -        var end;
    -        if (i + 2 < n && '-' === charsetParts[i + 1]) {
    -          end = decodeEscape(charsetParts[i + 2]);
    -          i += 2;
    -        } else {
    -          end = start;
    -        }
    -        ranges.push([start, end]);
    -        // If the range might intersect letters, then expand it.
    -        if (!(end < 65 || start > 122)) {
    -          if (!(end < 65 || start > 90)) {
    -            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    -          }
    -          if (!(end < 97 || start > 122)) {
    -            ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    -          }
    -        }
    -      }
    -
    -      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    -      // -> [[1, 12], [14, 14], [16, 17]]
    -      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    -      var consolidatedRanges = [];
    -      var lastRange = [NaN, NaN];
    -      for (var i = 0; i < ranges.length; ++i) {
    -        var range = ranges[i];
    -        if (range[0] <= lastRange[1] + 1) {
    -          lastRange[1] = Math.max(lastRange[1], range[1]);
    -        } else {
    -          consolidatedRanges.push(lastRange = range);
    -        }
    -      }
    -
    -      var out = ['['];
    -      if (inverse) { out.push('^'); }
    -      out.push.apply(out, groups);
    -      for (var i = 0; i < consolidatedRanges.length; ++i) {
    -        var range = consolidatedRanges[i];
    -        out.push(encodeEscape(range[0]));
    -        if (range[1] > range[0]) {
    -          if (range[1] + 1 > range[0]) { out.push('-'); }
    -          out.push(encodeEscape(range[1]));
    -        }
    -      }
    -      out.push(']');
    -      return out.join('');
    -    }
    -
    -    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    -      // Split into character sets, escape sequences, punctuation strings
    -      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    -      // include any of the above.
    -      var parts = regex.source.match(
    -          new RegExp(
    -              '(?:'
    -              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    -              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    -              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    -              + '|\\\\[0-9]+'  // a back-reference or octal escape
    -              + '|\\\\[^ux0-9]'  // other escape sequence
    -              + '|\\(\\?[:!=]'  // start of a non-capturing group
    -              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
    -              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    -              + ')',
    -              'g'));
    -      var n = parts.length;
    -
    -      // Maps captured group numbers to the number they will occupy in
    -      // the output or to -1 if that has not been determined, or to
    -      // undefined if they need not be capturing in the output.
    -      var capturedGroups = [];
    -
    -      // Walk over and identify back references to build the capturedGroups
    -      // mapping.
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          // groups are 1-indexed, so max group index is count of '('
    -          ++groupIndex;
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue && decimalValue <= groupIndex) {
    -            capturedGroups[decimalValue] = -1;
    -          }
    -        }
    -      }
    -
    -      // Renumber groups and reduce capturing groups to non-capturing groups
    -      // where possible.
    -      for (var i = 1; i < capturedGroups.length; ++i) {
    -        if (-1 === capturedGroups[i]) {
    -          capturedGroups[i] = ++capturedGroupIndex;
    -        }
    -      }
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          ++groupIndex;
    -          if (capturedGroups[groupIndex] === undefined) {
    -            parts[i] = '(?:';
    -          }
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue && decimalValue <= groupIndex) {
    -            parts[i] = '\\' + capturedGroups[groupIndex];
    -          }
    -        }
    -      }
    -
    -      // Remove any prefix anchors so that the output will match anywhere.
    -      // ^^ really does mean an anchored match though.
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    -      }
    -
    -      // Expand letters to groupts to handle mixing of case-sensitive and
    -      // case-insensitive patterns if necessary.
    -      if (regex.ignoreCase && needToFoldCase) {
    -        for (var i = 0; i < n; ++i) {
    -          var p = parts[i];
    -          var ch0 = p.charAt(0);
    -          if (p.length >= 2 && ch0 === '[') {
    -            parts[i] = caseFoldCharset(p);
    -          } else if (ch0 !== '\\') {
    -            // TODO: handle letters in numeric escapes.
    -            parts[i] = p.replace(
    -                /[a-zA-Z]/g,
    -                function (ch) {
    -                  var cc = ch.charCodeAt(0);
    -                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    -                });
    -          }
    -        }
    -      }
    -
    -      return parts.join('');
    -    }
    -
    -    var rewritten = [];
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    -      rewritten.push(
    -          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    -    }
    -
    -    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    -  }
    -
    -  var PR_innerHtmlWorks = null;
    -  function getInnerHtml(node) {
    -    // inner html is hopelessly broken in Safari 2.0.4 when the content is
    -    // an html description of well formed XML and the containing tag is a PRE
    -    // tag, so we detect that case and emulate innerHTML.
    -    if (null === PR_innerHtmlWorks) {
    -      var testNode = document.createElement('PRE');
    -      testNode.appendChild(
    -          document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));
    -      PR_innerHtmlWorks = !/</.test(testNode.innerHTML);
    -    }
    -
    -    if (PR_innerHtmlWorks) {
    -      var content = node.innerHTML;
    -      // XMP tags contain unescaped entities so require special handling.
    -      if (isRawContent(node)) {
    -        content = textToHtml(content);
    -      } else if (!isPreformatted(node, content)) {
    -        content = content.replace(/(<br\s*\/?>)[\r\n]+/g, '$1')
    -            .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
    -      }
    -      return content;
    -    }
    -
    -    var out = [];
    -    for (var child = node.firstChild; child; child = child.nextSibling) {
    -      normalizedHtml(child, out);
    -    }
    -    return out.join('');
    -  }
    -
    -  /** returns a function that expand tabs to spaces.  This function can be fed
    -    * successive chunks of text, and will maintain its own internal state to
    -    * keep track of how tabs are expanded.
    -    * @return {function (string) : string} a function that takes
    -    *   plain text and return the text with tabs expanded.
    -    * @private
    -    */
    -  function makeTabExpander(tabWidth) {
    -    var SPACES = '                ';
    -    var charInLine = 0;
    -
    -    return function (plainText) {
    -      // walk over each character looking for tabs and newlines.
    -      // On tabs, expand them.  On newlines, reset charInLine.
    -      // Otherwise increment charInLine
    -      var out = null;
    -      var pos = 0;
    -      for (var i = 0, n = plainText.length; i < n; ++i) {
    -        var ch = plainText.charAt(i);
    -
    -        switch (ch) {
    -          case '\t':
    -            if (!out) { out = []; }
    -            out.push(plainText.substring(pos, i));
    -            // calculate how much space we need in front of this part
    -            // nSpaces is the amount of padding -- the number of spaces needed
    -            // to move us to the next column, where columns occur at factors of
    -            // tabWidth.
    -            var nSpaces = tabWidth - (charInLine % tabWidth);
    -            charInLine += nSpaces;
    -            for (; nSpaces >= 0; nSpaces -= SPACES.length) {
    -              out.push(SPACES.substring(0, nSpaces));
    -            }
    -            pos = i + 1;
    -            break;
    -          case '\n':
    -            charInLine = 0;
    -            break;
    -          default:
    -            ++charInLine;
    -        }
    -      }
    -      if (!out) { return plainText; }
    -      out.push(plainText.substring(pos));
    -      return out.join('');
    -    };
    -  }
    -
    -  var pr_chunkPattern = new RegExp(
    -      '[^<]+'  // A run of characters other than '<'
    -      + '|<\!--[\\s\\S]*?--\>'  // an HTML comment
    -      + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'  // a CDATA section
    -      // a probable tag that should not be highlighted
    -      + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
    -      + '|<',  // A '<' that does not begin a larger chunk
    -      'g');
    -  var pr_commentPrefix = /^<\!--/;
    -  var pr_cdataPrefix = /^<!\[CDATA\[/;
    -  var pr_brPrefix = /^<br\b/i;
    -  var pr_tagNameRe = /^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/;
    -
    -  /** split markup into chunks of html tags (style null) and
    -    * plain text (style {@link #PR_PLAIN}), converting tags which are
    -    * significant for tokenization (<br>) into their textual equivalent.
    -    *
    -    * @param {string} s html where whitespace is considered significant.
    -    * @return {Object} source code and extracted tags.
    -    * @private
    -    */
    -  function extractTags(s) {
    -    // since the pattern has the 'g' modifier and defines no capturing groups,
    -    // this will return a list of all chunks which we then classify and wrap as
    -    // PR_Tokens
    -    var matches = s.match(pr_chunkPattern);
    -    var sourceBuf = [];
    -    var sourceBufLen = 0;
    -    var extractedTags = [];
    -    if (matches) {
    -      for (var i = 0, n = matches.length; i < n; ++i) {
    -        var match = matches[i];
    -        if (match.length > 1 && match.charAt(0) === '<') {
    -          if (pr_commentPrefix.test(match)) { continue; }
    -          if (pr_cdataPrefix.test(match)) {
    -            // strip CDATA prefix and suffix.  Don't unescape since it's CDATA
    -            sourceBuf.push(match.substring(9, match.length - 3));
    -            sourceBufLen += match.length - 12;
    -          } else if (pr_brPrefix.test(match)) {
    -            // <br> tags are lexically significant so convert them to text.
    -            // This is undone later.
    -            sourceBuf.push('\n');
    -            ++sourceBufLen;
    -          } else {
    -            if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
    -              // A <span class="nocode"> will start a section that should be
    -              // ignored.  Continue walking the list until we see a matching end
    -              // tag.
    -              var name = match.match(pr_tagNameRe)[2];
    -              var depth = 1;
    -              var j;
    -              end_tag_loop:
    -              for (j = i + 1; j < n; ++j) {
    -                var name2 = matches[j].match(pr_tagNameRe);
    -                if (name2 && name2[2] === name) {
    -                  if (name2[1] === '/') {
    -                    if (--depth === 0) { break end_tag_loop; }
    -                  } else {
    -                    ++depth;
    -                  }
    -                }
    -              }
    -              if (j < n) {
    -                extractedTags.push(
    -                    sourceBufLen, matches.slice(i, j + 1).join(''));
    -                i = j;
    -              } else {  // Ignore unclosed sections.
    -                extractedTags.push(sourceBufLen, match);
    -              }
    -            } else {
    -              extractedTags.push(sourceBufLen, match);
    -            }
    -          }
    -        } else {
    -          var literalText = htmlToText(match);
    -          sourceBuf.push(literalText);
    -          sourceBufLen += literalText.length;
    -        }
    -      }
    -    }
    -    return { source: sourceBuf.join(''), tags: extractedTags };
    -  }
    -
    -  /** True if the given tag contains a class attribute with the nocode class. */
    -  function isNoCodeTag(tag) {
    -    return !!tag
    -        // First canonicalize the representation of attributes
    -        .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
    -                 ' $1="$2$3$4"')
    -        // Then look for the attribute we want.
    -        .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
    -  }
    -
    -  /**
    -   * Apply the given language handler to sourceCode and add the resulting
    -   * decorations to out.
    -   * @param {number} basePos the index of sourceCode within the chunk of source
    -   *    whose decorations are already present on out.
    -   */
    -  function appendDecorations(basePos, sourceCode, langHandler, out) {
    -    if (!sourceCode) { return; }
    -    var job = {
    -      source: sourceCode,
    -      basePos: basePos
    -    };
    -    langHandler(job);
    -    out.push.apply(out, job.decorations);
    -  }
    -
    -  /** Given triples of [style, pattern, context] returns a lexing function,
    -    * The lexing function interprets the patterns to find token boundaries and
    -    * returns a decoration list of the form
    -    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    -    * where index_n is an index into the sourceCode, and style_n is a style
    -    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    -    * all characters in sourceCode[index_n-1:index_n].
    -    *
    -    * The stylePatterns is a list whose elements have the form
    -    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    -    *
    -    * Style is a style constant like PR_PLAIN, or can be a string of the
    -    * form 'lang-FOO', where FOO is a language extension describing the
    -    * language of the portion of the token in $1 after pattern executes.
    -    * E.g., if style is 'lang-lisp', and group 1 contains the text
    -    * '(hello (world))', then that portion of the token will be passed to the
    -    * registered lisp handler for formatting.
    -    * The text before and after group 1 will be restyled using this decorator
    -    * so decorators should take care that this doesn't result in infinite
    -    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    -    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    -    * '<script>foo()<\/script>', which would cause the current decorator to
    -    * be called with '<script>' which would not match the same rule since
    -    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    -    * the generic tag rule.  The handler registered for the 'js' extension would
    -    * then be called with 'foo()', and finally, the current decorator would
    -    * be called with '<\/script>' which would not match the original rule and
    -    * so the generic tag rule would identify it as a tag.
    -    *
    -    * Pattern must only match prefixes, and if it matches a prefix, then that
    -    * match is considered a token with the same style.
    -    *
    -    * Context is applied to the last non-whitespace, non-comment token
    -    * recognized.
    -    *
    -    * Shortcut is an optional string of characters, any of which, if the first
    -    * character, gurantee that this pattern and only this pattern matches.
    -    *
    -    * @param {Array} shortcutStylePatterns patterns that always start with
    -    *   a known character.  Must have a shortcut string.
    -    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    -    *   order if the shortcut ones fail.  May have shortcuts.
    -    *
    -    * @return {function (Object)} a
    -    *   function that takes source code and returns a list of decorations.
    -    */
    -  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    -    var shortcuts = {};
    -    var tokenizer;
    -    (function () {
    -      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    -      var allRegexs = [];
    -      var regexKeys = {};
    -      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    -        var patternParts = allPatterns[i];
    -        var shortcutChars = patternParts[3];
    -        if (shortcutChars) {
    -          for (var c = shortcutChars.length; --c >= 0;) {
    -            shortcuts[shortcutChars.charAt(c)] = patternParts;
    -          }
    -        }
    -        var regex = patternParts[1];
    -        var k = '' + regex;
    -        if (!regexKeys.hasOwnProperty(k)) {
    -          allRegexs.push(regex);
    -          regexKeys[k] = null;
    -        }
    -      }
    -      allRegexs.push(/[\0-\uffff]/);
    -      tokenizer = combinePrefixPatterns(allRegexs);
    -    })();
    -
    -    var nPatterns = fallthroughStylePatterns.length;
    -    var notWs = /\S/;
    -
    -    /**
    -     * Lexes job.source and produces an output array job.decorations of style
    -     * classes preceded by the position at which they start in job.source in
    -     * order.
    -     *
    -     * @param {Object} job an object like {@code
    -     *    source: {string} sourceText plain text,
    -     *    basePos: {int} position of job.source in the larger chunk of
    -     *        sourceCode.
    -     * }
    -     */
    -    var decorate = function (job) {
    -      var sourceCode = job.source, basePos = job.basePos;
    -      /** Even entries are positions in source in ascending order.  Odd enties
    -        * are style markers (e.g., PR_COMMENT) that run from that position until
    -        * the end.
    -        * @type {Array.<number|string>}
    -        */
    -      var decorations = [basePos, PR_PLAIN];
    -      var pos = 0;  // index into sourceCode
    -      var tokens = sourceCode.match(tokenizer) || [];
    -      var styleCache = {};
    -
    -      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    -        var token = tokens[ti];
    -        var style = styleCache[token];
    -        var match = void 0;
    -
    -        var isEmbedded;
    -        if (typeof style === 'string') {
    -          isEmbedded = false;
    -        } else {
    -          var patternParts = shortcuts[token.charAt(0)];
    -          if (patternParts) {
    -            match = token.match(patternParts[1]);
    -            style = patternParts[0];
    -          } else {
    -            for (var i = 0; i < nPatterns; ++i) {
    -              patternParts = fallthroughStylePatterns[i];
    -              match = token.match(patternParts[1]);
    -              if (match) {
    -                style = patternParts[0];
    -                break;
    -              }
    -            }
    -
    -            if (!match) {  // make sure that we make progress
    -              style = PR_PLAIN;
    -            }
    -          }
    -
    -          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    -          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    -            isEmbedded = false;
    -            style = PR_SOURCE;
    -          }
    -
    -          if (!isEmbedded) { styleCache[token] = style; }
    -        }
    -
    -        var tokenStart = pos;
    -        pos += token.length;
    -
    -        if (!isEmbedded) {
    -          decorations.push(basePos + tokenStart, style);
    -        } else {  // Treat group 1 as an embedded block of source code.
    -          var embeddedSource = match[1];
    -          var embeddedSourceStart = token.indexOf(embeddedSource);
    -          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    -          if (match[2]) {
    -            // If embeddedSource can be blank, then it would match at the
    -            // beginning which would cause us to infinitely recurse on the
    -            // entire token, so we catch the right context in match[2].
    -            embeddedSourceEnd = token.length - match[2].length;
    -            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    -          }
    -          var lang = style.substring(5);
    -          // Decorate the left of the embedded source
    -          appendDecorations(
    -              basePos + tokenStart,
    -              token.substring(0, embeddedSourceStart),
    -              decorate, decorations);
    -          // Decorate the embedded source
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceStart,
    -              embeddedSource,
    -              langHandlerForExtension(lang, embeddedSource),
    -              decorations);
    -          // Decorate the right of the embedded section
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceEnd,
    -              token.substring(embeddedSourceEnd),
    -              decorate, decorations);
    -        }
    -      }
    -      job.decorations = decorations;
    -    };
    -    return decorate;
    -  }
    -
    -  /** returns a function that produces a list of decorations from source text.
    -    *
    -    * This code treats ", ', and ` as string delimiters, and \ as a string
    -    * escape.  It does not recognize perl's qq() style strings.
    -    * It has no special handling for double delimiter escapes as in basic, or
    -    * the tripled delimiters used in python, but should work on those regardless
    -    * although in those cases a single string literal may be broken up into
    -    * multiple adjacent string literals.
    -    *
    -    * It recognizes C, C++, and shell style comments.
    -    *
    -    * @param {Object} options a set of optional parameters.
    -    * @return {function (Object)} a function that examines the source code
    -    *     in the input job and builds the decoration list.
    -    */
    -  function sourceDecorator(options) {
    -    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    -    if (options['tripleQuotedStrings']) {
    -      // '''multi-line-string''', 'single-line-string', and double-quoted
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    -           null, '\'"']);
    -    } else if (options['multiLineStrings']) {
    -      // 'multi-line-string', "multi-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    -           null, '\'"`']);
    -    } else {
    -      // 'single-line-string', "single-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,
    -           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    -           null, '"\'']);
    -    }
    -    if (options['verbatimStrings']) {
    -      // verbatim-string-literal production from the C# grammar.  See issue 93.
    -      fallthroughStylePatterns.push(
    -          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    -    }
    -    var hc = options['hashComments'];
    -    if (hc) {
    -      if (options['cStyleComments']) {
    -        if (hc > 1) {  // multiline hash comments
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
    -        } else {
    -          // Stop C preprocessor declarations at an unclosed open comment
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
    -               null, '#']);
    -        }
    -        fallthroughStylePatterns.push(
    -            [PR_STRING,
    -             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
    -             null]);
    -      } else {
    -        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    -      }
    -    }
    -    if (options['cStyleComments']) {
    -      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    -      fallthroughStylePatterns.push(
    -          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    -    }
    -    if (options['regexLiterals']) {
    -      var REGEX_LITERAL = (
    -          // A regular expression literal starts with a slash that is
    -          // not followed by * or / so that it is not confused with
    -          // comments.
    -          '/(?=[^/*])'
    -          // and then contains any number of raw characters,
    -          + '(?:[^/\\x5B\\x5C]'
    -          // escape sequences (\x5C),
    -          +    '|\\x5C[\\s\\S]'
    -          // or non-nesting character sets (\x5B\x5D);
    -          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
    -          // finally closed by a /.
    -          + '/');
    -      fallthroughStylePatterns.push(
    -          ['lang-regex',
    -           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    -           ]);
    -    }
    -
    -    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');
    -    if (keywords.length) {
    -      fallthroughStylePatterns.push(
    -          [PR_KEYWORD,
    -           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);
    -    }
    -
    -    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    -    fallthroughStylePatterns.push(
    -        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    -        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],
    -        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_LITERAL,
    -         new RegExp(
    -             '^(?:'
    -             // A hex number
    -             + '0x[a-f0-9]+'
    -             // or an octal or decimal number,
    -             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    -             // possibly in scientific notation
    -             + '(?:e[+\\-]?\\d+)?'
    -             + ')'
    -             // with an optional modifier like UL for unsigned long
    -             + '[a-z]*', 'i'),
    -         null, '0123456789'],
    -        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);
    -
    -    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    -  }
    -
    -  var decorateSource = sourceDecorator({
    -        'keywords': ALL_KEYWORDS,
    -        'hashComments': true,
    -        'cStyleComments': true,
    -        'multiLineStrings': true,
    -        'regexLiterals': true
    -      });
    -
    -  /** Breaks {@code job.source} around style boundaries in
    -    * {@code job.decorations} while re-interleaving {@code job.extractedTags},
    -    * and leaves the result in {@code job.prettyPrintedHtml}.
    -    * @param {Object} job like {
    -    *    source: {string} source as plain text,
    -    *    extractedTags: {Array.<number|string>} extractedTags chunks of raw
    -    *                   html preceded by their position in {@code job.source}
    -    *                   in order
    -    *    decorations: {Array.<number|string} an array of style classes preceded
    -    *                 by the position at which they start in job.source in order
    -    * }
    -    * @private
    -    */
    -  function recombineTagsAndDecorations(job) {
    -    var sourceText = job.source;
    -    var extractedTags = job.extractedTags;
    -    var decorations = job.decorations;
    -    var numberLines = job.numberLines;
    -    var sourceNode = job.sourceNode;
    -
    -    var html = [];
    -    // index past the last char in sourceText written to html
    -    var outputIdx = 0;
    -
    -    var openDecoration = null;
    -    var currentDecoration = null;
    -    var tagPos = 0;  // index into extractedTags
    -    var decPos = 0;  // index into decorations
    -    var tabExpander = makeTabExpander(window['PR_TAB_WIDTH']);
    -
    -    var adjacentSpaceRe = /([\r\n ]) /g;
    -    var startOrSpaceRe = /(^| ) /gm;
    -    var newlineRe = /\r\n?|\n/g;
    -    var trailingSpaceRe = /[ \r\n]$/;
    -    var lastWasSpace = true;  // the last text chunk emitted ended with a space.
    -
    -    // See bug 71 and http://stackoverflow.com/questions/136443/why-doesnt-ie7-
    -    var isIE678 = window['_pr_isIE6']();
    -    var lineBreakHtml = (
    -        isIE678
    -        ? (sourceNode && sourceNode.tagName === 'PRE'
    -           // Use line feeds instead of <br>s so that copying and pasting works
    -           // on IE.
    -           // See Issue 104 for the derivation of this mess.
    -           ? (isIE678 === 6 ? '&#160;\r\n' :
    -              isIE678 === 7 ? '&#160;<br />\r' :
    -              isIE678 === 8 ? '&#160;<br />' : '&#160;\r')
    -           // IE collapses multiple adjacent <br>s into 1 line break.
    -           // Prefix every newline with '&#160;' to prevent such behavior.
    -           // &nbsp; is the same as &#160; but works in XML as well as HTML.
    -           : '&#160;<br />')
    -        : '<br />');
    -
    -    var lineBreaker;
    -    if (numberLines) {
    -      var lineBreaks = [];
    -      for (var i = 0; i < 10; ++i) {
    -        lineBreaks[i] = lineBreakHtml + '</li><li class="L' + i + '">';
    -      }
    -      var lineNum = typeof numberLines === 'number'
    -          ? numberLines - 1 /* number lines are 1 indexed */ : 0;
    -      html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
    -      if (lineNum) {
    -        html.push(' value="', lineNum + 1, '"');
    -      }
    -      html.push('>');
    -      lineBreaker = function () {
    -        var lb = lineBreaks[++lineNum % 10];
    -        // If a decoration is open, we need to close it before closing a list-item
    -        // and reopen it on the other side of the list item.
    -        return openDecoration
    -            ? ('</span>' + lb + '<span class="' + openDecoration + '">') : lb;
    -      };
    -    } else {
    -      lineBreaker = lineBreakHtml;
    -    }
    -
    -    // A helper function that is responsible for opening sections of decoration
    -    // and outputing properly escaped chunks of source
    -    function emitTextUpTo(sourceIdx) {
    -      if (sourceIdx > outputIdx) {
    -        if (openDecoration && openDecoration !== currentDecoration) {
    -          // Close the current decoration
    -          html.push('</span>');
    -          openDecoration = null;
    -        }
    -        if (!openDecoration && currentDecoration) {
    -          openDecoration = currentDecoration;
    -          html.push('<span class="', openDecoration, '">');
    -        }
    -        // This interacts badly with some wikis which introduces paragraph tags
    -        // into pre blocks for some strange reason.
    -        // It's necessary for IE though which seems to lose the preformattedness
    -        // of <pre> tags when their innerHTML is assigned.
    -        // http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html
    -        // and it serves to undo the conversion of <br>s to newlines done in
    -        // chunkify.
    -        var htmlChunk = textToHtml(
    -            tabExpander(sourceText.substring(outputIdx, sourceIdx)))
    -            .replace(lastWasSpace
    -                     ? startOrSpaceRe
    -                     : adjacentSpaceRe, '$1&#160;');
    -        // Keep track of whether we need to escape space at the beginning of the
    -        // next chunk.
    -        lastWasSpace = trailingSpaceRe.test(htmlChunk);
    -        html.push(htmlChunk.replace(newlineRe, lineBreaker));
    -        outputIdx = sourceIdx;
    -      }
    -    }
    -
    -    while (true) {
    -      // Determine if we're going to consume a tag this time around.  Otherwise
    -      // we consume a decoration or exit.
    -      var outputTag;
    -      if (tagPos < extractedTags.length) {
    -        if (decPos < decorations.length) {
    -          // Pick one giving preference to extractedTags since we shouldn't open
    -          // a new style that we're going to have to immediately close in order
    -          // to output a tag.
    -          outputTag = extractedTags[tagPos] <= decorations[decPos];
    -        } else {
    -          outputTag = true;
    -        }
    -      } else {
    -        outputTag = false;
    -      }
    -      // Consume either a decoration or a tag or exit.
    -      if (outputTag) {
    -        emitTextUpTo(extractedTags[tagPos]);
    -        if (openDecoration) {
    -          // Close the current decoration
    -          html.push('</span>');
    -          openDecoration = null;
    -        }
    -        html.push(extractedTags[tagPos + 1]);
    -        tagPos += 2;
    -      } else if (decPos < decorations.length) {
    -        emitTextUpTo(decorations[decPos]);
    -        currentDecoration = decorations[decPos + 1];
    -        decPos += 2;
    -      } else {
    -        break;
    -      }
    -    }
    -    emitTextUpTo(sourceText.length);
    -    if (openDecoration) {
    -      html.push('</span>');
    -    }
    -    if (numberLines) { html.push('</li></ol>'); }
    -    job.prettyPrintedHtml = html.join('');
    -  }
    -
    -  /** Maps language-specific file extensions to handlers. */
    -  var langHandlerRegistry = {};
    -  /** Register a language handler for the given file extensions.
    -    * @param {function (Object)} handler a function from source code to a list
    -    *      of decorations.  Takes a single argument job which describes the
    -    *      state of the computation.   The single parameter has the form
    -    *      {@code {
    -    *        source: {string} as plain text.
    -    *        decorations: {Array.<number|string>} an array of style classes
    -    *                     preceded by the position at which they start in
    -    *                     job.source in order.
    -    *                     The language handler should assigned this field.
    -    *        basePos: {int} the position of source in the larger source chunk.
    -    *                 All positions in the output decorations array are relative
    -    *                 to the larger source chunk.
    -    *      } }
    -    * @param {Array.<string>} fileExtensions
    -    */
    -  function registerLangHandler(handler, fileExtensions) {
    -    for (var i = fileExtensions.length; --i >= 0;) {
    -      var ext = fileExtensions[i];
    -      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    -        langHandlerRegistry[ext] = handler;
    -      } else if ('console' in window) {
    -        console['warn']('cannot override language handler %s', ext);
    -      }
    -    }
    -  }
    -  function langHandlerForExtension(extension, source) {
    -    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    -      // Treat it as markup if the first non whitespace character is a < and
    -      // the last non-whitespace character is a >.
    -      extension = /^\s*</.test(source)
    -          ? 'default-markup'
    -          : 'default-code';
    -    }
    -    return langHandlerRegistry[extension];
    -  }
    -  registerLangHandler(decorateSource, ['default-code']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [],
    -          [
    -           [PR_PLAIN,       /^[^<?]+/],
    -           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    -           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    -           // Unescaped content in an unknown language
    -           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    -           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    -           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    -           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    -           // Unescaped content in javascript.  (Or possibly vbscript).
    -           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    -           // Contains unescaped stylesheet content
    -           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    -           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    -          ]),
    -      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [
    -           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    -           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    -           ],
    -          [
    -           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    -           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    -           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    -           [PR_PUNCTUATION,  /^[=<>\/]+/],
    -           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    -           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    -           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    -           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    -           ]),
    -      ['in.tag']);
    -  registerLangHandler(
    -      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CPP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true
    -        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': 'null true false'
    -        }), ['json']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CSHARP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true,
    -          'verbatimStrings': true
    -        }), ['cs']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JAVA_KEYWORDS,
    -          'cStyleComments': true
    -        }), ['java']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': SH_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true
    -        }), ['bsh', 'csh', 'sh']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PYTHON_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'tripleQuotedStrings': true
    -        }), ['cv', 'py']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PERL_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['perl', 'pl', 'pm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': RUBY_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['rb']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JSCRIPT_KEYWORDS,
    -          'cStyleComments': true,
    -          'regexLiterals': true
    -        }), ['js']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': COFFEE_KEYWORDS,
    -          'hashComments': 3,  // ### style block comments
    -          'cStyleComments': true,
    -          'multilineStrings': true,
    -          'tripleQuotedStrings': true,
    -          'regexLiterals': true
    -        }), ['coffee']);
    -  registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    -
    -  function applyDecorator(job) {
    -    var sourceCodeHtml = job.sourceCodeHtml;
    -    var opt_langExtension = job.langExtension;
    -
    -    // Prepopulate output in case processing fails with an exception.
    -    job.prettyPrintedHtml = sourceCodeHtml;
    -
    -    try {
    -      // Extract tags, and convert the source code to plain text.
    -      var sourceAndExtractedTags = extractTags(sourceCodeHtml);
    -      /** Plain text. @type {string} */
    -      var source = sourceAndExtractedTags.source;
    -      job.source = source;
    -      job.basePos = 0;
    -
    -      /** Even entries are positions in source in ascending order.  Odd entries
    -        * are tags that were extracted at that position.
    -        * @type {Array.<number|string>}
    -        */
    -      job.extractedTags = sourceAndExtractedTags.tags;
    -
    -      // Apply the appropriate language handler
    -      langHandlerForExtension(opt_langExtension, source)(job);
    -      // Integrate the decorations and tags back into the source code to produce
    -      // a decorated html string which is left in job.prettyPrintedHtml.
    -      recombineTagsAndDecorations(job);
    -    } catch (e) {
    -      if ('console' in window) {
    -        console['log'](e && e['stack'] ? e['stack'] : e);
    -      }
    -    }
    -  }
    -
    -  /**
    -   * @param sourceCodeHtml {string} The HTML to pretty print.
    -   * @param opt_langExtension {string} The language name to use.
    -   *     Typically, a filename extension like 'cpp' or 'java'.
    -   * @param opt_numberLines {number|boolean} True to number lines,
    -   *     or the 1-indexed number of the first line in sourceCodeHtml.
    -   */
    -  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
    -    var job = {
    -      sourceCodeHtml: sourceCodeHtml,
    -      langExtension: opt_langExtension,
    -      numberLines: opt_numberLines
    -    };
    -    applyDecorator(job);
    -    return job.prettyPrintedHtml;
    -  }
    -
    -  function prettyPrint(opt_whenDone) {
    -    function byTagName(tn) { return document.getElementsByTagName(tn); }
    -    // fetch a list of nodes to rewrite
    -    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    -    var elements = [];
    -    for (var i = 0; i < codeSegments.length; ++i) {
    -      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    -        elements.push(codeSegments[i][j]);
    -      }
    -    }
    -    codeSegments = null;
    -
    -    var clock = Date;
    -    if (!clock['now']) {
    -      clock = { 'now': function () { return (new Date).getTime(); } };
    -    }
    -
    -    // The loop is broken into a series of continuations to make sure that we
    -    // don't make the browser unresponsive when rewriting a large page.
    -    var k = 0;
    -    var prettyPrintingJob;
    -
    -    function doWork() {
    -      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
    -                     clock.now() + 250 /* ms */ :
    -                     Infinity);
    -      for (; k < elements.length && clock.now() < endTime; k++) {
    -        var cs = elements[k];
    -        if (cs.className && cs.className.indexOf('prettyprint') >= 0) {
    -          // If the classes includes a language extensions, use it.
    -          // Language extensions can be specified like
    -          //     <pre class="prettyprint lang-cpp">
    -          // the language extension "cpp" is used to find a language handler as
    -          // passed to PR.registerLangHandler.
    -          var langExtension = cs.className.match(/\blang-(\w+)\b/);
    -          if (langExtension) { langExtension = langExtension[1]; }
    -
    -          // make sure this is not nested in an already prettified element
    -          var nested = false;
    -          for (var p = cs.parentNode; p; p = p.parentNode) {
    -            if ((p.tagName === 'pre' || p.tagName === 'code' ||
    -                 p.tagName === 'xmp') &&
    -                p.className && p.className.indexOf('prettyprint') >= 0) {
    -              nested = true;
    -              break;
    -            }
    -          }
    -          if (!nested) {
    -            // fetch the content as a snippet of properly escaped HTML.
    -            // Firefox adds newlines at the end.
    -            var content = getInnerHtml(cs);
    -            content = content.replace(/(?:\r\n?|\n)$/, '');
    -
    -            // Look for a class like linenums or linenums:<n> where <n> is the
    -            // 1-indexed number of the first line.
    -            var numberLines = cs.className.match(/\blinenums\b(?::(\d+))?/);
    -
    -            // do the pretty printing
    -            prettyPrintingJob = {
    -              sourceCodeHtml: content,
    -              langExtension: langExtension,
    -              sourceNode: cs,
    -              numberLines: numberLines
    -                  ? numberLines[1] && numberLines[1].length ? +numberLines[1] : true
    -                  : false
    -            };
    -            applyDecorator(prettyPrintingJob);
    -            replaceWithPrettyPrintedHtml();
    -          }
    -        }
    -      }
    -      if (k < elements.length) {
    -        // finish up in a continuation
    -        setTimeout(doWork, 250);
    -      } else if (opt_whenDone) {
    -        opt_whenDone();
    -      }
    -    }
    -
    -    function replaceWithPrettyPrintedHtml() {
    -      var newContent = prettyPrintingJob.prettyPrintedHtml;
    -      if (!newContent) { return; }
    -      var cs = prettyPrintingJob.sourceNode;
    -
    -      // push the prettified html back into the tag.
    -      if (!isRawContent(cs)) {
    -        // just replace the old html with the new
    -        cs.innerHTML = newContent;
    -      } else {
    -        // we need to change the tag to a <pre> since <xmp>s do not allow
    -        // embedded tags such as the span tags used to attach styles to
    -        // sections of source code.
    -        var pre = document.createElement('PRE');
    -        for (var i = 0; i < cs.attributes.length; ++i) {
    -          var a = cs.attributes[i];
    -          if (a.specified) {
    -            var aname = a.name.toLowerCase();
    -            if (aname === 'class') {
    -              pre.className = a.value;  // For IE 6
    -            } else {
    -              pre.setAttribute(a.name, a.value);
    -            }
    -          }
    -        }
    -        pre.innerHTML = newContent;
    -
    -        // remove the old
    -        cs.parentNode.replaceChild(pre, cs);
    -        cs = pre;
    -      }
    -    }
    -
    -    doWork();
    -  }
    -
    -  window['PR_normalizedHtml'] = normalizedHtml;
    -  window['prettyPrintOne'] = prettyPrintOne;
    -  window['prettyPrint'] = prettyPrint;
    -  window['PR'] = {
    -        'combinePrefixPatterns': combinePrefixPatterns,
    -        'createSimpleLexer': createSimpleLexer,
    -        'registerLangHandler': registerLangHandler,
    -        'sourceDecorator': sourceDecorator,
    -        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    -        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    -        'PR_COMMENT': PR_COMMENT,
    -        'PR_DECLARATION': PR_DECLARATION,
    -        'PR_KEYWORD': PR_KEYWORD,
    -        'PR_LITERAL': PR_LITERAL,
    -        'PR_NOCODE': PR_NOCODE,
    -        'PR_PLAIN': PR_PLAIN,
    -        'PR_PUNCTUATION': PR_PUNCTUATION,
    -        'PR_SOURCE': PR_SOURCE,
    -        'PR_STRING': PR_STRING,
    -        'PR_TAG': PR_TAG,
    -        'PR_TYPE': PR_TYPE
    -      };
    -})();
    diff --git a/example.html b/example.html
    new file mode 100644
    index 0000000..c7c1a96
    --- /dev/null
    +++ b/example.html
    @@ -0,0 +1,13 @@
    +<!DOCTYPE html>
    +<html>
    +<head>
    +</head>
    +<body>
    +  <script type="text/javascript" src="build/dat.gui.min.js"></script>
    +  <script type="text/javascript">
    +    var obj = { x: 5 };
    +    var gui = new dat.GUI();
    +    gui.add(obj, 'x', 0, 10);
    +  </script>
    +</body>
    +</html>
    \ No newline at end of file
    diff --git a/index.html b/index.html
    deleted file mode 100644
    index 54046c7..0000000
    --- a/index.html
    +++ /dev/null
    @@ -1,402 +0,0 @@
    -<!doctype html>
    -<html>
    -<head>
    -
    -  <title>dat.gui</title>
    -
    -  <link rel='icon' type='image/png' href='docs/assets/favicon.png'/>
    -
    -  <!--Minified build-->
    -  <!--<script type='text/javascript' src='build/DAT.GUI.min.js'></script>-->
    -
    -  <!--Build--->
    -  <!--<script type='text/javascript' src='build/DAT.GUI.js'></script>-->
    -
    -  <!--All source-->
    -  <link href='src/DAT/GUI/GUI.css' media='screen' rel='stylesheet' type='text/css'/>
    -  <script type='text/javascript' src='src/DAT/GUI/GUI.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/ControllerNumberSlider.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/Controller.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/ControllerBoolean.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/ControllerString.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/ControllerFunction.js'></script>
    -  <script type='text/javascript' src='src/DAT/GUI/ControllerNumber.js'></script>
    -
    -  <!--Demo-->
    -  <link href='docs/docs.css' media='screen' rel='stylesheet' type='text/css'/>
    -  <script type='text/javascript' src='docs/RequestAnimationFrame.js'></script>
    -  <script type='text/javascript' src='docs/improvedNoise.js'></script>
    -  <script type='text/javascript' src='docs/prettify.js'></script>
    -  <script type='text/javascript' src='docs/demo.js'></script>
    -
    -  <script type='text/javascript'>
    -    //<![CDATA[
    -
    -    window.onload = function() {
    -
    -      prettyPrint();
    -
    -      var fizzyText = new FizzyText('dat.gui');
    -      var gui = new DAT.GUI();
    -
    -      // Text field
    -      gui.add(fizzyText, 'message');
    -
    -      // Sliders with min + max
    -      gui.add(fizzyText, 'maxSize').min(0.5).max(7);
    -      gui.add(fizzyText, 'growthSpeed').min(0.01).max(1).step(0.05);
    -      gui.add(fizzyText, 'speed', 0.1, 2, 0.05); // shorthand for min/max/step
    -
    -      // Sliders with min, max and increment.
    -      gui.add(fizzyText, 'noiseStrength', 10, 100, 5);
    -
    -      // Boolean checkbox
    -      gui.add(fizzyText, 'displayOutline');
    -
    -      // Fires a function called 'explode'
    -      gui.add(fizzyText, 'explode').name('Explode!'); // Specify a custom name.
    -
    -      // Javascript for documentation
    -      getCollapsables();
    -      handleListening();
    -    };
    -
    -    function toggle(e) {
    -
    -      var collapsable = this.childNodes[3],
    -          wrapper = collapsable.childNodes[1];
    -
    -      if (this.className === 'collapsed') {
    -        this.className = 'expanded';
    -        collapsable.style.height = wrapper.clientHeight + 'px';
    -      } else {
    -        this.className = 'collapsed';
    -        collapsable.style.height = '0px';
    -      }
    -    }
    -
    -    function getCollapsables() {
    -
    -      if (document.getElementsByClassName == undefined) {
    -        document.getElementsByClassName = function(className) {
    -          var hasClassName = new RegExp('(?:^|\\s)' + className + '(?:$|\\s)');
    -          var allElements = document.getElementsByTagName('*');
    -          var results = [];
    -
    -          var element;
    -          for (var i = 0; (element = allElements[i]) != null; i++) {
    -            var elementClass = element.className;
    -            if (elementClass && elementClass.indexOf(className) != -1 &&
    -                hasClassName.test(elementClass))
    -              results.push(element);
    -          }
    -
    -          return results;
    -        };
    -      }
    -
    -      collapsed = document.getElementsByClassName('collapsed');
    -      expanded = document.getElementsByClassName('expanded');
    -    }
    -
    -    function handleListening() {
    -
    -      for (var i = 0; i < collapsed.length; i++) {
    -        collapsed[i].addEventListener('click', toggle, false);
    -      }
    -
    -      for (var j = 0; j < expanded.length; j++) {
    -        expanded[i].addEventListener('click', toggle, false);
    -      }
    -    }
    -
    -    //]]>
    -  </script>
    -</head>
    -
    -<body>
    -<div id='container'>
    -
    -<!-- GUIDAT logo -->
    -<div id='helvetica-demo'></div>
    -
    -<!-- It gives you this! -->
    -<div id='notifier'></div>
    -
    -<h1><a href='http://twitter.com/guidat'><img src='docs/assets/profile.png'
    -                                             border='0' alt='dat.gui flag'/></a>
    -</h1>
    -
    -<p><strong>dat.gui</strong> is a lightweight controller library for JavaScript.
    -  It allows you to easily manipulate variables and fire functions on the fly.
    -</p>
    -
    -<ul>
    -  <li>
    -  	<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.min.js'><strong>Download the minified source</strong></a>
    -    <small id='buildsizemin'>[19.7kb]
    -    </small>
    -  </li>
    -  <li>
    -  	<a href='https://github.com/dataarts/dat.gui/raw/build/DAT.GUI.js'><strong>Download the uncompressed source</strong></a>
    -    <small id='buildsize'>[34.1kb]
    -    </small>
    -  </li>
    -
    -  <li><a href='http://github.com/dataarts/dat.gui'>Contribute on GitHub!</a></li>
    -</ul>
    -
    -<h2>Basic Usage</h2>
    -    <pre id='demo-pre' class='prettyprint'>
    -&lt;script type='text/javascript' src='DAT.GUI.min.js'&gt;&lt;/script&gt;
    -&lt;script type='text/javascript'&gt;
    -
    -window.onload = function() {
    -
    -   var fizzyText = new <a href='docs/demo.js'>FizzyText</a>('dat.gui');
    -
    -   var gui = new DAT.GUI();
    -
    -   // Text field
    -   gui.add(fizzyText, 'message');
    -
    -   // Sliders with min + max
    -   gui.add(fizzyText, 'maxSize').min(0.5).max(7);
    -   gui.add(fizzyText, 'growthSpeed').min(0.01).max(1).step(0.05);
    -   gui.add(fizzyText, 'speed', 0.1, 2, 0.05); // shorthand for min/max/step
    -
    -   gui.add(fizzyText, 'noiseStrength', 10, 100, 5);
    -
    -   // Boolean checkbox
    -   gui.add(fizzyText, 'displayOutline');
    -
    -   // Fires a function called 'explode'
    -   gui.add(fizzyText, 'explode').name('Explode!'); // Specify a custom name.
    -
    -};
    -
    -&lt;/script&gt;
    -</pre>
    -
    -<ul id='desc'>
    -  <li><code>DAT.GUI</code> will infer the type of the property you're trying
    -    to add<br/>
    -    (based on its initial value) and create the corresponding control.
    -  </li>
    -
    -  <li>The properties must be public, i.e. defined by <code><strong>this</strong>.prop
    -    = value</code>.
    -  </li>
    -</ul>
    -
    -<!--
    -        <h2 class='collapsed'>Fire a function when someone uses a control</h2>
    -        <pre class='prettyprint'>gui.add(obj, 'propName').onChange(function(n) {
    -        alert('You changed me to ' + n);
    -});</pre>-->
    -
    -<!--<div class='collapsed'>-->
    -  <!---->
    -  <!--<h2 class='section'>Saving your parameters</h2>-->
    -
    -  <!--<div class='collapsable'>-->
    -    <!--<div>-->
    -      <!--<p>The simplest way to save your parameters is via-->
    -        <!--<code>DAT.GUI.saveURL()</code>. This method directs your browser to a-->
    -        <!--URL containing the current GUI settings.</p>-->
    -                <!--<pre class='prettyprint last'>-->
    -<!--// Make a button for the url function-->
    -<!--gui.add(DAT.GUI, 'saveURL');</pre>-->
    -    <!--</div>-->
    -  <!--</div>-->
    -<!--</div>-->
    -<!--<div class='collapsed'>-->
    -  <!--<h2 class='section'>Advanced saving</h2>-->
    -
    -  <!--<div class='collapsable'>-->
    -    <!--<div>-->
    -      <!--<p>Let's say you'd like to share your settings with someone. Instead of-->
    -        <!--sending a long link with lots of parameters stored in it, you can make-->
    -        <!--your saved settings the defaults.</p>-->
    -
    -      <!--<p>First, add the method <code>DAT.GUI.showSaveString()</code> to a gui-->
    -        <!--object:</p>-->
    -                <!--<pre class='prettyprint'>var gui = new DAT.GUI();-->
    -
    -<!--// Add some stuff (and pretend I change their values);-->
    -<!--gui.add(someObject, 'someProperty');-->
    -<!--gui.add(someObject, 'someOtherProperty');-->
    -
    -<!--// Make a save button.-->
    -<!--gui.add(DAT.GUI, 'showSaveString');</pre>-->
    -
    -      <!--<p>Clicking the 'showSaveString' button bring up an alert with a string.-->
    -        <!--Copy and paste that string into the method <code>DAT.GUI.load()</code>-->
    -        <!--before you instantiate any gui objects.</p>-->
    -            <!--<pre class='prettyprint'>-->
    -<!--// Replace COPIED STRING with the value you got from showSaveString()-->
    -<!--DAT.GUI.load('COPIED STRING');-->
    -
    -<!--var gui = new DAT.GUI();-->
    -
    -<!--// Now these properties will be set to the values you just saved.-->
    -<!--gui.add(someObject, 'someProperty');-->
    -<!--gui.add(someObject, 'someOtherProperty');</pre>-->
    -
    -      <!--<p class='last'><strong>Save strings won't work if you change the order in-->
    -        <!--which you've added properties to your gui objects, or the order of the-->
    -        <!--gui objects themselves.</strong>. If you want to add more parameters to-->
    -        <!--your gui and use an old save string, make sure they're added after the-->
    -        <!--properties whose values you've saved.</p>-->
    -    <!--</div>-->
    -  <!--</div>-->
    -<!--</div>-->
    -
    -
    -<div class='collapsed'>
    -  <h2 class='section'>Choosing from a list of values</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -<pre class='prettyprint first last'>gui.add(obj, 'propertyName').options(1, 2, 3, 5, 8);
    -
    -// Alternatively, you can specify custom labels using object syntax
    -gui.add(obj, 'propertyName').options({'Small': 1, 'Medium': 2, 'Large': 3});
    -</pre>
    -    </div>
    -  </div>
    -</div>
    -
    -<div class='collapsed'>
    -  <h2 class='section'>Listen for variable changes inside the GUI</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -      <p>To fire a function whenever a user changes a variable via the GUI, use
    -        the following syntax:</p>
    -                <pre class='prettyprint'>gui.add(obj, 'propertyName').onChange(function(newValue) {
    -   alert('You changed me to ' + newValue);
    -});</pre>
    -      <p>This can be slightly annoying for types like number or string. You may
    -        not want to fire a function while the user is sliding, or while they're
    -        typing. To fire a function when the user has <em>finished</em> making
    -        changes, use the following:</p>
    -                <pre class='prettyprint'>gui.add(obj, 'propertyName').onFinishChange(function(newValue) {
    -   alert('You just finished changing me to ' + newValue);
    -});</pre>
    -      <p>Finally, if you'd like to do a little something extra when a function
    -        is called, use the following:</p>
    -                <pre class='prettyprint last'>gui.add(obj, 'functionName').onFire(function() {
    -   alert('You called a function with dat.gui');
    -});</pre>
    -    </div>
    -  </div>
    -</div>
    -<div class='collapsed'>
    -  <h2 class='section'>Listen for variable changes outside of the GUI</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -      <p>Let's say you have a variable that changes by itself from time to time.
    -        If you'd like the GUI to reflect those changes, use the <code>listen()</code>
    -        method.</p>
    -      <pre
    -          class='prettyprint last'>gui.add(obj, 'changingProperty').listen();</pre>
    -    </div>
    -  </div>
    -</div>
    -
    -<div class='collapsed'>
    -  <h2 class='section'>Advanced listening</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -      <p>By default, <code>DAT.GUI</code> will create an internal interval
    -        that checks for changes in the values you've marked with
    -        <code>listen()</code>. If you'd like to check for these changes in an
    -        interval of your own definition, use the following:</p>
    -                <pre class='prettyprint'>
    -gui.autoListen = false; // disables internal interval
    -gui.add(obj, 'changingProperty').listen();
    -
    -// Make your own loop
    -setInterval(function() {
    -    gui.listen(); // updates values you've marked with listen()
    -}, 1000 / 60);</pre>
    -
    -      <p>Alternatively, you can forego calling <code>listen()</code> on
    -        individual controllers, and instead choose to monitor changes in
    -        <em>all</em> values controlled by your gui.</p>
    -                <pre class='prettyprint last'>
    -gui.autoListen = false; // disables internal interval
    -gui.add(obj, 'add');
    -gui.add(obj, 'lotsa');
    -gui.add(obj, 'properties');
    -
    -// Make your own loop
    -setInterval(function() {
    -    gui.listenAll(); // updates ALL values managed by this gui
    -}, 1000 / 60);</pre>
    -    </div>
    -  </div>
    -</div>
    -
    -<div class='collapsed'>
    -  <h2 class='section'>Multiple panels and custom placement</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -      <p>You can instantiate multiple <code>DAT.GUI</code> objects and name them
    -        however you'd like.</p>
    -                <pre class='prettyprint'>var gui1 = new DAT.GUI();
    -var gui2 = new DAT.GUI();
    -
    -// The name function overwrites the 'Show Controls' text.
    -gui1.name('Utilities');
    -gui2.name('Camera Placement');</pre>
    -
    -      <p>By default, <code>DAT.GUI</code> panels will be automatically added
    -        to the HTML document and fixed to the top of the screen from right to
    -        left. You can disable this behavior and append the gui DOM element to
    -        a container of your choosing.</p>
    -                <pre class='prettyprint last'>
    -// Notice this belongs to the DAT.GUI class (uppercase)
    -// and not an instance thereof.
    -DAT.GUI.autoPlace = false;
    -
    -var gui = new DAT.GUI();
    -
    -// Do some custom styles ...
    -gui.domElement.style.position = 'absolute';
    -gui.domElement.style.top = '20px';
    -gui.domElement.style.left = '20px';
    -
    -document.getElementById('my-gui-container').appendChild( gui.domElement );</pre>
    -    </div>
    -  </div>
    -</div>
    -
    -<div class='collapsed'>
    -  <h2 class='section'>Pro tips.</h2>
    -
    -  <div class='collapsable'>
    -    <div>
    -      <ol id='secrets'>
    -        <li><code>DAT.GUI</code> panels are resizeable. Drag the open/close
    -          button.
    -        </li>
    -
    -        <li>Press 'H' to show/hide GUI&apos;s.</li>
    -      </ol>
    -    </div>
    -  </div>
    -</div>
    -
    -<div class='trans'>&nbsp;</div>
    -
    -<footer class='trans'>Initiated by <a href='http://georgemichaelbrower.com/'>George
    -  Michael Brower</a> and <a href='http://jonobr1.com/'>Jono Brandel</a> of the
    -  Data Arts Team, Google Creative Lab.
    -</footer>
    -</body>
    -</html>
    diff --git a/readme.wiki b/readme.wiki
    new file mode 100644
    index 0000000..3111ca7
    --- /dev/null
    +++ b/readme.wiki
    @@ -0,0 +1,89 @@
    +=dat.GUI=
    +A lightweight graphical user interface for changing variables in JavaScript. 
    +
    +Get started with dat.GUI by reading the tutorial at [http://workshop.chromeexperiments.com/examples/gui].
    +
    +----
    +
    +==Packaged Builds==
    +The easiest way to use dat.GUI in your code is by using the built source at {{{build/dat.gui.min.js}}}. These built JavaScript files bundle all the necessary dependencies to run dat.GUI.
    +
    +In your {{{head}}} tag, include the following code:
    +{{{
    +<script type="text/javascript" src="dat.gui.min.js"></script>
    +}}}
    +
    +----
    +
    +==Using dat.GUI with require.js==
    +Internally, dat.GUI uses [http://requirejs.org/ require.js] to handle dependency management. If you're making changes to the source and want to see the effects of your changes without building, use require js.
    +
    +In your {{{head}}} tag, include the following code:
    +{{{
    +<script data-main="path/to/main" src="path/to/requirejs/require.js"></script>
    +}}}
    +
    +Then, in {{{path/to/main.js}}}:
    +{{{
    +require([
    +  'path/to/gui/module/GUI'
    +], function(GUI) {
    +
    +  // No namespace necessary 
    +  var gui = new GUI();
    +
    +});
    +}}}
    +
    +----
    +
    +==Directory Contents==
    + * build: Concatenated source code.
    + * src: Modular code in [http://requirejs.org/ require.js] format. Also includes css, [http://sass-lang.com/ scss], and html, some of which is included during build.
    + * tests: [https://github.com/jquery/qunit QUnit] test suite.
    + * utils: [http://nodejs.org/ node.js] utility scripts for compiling source.
    +
    +----
    +
    +==Building your own dat.GUI==
    +
    +In the terminal, enter the following:
    +
    +{{{
    +$ cd utils
    +$ node build_gui.js
    +}}}
    +
    +This will create a namespaced, unminified build of dat.GUI at {{{build/dat.gui.js}}}
    +
    +_To export minified source using Closure Compiler, open {{{utils/build_gui.js}}} and set the {{{minify}}} parameter to {{{true}}}._
    +
    +----
    +
    +==Change log==
    +
    +===0.5===
    + * Moved to requirejs for dependency management.
    + * Changed global namespace from *DAT* to *dat* (lowercase).
    + * Added support for color controllers. See [http://workshop.chromeexperiments.com/examples/gui/#4--Color-Controllers Color Controllers].
    + * Added support for folders. See [http://workshop.chromeexperiments.com/examples/gui/#3--Folders Folders].
    + * Added support for saving named presets.  See [http://workshop.chromeexperiments.com/examples/gui/examples/gui/#6--Presets Presets].
    + * Removed `height` parameter from GUI constructor. Scrollbar automatically induced when window is too short.
    + * `dat.GUI.autoPlace` parameter removed. Use `new dat.GUI( { autoPlace: false } )`. See [http://workshop.chromeexperiments.com/examples/gui/#9--Custom-Placement Custom Placement].
    + * `gui.autoListen` and `gui.listenAll()` removed. See [http://workshop.chromeexperiments.com/examples/gui/#11--Updating-the-Display-Manually Updating The Display Manually].
    + * `dat.GUI.load` removed. See [http://workshop.chromeexperiments.com/examples/gui/#5--Saving-Values Saving Values].
    + * Made Controller code completely agnostic of GUI. Controllers can easily be created independent of a GUI panel.
    +
    +
    +===0.4===
    +
    + * Migrated from GitHub to Google Code.
    +
    +----
    +
    +==Thanks==
    +The following libraries and open-source projects were used in the development of dat.GUI.
    + * [http://requirejs.org/ require.js]
    + * [http://sass-lang.com/ Sass]
    + * [http://nodejs.org/ node.js]
    + * [https://github.com/jquery/qunit QUnit] / [http://jquery.com jquery]
    \ No newline at end of file
    diff --git a/src/DAT/GUI/Controller.js b/src/DAT/GUI/Controller.js
    deleted file mode 100644
    index eb744d9..0000000
    --- a/src/DAT/GUI/Controller.js
    +++ /dev/null
    @@ -1,114 +0,0 @@
    -DAT.GUI.Controller = function() {
    -
    -  this.parent = arguments[0];
    -  this.object = arguments[1];
    -  this.propertyName = arguments[2];
    -
    -  //if (arguments.length > 0) this.initialValue = this.propertyName[this.object];
    -  if (arguments.length > 0) this.initialValue = this.object[this.propertyName];
    -
    -  this.domElement = document.createElement('div');
    -  this.domElement.setAttribute('class', 'guidat-controller ' + this.type);
    -
    -  this.propertyNameElement = document.createElement('span');
    -  this.propertyNameElement.setAttribute('class', 'guidat-propertyname');
    -  this.name(this.propertyName);
    -  this.domElement.appendChild(this.propertyNameElement);
    -
    -  DAT.GUI.makeUnselectable(this.domElement);
    -
    -};
    -
    -DAT.GUI.Controller.prototype.changeFunction = null;
    -DAT.GUI.Controller.prototype.finishChangeFunction = null;
    -
    -DAT.GUI.Controller.prototype.name = function(n) {
    -  this.propertyNameElement.innerHTML = n;
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.reset = function() {
    -  this.setValue(this.initialValue);
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.listen = function() {
    -  this.parent.listenTo(this);
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.unlisten = function() {
    -  this.parent.unlistenTo(this); // <--- hasn't been tested yet
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.setValue = function(n) {
    -	if(this.object[this.propertyName] != undefined){
    -		this.object[this.propertyName] = n;
    -	}else{
    -		var o = new Object();
    -		o[this.propertyName] = n;
    -		this.object.set(o);
    -	}
    -  if (this.changeFunction != null) {
    -    this.changeFunction.call(this, n);
    -  }
    -  this.updateDisplay();
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.getValue = function() {
    -	var val = this.object[this.propertyName];
    -	if(val == undefined) val = this.object.get(this.propertyName);
    -  return val;
    -};
    -
    -DAT.GUI.Controller.prototype.updateDisplay = function() {
    -  
    -};
    -
    -DAT.GUI.Controller.prototype.onChange = function(fnc) {
    -  this.changeFunction = fnc;
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.onFinishChange = function(fnc) {
    -  this.finishChangeFunction = fnc;
    -  return this;
    -};
    -
    -DAT.GUI.Controller.prototype.options = function() {
    -  var _this = this;
    -  var select = document.createElement('select');
    -  if (arguments.length == 1) {
    -    var arr = arguments[0];
    -    for (var i in arr) {
    -      var opt = document.createElement('option');
    -      opt.innerHTML = i;
    -      opt.setAttribute('value', arr[i]);
    -      if (arguments[i] == this.getValue()) {
    -        opt.selected = true;
    -      }
    -      select.appendChild(opt);
    -    }
    -  } else {
    -    for (var i = 0; i < arguments.length; i++) {
    -      var opt = document.createElement('option');
    -      opt.innerHTML = arguments[i];
    -      opt.setAttribute('value', arguments[i]);
    -      if (arguments[i] == this.getValue()) {
    -        opt.selected = true;
    -      }
    -      select.appendChild(opt);
    -    }
    -  }
    -
    -  select.addEventListener('change', function() {
    -    _this.setValue(this.value);
    -    if (_this.finishChangeFunction != null) {
    -      _this.finishChangeFunction.call(this, _this.getValue());
    -    }
    -  }, false);
    -  _this.domElement.appendChild(select);
    -  return this;
    -};
    diff --git a/src/DAT/GUI/ControllerBoolean.js b/src/DAT/GUI/ControllerBoolean.js
    deleted file mode 100644
    index be4f5b0..0000000
    --- a/src/DAT/GUI/ControllerBoolean.js
    +++ /dev/null
    @@ -1,43 +0,0 @@
    -DAT.GUI.ControllerBoolean = function() {
    -
    -  this.type = "boolean";
    -  DAT.GUI.Controller.apply(this, arguments);
    -
    -  var _this = this;
    -  var input = document.createElement('input');
    -  input.setAttribute('type', 'checkbox');
    -
    -  input.checked = this.getValue();
    -  this.setValue(this.getValue());
    -
    -  this.domElement.addEventListener('click', function(e) {
    -    input.checked = !input.checked;
    -    e.preventDefault();
    -    _this.setValue(input.checked);
    -  }, false);
    -
    -  input.addEventListener('mouseup', function(e) {
    -    input.checked = !input.checked; // counteracts default.
    -  }, false);
    -
    -  this.domElement.style.cursor = "pointer";
    -  this.propertyNameElement.style.cursor = "pointer";
    -  this.domElement.appendChild(input);
    -
    -  this.updateDisplay = function() {
    -    input.checked = _this.getValue();
    -  };
    -
    -
    -  this.setValue = function(val) {
    -    if (typeof val != "boolean") {
    -      try {
    -        val = eval(val);
    -      } catch (e) {
    -      }
    -    }
    -    return DAT.GUI.Controller.prototype.setValue.call(this, val);
    -  };
    -
    -};
    -DAT.GUI.extendController(DAT.GUI.ControllerBoolean);
    diff --git a/src/DAT/GUI/ControllerFunction.js b/src/DAT/GUI/ControllerFunction.js
    deleted file mode 100644
    index 9ef4fc0..0000000
    --- a/src/DAT/GUI/ControllerFunction.js
    +++ /dev/null
    @@ -1,30 +0,0 @@
    -DAT.GUI.ControllerFunction = function() {
    -
    -  this.type = "function";
    -
    -  var _this = this;
    -
    -  DAT.GUI.Controller.apply(this, arguments);
    -
    -  this.domElement.addEventListener('click', function() {
    -    _this.fire();
    -  }, false);
    -
    -  this.domElement.style.cursor = "pointer";
    -  this.propertyNameElement.style.cursor = "pointer";
    -
    -  var fireFunction = null;
    -  this.onFire = function(fnc) {
    -    fireFunction = fnc;
    -    return this;
    -  }
    -
    -  this.fire = function() {
    -    if (fireFunction != null) {
    -      fireFunction.call(this);
    -    }
    -    _this.object[_this.propertyName].call(_this.object);
    -  };
    -
    -};
    -DAT.GUI.extendController(DAT.GUI.ControllerFunction);
    diff --git a/src/DAT/GUI/ControllerNumber.js b/src/DAT/GUI/ControllerNumber.js
    deleted file mode 100644
    index db45315..0000000
    --- a/src/DAT/GUI/ControllerNumber.js
    +++ /dev/null
    @@ -1,243 +0,0 @@
    -DAT.GUI.ControllerNumber = function() {
    -
    -  this.type = "number";
    -
    -  DAT.GUI.Controller.apply(this, arguments);
    -
    -  var _this = this;
    -
    -  // If we simply click and release a number field, we want to highlight it.
    -  // This variable keeps track of whether or not we've dragged
    -  var draggedNumberField = false;
    -  
    -  var clickedNumberField = false;
    -  var draggingHorizontal = false;
    -  var draggingVertical = false;
    -
    -  var y = 0, py = 0;
    -
    -  var min = arguments[3];
    -  var max = arguments[4];
    -  var step = arguments[5];
    -
    -  var defaultStep = function() {
    -      step = (max - min) * 0.01;
    -  };
    -
    -  this.min = function() {
    -    var needsSlider = false;
    -    if (min == undefined && max != undefined) {
    -      needsSlider = true;
    -    }
    -    if (arguments.length == 0) {
    -      return min;
    -    } else {
    -      min = arguments[0];
    -    }
    -    if (needsSlider) {
    -      addSlider();
    -      if (step == undefined) {
    -        defaultStep();
    -      }
    -    }
    -    return _this;
    -  };
    -
    -  this.max = function() {
    -    var needsSlider = false;
    -    if (min != undefined && max == undefined) {
    -      needsSlider = true;
    -    }
    -    if (arguments.length == 0) {
    -      return max;
    -    } else {
    -      max = arguments[0];
    -    }
    -    if (needsSlider) {
    -      addSlider();
    -      if (step == undefined) { 
    -        defaultStep();
    -      }
    -    }
    -    return _this;
    -  };
    -
    -  this.step = function() {
    -    if (arguments.length == 0) {
    -      return step;
    -    } else {
    -      step = arguments[0];
    -    }
    -    return _this;
    -  };
    -
    -  this.getMin = function() {
    -    return min;
    -  };
    -
    -  this.getMax = function() {
    -    return max;
    -  };
    -  
    -  this.getStep = function() {
    -    if (step == undefined) {
    -      if (max != undefined && min != undefined) {
    -        return (max-min)/100;
    -      } else {
    -        return 1;
    -      }
    -    } else {
    -      return step;
    -    }
    -  }
    -
    -  var numberField = document.createElement('input');
    -  numberField.setAttribute('id', this.propertyName);
    -  numberField.setAttribute('type', 'text');
    -  numberField.setAttribute('value', this.getValue());
    -
    -  if (step) numberField.setAttribute('step', step);
    -
    -  this.domElement.appendChild(numberField);
    -
    -  var slider;
    -
    -  var addSlider = function() {
    -    slider = new DAT.GUI.ControllerNumberSlider(_this, min, max, step, _this.getValue());
    -    _this.domElement.appendChild(slider.domElement);
    -  };
    -
    -  if (min != undefined && max != undefined) {
    -    addSlider();
    -  }
    -
    -  numberField.addEventListener('blur', function() {
    -    var val = parseFloat(this.value);
    -    if (slider) {
    -      DAT.GUI.removeClass(_this.domElement, 'active');
    -    }
    -    if (!isNaN(val)) {
    -      _this.setValue(val);
    -    }
    -  }, false);
    -
    -
    -  numberField.addEventListener('mousewheel', function(e) {
    -    e.preventDefault();
    -    _this.setValue(_this.getValue() + Math.abs(e.wheelDeltaY) / e.wheelDeltaY * _this.getStep());
    -    return false;
    -  }, false);
    -
    -  numberField.addEventListener('mousedown', function(e) {
    -    py = y = e.pageY;
    -    clickedNumberField = true;
    -    DAT.GUI.makeSelectable(numberField);
    -    document.addEventListener('mousemove', dragNumberField, false);
    -    document.addEventListener('mouseup', mouseup, false);
    -  }, false);
    -
    -  // Handle up arrow and down arrow
    -  numberField.addEventListener('keydown', function(e) {
    -    var newVal;
    -    switch (e.keyCode) {
    -      case 13:    // enter
    -        newVal = parseFloat(this.value);
    -        _this.setValue(newVal);
    -        break;
    -      case 38:    // up
    -        newVal = _this.getValue() + _this.getStep();
    -        _this.setValue(newVal);
    -        break;
    -      case 40:    // down
    -        newVal = _this.getValue() - _this.getStep();
    -        _this.setValue(newVal);
    -        break;
    -    }
    -  }, false);
    -
    -  var mouseup = function(e) {
    -    document.removeEventListener('mousemove', dragNumberField, false);
    -    
    -    DAT.GUI.makeSelectable(numberField);
    -    if (clickedNumberField && !draggedNumberField) {
    -      //numberField.focus();
    -      //numberField.select();
    -    }
    -    draggedNumberField = false;
    -    clickedNumberField = false;
    -    if (_this.finishChangeFunction != null) {
    -      _this.finishChangeFunction.call(this, _this.getValue());
    -    }
    -    draggingHorizontal = false;
    -    draggingVertical = false;
    -    document.removeEventListener('mouseup', mouseup, false);
    -  };
    -
    -  var dragNumberField = function(e) {
    -
    -    py = y;
    -    y = e.pageY;
    -    var dy = py - y;
    -
    -    
    -
    -    if (!draggingHorizontal && !draggingVertical) {
    -      if (dy == 0) {
    -        draggingHorizontal = true;
    -      } else {
    -        draggingVertical = true;
    -      }
    -    }
    -
    -    if (draggingHorizontal) {
    -      return true;
    -    }
    -
    -    DAT.GUI.addClass(_this.domElement, 'active');
    -
    -    DAT.GUI.makeUnselectable(_this.parent.domElement);
    -    DAT.GUI.makeUnselectable(numberField);
    -
    -    draggedNumberField = true;
    -    e.preventDefault();
    -
    -    var newVal = _this.getValue() + dy * _this.getStep();
    -    _this.setValue(newVal);
    -    return false;
    -
    -  };
    -
    -  this.options = function() {
    -    _this.noSlider();
    -    _this.domElement.removeChild(numberField);
    -    return DAT.GUI.Controller.prototype.options.apply(this, arguments);
    -  };
    -
    -  this.noSlider = function() {
    -    if (slider) {
    -      _this.domElement.removeChild(slider.domElement);
    -    }
    -    return this;
    -  };
    -
    -  this.setValue = function(val) {
    -
    -    val = parseFloat(val);
    -
    -    if (min != undefined && val <= min) {
    -      val = min;
    -    } else if (max != undefined && val >= max) {
    -      val = max;
    -    }
    -
    -    return DAT.GUI.Controller.prototype.setValue.call(this, val);
    -
    -  };
    -
    -  this.updateDisplay = function() {
    -    numberField.value = DAT.GUI.roundToDecimal(_this.getValue(), 4);
    -    if (slider) slider.value = _this.getValue();
    -  };
    -};
    -
    -DAT.GUI.extendController(DAT.GUI.ControllerNumber);
    diff --git a/src/DAT/GUI/ControllerNumberSlider.js b/src/DAT/GUI/ControllerNumberSlider.js
    deleted file mode 100644
    index d5521d2..0000000
    --- a/src/DAT/GUI/ControllerNumberSlider.js
    +++ /dev/null
    @@ -1,64 +0,0 @@
    -DAT.GUI.ControllerNumberSlider = function(numberController, min, max, step, initValue) {
    -
    -  var clicked = false;
    -  var _this = this;
    -
    -  var x, px;
    -
    -  this.domElement = document.createElement('div');
    -  this.domElement.setAttribute('class', 'guidat-slider-bg');
    -
    -  this.fg = document.createElement('div');
    -  this.fg.setAttribute('class', 'guidat-slider-fg');
    -
    -  this.domElement.appendChild(this.fg);
    -
    -  var onDrag = function(e) {
    -    if (!clicked) return;
    -    var pos = findPos(_this.domElement);
    -    var val = DAT.GUI.map(e.pageX, pos[0], pos[0] + _this.domElement
    -        .offsetWidth, numberController.getMin(), numberController.getMax());
    -    val = Math.round(val / numberController.getStep()) * numberController
    -        .getStep();
    -    numberController.setValue(val);
    -  };
    -
    -  this.domElement.addEventListener('mousedown', function(e) {
    -    clicked = true;
    -    x = px = e.pageX;
    -    DAT.GUI.addClass(numberController.domElement, 'active');
    -    onDrag(e);
    -    document.addEventListener('mouseup', mouseup, false);
    -  }, false);
    -
    -  var mouseup = function(e) {
    -    DAT.GUI.removeClass(numberController.domElement, 'active');
    -    clicked = false;
    -    if (numberController.finishChangeFunction != null) {
    -      numberController.finishChangeFunction.call(this,
    -          numberController.getValue());
    -    }
    -    document.removeEventListener('mouseup', mouseup, false);
    -  };
    -
    -  var findPos = function(obj) {
    -    var curleft = 0, curtop = 0;
    -    if (obj.offsetParent) {
    -      do {
    -        curleft += obj.offsetLeft;
    -        curtop += obj.offsetTop;
    -      } while ((obj = obj.offsetParent));
    -      return [curleft,curtop];
    -    }
    -  };
    -
    -  this.__defineSetter__('value', function(e) {
    -    this.fg.style.width = DAT.GUI.map(e, numberController.getMin(),
    -        numberController.getMax(), 0, 100) + "%";
    -  });
    -
    -  document.addEventListener('mousemove', onDrag, false);
    -
    -  this.value = initValue;
    -
    -};
    \ No newline at end of file
    diff --git a/src/DAT/GUI/ControllerString.js b/src/DAT/GUI/ControllerString.js
    deleted file mode 100644
    index 9642e82..0000000
    --- a/src/DAT/GUI/ControllerString.js
    +++ /dev/null
    @@ -1,57 +0,0 @@
    -DAT.GUI.ControllerString = function() {
    -
    -  this.type = "string";
    -
    -  var _this = this;
    -  DAT.GUI.Controller.apply(this, arguments);
    -
    -  var input = document.createElement('input');
    -
    -  var initialValue = this.getValue();
    -
    -  input.setAttribute('value', initialValue);
    -  input.setAttribute('spellcheck', 'false');
    -
    -  this.domElement.addEventListener('mouseup', function() {
    -    input.focus();
    -    input.select();
    -  }, false);
    -
    -  // TODO: getting messed up on ctrl a
    -  input.addEventListener('keyup', function(e) {
    -    if (e.keyCode == 13 && _this.finishChangeFunction != null) {
    -      _this.finishChangeFunction.call(this, _this.getValue());
    -      input.blur();
    -    }
    -    _this.setValue(input.value);
    -  }, false);
    -
    -  input.addEventListener('mousedown', function(e) {
    -    DAT.GUI.makeSelectable(input);
    -  }, false);
    -
    -  input.addEventListener('blur', function() {
    -    DAT.GUI.supressHotKeys = false;
    -    if (_this.finishChangeFunction != null) {
    -      _this.finishChangeFunction.call(this, _this.getValue());
    -    }
    -  }, false);
    -
    -  input.addEventListener('focus', function() {
    -    DAT.GUI.supressHotKeys = true;
    -  }, false);
    -
    -  this.updateDisplay = function() {
    -    input.value = _this.getValue();
    -  };
    -
    -  this.options = function() {
    -    _this.domElement.removeChild(input);
    -    return DAT.GUI.Controller.prototype.options.apply(this, arguments);
    -  };
    -
    -  this.domElement.appendChild(input);
    -
    -};
    -
    -DAT.GUI.extendController(DAT.GUI.ControllerString);
    diff --git a/src/DAT/GUI/GUI.css b/src/DAT/GUI/GUI.css
    deleted file mode 100644
    index e5af34c..0000000
    --- a/src/DAT/GUI/GUI.css
    +++ /dev/null
    @@ -1,168 +0,0 @@
    -#guidat {
    -  position: fixed;
    -  top: 0;
    -  right: 0;
    -  width: auto;
    -  z-index: 1001;
    -  text-align: right;
    -}
    -
    -.guidat {
    -  color: #fff;
    -  opacity: 0.97;
    -  text-align: left;
    -  float: right;
    -  margin-right: 20px;
    -  margin-bottom: 20px;
    -  background-color: #fff;
    -}
    -
    -.guidat,
    -.guidat input {
    -  font: 9.5px Lucida Grande, sans-serif;
    -}
    -
    -.guidat-controllers {
    -  height: 300px;
    -  overflow-y: auto;
    -  overflow-x: hidden;
    -  background-color: rgba(0, 0, 0, 0.1);
    -}
    -
    -a.guidat-toggle:link,
    -a.guidat-toggle:visited,
    -a.guidat-toggle:active {
    -  text-decoration: none;
    -  cursor: pointer;
    -  color: #fff;
    -  background-color: #222;
    -  text-align: center;
    -  display: block;
    -  padding: 5px;
    -
    -}
    -
    -a.guidat-toggle:hover {
    -  background-color: #000;
    -}
    -
    -.guidat-controller {
    -  padding: 3px;
    -  height: 25px;
    -  clear: left;
    -  border-bottom: 1px solid #222;
    -  background-color: #111;
    -}
    -
    -.guidat-controller,
    -.guidat-controller input,
    -.guidat-slider-bg,
    -.guidat-slider-fg {
    -  -moz-transition: background-color 0.15s linear;
    -  -webkit-transition: background-color 0.15s linear;
    -  transition: background-color 0.15s linear;
    -}
    -
    -.guidat-controller.boolean:hover,
    -.guidat-controller.function:hover {
    -  background-color: #000;
    -}
    -
    -.guidat-controller input {
    -  float: right;
    -  outline: none;
    -  border: 0;
    -  padding: 4px;
    -  margin-top: 2px;
    -  background-color: #222;
    -}
    -
    -.guidat-controller select {
    -  margin-top: 4px;
    -  float: right;
    -}
    -
    -.guidat-controller input:hover {
    -  background-color: #444;
    -}
    -
    -.guidat-controller input:focus,
    -.guidat-controller.active input {
    -  background-color: #555;
    -  color: #fff;
    -}
    -
    -.guidat-controller.number {
    -  border-left: 5px solid #00aeff;
    -}
    -
    -.guidat-controller.string {
    -  border-left: 5px solid #1ed36f;
    -}
    -
    -.guidat-controller.string input {
    -  border: 0;
    -  color: #1ed36f;
    -  margin-right: 2px;
    -  width: 148px;
    -}
    -
    -.guidat-controller.boolean {
    -  border-left: 5px solid #54396e;
    -}
    -
    -.guidat-controller.function {
    -  border-left: 5px solid #e61d5f;
    -}
    -
    -.guidat-controller.number input[type=text] {
    -  width: 35px;
    -  margin-left: 5px;
    -  margin-right: 2px;
    -  color: #00aeff;
    -}
    -
    -.guidat .guidat-controller.boolean input {
    -  margin-top: 6px;
    -  margin-right: 2px;
    -  font-size: 20px;
    -}
    -
    -.guidat-controller:last-child {
    -  border-bottom: none;
    -  -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -  -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -}
    -
    -.guidat-propertyname {
    -  padding: 5px;
    -  padding-top: 7px;
    -  cursor: default;
    -  display: inline-block;
    -}
    -
    -.guidat-controller .guidat-slider-bg:hover,
    -.guidat-controller.active .guidat-slider-bg {
    -  background-color: #444;
    -}
    -
    -.guidat-controller .guidat-slider-bg .guidat-slider-fg:hover,
    -.guidat-controller.active .guidat-slider-bg .guidat-slider-fg {
    -  background-color: #52c8ff;
    -}
    -
    -.guidat-slider-bg {
    -  background-color: #222;
    -  cursor: ew-resize;
    -  width: 40%;
    -  margin-top: 2px;
    -  float: right;
    -  height: 21px;
    -}
    -
    -.guidat-slider-fg {
    -  cursor: ew-resize;
    -  background-color: #00aeff;
    -  height: 21px;
    -}
    diff --git a/src/DAT/GUI/GUI.js b/src/DAT/GUI/GUI.js
    index 5981573..e066316 100644
    --- a/src/DAT/GUI/GUI.js
    +++ b/src/DAT/GUI/GUI.js
    @@ -1,740 +1,1323 @@
    -var DAT = DAT || {};
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
     
    -DAT.GUI = function(parameters) {
    +define([
     
    -  if (parameters == undefined) {
    -    parameters = {};
    -  }
    -
    -
    -  var paramsExplicitHeight = false;
    -  if (parameters.height == undefined) {
    -    parameters.height = 300;
    -  } else {
    -    paramsExplicitHeight = true;
    -  }
    -
    -  var MIN_WIDTH = 240;
    -  var MAX_WIDTH = 500;
    -
    -  var controllers = [];
    -  var listening = [];
    -
    -  var autoListen = true;
    -
    -  var listenInterval;
    -
    -  // Sum total of heights of controllers in this gui
    -  var controllerHeight;
    -
    -  var _this = this;
    -
    -  var open = true;
    +  'dat/utils/css',
       
    -  var width = 280;
    -  if (parameters.width != undefined) {
    -  	width = parameters.width;
    -  }
    +  'text!dat/gui/saveDialogue.html',
    +  'text!dat/gui/style.css',
     
    -  // Prevents checkForOverflow bug in which loaded gui appearance
    -  // settings are not respected by presence of scrollbar.
    -  var explicitOpenHeight = false;
    +  'dat/controllers/factory',
    +  'dat/controllers/Controller',
    +  'dat/controllers/BooleanController',
    +  'dat/controllers/FunctionController',
    +  'dat/controllers/NumberControllerBox',
    +  'dat/controllers/NumberControllerSlider',
    +  'dat/controllers/OptionController',
    +  'dat/controllers/ColorController',
     
    -  // How big we get when we open
    -  var openHeight;
    +  'dat/utils/requestAnimationFrame',
     
    -  var closeString = 'Close Controls';
    -  var openString = 'Open Controls';
    +  'dat/dom/CenteredDiv',
    +  'dat/dom/dom',
     
    -  var name;
    +  'dat/utils/common'
     
    -  var resizeTo = 0;
    -  var resizeTimeout;
    +], function(css, saveDialogueContents, styleSheet, controllerFactory, Controller, BooleanController, FunctionController, NumberControllerBox, NumberControllerSlider, OptionController, ColorController, requestAnimationFrame, CenteredDiv, dom, common) {
     
    -  this.domElement = document.createElement('div');
    -  this.domElement.setAttribute('class', 'guidat');
    -  this.domElement.style.width = width + 'px';
    +  css.inject(styleSheet);
     
    -  var curControllerContainerHeight = parameters.height;
    -  var controllerContainer = document.createElement('div');
    -  controllerContainer.setAttribute('class', 'guidat-controllers');
    -  controllerContainer.style.height = curControllerContainerHeight + 'px';
    +  /** Outer-most className for GUI's */
    +  var CSS_NAMESPACE = 'dg';
     
    -  // Firefox hack to prevent horizontal scrolling
    -  controllerContainer.addEventListener('DOMMouseScroll', function(e) {
    +  var HIDE_KEY_CODE = 72;
     
    -    var scrollAmount = this.scrollTop;
    +  var DEFAULT_DEFAULT_PRESET_NAME = 'Default';
    +
    +  var SUPPORTS_LOCAL_STORAGE = (function() {
    +    try {
    +      return 'localStorage' in window && window['localStorage'] !== null;
    +    } catch (e) {
    +      return false;
    +    }
    +  })();
    +
    +  var SAVE_DIALOGUE;
    +
    +  /** Have we yet to create an autoPlace GUI? */
    +  var auto_place_virgin = true;
    +
    +  /** Fixed position div that auto place GUI's go inside */
    +  var auto_place_container;
    +
    +  /** Are we hiding the GUI's ? */
    +  var hide = false;
    +
    +  /** GUI's which should be hidden */
    +  var hideable_guis = [];
    +
    +  /**
    +   * A lightweight controller library for JavaScript. It allows you to easily
    +   * manipulate variables and fire functions on the fly.
    +   * @class
    +   *
    +   * @member dat.gui
    +   *
    +   * @param {Object} [params]
    +   * @param {String} [params.name] The name of this GUI.
    +   * @param {Object} [params.load] JSON object representing the saved state of
    +   * this GUI.
    +   * @param {Boolean} [params.auto=true]
    +   * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.
    +   * @param {Boolean} [params.closed] If true, starts closed
    +   */
    +  var GUI = function(params) {
    +
    +    var _this = this;
    +
    +    /**
    +     * Outermost DOM Element
    +     * @type DOMElement
    +     */
    +    this.domElement = document.createElement('div');
    +    this.__ul = document.createElement('ul');
    +    this.domElement.appendChild(this.__ul);
    +
    +    dom.addClass(this.domElement, CSS_NAMESPACE);
    +
    +    /**
    +     * Nested GUI's by name
    +     * @ignore
    +     */
    +    this.__folders = {};
    +
    +    this.__controllers = [];
    +
    +    /**
    +     * List of objects I'm remembering for save, only used in top level GUI
    +     * @ignore
    +     */
    +    this.__rememberedObjects = [];
    +
    +    /**
    +     * Maps the index of remembered objects to a map of controllers, only used
    +     * in top level GUI.
    +     *
    +     * @private
    +     * @ignore
    +     *
    +     * @example
    +     * [
    +     *  {
    +     *    propertyName: Controller,
    +     *    anotherPropertyName: Controller
    +     *  },
    +     *  {
    +     *    propertyName: Controller
    +     *  }
    +     * ]
    +     */
    +    this.__rememberedObjectIndecesToControllers = [];
    +
    +    this.__listening = [];
    +
    +    params = params || {};
    +
    +    // Default parameters
    +    params = common.defaults(params, {
    +      autoPlace: true,
    +      width: GUI.DEFAULT_WIDTH
    +    });
    +
    +    params = common.defaults(params, {
    +      resizable: params.autoPlace,
    +      hideable: params.autoPlace
    +    });
    +
    +
    +    if (!common.isUndefined(params.load)) {
    +
    +      // Explicit preset
    +      if (params.preset) params.load.preset = params.preset;
    +
    +    } else {
    +
    +      params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };
     
    -    if (e.wheelDelta) {
    -      scrollAmount += e.wheelDelta;
    -    } else if (e.detail) {
    -      scrollAmount += e.detail;
         }
     
    -    if (e.preventDefault) {
    -      e.preventDefault();
    +    if (common.isUndefined(params.parent) && params.hideable) {
    +      hideable_guis.push(this);
         }
     
    -    e.returnValue = false;
    -
    -    controllerContainer.scrollTop = scrollAmount;
    -
    -  }, false);
    +    // Only root level GUI's are resizable.
    +    params.resizable = common.isUndefined(params.parent) && params.resizable;
     
     
    -  var toggleButton = document.createElement('a');
    -  toggleButton.setAttribute('class', 'guidat-toggle');
    -  toggleButton.setAttribute('href', '#');
    -  toggleButton.innerHTML = open ? closeString : openString;
    +    if (params.autoPlace && common.isUndefined(params.scrollable)) {
    +      params.scrollable = true;
    +    }
    +//    params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;
     
    -  var toggleDragged = false;
    -  var dragDisplacementY = 0;
    -  var dragDisplacementX = 0;
    -  var togglePressed = false;
    +    // Not part of params because I don't want people passing this in via
    +    // constructor. Should be a 'remembered' value.
    +    var use_local_storage =
    +        SUPPORTS_LOCAL_STORAGE &&
    +            localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';
     
    -  var my, pmy, mx, pmx;
    +    Object.defineProperties(this,
     
    -  var resize = function(e) {
    -    pmy = my;
    -    pmx = mx;
    -    my = e.pageY;
    -    mx = e.pageX;
    +        /** @lends dat.gui.GUI.prototype */
    +        {
     
    -    var dmy = my - pmy;
    +          /**
    +           * The parent <code>GUI</code>
    +           * @type dat.gui.GUI
    +           */
    +          parent: {
    +            get: function() {
    +              return params.parent;
    +            }
    +          },
    +
    +          scrollable: {
    +            get: function() {
    +              return params.scrollable;
    +            }
    +          },
    +
    +
    +          /**
    +           * Handles <code>GUI</code>'s element placement for you
    +           * @type Boolean
    +           */
    +          autoPlace: {
    +            get: function() {
    +              return params.autoPlace;
    +            }
    +          },
    +
    +          /**
    +           * The identifier for a set of saved values
    +           * @type String
    +           */
    +          preset: {
    +
    +            get: function() {
    +              if (_this.parent) {
    +                return _this.getRoot().preset;
    +              } else {
    +                return params.load.preset;
    +              }
    +            },
    +
    +            set: function(v) {
    +              if (_this.parent) {
    +                _this.getRoot().preset = v;
    +              } else {
    +                params.load.preset = v;
    +              }
    +              setPresetSelectIndex(this);
    +              _this.revert();
    +            }
    +
    +          },
    +
    +          /**
    +           * The width of <code>GUI</code> element
    +           * @type Number
    +           */
    +          width: {
    +            get: function() {
    +              return params.width;
    +            },
    +            set: function(v) {
    +              params.width = v;
    +              setWidth(_this, v);
    +            }
    +          },
    +
    +          /**
    +           * The name of <code>GUI</code>. Used for folders. i.e
    +           * a folder's name
    +           * @type String
    +           */
    +          name: {
    +            get: function() {
    +              return params.name;
    +            },
    +            set: function(v) {
    +              // TODO Check for collisions among sibling folders
    +              params.name = v;
    +              if (title_row_name) {
    +                title_row_name.innerHTML = params.name;
    +              }
    +            }
    +          },
    +
    +          /**
    +           * Whether the <code>GUI</code> is collapsed or not
    +           * @type Boolean
    +           */
    +          closed: {
    +            get: function() {
    +              return params.closed;
    +            },
    +            set: function(v) {
    +              params.closed = v;
    +              if (params.closed) {
    +                dom.addClass(_this.__ul, GUI.CLASS_CLOSED);
    +              } else {
    +                dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);
    +              }
    +              // For browsers that aren't going to respect the CSS transition,
    +              // Lets just check our height against the window height right off
    +              // the bat.
    +              this.onResize();
    +//              resetWidth();
    +            }
    +          },
    +
    +          /**
    +           * Contains all presets
    +           * @type Object
    +           */
    +          load: {
    +            get: function() {
    +              return params.load;
    +            }
    +          },
    +
    +          /**
    +           * Determines whether or not to use <a href="https://developer.mozilla.org/en/DOM/Storage#localStorage">localStorage</a> as the means for
    +           * <code>remember</code>ing
    +           * @type Boolean
    +           */
    +          useLocalStorage: {
    +
    +            get: function() {
    +              return use_local_storage;
    +            },
    +            set: function(bool) {
    +              if (SUPPORTS_LOCAL_STORAGE) {
    +                use_local_storage = bool;
    +                if (bool) {
    +                  dom.bind(window, 'unload', saveToLocalStorage);
    +                } else {
    +                  dom.unbind(window, 'unload', saveToLocalStorage);
    +                }
    +                localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);
    +              }
    +            }
    +
    +          }
    +
    +        });
    +
    +    // Are we a root level GUI?
    +    if (common.isUndefined(params.parent)) {
    +
    +      params.closed = false;
    +      dom.addClass(this.domElement, GUI.CLASS_MAIN);
    +      dom.makeSelectable(this.domElement, false);
    +
    +      // Are we supposed to be loading locally?
    +      if (SUPPORTS_LOCAL_STORAGE) {
    +
    +        if (use_local_storage) {
    +
    +          _this.useLocalStorage = true;
    +
    +          var saved_gui = localStorage.getItem(getLocalStorageHash(this, 'gui'));
    +
    +          if (saved_gui) {
    +            params.load = JSON.parse(saved_gui);
    +          }
    +
    +        }
     
    -    if (!open) {
    -      if (dmy > 0) {
    -        open = true;
    -        curControllerContainerHeight = openHeight = 1;
    -        toggleButton.innerHTML = name || closeString;
    -      } else {
    -        return;
           }
    +
    +      // Oh, you're a nested GUI!
    +    } else {
    +
    +      if (params.closed === undefined) {
    +        params.closed = true;
    +      }
    +
    +      var title_row_name = document.createTextNode(params.name);
    +      dom.addClass(title_row_name, 'controller-name');
    +
    +      var title_row = addRow(_this, title_row_name);
    +
    +      var on_click_title = function(e) {
    +        e.preventDefault();
    +        e.stopPropagation()
    +        _this.closed = !_this.closed;
    +        return false;
    +      };
    +
    +      dom.addClass(this.__ul, GUI.CLASS_CLOSED);
    +
    +      dom.addClass(title_row, 'title');
    +      dom.bind(title_row, 'click', on_click_title);
    +
    +      if (!params.closed) {
    +        this.closed = false;
    +      }
    +
         }
     
    -    // TODO: Flip this if you want to resize to the left.
    -    var dmx = pmx - mx;
    +    if (params.autoPlace) {
    +
    +      if (common.isUndefined(params.parent)) {
    +
    +        if (auto_place_virgin) {
    +          auto_place_container = document.createElement('div');
    +          dom.addClass(auto_place_container, CSS_NAMESPACE);
    +          dom.addClass(auto_place_container, GUI.CLASS_AUTO_PLACE_CONTAINER);
    +          document.body.appendChild(auto_place_container);
    +          auto_place_virgin = false;
    +        }
    +
    +        // Put it in the dom for you.
    +        auto_place_container.appendChild(this.domElement);
    +
    +        // Apply the auto styles
    +        dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);
    +
    +      }
    +
    +
    +      // Make it not elastic.
    +      if (!this.parent) setWidth(_this, params.width);
     
    -    if (dmy > 0 &&
    -        curControllerContainerHeight > controllerHeight) {
    -      var d = DAT.GUI.map(curControllerContainerHeight, controllerHeight,
    -          controllerHeight + 100, 1, 0);
    -      dmy *= d;
         }
     
    -    toggleDragged = true;
    +    dom.bind(window, 'resize', function() { _this.onResize() });
    +    dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); });
    +    dom.bind(this.__ul, 'transitionend', function() { _this.onResize() });
    +    dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() });
    +    this.onResize();
     
    -    dragDisplacementY += dmy;
    -    openHeight += dmy;
    -    curControllerContainerHeight += dmy;
    -    controllerContainer.style.height = openHeight + 'px';
     
    -    dragDisplacementX += dmx;
    -    width += dmx;
    -    width = DAT.GUI.constrain(width, MIN_WIDTH, MAX_WIDTH);
    -    _this.domElement.style.width = width + 'px';
    +    if (params.resizable) {
    +      addResizeHandle(this);
    +    }
     
    -    checkForOverflow();
    +    function saveToLocalStorage() {
    +      localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));
    +    }
    +
    +    // Small hack to fix CSS positioning bug in Chrome
    +    function resetWidth() {
    +      var root = _this.getRoot();
    +      root.width += 1;
    +      common.defer(function() {
    +        root.width -= 1;
    +      });
    +    }
    +
    +    if (!params.parent) {
    +      resetWidth();
    +    }
     
       };
     
    -  toggleButton.addEventListener('mousedown', function(e) {
    -    pmy = my = e.pageY;
    -    pmx = mx = e.pageX;
    -    togglePressed = true;
    -    e.preventDefault();
    -    dragDisplacementX = 0;
    -    dragDisplacementY = 0;
    -    document.addEventListener('mousemove', resize, false);
    -    return false;
    +  GUI.toggleHide = function() {
     
    -  }, false);
    +    hide = !hide;
    +    common.each(hideable_guis, function(gui) {
    +      gui.domElement.style.zIndex = hide ? -999 : 999;
    +      gui.domElement.style.opacity = hide ? 0 : 1;
    +    });
    +  };
     
    -  toggleButton.addEventListener('click', function(e) {
    -    e.preventDefault();
    -    return false;
    -  }, false);
    +  GUI.CLASS_AUTO_PLACE = 'a';
    +  GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';
    +  GUI.CLASS_MAIN = 'main';
    +  GUI.CLASS_CONTROLLER_ROW = 'cr';
    +  GUI.CLASS_TOO_TALL = 'taller-than-window';
    +  GUI.CLASS_CLOSED = 'closed';
     
    -  document.addEventListener('mouseup', function(e) {
    +  GUI.DEFAULT_WIDTH = 245;
     
    -    if (togglePressed && !toggleDragged) {
    -      _this.toggle();
    +  dom.bind(window, 'keydown', function(e) {
    +
    +    if (document.activeElement.type !== 'text' &&
    +        (e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) {
    +      GUI.toggleHide();
         }
     
    -    if (togglePressed && toggleDragged) {
    +  }, false);
    +
    +  common.extend(
    +
    +      GUI.prototype,
    +
    +      /** @lends dat.gui.GUI */
    +      {
    +
    +        /**
    +         * @param object
    +         * @param property
    +         * @returns {dat.controllers.Controller} The new controller that was added.
    +         * @instance
    +         */
    +        add: function(object, property) {
    +
    +          return add(
    +              this,
    +              object,
    +              property,
    +              {
    +                factoryArgs: Array.prototype.slice.call(arguments, 2)
    +              }
    +          );
    +
    +        },
    +
    +        /**
    +         * @param object
    +         * @param property
    +         * @returns {dat.controllers.ColorController} The new controller that was added.
    +         * @instance
    +         */
    +        addColor: function(object, property) {
    +
    +          return add(
    +              this,
    +              object,
    +              property,
    +              {
    +                color: true
    +              }
    +          );
    +
    +        },
    +
    +        /**
    +         * @param controller
    +         * @instance
    +         */
    +        remove: function(controller) {
    +
    +          // TODO listening?
    +          this.__ul.removeChild(controller.__li);
    +          this.__controllers.slice(this.__controllers.indexOf(controller), 1);
    +          var _this = this;
    +          common.defer(function() {
    +            _this.onResize();
    +          });
    +
    +        },
    +
    +        destroy: function() {
    +
    +          if (this.autoPlace) {
    +            auto_place_container.removeChild(this.domElement);
    +          }
    +
    +        },
    +
    +        /**
    +         * @param name
    +         * @returns {dat.gui.GUI} The new folder.
    +         * @throws {Error} if this GUI already has a folder by the specified
    +         * name
    +         * @instance
    +         */
    +        addFolder: function(name) {
    +
    +          // We have to prevent collisions on names in order to have a key
    +          // by which to remember saved values
    +          if (this.__folders[name] !== undefined) {
    +            throw new Error('You already have a folder in this GUI by the' +
    +                ' name "' + name + '"');
    +          }
    +
    +          var new_gui_params = { name: name, parent: this };
    +
    +          // We need to pass down the autoPlace trait so that we can
    +          // attach event listeners to open/close folder actions to
    +          // ensure that a scrollbar appears if the window is too short.
    +          new_gui_params.autoPlace = this.autoPlace;
    +
    +          // Do we have saved appearance data for this folder?
    +
    +          if (this.load && // Anything loaded?
    +              this.load.folders && // Was my parent a dead-end?
    +              this.load.folders[name]) { // Did daddy remember me?
    +
    +            // Start me closed if I was closed
    +            new_gui_params.closed = this.load.folders[name].closed;
    +
    +            // Pass down the loaded data
    +            new_gui_params.load = this.load.folders[name];
    +
    +          }
    +
    +          var gui = new GUI(new_gui_params);
    +          this.__folders[name] = gui;
    +
    +          var li = addRow(this, gui.domElement);
    +          dom.addClass(li, 'folder');
    +
    +          gui.open = function() {
    +            this.closed = false;
    +          };
    +
    +          gui.close = function() {
    +            this.closed = true;
    +          };
    +
    +          return gui;
    +
    +        },
    +
    +        onResize: function() {
    +
    +
    +          var root = this.getRoot();
    +
    +
    +          if (root.scrollable) {
    +
    +            var top = dom.getOffset(root.domElement).top;
    +
    +            var h = 0;
    +            common.each(root.__ul.childNodes, function(node) {
    +              h += dom.getHeight(node);
    +            });
    +
    +
    +            if (window.innerHeight < h) {
    +              dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);
    +              root.__ul.style.height = window.innerHeight - top + 'px';
    +            } else {
    +              dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);
    +              root.__ul.style.height = 'auto';
    +            }
    +
    +
    +          }
    +
    +          if (root.__resize_handle) {
    +            common.defer(function() {
    +              root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';
    +            });
    +          }
    +
    +        },
    +
    +        /**
    +         * Mark objects for saving. The order of these objects cannot change as
    +         * the GUI grows. When remembering new objects, append them to the end
    +         * of the list.
    +         *
    +         * @param {Object...} objects
    +         * @throws {Error} if not called on a top level GUI.
    +         * @instance
    +         */
    +        remember: function() {
    +        
    +          if (common.isUndefined(SAVE_DIALOGUE)) {
    +            SAVE_DIALOGUE = new CenteredDiv();
    +            SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;
    +          }
    +
    +          if (this.parent) {
    +            throw new Error("You can only call remember on a top level GUI.");
    +          }
    +
    +          var _this = this;
    +
    +          common.each(Array.prototype.slice.call(arguments), function(object) {
    +            if (_this.__rememberedObjects.length == 0) {
    +              addSaveMenu(_this);
    +            }
    +            if (_this.__rememberedObjects.indexOf(object) == -1) {
    +              _this.__rememberedObjects.push(object);
    +            }
    +          });
    +
    +          if (this.autoPlace) {
    +            // Set save row width
    +            setWidth(this, this.width);
    +          }
    +
    +        },
    +
    +        /**
    +         * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.
    +         * @instance
    +         */
    +        getRoot: function() {
    +          var gui = this;
    +          while (gui.parent) {
    +            gui = gui.parent;
    +          }
    +          return gui;
    +        },
    +
    +        /**
    +         * @returns {Object} a JSON object representing the current state of
    +         * this GUI as well as its remembered properties.
    +         * @instance
    +         */
    +        getSaveObject: function() {
    +
    +          var toReturn = this.load;
    +
    +          toReturn.closed = this.closed;
    +
    +          // Am I remembering any values?
    +          if (this.__rememberedObjects.length > 0) {
    +
    +            toReturn.preset = this.preset;
    +
    +            if (!toReturn.remembered) {
    +              toReturn.remembered = {};
    +            }
    +
    +            toReturn.remembered[this.preset] = getCurrentPreset(this);
    +
    +          }
    +
    +          toReturn.folders = {};
    +          common.each(this.__folders, function(element, key) {
    +            toReturn.folders[key] = element.getSaveObject();
    +          });
    +
    +          return toReturn;
    +
    +        },
    +
    +        save: function() {
    +
    +          if (!this.load.remembered) {
    +            this.load.remembered = {};
    +          }
    +
    +          this.load.remembered[this.preset] = getCurrentPreset(this);
    +          markPresetModified(this, false);
    +
    +        },
    +
    +        saveAs: function(presetName) {
    +
    +          if (!this.load.remembered) {
    +
    +            // Retain default values upon first save
    +            this.load.remembered = {};
    +            this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);
    +
    +          }
    +
    +          this.load.remembered[presetName] = getCurrentPreset(this);
    +          this.preset = presetName;
    +          addPresetOption(this, presetName, true);
    +
    +        },
    +
    +        revert: function(gui) {
    +
    +          common.each(this.__controllers, function(controller) {
    +            // Make revert work on Default.
    +            if (!this.getRoot().load.remembered) {
    +              controller.setValue(controller.initialValue);
    +            } else { 
    +              recallSavedValue(gui || this.getRoot(), controller);
    +            }
    +          }, this);
    +
    +          common.each(this.__folders, function(folder) {
    +            folder.revert(folder);
    +          });
    +
    +          if (!gui) {
    +            markPresetModified(this.getRoot(), false);
    +          }
    +
    +
    +        },
    +
    +        listen: function(controller) {
    +
    +          var init = this.__listening.length == 0;
    +          this.__listening.push(controller);
    +          if (init) updateDisplays(this.__listening);
    +
    +        }
     
    -      if (dragDisplacementX == 0) {
    -        adaptToScrollbar();
           }
     
    -      if (openHeight > controllerHeight) {
    +  );
     
    -        clearTimeout(resizeTimeout);
    -        openHeight = resizeTo = controllerHeight;
    -        beginResize();
    +  function add(gui, object, property, params) {
     
    -      } else if (controllerContainer.children.length >= 1) {
    +    if (object[property] === undefined) {
    +      throw new Error("Object " + object + " has no property \"" + property + "\"");
    +    }
    +
    +    var controller;
    +
    +    if (params.color) {
    +
    +      controller = new ColorController(object, property);
    +
    +    } else {
    +
    +      var factoryArgs = [object,property].concat(params.factoryArgs);
    +      controller = controllerFactory.apply(gui, factoryArgs);
    +
    +    }
    +
    +    if (params.before instanceof Controller) {
    +      params.before = params.before.__li;
    +    }
    +
    +    recallSavedValue(gui, controller);
    +
    +    dom.addClass(controller.domElement, 'c');
    +
    +    var name = document.createElement('span');
    +    dom.addClass(name, 'property-name');
    +    name.innerHTML = controller.property;
    +
    +    var container = document.createElement('div');
    +    container.appendChild(name);
    +    container.appendChild(controller.domElement);
    +
    +    var li = addRow(gui, container, params.before);
    +
    +    dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
    +    dom.addClass(li, typeof controller.getValue());
    +
    +    augmentController(gui, li, controller);
    +
    +    gui.__controllers.push(controller);
    +
    +    return controller;
    +
    +  }
    +
    +  /**
    +   * Add a row to the end of the GUI or before another row.
    +   *
    +   * @param gui
    +   * @param [dom] If specified, inserts the dom content in the new row
    +   * @param [liBefore] If specified, places the new row before another row
    +   */
    +  function addRow(gui, dom, liBefore) {
    +    var li = document.createElement('li');
    +    if (dom) li.appendChild(dom);
    +    if (liBefore) {
    +      gui.__ul.insertBefore(li, params.before);
    +    } else {
    +      gui.__ul.appendChild(li);
    +    }
    +    gui.onResize();
    +    return li;
    +  }
    +
    +  function augmentController(gui, li, controller) {
    +
    +    controller.__li = li;
    +    controller.__gui = gui;
    +
    +    common.extend(controller, {
    +
    +      options: function(options) {
    +
    +        if (arguments.length > 1) {
    +          controller.remove();
    +
    +          return add(
    +              gui,
    +              controller.object,
    +              controller.property,
    +              {
    +                before: controller.__li.nextElementSibling,
    +                factoryArgs: [common.toArray(arguments)]
    +              }
    +          );
    +
    +        }
    +
    +        if (common.isArray(options) || common.isObject(options)) {
    +          controller.remove();
    +
    +          return add(
    +              gui,
    +              controller.object,
    +              controller.property,
    +              {
    +                before: controller.__li.nextElementSibling,
    +                factoryArgs: [options]
    +              }
    +          );
    +
    +        }
    +
    +      },
    +
    +      name: function(v) {
    +        controller.__li.firstElementChild.firstElementChild.innerHTML = v;
    +        return controller;
    +      },
    +
    +      listen: function() {
    +        controller.__gui.listen(controller);
    +        return controller;
    +      },
    +
    +      remove: function() {
    +        controller.__gui.remove(controller);
    +        return controller;
    +      }
    +
    +    });
    +
    +    // All sliders should be accompanied by a box.
    +    if (controller instanceof NumberControllerSlider) {
    +
    +      var box = new NumberControllerBox(controller.object, controller.property,
    +          { min: controller.__min, max: controller.__max, step: controller.__step });
    +
    +      common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) {
    +        var pc = controller[method];
    +        var pb = box[method];
    +        controller[method] = box[method] = function() {
    +          var args = Array.prototype.slice.call(arguments);
    +          pc.apply(controller, args);
    +          return pb.apply(box, args);
    +        }
    +      });
    +
    +      dom.addClass(li, 'has-slider');
    +      controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);
    +
    +    }
    +    else if (controller instanceof NumberControllerBox) {
    +
    +      var r = function(returned) {
    +
    +        // Have we defined both boundaries?
    +        if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {
    +
    +          // Well, then lets just replace this with a slider.
    +          controller.remove();
    +          return add(
    +              gui,
    +              controller.object,
    +              controller.property,
    +              {
    +                before: controller.__li.nextElementSibling,
    +                factoryArgs: [controller.__min, controller.__max, controller.__step]
    +              });
    +
    +        }
    +
    +        return returned;
    +
    +      };
    +
    +      controller.min = common.compose(r, controller.min);
    +      controller.max = common.compose(r, controller.max);
    +
    +    }
    +    else if (controller instanceof BooleanController) {
    +
    +      dom.bind(li, 'click', function() {
    +        dom.fakeEvent(controller.__checkbox, 'click');
    +      });
    +
    +      dom.bind(controller.__checkbox, 'click', function(e) {
    +        e.stopPropagation(); // Prevents double-toggle
    +      })
    +
    +    }
    +    else if (controller instanceof FunctionController) {
    +
    +      dom.bind(li, 'click', function() {
    +        dom.fakeEvent(controller.__button, 'click');
    +      });
    +
    +      dom.bind(li, 'mouseover', function() {
    +        dom.addClass(controller.__button, 'hover');
    +      });
    +
    +      dom.bind(li, 'mouseout', function() {
    +        dom.removeClass(controller.__button, 'hover');
    +      });
    +
    +    }
    +    else if (controller instanceof ColorController) {
    +
    +      dom.addClass(li, 'color');
    +      controller.updateDisplay = common.compose(function(r) {
    +        li.style.borderLeftColor = controller.__color.toString();
    +        return r;
    +      }, controller.updateDisplay);
    +
    +      controller.updateDisplay();
    +
    +    }
    +
    +    controller.setValue = common.compose(function(r) {
    +      if (gui.getRoot().__preset_select && controller.isModified()) {
    +        markPresetModified(gui.getRoot(), true);
    +      }
    +      return r;
    +    }, controller.setValue);
    +
    +  }
    +
    +  function recallSavedValue(gui, controller) {
    +
    +    // Find the topmost GUI, that's where remembered objects live.
    +    var root = gui.getRoot();
    +
    +    // Does the object we're controlling match anything we've been told to
    +    // remember?
    +    var matched_index = root.__rememberedObjects.indexOf(controller.object);
    +
    +    // Why yes, it does!
    +    if (matched_index != -1) {
    +
    +      // Let me fetch a map of controllers for thcommon.isObject.
    +      var controller_map =
    +          root.__rememberedObjectIndecesToControllers[matched_index];
    +
    +      // Ohp, I believe this is the first controller we've created for this
    +      // object. Lets make the map fresh.
    +      if (controller_map === undefined) {
    +        controller_map = {};
    +        root.__rememberedObjectIndecesToControllers[matched_index] =
    +            controller_map;
    +      }
    +
    +      // Keep track of this controller
    +      controller_map[controller.property] = controller;
    +
    +      // Okay, now have we saved any values for this controller?
    +      if (root.load && root.load.remembered) {
    +
    +        var preset_map = root.load.remembered;
    +
    +        // Which preset are we trying to load?
    +        var preset;
    +
    +        if (preset_map[gui.preset]) {
    +
    +          preset = preset_map[gui.preset];
    +
    +        } else if (preset_map[DEFAULT_DEFAULT_PRESET_NAME]) {
    +
    +          // Uhh, you can have the default instead?
    +          preset = preset_map[DEFAULT_DEFAULT_PRESET_NAME];
     
    -        var singleControllerHeight = controllerContainer.children[0].
    -            offsetHeight;
    -        clearTimeout(resizeTimeout);
    -        var target = Math.round(curControllerContainerHeight /
    -            singleControllerHeight) * singleControllerHeight - 1;
    -        resizeTo = target;
    -        if (resizeTo <= 0) {
    -          _this.close();
    -          openHeight = singleControllerHeight * 2;
             } else {
    -          openHeight = resizeTo;
    -          beginResize();
    -        }
    -      }
    -    }
     
    -    document.removeEventListener('mousemove', resize, false);
    -    e.preventDefault();
    -    toggleDragged = false;
    -    togglePressed = false;
    +          // Nada.
     
    -    return false;
    +          return;
     
    -  }, false);
    -
    -  this.domElement.appendChild(controllerContainer);
    -  this.domElement.appendChild(toggleButton);
    -
    -  if (parameters.domElement) {
    -    parameters.domElement.appendChild(this.domElement);
    -  } else if (DAT.GUI.autoPlace) {
    -    if (DAT.GUI.autoPlaceContainer == null) {
    -      DAT.GUI.autoPlaceContainer = document.createElement('div');
    -      DAT.GUI.autoPlaceContainer.setAttribute('id', 'guidat');
    -
    -      document.body.appendChild(DAT.GUI.autoPlaceContainer);
    -    }
    -    DAT.GUI.autoPlaceContainer.appendChild(this.domElement);
    -  }
    -
    -  this.autoListenIntervalTime = 1000 / 60;
    -
    -  var createListenInterval = function() {
    -    listenInterval = setInterval(function() {
    -      _this.listen();
    -    }, this.autoListenIntervalTime);
    -  };
    -
    -  this.__defineSetter__('autoListen', function(v) {
    -    autoListen = v;
    -    if (!autoListen) {
    -      clearInterval(listenInterval);
    -    } else {
    -      if (listening.length > 0) createListenInterval();
    -    }
    -  });
    -
    -  this.__defineGetter__('autoListen', function(v) {
    -    return autoListen;
    -  });
    -
    -  this.listenTo = function(controller) {
    -    // TODO: check for duplicates
    -    if (listening.length == 0) {
    -      createListenInterval();
    -    }
    -    listening.push(controller);
    -  };
    -
    -  this.unlistenTo = function(controller) {
    -    // TODO: test this
    -    for (var i = 0; i < listening.length; i++) {
    -      if (listening[i] == controller) listening.splice(i, 1);
    -    }
    -    if (listening.length <= 0) {
    -      clearInterval(listenInterval);
    -    }
    -  };
    -
    -  this.listen = function(whoToListenTo) {
    -    var arr = whoToListenTo || listening;
    -    for (var i in arr) {
    -      arr[i].updateDisplay();
    -    }
    -  };
    -
    -  this.listenAll = function() {
    -    this.listen(controllers);
    -  }
    -
    -  this.autoListen = true;
    -
    -  var alreadyControlled = function(object, propertyName) {
    -    for (var i in controllers) {
    -      if (controllers[i].object == object &&
    -          controllers[i].propertyName == propertyName) {
    -        return true;
    -      }
    -    }
    -    return false;
    -  };
    -
    -  var construct = function(constructor, args) {
    -    function C() {
    -      return constructor.apply(this, args);
    -    }
    -
    -    C.prototype = constructor.prototype;
    -    return new C();
    -  };
    -
    -  this.add = function() {
    -
    -
    -    if (arguments.length == 1) {
    -      var toReturn = [];
    -      for (var i in arguments[0]) {
    -        toReturn.push(_this.add(arguments[0], i));
    -      }
    -      return toReturn;
    -    }
    -
    -    var object = arguments[0];
    -    var propertyName = arguments[1];
    -
    -    // Have we already added this?
    -    if (alreadyControlled(object, propertyName)) {
    -      //  DAT.GUI.error('Controller for \'' + propertyName+'\' already added.');
    -      //  return;
    -    }
    -
    -    var value = object[propertyName];
    -    if(value == undefined && object.get) value = object.get(propertyName);
    -
    -    // Does this value exist? Is it accessible?
    -    if (value == undefined) {
    -      DAT.GUI.error(object + ' either has no property \'' + propertyName +
    -          '\', or the property is inaccessible.');
    -      return;
    -    }
    -
    -    var type = typeof value;
    -    var handler = handlerTypes[type];
    -
    -    // Do we know how to deal with this data type?
    -    if (handler == undefined) {
    -      DAT.GUI.error('Cannot create controller for data type \'' + type + '\'');
    -      return;
    -    }
    -
    -    var args = [this]; // Set first arg (parent) to this 
    -    for (var j = 0; j < arguments.length; j++) {
    -      args.push(arguments[j]);
    -    }
    -
    -    var controllerObject = construct(handler, args);
    -
    -    // Were we able to make the controller?
    -    if (!controllerObject) {
    -      DAT.GUI.error('Error creating controller for \'' + propertyName + '\'.');
    -      return;
    -    }
    -
    -    // Success.
    -    controllerContainer.appendChild(controllerObject.domElement);
    -    controllers.push(controllerObject);
    -    DAT.GUI.allControllers.push(controllerObject);
    -
    -    // Do we have a saved value for this controller?
    -    if (type != 'function' &&
    -        DAT.GUI.saveIndex < DAT.GUI.savedValues.length) {
    -      controllerObject.setValue(DAT.GUI.savedValues[DAT.GUI.saveIndex]);
    -      DAT.GUI.saveIndex++;
    -    }
    -
    -    // Compute sum height of controllers.
    -    checkForOverflow();
    -
    -    // Prevents checkForOverflow bug in which loaded gui appearance
    -    // settings are not respected by presence of scrollbar.
    -    if (!explicitOpenHeight) {
    -      openHeight = controllerHeight;
    -    }
    -
    -    // Let's see if we're doing this on onload and lets *try* to guess how
    -    // big you want the damned box.
    -    if (!paramsExplicitHeight) {
    -      try {
    -
    -        // Probably a better way to do this
    -        var caller = arguments.callee.caller;
    -
    -        if (caller == window['onload']) {
    -          curControllerContainerHeight = resizeTo = openHeight =
    -              controllerHeight;
    -          controllerContainer.style.height = curControllerContainerHeight + 'px';
             }
     
    -      } catch (e) {}
    -    }
     
    +        // Did the loaded object remember thcommon.isObject?
    +        if (preset[matched_index] &&
     
    -    return controllerObject;
    +          // Did we remember this particular property?
    +            preset[matched_index][controller.property] !== undefined) {
     
    -  }
    +          // We did remember something for this guy ...
    +          var value = preset[matched_index][controller.property];
     
    -  var checkForOverflow = function() {
    -    controllerHeight = 0;
    -    for (var i in controllers) {
    -      controllerHeight += controllers[i].domElement.offsetHeight;
    -    }
    -    if (controllerHeight - 1 > openHeight) {
    -      controllerContainer.style.overflowY = 'auto';
    -    } else {
    -      controllerContainer.style.overflowY = 'hidden';
    -    }
    -  };
    +          // And that's what it is.
    +          controller.initialValue = value;
    +          controller.setValue(value);
     
    -  var handlerTypes = {
    -    'number': DAT.GUI.ControllerNumber,
    -    'string': DAT.GUI.ControllerString,
    -    'boolean': DAT.GUI.ControllerBoolean,
    -    'function': DAT.GUI.ControllerFunction
    -  };
    +        }
     
    -  this.reset = function() {
    -    // TODO ... Set all values back to their initials.
    -    for (var i = 0, l = DAT.GUI.allControllers.length; i < l; i++) {
    -        // apply to each controller
    -        DAT.GUI.allControllers[i].reset();
    -    }
    -  }
    -
    -  this.toggle = function() {
    -    open ? this.close() : this.open();
    -  };
    -
    -  this.open = function() {
    -    toggleButton.innerHTML = name || closeString;
    -    resizeTo = openHeight;
    -    clearTimeout(resizeTimeout);
    -    beginResize();
    -    adaptToScrollbar();
    -    open = true;
    -  }
    -
    -  this.close = function() {
    -    toggleButton.innerHTML = name || openString;
    -    resizeTo = 0;
    -    clearTimeout(resizeTimeout);
    -    beginResize();
    -    adaptToScrollbar();
    -    open = false;
    -  }
    -
    -  this.name = function(n) {
    -    name = n;
    -    toggleButton.innerHTML = n;
    -  }
    -
    -  // used in saveURL
    -  this.appearanceVars = function() {
    -    return [open, width, openHeight, controllerContainer.scrollTop]
    -  }
    -
    -  var beginResize = function() {
    -
    -    curControllerContainerHeight = controllerContainer.offsetHeight;
    -    curControllerContainerHeight += (resizeTo - curControllerContainerHeight)
    -        * 0.6;
    -
    -    if (Math.abs(curControllerContainerHeight - resizeTo) < 1) {
    -      curControllerContainerHeight = resizeTo;
    -    } else {
    -      resizeTimeout = setTimeout(beginResize, 1000 / 30);
    -    }
    -    controllerContainer.style.height = Math.round(curControllerContainerHeight)
    -        + 'px';
    -    checkForOverflow();
    -
    -  }
    -
    -  var adaptToScrollbar = function() {
    -    // Clears lingering scrollbar column
    -    _this.domElement.style.width = (width - 1) + 'px';
    -    setTimeout(function() {
    -      _this.domElement.style.width = width + 'px';
    -    }, 1);
    -  };
    -
    -
    -  // Load saved appearance:
    -
    -  if (DAT.GUI.guiIndex < DAT.GUI.savedAppearanceVars.length) {
    -
    -    width = parseInt(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][1]);
    -    _this.domElement.style.width = width + 'px';
    -
    -    openHeight = parseInt(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][2]);
    -    explicitOpenHeight = true;
    -    if (eval(DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][0]) == true) {
    -      curControllerContainerHeight = openHeight;
    -      var t = DAT.GUI.savedAppearanceVars[DAT.GUI.guiIndex][3]
    -
    -      // Hack.
    -      setTimeout(function() {
    -        controllerContainer.scrollTop = t;
    -      }, 0);
    -
    -      if (DAT.GUI.scrollTop > -1) {
    -        document.body.scrollTop = DAT.GUI.scrollTop;
           }
    -      resizeTo = openHeight;
    -      this.open();
    +
         }
     
    -    DAT.GUI.guiIndex++;
       }
     
    -  DAT.GUI.allGuis.push(this);
    +  function getLocalStorageHash(gui, key) {
    +    // TODO how does this deal with multiple GUI's?
    +    return document.location.href + '.' + key;
     
    -  // Add hide listener if this is the first DAT.GUI.
    +  }
     
    -  if (DAT.GUI.allGuis.length == 1) {
    +  function addSaveMenu(gui) {
     
    -    window.addEventListener('keyup', function(e) {
    -      // Hide on 'H'
    -      if (!DAT.GUI.supressHotKeys && e.keyCode == 72) {
    -        DAT.GUI.toggleHide();
    +    var div = gui.__save_row = document.createElement('li');
    +
    +    dom.addClass(gui.domElement, 'has-save');
    +
    +    gui.__ul.insertBefore(div, gui.__ul.firstChild);
    +
    +    dom.addClass(div, 'save-row');
    +
    +    var gears = document.createElement('span');
    +    gears.innerHTML = '&nbsp;';
    +    dom.addClass(gears, 'button gears');
    +
    +    // TODO replace with FunctionController
    +    var button = document.createElement('span');
    +    button.innerHTML = 'Save';
    +    dom.addClass(button, 'button');
    +    dom.addClass(button, 'save');
    +
    +    var button2 = document.createElement('span');
    +    button2.innerHTML = 'New';
    +    dom.addClass(button2, 'button');
    +    dom.addClass(button2, 'save-as');
    +
    +    var button3 = document.createElement('span');
    +    button3.innerHTML = 'Revert';
    +    dom.addClass(button3, 'button');
    +    dom.addClass(button3, 'revert');
    +
    +    var select = gui.__preset_select = document.createElement('select');
    +
    +    if (gui.load && gui.load.remembered) {
    +
    +      common.each(gui.load.remembered, function(value, key) {
    +        addPresetOption(gui, key, key == gui.preset);
    +      });
    +
    +    } else {
    +      addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);
    +    }
    +
    +    dom.bind(select, 'change', function() {
    +
    +
    +      for (var index = 0; index < gui.__preset_select.length; index++) {
    +        gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;
           }
    -    }, false);
     
    -    if (DAT.GUI.inlineCSS) {
    -      var styleSheet = document.createElement('style');
    -      styleSheet.setAttribute('type', 'text/css');
    -      styleSheet.innerHTML = DAT.GUI.inlineCSS;
    -      document.head.insertBefore(styleSheet, document.head.firstChild);
    +      gui.preset = this.value;
    +
    +    });
    +
    +    div.appendChild(select);
    +    div.appendChild(gears);
    +    div.appendChild(button);
    +    div.appendChild(button2);
    +    div.appendChild(button3);
    +
    +    if (SUPPORTS_LOCAL_STORAGE) {
    +
    +      var saveLocally = document.getElementById('dg-save-locally');
    +      var explain = document.getElementById('dg-local-explain');
    +
    +      saveLocally.style.display = 'block';
    +
    +      var localStorageCheckBox = document.getElementById('dg-local-storage');
    +
    +      if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {
    +        localStorageCheckBox.setAttribute('checked', 'checked');
    +      }
    +
    +      function showHideExplain() {
    +        explain.style.display = gui.useLocalStorage ? 'block' : 'none';
    +      }
    +
    +      showHideExplain();
    +
    +      // TODO: Use a boolean controller, fool!
    +      dom.bind(localStorageCheckBox, 'change', function() {
    +        gui.useLocalStorage = !gui.useLocalStorage;
    +        showHideExplain();
    +      });
    +
    +    }
    +
    +    var newConstructorTextArea = document.getElementById('dg-new-constructor');
    +
    +    dom.bind(newConstructorTextArea, 'keydown', function(e) {
    +      if (e.metaKey && (e.which === 67 || e.keyCode == 67)) {
    +        SAVE_DIALOGUE.hide();
    +      }
    +    });
    +
    +    dom.bind(gears, 'click', function() {
    +      newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);
    +      SAVE_DIALOGUE.show();
    +      newConstructorTextArea.focus();
    +      newConstructorTextArea.select();
    +    });
    +
    +    dom.bind(button, 'click', function() {
    +      gui.save();
    +    });
    +
    +    dom.bind(button2, 'click', function() {
    +      var presetName = prompt('Enter a new preset name.');
    +      if (presetName) gui.saveAs(presetName);
    +    });
    +
    +    dom.bind(button3, 'click', function() {
    +      gui.revert();
    +    });
    +
    +//    div.appendChild(button2);
    +
    +  }
    +
    +  function addResizeHandle(gui) {
    +
    +    gui.__resize_handle = document.createElement('div');
    +
    +    common.extend(gui.__resize_handle.style, {
    +
    +      width: '6px',
    +      marginLeft: '-3px',
    +      height: '200px',
    +      cursor: 'ew-resize',
    +      position: 'absolute'
    +//      border: '1px solid blue'
    +
    +    });
    +
    +    var pmouseX;
    +
    +    dom.bind(gui.__resize_handle, 'mousedown', dragStart);
    +
    +    gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);
    +
    +    function dragStart(e) {
    +
    +      e.preventDefault();
    +
    +      pmouseX = e.clientX;
    +
    +      dom.bind(window, 'mousemove', drag);
    +      dom.bind(window, 'mouseup', dragStop);
    +
    +      return false;
    +
    +    }
    +
    +    function drag(e) {
    +
    +      e.preventDefault();
    +
    +      gui.width += pmouseX - e.clientX;
    +      pmouseX = e.clientX;
    +
    +      return false;
    +
    +    }
    +
    +    function dragStop() {
    +
    +      dom.unbind(window, 'mousemove', drag);
    +      dom.unbind(window, 'mouseup', dragStop);
    +
         }
     
       }
     
    -};
    -
    -// Do not set this directly.
    -DAT.GUI.hidden = false;
    -
    -// Static members
    -
    -DAT.GUI.autoPlace = true;
    -DAT.GUI.autoPlaceContainer = null;
    -DAT.GUI.allControllers = [];
    -DAT.GUI.allGuis = [];
    -
    -DAT.GUI.supressHotKeys = false;
    -
    -DAT.GUI.toggleHide = function() {
    -  if (DAT.GUI.hidden) {
    -    DAT.GUI.open();
    -  } else {
    -    DAT.GUI.close();
    -  }
    -}
    -
    -DAT.GUI.open = function() {
    -  DAT.GUI.hidden = false;
    -  for (var i in DAT.GUI.allGuis) {
    -    DAT.GUI.allGuis[i].domElement.style.display = 'block';
    -  }
    -}
    -
    -DAT.GUI.close = function() {
    -  DAT.GUI.hidden = true;
    -  for (var i in DAT.GUI.allGuis) {
    -    DAT.GUI.allGuis[i].domElement.style.display = 'none';
    -  }
    -}
    -
    -DAT.GUI.saveURL = function() {
    -  var url = DAT.GUI.replaceGetVar('saveString', DAT.GUI.getSaveString());
    -  window.location = url;
    -};
    -
    -DAT.GUI.scrollTop = -1;
    -
    -DAT.GUI.load = function(saveString) {
    -
    -  //DAT.GUI.savedAppearanceVars = [];
    -  var vals = saveString.split(',');
    -  var numGuis = parseInt(vals[0]);
    -  DAT.GUI.scrollTop = parseInt(vals[1]);
    -  for (var i = 0; i < numGuis; i++) {
    -    var appr = vals.splice(2, 4);
    -    DAT.GUI.savedAppearanceVars.push(appr);
    -  }
    -
    -  DAT.GUI.savedValues = vals.splice(2, vals.length);
    -
    -};
    -
    -DAT.GUI.savedValues = [];
    -DAT.GUI.savedAppearanceVars = [];
    -
    -DAT.GUI.getSaveString = function() {
    -
    -  var vals = [], i;
    -
    -  vals.push(DAT.GUI.allGuis.length);
    -  vals.push(document.body.scrollTop);
    -
    -
    -  for (i in DAT.GUI.allGuis) {
    -    var av = DAT.GUI.allGuis[i].appearanceVars();
    -    for (var j = 0; j < av.length; j++) {
    -      vals.push(av[j]);
    +  function setWidth(gui, w) {
    +    gui.domElement.style.width = w + 'px';
    +    // Auto placed save-rows are position fixed, so we have to
    +    // set the width manually if we want it to bleed to the edge
    +    if (gui.__save_row && gui.autoPlace) {
    +      gui.__save_row.style.width = w + 'px';
         }
       }
     
    -  for (i in DAT.GUI.allControllers) {
    +  function getCurrentPreset(gui, useInitialValues) {
     
    -    // We don't save values for functions.
    -    if (DAT.GUI.allControllers[i].type == 'function') {
    -      continue;
    -    }
    +    var toReturn = {};
     
    -    var v = DAT.GUI.allControllers[i].getValue();
    +    // For each object I'm remembering
    +    common.each(gui.__rememberedObjects, function(val, index) {
     
    -    // Round numbers so they don't get enormous
    -    if (DAT.GUI.allControllers[i].type == 'number') {
    -      v = DAT.GUI.roundToDecimal(v, 4);
    -    }
    +      var saved_values = {};
     
    -    vals.push(v);
    +      // The controllers I've made for thcommon.isObject by property
    +      var controller_map =
    +          gui.__rememberedObjectIndecesToControllers[index];
    +
    +      // Remember each value for each property
    +      common.each(controller_map, function(controller, property) {
    +        saved_values[property] = useInitialValues ? controller.initialValue : controller.getValue();
    +      });
    +
    +      // Save the values for thcommon.isObject
    +      toReturn[index] = saved_values;
    +
    +    });
    +
    +    return toReturn;
     
       }
     
    -  return vals.join(',');
    -
    -};
    -
    -DAT.GUI.getVarFromURL = function(v) {
    -
    -  var vars = [], hash;
    -  var hashes = window.location.href.slice(
    -      window.location.href.indexOf('?') + 1).split('&');
    -
    -  for (var i = 0; i < hashes.length; i++) {
    -    hash = hashes[i].split('=');
    -    if (hash == undefined) continue;
    -    if (hash[0] == v) {
    -      return hash[1];
    +  function addPresetOption(gui, name, setSelected) {
    +    var opt = document.createElement('option');
    +    opt.innerHTML = name;
    +    opt.value = name;
    +    gui.__preset_select.appendChild(opt);
    +    if (setSelected) {
    +      gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;
         }
       }
     
    -  return null;
    -
    -};
    -
    -DAT.GUI.replaceGetVar = function(varName, val) {
    -
    -  var vars = [], hash;
    -  var loc = window.location.href;
    -  var hashes = window.location.href.slice(
    -      window.location.href.indexOf('?') + 1).split('&');
    -
    -  for (var i = 0; i < hashes.length; i++) {
    -    hash = hashes[i].split('=');
    -    if (hash == undefined) continue;
    -    if (hash[0] == varName) {
    -      return loc.replace(hash[1], val);
    +  function setPresetSelectIndex(gui) {
    +    for (var index = 0; index < gui.__preset_select.length; index++) {
    +      if (gui.__preset_select[index].value == gui.preset) {
    +        gui.__preset_select.selectedIndex = index;
    +      }
         }
       }
     
    -  if (window.location.href.indexOf('?') != -1) {
    -    return loc + '&' + varName + '=' + val;
    +  function markPresetModified(gui, modified) {
    +    var opt = gui.__preset_select[gui.__preset_select.selectedIndex];
    +//    console.log('mark', modified, opt);
    +    if (modified) {
    +      opt.innerHTML = opt.value + "*";
    +    } else {
    +      opt.innerHTML = opt.value;
    +    }
       }
     
    -  return loc + '?' + varName + '=' + val;
    +  function updateDisplays(controllerArray) {
     
    -};
     
    -DAT.GUI.saveIndex = 0;
    -DAT.GUI.guiIndex = 0;
    +    if (controllerArray.length != 0) {
     
    -DAT.GUI.showSaveString = function() {
    -  alert(DAT.GUI.getSaveString());
    -};
    +      requestAnimationFrame(function() {
    +        updateDisplays(controllerArray);
    +      });
     
    -// Util functions
    +    }
     
    -DAT.GUI.makeUnselectable = function(elem) {
    -  if (elem == undefined || elem.style == undefined) return;
    -  elem.onselectstart = function() {
    -    return false;
    -  };
    -  elem.style.MozUserSelect = 'none';
    -  elem.style.KhtmlUserSelect = 'none';
    -  elem.unselectable = 'on';
    +    common.each(controllerArray, function(c) {
    +      c.updateDisplay();
    +    });
     
    -  var kids = elem.childNodes;
    -  for (var i = 0; i < kids.length; i++) {
    -    DAT.GUI.makeUnselectable(kids[i]);
       }
     
    -};
    +  return GUI;
     
    -DAT.GUI.makeSelectable = function(elem) {
    -  if (elem == undefined || elem.style == undefined) return;
    -  elem.onselectstart = function() {
    -  };
    -  elem.style.MozUserSelect = 'auto';
    -  elem.style.KhtmlUserSelect = 'auto';
    -  elem.unselectable = 'off';
    -
    -  var kids = elem.childNodes;
    -  for (var i = 0; i < kids.length; i++) {
    -    DAT.GUI.makeSelectable(kids[i]);
    -  }
    -
    -};
    -
    -DAT.GUI.map = function(v, i1, i2, o1, o2) {
    -  return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));
    -};
    -
    -DAT.GUI.constrain = function (v, o1, o2) {
    -  if (v < o1) v = o1;
    -  else if (v > o2) v = o2;
    -  return v;
    -};
    -
    -DAT.GUI.error = function(str) {
    -  if (typeof console.error == 'function') {
    -    console.error('[DAT.GUI ERROR] ' + str);
    -  }
    -};
    -
    -DAT.GUI.roundToDecimal = function(n, decimals) {
    -  var t = Math.pow(10, decimals);
    -  return Math.round(n * t) / t;
    -};
    -
    -DAT.GUI.extendController = function(clazz) {
    -  clazz.prototype = new DAT.GUI.Controller();
    -  clazz.prototype.constructor = clazz;
    -};
    -
    -DAT.GUI.addClass = function(domElement, className) {
    -  if (DAT.GUI.hasClass(domElement, className)) return;
    -  domElement.className += ' ' + className;
    -}
    -
    -DAT.GUI.hasClass = function(domElement, className) {
    -  return domElement.className.indexOf(className) != -1;
    -}
    -
    -DAT.GUI.removeClass = function(domElement, className) {
    -  var reg = new RegExp(' ' + className, 'g');
    -  domElement.className = domElement.className.replace(reg, '');
    -}
    -
    -if (DAT.GUI.getVarFromURL('saveString') != null) {
    -  DAT.GUI.load(DAT.GUI.getVarFromURL('saveString'));
    -}
    +});
    diff --git a/src/dat/color/Color.js b/src/dat/color/Color.js
    new file mode 100644
    index 0000000..429d314
    --- /dev/null
    +++ b/src/dat/color/Color.js
    @@ -0,0 +1,189 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/color/interpret',
    +  'dat/color/math',
    +  'dat/color/toString',
    +  'dat/utils/common'
    +], function(interpret, math, toString, common) {
    +
    +  var Color = function() {
    +
    +    this.__state = interpret.apply(this, arguments);
    +
    +    if (this.__state === false) {
    +      throw 'Failed to interpret color arguments';
    +    }
    +
    +    this.__state.a = this.__state.a || 1;
    +
    +
    +  };
    +
    +  Color.COMPONENTS = ['r','g','b','h','s','v','hex','a'];
    +
    +  common.extend(Color.prototype, {
    +
    +    toString: function() {
    +      return toString(this);
    +    },
    +
    +    toOriginal: function() {
    +      return this.__state.conversion.write(this);
    +    }
    +
    +  });
    +
    +  defineRGBComponent(Color.prototype, 'r', 2);
    +  defineRGBComponent(Color.prototype, 'g', 1);
    +  defineRGBComponent(Color.prototype, 'b', 0);
    +
    +  defineHSVComponent(Color.prototype, 'h');
    +  defineHSVComponent(Color.prototype, 's');
    +  defineHSVComponent(Color.prototype, 'v');
    +
    +  Object.defineProperty(Color.prototype, 'a', {
    +
    +    get: function() {
    +      return this.__state.a;
    +    },
    +
    +    set: function(v) {
    +      this.__state.a = v;
    +    }
    +
    +  });
    +
    +  Object.defineProperty(Color.prototype, 'hex', {
    +
    +    get: function() {
    +
    +      if (!this.__state.space !== 'HEX') {
    +        this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);
    +      }
    +
    +      return this.__state.hex;
    +
    +    },
    +
    +    set: function(v) {
    +
    +      this.__state.space = 'HEX';
    +      this.__state.hex = v;
    +
    +    }
    +
    +  });
    +
    +  function defineRGBComponent(target, component, componentHexIndex) {
    +
    +    Object.defineProperty(target, component, {
    +
    +      get: function() {
    +
    +        if (this.__state.space === 'RGB') {
    +          return this.__state[component];
    +        }
    +
    +        recalculateRGB(this, component, componentHexIndex);
    +
    +        return this.__state[component];
    +
    +      },
    +
    +      set: function(v) {
    +
    +        if (this.__state.space !== 'RGB') {
    +          recalculateRGB(this, component, componentHexIndex);
    +          this.__state.space = 'RGB';
    +        }
    +
    +        this.__state[component] = v;
    +
    +      }
    +
    +    });
    +
    +  }
    +
    +  function defineHSVComponent(target, component) {
    +
    +    Object.defineProperty(target, component, {
    +
    +      get: function() {
    +
    +        if (this.__state.space === 'HSV')
    +          return this.__state[component];
    +
    +        recalculateHSV(this);
    +
    +        return this.__state[component];
    +
    +      },
    +
    +      set: function(v) {
    +
    +        if (this.__state.space !== 'HSV') {
    +          recalculateHSV(this);
    +          this.__state.space = 'HSV';
    +        }
    +
    +        this.__state[component] = v;
    +
    +      }
    +
    +    });
    +
    +  }
    +
    +  function recalculateRGB(color, component, componentHexIndex) {
    +
    +    if (color.__state.space === 'HEX') {
    +
    +      color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);
    +
    +    } else if (color.__state.space === 'HSV') {
    +
    +      common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));
    +
    +    } else {
    +
    +      throw 'Corrupted color state';
    +
    +    }
    +
    +  }
    +
    +  function recalculateHSV(color) {
    +
    +    var result = math.rgb_to_hsv(color.r, color.g, color.b);
    +
    +    common.extend(color.__state,
    +        {
    +          s: result.s,
    +          v: result.v
    +        }
    +    );
    +
    +    if (!common.isNaN(result.h)) {
    +      color.__state.h = result.h;
    +    } else if (common.isUndefined(color.__state.h)) {
    +      color.__state.h = 0;
    +    }
    +
    +  }
    +
    +  return Color;
    +
    +});
    diff --git a/src/dat/color/interpret.js b/src/dat/color/interpret.js
    new file mode 100644
    index 0000000..8e64d03
    --- /dev/null
    +++ b/src/dat/color/interpret.js
    @@ -0,0 +1,340 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/color/toString',
    +  'dat/utils/common'
    +], function(toString, common) {
    +
    +  var result, toReturn;
    +
    +  var interpret = function() {
    +
    +    toReturn = false;
    +
    +    var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];
    +
    +    common.each(INTERPRETATIONS, function(family) {
    +
    +      if (family.litmus(original)) {
    +
    +        common.each(family.conversions, function(conversion, conversionName) {
    +
    +          result = conversion.read(original);
    +
    +          if (toReturn === false && result !== false) {
    +            toReturn = result;
    +            result.conversionName = conversionName;
    +            result.conversion = conversion;
    +            return common.BREAK;
    +
    +          }
    +
    +        });
    +
    +        return common.BREAK;
    +
    +      }
    +
    +    });
    +
    +    return toReturn;
    +
    +  };
    +
    +  var INTERPRETATIONS = [
    +
    +    // Strings
    +    {
    +
    +      litmus: common.isString,
    +
    +      conversions: {
    +
    +        THREE_CHAR_HEX: {
    +
    +          read: function(original) {
    +
    +            var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
    +            if (test === null) return false;
    +
    +            return {
    +              space: 'HEX',
    +              hex: parseInt(
    +                  '0x' +
    +                      test[1].toString() + test[1].toString() +
    +                      test[2].toString() + test[2].toString() +
    +                      test[3].toString() + test[3].toString())
    +            };
    +
    +          },
    +
    +          write: toString
    +
    +        },
    +
    +        SIX_CHAR_HEX: {
    +
    +          read: function(original) {
    +
    +            var test = original.match(/^#([A-F0-9]{6})$/i);
    +            if (test === null) return false;
    +
    +            return {
    +              space: 'HEX',
    +              hex: parseInt('0x' + test[1].toString())
    +            };
    +
    +          },
    +
    +          write: toString
    +
    +        },
    +
    +        CSS_RGB: {
    +
    +          read: function(original) {
    +
    +            var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
    +            if (test === null) return false;
    +
    +            return {
    +              space: 'RGB',
    +              r: parseFloat(test[1]),
    +              g: parseFloat(test[2]),
    +              b: parseFloat(test[3])
    +            };
    +
    +          },
    +
    +          write: toString
    +
    +        },
    +
    +        CSS_RGBA: {
    +
    +          read: function(original) {
    +
    +            var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
    +            if (test === null) return false;
    +
    +            return {
    +              space: 'RGB',
    +              r: parseFloat(test[1]),
    +              g: parseFloat(test[2]),
    +              b: parseFloat(test[3]),
    +              a: parseFloat(test[4])
    +            };
    +
    +          },
    +
    +          write: toString
    +
    +        }
    +
    +      }
    +
    +    },
    +
    +    // Numbers
    +    {
    +
    +      litmus: common.isNumber,
    +
    +      conversions: {
    +
    +        HEX: {
    +          read: function(original) {
    +            return {
    +              space: 'HEX',
    +              hex: original,
    +              conversionName: 'HEX'
    +            }
    +          },
    +
    +          write: function(color) {
    +            return color.hex;
    +          }
    +        }
    +
    +      }
    +
    +    },
    +
    +    // Arrays
    +    {
    +
    +      litmus: common.isArray,
    +
    +      conversions: {
    +
    +        RGB_ARRAY: {
    +          read: function(original) {
    +            if (original.length != 3) return false;
    +            return {
    +              space: 'RGB',
    +              r: original[0],
    +              g: original[1],
    +              b: original[2]
    +            };
    +          },
    +
    +          write: function(color) {
    +            return [color.r, color.g, color.b];
    +          }
    +
    +        },
    +
    +        RGBA_ARRAY: {
    +          read: function(original) {
    +            if (original.length != 4) return false;
    +            return {
    +              space: 'RGB',
    +              r: original[0],
    +              g: original[1],
    +              b: original[2],
    +              a: original[3]
    +            };
    +          },
    +
    +          write: function(color) {
    +            return [color.r, color.g, color.b, color.a];
    +          }
    +
    +        }
    +
    +      }
    +
    +    },
    +
    +    // Objects
    +    {
    +
    +      litmus: common.isObject,
    +
    +      conversions: {
    +
    +        RGBA_OBJ: {
    +          read: function(original) {
    +            if (common.isNumber(original.r) &&
    +                common.isNumber(original.g) &&
    +                common.isNumber(original.b) &&
    +                common.isNumber(original.a)) {
    +              return {
    +                space: 'RGB',
    +                r: original.r,
    +                g: original.g,
    +                b: original.b,
    +                a: original.a
    +              }
    +            }
    +            return false;
    +          },
    +
    +          write: function(color) {
    +            return {
    +              r: color.r,
    +              g: color.g,
    +              b: color.b,
    +              a: color.a
    +            }
    +          }
    +        },
    +
    +        RGB_OBJ: {
    +          read: function(original) {
    +            if (common.isNumber(original.r) &&
    +                common.isNumber(original.g) &&
    +                common.isNumber(original.b)) {
    +              return {
    +                space: 'RGB',
    +                r: original.r,
    +                g: original.g,
    +                b: original.b
    +              }
    +            }
    +            return false;
    +          },
    +
    +          write: function(color) {
    +            return {
    +              r: color.r,
    +              g: color.g,
    +              b: color.b
    +            }
    +          }
    +        },
    +
    +        HSVA_OBJ: {
    +          read: function(original) {
    +            if (common.isNumber(original.h) &&
    +                common.isNumber(original.s) &&
    +                common.isNumber(original.v) &&
    +                common.isNumber(original.a)) {
    +              return {
    +                space: 'HSV',
    +                h: original.h,
    +                s: original.s,
    +                v: original.v,
    +                a: original.a
    +              }
    +            }
    +            return false;
    +          },
    +
    +          write: function(color) {
    +            return {
    +              h: color.h,
    +              s: color.s,
    +              v: color.v,
    +              a: color.a
    +            }
    +          }
    +        },
    +
    +        HSV_OBJ: {
    +          read: function(original) {
    +            if (common.isNumber(original.h) &&
    +                common.isNumber(original.s) &&
    +                common.isNumber(original.v)) {
    +              return {
    +                space: 'HSV',
    +                h: original.h,
    +                s: original.s,
    +                v: original.v
    +              }
    +            }
    +            return false;
    +          },
    +
    +          write: function(color) {
    +            return {
    +              h: color.h,
    +              s: color.s,
    +              v: color.v
    +            }
    +          }
    +
    +        }
    +
    +      }
    +
    +    }
    +
    +
    +  ];
    +
    +  return interpret;
    +
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/color/math.js b/src/dat/color/math.js
    new file mode 100644
    index 0000000..6be2613
    --- /dev/null
    +++ b/src/dat/color/math.js
    @@ -0,0 +1,100 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +
    +], function() {
    +
    +  var tmpComponent;
    +
    +  return {
    +
    +    hsv_to_rgb: function(h, s, v) {
    +
    +      var hi = Math.floor(h / 60) % 6;
    +
    +      var f = h / 60 - Math.floor(h / 60);
    +      var p = v * (1.0 - s);
    +      var q = v * (1.0 - (f * s));
    +      var t = v * (1.0 - ((1.0 - f) * s));
    +      var c = [
    +        [v, t, p],
    +        [q, v, p],
    +        [p, v, t],
    +        [p, q, v],
    +        [t, p, v],
    +        [v, p, q]
    +      ][hi];
    +
    +      return {
    +        r: c[0] * 255,
    +        g: c[1] * 255,
    +        b: c[2] * 255
    +      };
    +
    +    },
    +
    +    rgb_to_hsv: function(r, g, b) {
    +
    +      var min = Math.min(r, g, b),
    +          max = Math.max(r, g, b),
    +          delta = max - min,
    +          h, s;
    +
    +      if (max != 0) {
    +        s = delta / max;
    +      } else {
    +        return {
    +          h: NaN,
    +          s: 0,
    +          v: 0
    +        };
    +      }
    +
    +      if (r == max) {
    +        h = (g - b) / delta;
    +      } else if (g == max) {
    +        h = 2 + (b - r) / delta;
    +      } else {
    +        h = 4 + (r - g) / delta;
    +      }
    +      h /= 6;
    +      if (h < 0) {
    +        h += 1;
    +      }
    +
    +      return {
    +        h: h * 360,
    +        s: s,
    +        v: max / 255
    +      };
    +    },
    +
    +    rgb_to_hex: function(r, g, b) {
    +      var hex = this.hex_with_component(0, 2, r);
    +      hex = this.hex_with_component(hex, 1, g);
    +      hex = this.hex_with_component(hex, 0, b);
    +      return hex;
    +    },
    +
    +    component_from_hex: function(hex, componentIndex) {
    +      return (hex >> (componentIndex * 8)) & 0xFF;
    +    },
    +
    +    hex_with_component: function(hex, componentIndex, value) {
    +      return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent));
    +    }
    +
    +  }
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/color/toString.js b/src/dat/color/toString.js
    new file mode 100644
    index 0000000..c052a79
    --- /dev/null
    +++ b/src/dat/color/toString.js
    @@ -0,0 +1,37 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/utils/common'
    +], function(common) {
    +
    +  return function(color) {
    +
    +    if (color.a == 1 || common.isUndefined(color.a)) {
    +
    +      var s = color.hex.toString(16);
    +      while (s.length < 6) {
    +        s = '0' + s;
    +      }
    +
    +      return '#' + s;
    +
    +    } else {
    +
    +      return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')';
    +
    +    }
    +
    +  }
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/BooleanController.js b/src/dat/controllers/BooleanController.js
    new file mode 100644
    index 0000000..4c1e5ac
    --- /dev/null
    +++ b/src/dat/controllers/BooleanController.js
    @@ -0,0 +1,96 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/controllers/Controller',
    +  'dat/dom/dom',
    +  'dat/utils/common'
    +], function(Controller, dom, common) {
    +
    +  /**
    +   * @class Provides a checkbox input to alter the boolean property of an object.
    +   * @extends dat.controllers.Controller
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   *
    +   * @member dat.controllers
    +   */
    +  var BooleanController = function(object, property) {
    +
    +    BooleanController.superclass.call(this, object, property);
    +
    +    var _this = this;
    +    var _prev = this.getValue();
    +
    +    this.__checkbox = document.createElement('input');
    +    this.__checkbox.setAttribute('type', 'checkbox');
    +
    +
    +    dom.bind(this.__checkbox, 'change', onChange, false);
    +
    +    this.domElement.appendChild(this.__checkbox);
    +
    +    // Match original value
    +    this.updateDisplay();
    +
    +    function onChange() {
    +      var cur = !_this.getValue();
    +      if (cur !== _prev) {
    +        _this.setValue(cur);
    +      } else {
    +        _this.setValue(!cur);
    +      }
    +      _prev = cur;
    +    }
    +
    +  };
    +
    +  BooleanController.superclass = Controller;
    +
    +  common.extend(
    +
    +      BooleanController.prototype,
    +      Controller.prototype,
    +
    +      {
    +
    +        setValue: function(v) {
    +          var toReturn = BooleanController.superclass.prototype.setValue.call(this, v);
    +          if (this.__onFinishChange) {
    +            this.__onFinishChange.call(this, this.getValue());
    +          }
    +          this.__prev = this.getValue();
    +          return toReturn;
    +        },
    +
    +        updateDisplay: function() {
    +          
    +          if (this.getValue() === true) {
    +            this.__checkbox.setAttribute('checked', 'checked');
    +          } else {
    +            this.__checkbox.removeAttribute('checked');
    +          }
    +
    +          return BooleanController.superclass.prototype.updateDisplay.call(this);
    +
    +        }
    +
    +
    +      }
    +
    +  );
    +
    +  return BooleanController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/ColorController.js b/src/dat/controllers/ColorController.js
    new file mode 100644
    index 0000000..eef8978
    --- /dev/null
    +++ b/src/dat/controllers/ColorController.js
    @@ -0,0 +1,324 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/controllers/Controller',
    +  'dat/dom/dom',
    +  'dat/color/Color',
    +  'dat/color/interpret',
    +  'dat/utils/common'
    +], function(Controller, dom, Color, interpret, common) {
    +
    +  var ColorController = function(object, property) {
    +
    +    ColorController.superclass.call(this, object, property);
    +
    +    this.__color = new Color(this.getValue());
    +    this.__temp = new Color(0);
    +
    +    var _this = this;
    +
    +    this.domElement = document.createElement('div');
    +
    +    dom.makeSelectable(this.domElement, false);
    +
    +    this.__selector = document.createElement('div');
    +    this.__selector.className = 'selector';
    +
    +    this.__saturation_field = document.createElement('div');
    +    this.__saturation_field.className = 'saturation-field';
    +
    +    this.__field_knob = document.createElement('div');
    +    this.__field_knob.className = 'field-knob';
    +    this.__field_knob_border = '2px solid ';
    +
    +    this.__hue_knob = document.createElement('div');
    +    this.__hue_knob.className = 'hue-knob';
    +
    +    this.__hue_field = document.createElement('div');
    +    this.__hue_field.className = 'hue-field';
    +
    +    this.__input = document.createElement('input');
    +    this.__input.type = 'text';
    +    this.__input_textShadow = '0 1px 1px ';
    +
    +    dom.bind(this.__input, 'keydown', function(e) {
    +      if (e.keyCode === 13) { // on enter
    +        onBlur.call(this);
    +      }
    +    });
    +
    +    dom.bind(this.__input, 'blur', onBlur);
    +
    +    dom.bind(this.__selector, 'mousedown', function(e) {
    +
    +      dom
    +        .addClass(this, 'drag')
    +        .bind(window, 'mouseup', function(e) {
    +          dom.removeClass(_this.__selector, 'drag');
    +        });
    +
    +    });
    +
    +    var value_field = document.createElement('div');
    +
    +    common.extend(this.__selector.style, {
    +      width: '122px',
    +      height: '102px',
    +      padding: '3px',
    +      backgroundColor: '#222',
    +      boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
    +    });
    +
    +    common.extend(this.__field_knob.style, {
    +      position: 'absolute',
    +      width: '12px',
    +      height: '12px',
    +      border: this.__field_knob_border + (this.__color.v < .5 ? '#fff' : '#000'),
    +      boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
    +      borderRadius: '12px',
    +      zIndex: 1
    +    });
    +    
    +    common.extend(this.__hue_knob.style, {
    +      position: 'absolute',
    +      width: '15px',
    +      height: '2px',
    +      borderRight: '4px solid #fff',
    +      zIndex: 1
    +    });
    +
    +    common.extend(this.__saturation_field.style, {
    +      width: '100px',
    +      height: '100px',
    +      border: '1px solid #555',
    +      marginRight: '3px',
    +      display: 'inline-block',
    +      cursor: 'pointer'
    +    });
    +
    +    common.extend(value_field.style, {
    +      width: '100%',
    +      height: '100%',
    +      background: 'none'
    +    });
    +    
    +    linearGradient(value_field, 'top', 'rgba(0,0,0,0)', '#000');
    +
    +    common.extend(this.__hue_field.style, {
    +      width: '15px',
    +      height: '100px',
    +      display: 'inline-block',
    +      border: '1px solid #555',
    +      cursor: 'ns-resize'
    +    });
    +
    +    hueGradient(this.__hue_field);
    +
    +    common.extend(this.__input.style, {
    +      outline: 'none',
    +//      width: '120px',
    +      textAlign: 'center',
    +//      padding: '4px',
    +//      marginBottom: '6px',
    +      color: '#fff',
    +      border: 0,
    +      fontWeight: 'bold',
    +      textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
    +    });
    +
    +    dom.bind(this.__saturation_field, 'mousedown', fieldDown);
    +    dom.bind(this.__field_knob, 'mousedown', fieldDown);
    +
    +    dom.bind(this.__hue_field, 'mousedown', function(e) {
    +      setH(e);
    +      dom.bind(window, 'mousemove', setH);
    +      dom.bind(window, 'mouseup', unbindH);
    +    });
    +
    +    function fieldDown(e) {
    +      setSV(e);
    +      // document.body.style.cursor = 'none';
    +      dom.bind(window, 'mousemove', setSV);
    +      dom.bind(window, 'mouseup', unbindSV);
    +    }
    +
    +    function unbindSV() {
    +      dom.unbind(window, 'mousemove', setSV);
    +      dom.unbind(window, 'mouseup', unbindSV);
    +      // document.body.style.cursor = 'default';
    +    }
    +
    +    function onBlur() {
    +      var i = interpret(this.value);
    +      if (i !== false) {
    +        _this.__color.__state = i;
    +        _this.setValue(_this.__color.toOriginal());
    +      } else {
    +        this.value = _this.__color.toString();
    +      }
    +    }
    +
    +    function unbindH() {
    +      dom.unbind(window, 'mousemove', setH);
    +      dom.unbind(window, 'mouseup', unbindH);
    +    }
    +
    +    this.__saturation_field.appendChild(value_field);
    +    this.__selector.appendChild(this.__field_knob);
    +    this.__selector.appendChild(this.__saturation_field);
    +    this.__selector.appendChild(this.__hue_field);
    +    this.__hue_field.appendChild(this.__hue_knob);
    +
    +    this.domElement.appendChild(this.__input);
    +    this.domElement.appendChild(this.__selector);
    +
    +    this.updateDisplay();
    +
    +    function setSV(e) {
    +
    +      e.preventDefault();
    +
    +      var w = dom.getWidth(_this.__saturation_field);
    +      var o = dom.getOffset(_this.__saturation_field);
    +      var s = (e.clientX - o.left + document.body.scrollLeft) / w;
    +      var v = 1 - (e.clientY - o.top + document.body.scrollTop) / w;
    +
    +      if (v > 1) v = 1;
    +      else if (v < 0) v = 0;
    +
    +      if (s > 1) s = 1;
    +      else if (s < 0) s = 0;
    +
    +      _this.__color.v = v;
    +      _this.__color.s = s;
    +
    +      _this.setValue(_this.__color.toOriginal());
    +
    +
    +      return false;
    +
    +    }
    +
    +    function setH(e) {
    +
    +      e.preventDefault();
    +
    +      var s = dom.getHeight(_this.__hue_field);
    +      var o = dom.getOffset(_this.__hue_field);
    +      var h = 1 - (e.clientY - o.top + document.body.scrollTop) / s;
    +
    +      if (h > 1) h = 1;
    +      else if (h < 0) h = 0;
    +
    +      _this.__color.h = h * 360;
    +
    +      _this.setValue(_this.__color.toOriginal());
    +
    +      return false;
    +
    +    }
    +
    +  };
    +
    +  ColorController.superclass = Controller;
    +
    +  common.extend(
    +
    +      ColorController.prototype,
    +      Controller.prototype,
    +
    +      {
    +
    +        updateDisplay: function() {
    +
    +          var i = interpret(this.getValue());
    +
    +          if (i !== false) {
    +
    +            var mismatch = false;
    +
    +            // Check for mismatch on the interpreted value.
    +
    +            common.each(Color.COMPONENTS, function(component) {
    +              if (!common.isUndefined(i[component]) &&
    +                  !common.isUndefined(this.__color.__state[component]) &&
    +                  i[component] !== this.__color.__state[component]) {
    +                mismatch = true;
    +                return {}; // break
    +              }
    +            }, this);
    +
    +            // If nothing diverges, we keep our previous values
    +            // for statefulness, otherwise we recalculate fresh
    +            if (mismatch) {
    +              common.extend(this.__color.__state, i);
    +            }
    +
    +          }
    +
    +          common.extend(this.__temp.__state, this.__color.__state);
    +
    +          this.__temp.a = 1;
    +
    +          var flip = (this.__color.v < .5 || this.__color.s > .5) ? 255 : 0;
    +          var _flip = 255 - flip;
    +
    +          common.extend(this.__field_knob.style, {
    +            marginLeft: 100 * this.__color.s - 7 + 'px',
    +            marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
    +            backgroundColor: this.__temp.toString(),
    +            border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip +')'
    +          });
    +
    +          this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'
    +
    +          this.__temp.s = 1;
    +          this.__temp.v = 1;
    +
    +          linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toString());
    +
    +          common.extend(this.__input.style, {
    +            backgroundColor: this.__input.value = this.__color.toString(),
    +            color: 'rgb(' + flip + ',' + flip + ',' + flip +')',
    +            textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip +',.7)'
    +          });
    +
    +        }
    +
    +      }
    +
    +  );
    +  
    +  var vendors = ['-moz-','-o-','-webkit-','-ms-',''];
    +  
    +  function linearGradient(elem, x, a, b) {
    +    elem.style.background = '';
    +    common.each(vendors, function(vendor) {
    +      elem.style.cssText += 'background: ' + vendor + 'linear-gradient('+x+', '+a+' 0%, ' + b + ' 100%); ';
    +    });
    +  }
    +  
    +  function hueGradient(elem) {
    +    elem.style.background = '';
    +    elem.style.cssText += 'background: -moz-linear-gradient(top,  #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'
    +    elem.style.cssText += 'background: -webkit-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'
    +    elem.style.cssText += 'background: -o-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'
    +    elem.style.cssText += 'background: -ms-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'
    +    elem.style.cssText += 'background: linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'
    +  }
    +
    +
    +  return ColorController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/Controller.js b/src/dat/controllers/Controller.js
    new file mode 100644
    index 0000000..3a44df3
    --- /dev/null
    +++ b/src/dat/controllers/Controller.js
    @@ -0,0 +1,144 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +   'dat/utils/common'
    +], function(common) {
    +
    +  /**
    +   * @class An "abstract" class that represents a given property of an object.
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   *
    +   * @member dat.controllers
    +   */
    +  var Controller = function(object, property) {
    +
    +    this.initialValue = object[property];
    +
    +    /**
    +     * Those who extend this class will put their DOM elements in here.
    +     * @type {DOMElement}
    +     */
    +    this.domElement = document.createElement('div');
    +
    +    /**
    +     * The object to manipulate
    +     * @type {Object}
    +     */
    +    this.object = object;
    +
    +    /**
    +     * The name of the property to manipulate
    +     * @type {String}
    +     */
    +    this.property = property;
    +
    +    /**
    +     * The function to be called on change.
    +     * @type {Function}
    +     * @ignore
    +     */
    +    this.__onChange = undefined;
    +
    +    /**
    +     * The function to be called on finishing change.
    +     * @type {Function}
    +     * @ignore
    +     */
    +    this.__onFinishChange = undefined;
    +
    +  };
    +
    +  common.extend(
    +
    +      Controller.prototype,
    +
    +      /** @lends dat.controllers.Controller.prototype */
    +      {
    +
    +        /**
    +         * Specify that a function fire every time someone changes the value with
    +         * this Controller.
    +         *
    +         * @param {Function} fnc This function will be called whenever the value
    +         * is modified via this Controller.
    +         * @returns {dat.controllers.Controller} this
    +         */
    +        onChange: function(fnc) {
    +          this.__onChange = fnc;
    +          return this;
    +        },
    +
    +        /**
    +         * Specify that a function fire every time someone "finishes" changing
    +         * the value wih this Controller. Useful for values that change
    +         * incrementally like numbers or strings.
    +         *
    +         * @param {Function} fnc This function will be called whenever
    +         * someone "finishes" changing the value via this Controller.
    +         * @returns {dat.controllers.Controller} this
    +         */
    +        onFinishChange: function(fnc) {
    +          this.__onFinishChange = fnc;
    +          return this;
    +        },
    +
    +        /**
    +         * Change the value of <code>object[property]</code>
    +         *
    +         * @param {Object} newValue The new value of <code>object[property]</code>
    +         */
    +        setValue: function(newValue) {
    +          this.object[this.property] = newValue;
    +          if (this.__onChange) {
    +            this.__onChange.call(this, newValue);
    +          }
    +          this.updateDisplay();
    +          return this;
    +        },
    +
    +        /**
    +         * Gets the value of <code>object[property]</code>
    +         *
    +         * @returns {Object} The current value of <code>object[property]</code>
    +         */
    +        getValue: function() {
    +          return this.object[this.property];
    +        },
    +
    +        /**
    +         * Refreshes the visual display of a Controller in order to keep sync
    +         * with the object's current value.
    +         * @returns {dat.controllers.Controller} this
    +         */
    +        updateDisplay: function() {
    +          return this;
    +        },
    +
    +        /**
    +         * @returns {Boolean} true if the value has deviated from initialValue
    +         */
    +        isModified: function() {
    +          return this.initialValue !== this.getValue()
    +        }
    +
    +      }
    +
    +  );
    +
    +  return Controller;
    +
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/FunctionController.js b/src/dat/controllers/FunctionController.js
    new file mode 100644
    index 0000000..22cdaf6
    --- /dev/null
    +++ b/src/dat/controllers/FunctionController.js
    @@ -0,0 +1,72 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +    'dat/controllers/Controller',
    +    'dat/dom/dom',
    +    'dat/utils/common'
    +], function(Controller, dom, common) {
    +
    +  /**
    +   * @class Provides a GUI interface to fire a specified method, a property of an object.
    +   *
    +   * @extends dat.controllers.Controller
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   *
    +   * @member dat.controllers
    +   */
    +  var FunctionController = function(object, property, text) {
    +
    +    FunctionController.superclass.call(this, object, property);
    +
    +    var _this = this;
    +
    +    this.__button = document.createElement('div');
    +    this.__button.innerHTML = text === undefined ? 'Fire' : text;
    +    dom.bind(this.__button, 'click', function() {
    +      _this.fire();
    +    });
    +
    +    dom.addClass(this.__button, 'button');
    +
    +    this.domElement.appendChild(this.__button);
    +
    +
    +  };
    +
    +  FunctionController.superclass = Controller;
    +
    +  common.extend(
    +
    +      FunctionController.prototype,
    +      Controller.prototype,
    +      {
    +        
    +        fire: function() {
    +          if (this.__onChange) {
    +            this.__onChange.call(this);
    +          }
    +          if (this.__onFinishChange) {
    +            this.__onFinishChange.call(this, this.getValue());
    +          }
    +          this.getValue().call(this.object);
    +        }
    +      }
    +
    +  );
    +
    +  return FunctionController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/NumberController.js b/src/dat/controllers/NumberController.js
    new file mode 100644
    index 0000000..a589bf4
    --- /dev/null
    +++ b/src/dat/controllers/NumberController.js
    @@ -0,0 +1,143 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +    'dat/controllers/Controller',
    +    'dat/utils/common'
    +], function(Controller, common) {
    +
    +  /**
    +   * @class Represents a given property of an object that is a number.
    +   *
    +   * @extends dat.controllers.Controller
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   * @param {Object} [params] Optional parameters
    +   * @param {Number} [params.min] Minimum allowed value
    +   * @param {Number} [params.max] Maximum allowed value
    +   * @param {Number} [params.step] Increment by which to change value
    +   *
    +   * @member dat.controllers
    +   */
    +  var NumberController = function(object, property, params) {
    +
    +    NumberController.superclass.call(this, object, property);
    +
    +    params = params || {};
    +
    +    this.__min = params.min;
    +    this.__max = params.max;
    +    this.__step = params.step;
    +
    +    if (common.isUndefined(this.__step)) {
    +
    +      if (this.initialValue == 0) {
    +        this.__impliedStep = 1; // What are we, psychics?
    +      } else {
    +        // Hey Doug, check this out.
    +        this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10;
    +      }
    +
    +    } else {
    +
    +    	this.__impliedStep = this.__step;
    +
    +    }
    +
    +    this.__precision = numDecimals(this.__impliedStep);
    +
    +
    +  };
    +
    +  NumberController.superclass = Controller;
    +
    +  common.extend(
    +
    +      NumberController.prototype,
    +      Controller.prototype,
    +
    +      /** @lends dat.controllers.NumberController.prototype */
    +      {
    +
    +        setValue: function(v) {
    +
    +          if (this.__min !== undefined && v < this.__min) {
    +            v = this.__min;
    +          } else if (this.__max !== undefined && v > this.__max) {
    +            v = this.__max;
    +          }
    +
    +          if (this.__step !== undefined && v % this.__step != 0) {
    +            v = Math.round(v / this.__step) * this.__step;
    +          }
    +
    +          return NumberController.superclass.prototype.setValue.call(this, v);
    +
    +        },
    +
    +        /**
    +         * Specify a minimum value for <code>object[property]</code>.
    +         *
    +         * @param {Number} minValue The minimum value for
    +         * <code>object[property]</code>
    +         * @returns {dat.controllers.NumberController} this
    +         */
    +        min: function(v) {
    +          this.__min = v;
    +          return this;
    +        },
    +
    +        /**
    +         * Specify a maximum value for <code>object[property]</code>.
    +         *
    +         * @param {Number} maxValue The maximum value for
    +         * <code>object[property]</code>
    +         * @returns {dat.controllers.NumberController} this
    +         */
    +        max: function(v) {
    +          this.__max = v;
    +          return this;
    +        },
    +
    +        /**
    +         * Specify a step value that dat.controllers.NumberController
    +         * increments by.
    +         *
    +         * @param {Number} stepValue The step value for
    +         * dat.controllers.NumberController
    +         * @default if minimum and maximum specified increment is 1% of the
    +         * difference otherwise stepValue is 1
    +         * @returns {dat.controllers.NumberController} this
    +         */
    +        step: function(v) {
    +          this.__step = v;
    +          return this;
    +        }
    +
    +      }
    +
    +  );
    +
    +  function numDecimals(x) {
    +    x = x.toString();
    +    if (x.indexOf('.') > -1) {
    +      return x.length - x.indexOf('.') - 1;
    +    } else {
    +      return 0;
    +    }
    +  }
    +
    +  return NumberController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/NumberControllerBox.js b/src/dat/controllers/NumberControllerBox.js
    new file mode 100644
    index 0000000..6ae574d
    --- /dev/null
    +++ b/src/dat/controllers/NumberControllerBox.js
    @@ -0,0 +1,134 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/controllers/NumberController',
    +  'dat/dom/dom',
    +  'dat/utils/common'
    +], function(NumberController, dom, common) {
    +
    +  /**
    +   * @class Represents a given property of an object that is a number and
    +   * provides an input element with which to manipulate it.
    +   *
    +   * @extends dat.controllers.Controller
    +   * @extends dat.controllers.NumberController
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   * @param {Object} [params] Optional parameters
    +   * @param {Number} [params.min] Minimum allowed value
    +   * @param {Number} [params.max] Maximum allowed value
    +   * @param {Number} [params.step] Increment by which to change value
    +   *
    +   * @member dat.controllers
    +   */
    +  var NumberControllerBox = function(object, property, params) {
    +
    +    this.__truncationSuspended = false;
    +
    +    NumberControllerBox.superclass.call(this, object, property, params);
    +
    +    var _this = this;
    +
    +    /**
    +     * {Number} Previous mouse y position
    +     * @ignore
    +     */
    +    var prev_y;
    +
    +    this.__input = document.createElement('input');
    +    this.__input.setAttribute('type', 'text');
    +
    +    // Makes it so manually specified values are not truncated.
    +
    +    dom.bind(this.__input, 'change', onChange);
    +    dom.bind(this.__input, 'blur', onBlur);
    +    dom.bind(this.__input, 'mousedown', onMouseDown);
    +    dom.bind(this.__input, 'keydown', function(e) {
    +
    +      // When pressing entire, you can be as precise as you want.
    +      if (e.keyCode === 13) {
    +        _this.__truncationSuspended = true;
    +        this.blur();
    +        _this.__truncationSuspended = false;
    +      }
    +
    +    });
    +
    +    function onChange() {
    +      var attempted = parseFloat(_this.__input.value);
    +      if (!common.isNaN(attempted)) _this.setValue(attempted);
    +    }
    +
    +    function onBlur() {
    +      onChange();
    +      if (_this.__onFinishChange) {
    +        _this.__onFinishChange.call(_this, _this.getValue());
    +      }
    +    }
    +
    +    function onMouseDown(e) {
    +      dom.bind(window, 'mousemove', onMouseDrag);
    +      dom.bind(window, 'mouseup', onMouseUp);
    +      prev_y = e.clientY;
    +    }
    +
    +    function onMouseDrag(e) {
    +
    +      var diff = prev_y - e.clientY;
    +      _this.setValue(_this.getValue() + diff * _this.__impliedStep);
    +
    +      prev_y = e.clientY;
    +
    +    }
    +
    +    function onMouseUp() {
    +      dom.unbind(window, 'mousemove', onMouseDrag);
    +      dom.unbind(window, 'mouseup', onMouseUp);
    +    }
    +
    +    this.updateDisplay();
    +
    +    this.domElement.appendChild(this.__input);
    +
    +  };
    +
    +  NumberControllerBox.superclass = NumberController;
    +
    +  common.extend(
    +
    +      NumberControllerBox.prototype,
    +      NumberController.prototype,
    +
    +      {
    +
    +        updateDisplay: function() {
    +
    +          this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
    +          return NumberControllerBox.superclass.prototype.updateDisplay.call(this);
    +        }
    +
    +      }
    +
    +  );
    +
    +  function roundToDecimal(value, decimals) {
    +    var tenTo = Math.pow(10, decimals);
    +    return Math.round(value * tenTo) / tenTo;
    +  }
    +
    +  return NumberControllerBox;
    +
    +});
    +
    diff --git a/src/dat/controllers/NumberControllerSlider.css b/src/dat/controllers/NumberControllerSlider.css
    new file mode 100644
    index 0000000..c52186c
    --- /dev/null
    +++ b/src/dat/controllers/NumberControllerSlider.css
    @@ -0,0 +1,43 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +.slider {
    +  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    +  height: 1em;
    +  border-radius: 1em;
    +  background-color: #eee;
    +  padding: 0 0.5em;
    +  overflow: hidden;
    +}
    +
    +.slider-fg {
    +  padding: 1px 0 2px 0;
    +  background-color: #aaa;
    +  height: 1em;
    +  margin-left: -0.5em;
    +  padding-right: 0.5em;
    +  border-radius: 1em 0 0 1em;
    +}
    +
    +.slider-fg:after {
    +  display: inline-block;
    +  border-radius: 1em;
    +  background-color: #fff;
    +  border:  1px solid #aaa;
    +  content: '';
    +  float: right;
    +  margin-right: -1em;
    +  margin-top: -1px;
    +  height: 0.9em;
    +  width: 0.9em;
    +}
    \ No newline at end of file
    diff --git a/src/dat/controllers/NumberControllerSlider.js b/src/dat/controllers/NumberControllerSlider.js
    new file mode 100644
    index 0000000..6794008
    --- /dev/null
    +++ b/src/dat/controllers/NumberControllerSlider.js
    @@ -0,0 +1,129 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +    'dat/controllers/NumberController',
    +    'dat/dom/dom',
    +    'dat/utils/css',
    +    'dat/utils/common',
    +    'text!dat/controllers/NumberControllerSlider.css'
    +], 
    +function(NumberController, dom, css, common, styleSheet) {
    +
    +  /**
    +   * @class Represents a given property of an object that is a number, contains
    +   * a minimum and maximum, and provides a slider element with which to
    +   * manipulate it. It should be noted that the slider element is made up of
    +   * <code>&lt;div&gt;</code> tags, <strong>not</strong> the html5
    +   * <code>&lt;slider&gt;</code> element.
    +   *
    +   * @extends dat.controllers.Controller
    +   * @extends dat.controllers.NumberController
    +   * 
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   * @param {Number} minValue Minimum allowed value
    +   * @param {Number} maxValue Maximum allowed value
    +   * @param {Number} stepValue Increment by which to change value
    +   *
    +   * @member dat.controllers
    +   */
    +  var NumberControllerSlider = function(object, property, min, max, step) {
    +
    +    NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step });
    +
    +    var _this = this;
    +
    +    this.__background = document.createElement('div');
    +    this.__foreground = document.createElement('div');
    +    
    +
    +
    +    dom.bind(this.__background, 'mousedown', onMouseDown);
    +    
    +    dom.addClass(this.__background, 'slider');
    +    dom.addClass(this.__foreground, 'slider-fg');
    +
    +    function onMouseDown(e) {
    +
    +      dom.bind(window, 'mousemove', onMouseDrag);
    +      dom.bind(window, 'mouseup', onMouseUp);
    +
    +      onMouseDrag(e);
    +    }
    +
    +    function onMouseDrag(e) {
    +
    +      e.preventDefault();
    +
    +      var offset = dom.getOffset(_this.__background);
    +      var width = dom.getWidth(_this.__background);
    +      
    +      _this.setValue(
    +      	map(e.clientX, offset.left, offset.left + width, _this.__min, _this.__max)
    +      );
    +
    +      return false;
    +
    +    }
    +
    +    function onMouseUp() {
    +      dom.unbind(window, 'mousemove', onMouseDrag);
    +      dom.unbind(window, 'mouseup', onMouseUp);
    +      if (_this.__onFinishChange) {
    +        _this.__onFinishChange.call(_this, _this.getValue());
    +      }
    +    }
    +
    +    this.updateDisplay();
    +
    +    this.__background.appendChild(this.__foreground);
    +    this.domElement.appendChild(this.__background);
    +
    +  };
    +
    +  NumberControllerSlider.superclass = NumberController;
    +
    +  /**
    +   * Injects default stylesheet for slider elements.
    +   */
    +  NumberControllerSlider.useDefaultStyles = function() {
    +    css.inject(styleSheet);
    +  };
    +
    +  common.extend(
    +
    +      NumberControllerSlider.prototype,
    +      NumberController.prototype,
    +
    +      {
    +
    +        updateDisplay: function() {
    +          var pct = (this.getValue() - this.__min)/(this.__max - this.__min);
    +          this.__foreground.style.width = pct*100+'%';
    +          return NumberControllerSlider.superclass.prototype.updateDisplay.call(this);
    +        }
    +
    +      }
    +
    +
    +
    +  );
    +
    +	function map(v, i1, i2, o1, o2) {
    +		return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));
    +	}
    +
    +  return NumberControllerSlider;
    +  
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/OptionController.js b/src/dat/controllers/OptionController.js
    new file mode 100644
    index 0000000..1e9c53e
    --- /dev/null
    +++ b/src/dat/controllers/OptionController.js
    @@ -0,0 +1,103 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +    'dat/controllers/Controller',
    +    'dat/dom/dom',
    +    'dat/utils/common'
    +],
    +function(Controller, dom, common) {
    +
    +  /**
    +   * @class Provides a select input to alter the property of an object, using a
    +   * list of accepted values.
    +   *
    +   * @extends dat.controllers.Controller
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   * @param {Object|string[]} options A map of labels to acceptable values, or
    +   * a list of acceptable string values.
    +   *
    +   * @member dat.controllers
    +   */
    +  var OptionController = function(object, property, options) {
    +
    +    OptionController.superclass.call(this, object, property);
    +
    +    var _this = this;
    +
    +    /**
    +     * The drop down menu
    +     * @ignore
    +     */
    +    this.__select = document.createElement('select');
    +
    +    if (common.isArray(options)) {
    +      var map = {};
    +      common.each(options, function(element) {
    +        map[element] = element;
    +      });
    +      options = map;
    +    }
    +
    +    common.each(options, function(value, key) {
    +
    +      var opt = document.createElement('option');
    +      opt.innerHTML = key;
    +      opt.setAttribute('value', value);
    +      _this.__select.appendChild(opt);
    +
    +    });
    +
    +    // Acknowledge original value
    +    this.updateDisplay();
    +
    +    dom.bind(this.__select, 'change', function() {
    +      var desiredValue = this.options[this.selectedIndex].value;
    +      _this.setValue(desiredValue);
    +    });
    +
    +    this.domElement.appendChild(this.__select);
    +
    +  };
    +
    +  OptionController.superclass = Controller;
    +
    +  common.extend(
    +
    +      OptionController.prototype,
    +      Controller.prototype,
    +
    +      {
    +
    +        setValue: function(v) {
    +          var toReturn = OptionController.superclass.prototype.setValue.call(this, v);
    +          if (this.__onFinishChange) {
    +            this.__onFinishChange.call(this, this.getValue());
    +          }
    +          return toReturn;
    +        },
    +
    +        updateDisplay: function() {
    +          this.__select.value = this.getValue();
    +          return OptionController.superclass.prototype.updateDisplay.call(this);
    +        }
    +
    +      }
    +
    +  );
    +
    +  return OptionController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/StringController.js b/src/dat/controllers/StringController.js
    new file mode 100644
    index 0000000..75a5fd2
    --- /dev/null
    +++ b/src/dat/controllers/StringController.js
    @@ -0,0 +1,89 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +    'dat/controllers/Controller',
    +    'dat/dom/dom',
    +    'dat/utils/common'
    +], function(Controller, dom, common) {
    +
    +  /**
    +   * @class Provides a text input to alter the string property of an object.
    +   *
    +   * @extends dat.controllers.Controller
    +   *
    +   * @param {Object} object The object to be manipulated
    +   * @param {string} property The name of the property to be manipulated
    +   *
    +   * @member dat.controllers
    +   */
    +  var StringController = function(object, property) {
    +
    +    StringController.superclass.call(this, object, property);
    +
    +    var _this = this;
    +
    +    this.__input = document.createElement('input');
    +    this.__input.setAttribute('type', 'text');
    +
    +    dom.bind(this.__input, 'keyup', onChange);
    +    dom.bind(this.__input, 'change', onChange);
    +    dom.bind(this.__input, 'blur', onBlur);
    +    dom.bind(this.__input, 'keydown', function(e) {
    +      if (e.keyCode === 13) {
    +        this.blur();
    +      }
    +    });
    +    
    +
    +    function onChange() {
    +      _this.setValue(_this.__input.value);
    +    }
    +
    +    function onBlur() {
    +      if (_this.__onFinishChange) {
    +        _this.__onFinishChange.call(_this, _this.getValue());
    +      }
    +    }
    +
    +    this.updateDisplay();
    +
    +    this.domElement.appendChild(this.__input);
    +
    +  };
    +
    +  StringController.superclass = Controller;
    +
    +  common.extend(
    +
    +      StringController.prototype,
    +      Controller.prototype,
    +
    +      {
    +
    +        updateDisplay: function() {
    +          // Stops the caret from moving on account of:
    +          // keyup -> setValue -> updateDisplay
    +          if (!dom.isActive(this.__input)) {
    +            this.__input.value = this.getValue();
    +          }
    +          return StringController.superclass.prototype.updateDisplay.call(this);
    +        }
    +
    +      }
    +
    +  );
    +
    +  return StringController;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/controllers/factory.js b/src/dat/controllers/factory.js
    new file mode 100644
    index 0000000..897b267
    --- /dev/null
    +++ b/src/dat/controllers/factory.js
    @@ -0,0 +1,65 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/controllers/OptionController',
    +  'dat/controllers/NumberControllerBox',
    +  'dat/controllers/NumberControllerSlider',
    +  'dat/controllers/StringController',
    +  'dat/controllers/FunctionController',
    +  'dat/controllers/BooleanController',
    +  'dat/utils/common'
    +],
    +    function(OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) {
    +
    +      return function(object, property) {
    +
    +        var initialValue = object[property];
    +
    +        // Providing options?
    +        if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {
    +          return new OptionController(object, property, arguments[2]);
    +        }
    +
    +        // Providing a map?
    +
    +        if (common.isNumber(initialValue)) {
    +
    +          if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {
    +
    +            // Has min and max.
    +            return new NumberControllerSlider(object, property, arguments[2], arguments[3]);
    +
    +          } else {
    +
    +            return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });
    +
    +          }
    +
    +        }
    +
    +        if (common.isString(initialValue)) {
    +          return new StringController(object, property);
    +        }
    +
    +        if (common.isFunction(initialValue)) {
    +          return new FunctionController(object, property, '');
    +        }
    +
    +        if (common.isBoolean(initialValue)) {
    +          return new BooleanController(object, property);
    +        }
    +
    +      }
    +
    +    });
    \ No newline at end of file
    diff --git a/src/dat/dom/CenteredDiv.js b/src/dat/dom/CenteredDiv.js
    new file mode 100644
    index 0000000..174fda0
    --- /dev/null
    +++ b/src/dat/dom/CenteredDiv.js
    @@ -0,0 +1,109 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/dom/dom',
    +  'dat/utils/common'
    +], function(dom, common) {
    +
    +  var CenteredDiv = function() {
    +
    +    this.backgroundElement = document.createElement('div');
    +    common.extend(this.backgroundElement.style, {
    +      backgroundColor: 'rgba(0,0,0,0.5)',
    +      display: 'none',
    +      zIndex: '1000',
    +      opacity: 0,
    +      WebkitTransition: 'opacity 0.2s linear'
    +    });
    +
    +    dom.makeFullscreen(this.backgroundElement);
    +
    +    this.domElement = document.createElement('div');
    +    common.extend(this.domElement.style, {
    +      position: 'fixed',
    +      display: 'none',
    +      left: '50%',
    +      top: '50%',
    +      zIndex: '1001',
    +      opacity: 0,
    +      WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
    +    });
    +
    +
    +    document.body.appendChild(this.backgroundElement);
    +    document.body.appendChild(this.domElement);
    +
    +    var _this = this;
    +    dom.bind(this.backgroundElement, 'click', function() {
    +      _this.hide();
    +    });
    +
    +
    +  };
    +
    +  CenteredDiv.prototype.show = function() {
    +
    +    var _this = this;
    +
    +    this.backgroundElement.style.display = 'block';
    +
    +    this.domElement.style.display = 'block';
    +    this.domElement.style.opacity = 0;
    +//    this.domElement.style.top = '52%';
    +    this.domElement.style.webkitTransform = 'scale(1.1)';
    +
    +    this.layout();
    +
    +    common.defer(function() {
    +      _this.backgroundElement.style.opacity = 1;
    +      _this.domElement.style.opacity = 1;
    +      _this.domElement.style.webkitTransform = 'scale(1)';
    +    });
    +
    +  };
    +
    +  CenteredDiv.prototype.hide = function() {
    +
    +    var _this = this;
    +
    +    var hide = function() {
    +
    +      _this.domElement.style.display = 'none';
    +      _this.backgroundElement.style.display = 'none';
    +
    +      dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);
    +      dom.unbind(_this.domElement, 'transitionend', hide);
    +      dom.unbind(_this.domElement, 'oTransitionEnd', hide);
    +
    +    };
    +
    +    dom.bind(this.domElement, 'webkitTransitionEnd', hide);
    +    dom.bind(this.domElement, 'transitionend', hide);
    +    dom.bind(this.domElement, 'oTransitionEnd', hide);
    +
    +    this.backgroundElement.style.opacity = 0;
    +//    this.domElement.style.top = '48%';
    +    this.domElement.style.opacity = 0;
    +    this.domElement.style.webkitTransform = 'scale(1.1)';
    +
    +  };
    +
    +  CenteredDiv.prototype.layout = function() {
    +    this.domElement.style.marginLeft = -dom.getWidth(this.domElement) / 2 + 'px';
    +    this.domElement.style.marginTop = -dom.getHeight(this.domElement) / 2 + 'px';
    +  };
    +
    +  return CenteredDiv;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/dom/dom.js b/src/dat/dom/dom.js
    new file mode 100644
    index 0000000..734bc3e
    --- /dev/null
    +++ b/src/dat/dom/dom.js
    @@ -0,0 +1,287 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +  'dat/utils/common'
    +], function(common) {
    +
    +  var EVENT_MAP = {
    +    'HTMLEvents': ['change'],
    +    'MouseEvents': ['click','mousemove','mousedown','mouseup', 'mouseover'],
    +    'KeyboardEvents': ['keydown']
    +  };
    +
    +  var EVENT_MAP_INV = {};
    +  common.each(EVENT_MAP, function(v, k) {
    +    common.each(v, function(e) {
    +      EVENT_MAP_INV[e] = k;
    +    });
    +  });
    +
    +  var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/;
    +
    +  function cssValueToPixels(val) {
    +
    +    if (val === '0' || common.isUndefined(val)) return 0;
    +
    +    var match = val.match(CSS_VALUE_PIXELS);
    +
    +    if (!common.isNull(match)) {
    +      return parseFloat(match[1]);
    +    }
    +
    +    // TODO ...ems? %?
    +
    +    return 0;
    +
    +  }
    +
    +  /**
    +   * @namespace
    +   * @member dat.dom
    +   */
    +  var dom = {
    +
    +    /**
    +     * 
    +     * @param elem
    +     * @param selectable
    +     */
    +    makeSelectable: function(elem, selectable) {
    +
    +      if (elem === undefined || elem.style === undefined) return;
    +
    +      elem.onselectstart = selectable ? function() {
    +        return false;
    +      } : function() {
    +      };
    +
    +      elem.style.MozUserSelect = selectable ? 'auto' : 'none';
    +      elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';
    +      elem.unselectable = selectable ? 'on' : 'off';
    +
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param horizontal
    +     * @param vertical
    +     */
    +    makeFullscreen: function(elem, horizontal, vertical) {
    +
    +      if (common.isUndefined(horizontal)) horizontal = true;
    +      if (common.isUndefined(vertical)) vertical = true;
    +
    +      elem.style.position = 'absolute';
    +
    +      if (horizontal) {
    +        elem.style.left = 0;
    +        elem.style.right = 0;
    +      }
    +      if (vertical) {
    +        elem.style.top = 0;
    +        elem.style.bottom = 0;
    +      }
    +
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param eventType
    +     * @param params
    +     */
    +    fakeEvent: function(elem, eventType, params, aux) {
    +      params = params || {};
    +      var className = EVENT_MAP_INV[eventType];
    +      if (!className) {
    +        throw new Error('Event type ' + eventType + ' not supported.');
    +      }
    +      var evt = document.createEvent(className);
    +      switch (className) {
    +        case 'MouseEvents':
    +          var clientX = params.x || params.clientX || 0;
    +          var clientY = params.y || params.clientY || 0;
    +          evt.initMouseEvent(eventType, params.bubbles || false,
    +              params.cancelable || true, window, params.clickCount || 1,
    +              0, //screen X
    +              0, //screen Y
    +              clientX, //client X
    +              clientY, //client Y
    +              false, false, false, false, 0, null);
    +          break;
    +        case 'KeyboardEvents':
    +          var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz
    +          common.defaults(params, {
    +            cancelable: true,
    +            ctrlKey: false,
    +            altKey: false,
    +            shiftKey: false,
    +            metaKey: false,
    +            keyCode: undefined,
    +            charCode: undefined
    +          });
    +          init(eventType, params.bubbles || false,
    +              params.cancelable, window,
    +              params.ctrlKey, params.altKey,
    +              params.shiftKey, params.metaKey,
    +              params.keyCode, params.charCode);
    +          break;
    +        default:
    +          evt.initEvent(eventType, params.bubbles || false,
    +              params.cancelable || true);
    +          break;
    +      }
    +      common.defaults(evt, aux);
    +      elem.dispatchEvent(evt);
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param event
    +     * @param func
    +     * @param bool
    +     */
    +    bind: function(elem, event, func, bool) {
    +      bool = bool || false;
    +      if (elem.addEventListener)
    +        elem.addEventListener(event, func, bool);
    +      else if (elem.attachEvent)
    +        elem.attachEvent('on' + event, func);
    +      return dom;
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param event
    +     * @param func
    +     * @param bool
    +     */
    +    unbind: function(elem, event, func, bool) {
    +      bool = bool || false;
    +      if (elem.removeEventListener)
    +        elem.removeEventListener(event, func, bool);
    +      else if (elem.detachEvent)
    +        elem.detachEvent('on' + event, func);
    +      return dom;
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param className
    +     */
    +    addClass: function(elem, className) {
    +      if (elem.className === undefined) {
    +        elem.className = className;
    +      } else if (elem.className !== className) {
    +        var classes = elem.className.split(/ +/);
    +        if (classes.indexOf(className) == -1) {
    +          classes.push(className);
    +          elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, '');
    +        }
    +      }
    +      return dom;
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     * @param className
    +     */
    +    removeClass: function(elem, className) {
    +      if (className) {
    +        if (elem.className === undefined) {
    +          // elem.className = className;
    +        } else if (elem.className === className) {
    +          elem.removeAttribute('class');
    +        } else {
    +          var classes = elem.className.split(/ +/);
    +          var index = classes.indexOf(className);
    +          if (index != -1) {
    +            classes.splice(index, 1);
    +            elem.className = classes.join(' ');
    +          }
    +        }
    +      } else {
    +        elem.className = undefined;
    +      }
    +      return dom;
    +    },
    +
    +    hasClass: function(elem, className) {
    +      return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false;
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     */
    +    getWidth: function(elem) {
    +
    +      var style = getComputedStyle(elem);
    +
    +      return cssValueToPixels(style['border-left-width']) +
    +          cssValueToPixels(style['border-right-width']) +
    +          cssValueToPixels(style['padding-left']) +
    +          cssValueToPixels(style['padding-right']) +
    +          cssValueToPixels(style['width']);
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     */
    +    getHeight: function(elem) {
    +
    +      var style = getComputedStyle(elem);
    +
    +      return cssValueToPixels(style['border-top-width']) +
    +          cssValueToPixels(style['border-bottom-width']) +
    +          cssValueToPixels(style['padding-top']) +
    +          cssValueToPixels(style['padding-bottom']) +
    +          cssValueToPixels(style['height']);
    +    },
    +
    +    /**
    +     *
    +     * @param elem
    +     */
    +    getOffset: function(elem) {
    +      var offset = {left: 0, top:0};
    +      if (elem.offsetParent) {
    +        do {
    +          offset.left += elem.offsetLeft;
    +          offset.top += elem.offsetTop;
    +        } while (elem = elem.offsetParent);
    +      }
    +      return offset;
    +    },
    +
    +    // http://stackoverflow.com/posts/2684561/revisions
    +    /**
    +     * 
    +     * @param elem
    +     */
    +    isActive: function(elem) {
    +      return elem === document.activeElement && ( elem.type || elem.href );
    +    }
    +
    +  };
    +
    +  return dom;
    +
    +});
    \ No newline at end of file
    diff --git a/src/dat/gui/_structure.scss b/src/dat/gui/_structure.scss
    new file mode 100644
    index 0000000..dea86c0
    --- /dev/null
    +++ b/src/dat/gui/_structure.scss
    @@ -0,0 +1,221 @@
    +$nest-margin: 4px;
    +$row-height: 27px;
    +
    +.dg {
    +
    +  /** Clear list styles */
    +  ul {
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    width: 100%;
    +    clear: both;
    +  }
    +
    +  /* Auto-place container */
    +  &.ac {
    +   position: fixed;
    +   top: 0;
    +   left: 0;
    +   right: 0;
    +   height: 0;
    +   z-index: 0;
    +  }
    +
    +  &.main {
    +    @include transition(opacity, 0.1s, linear);
    +    /*overflow-y: hidden;*/
    +    &.taller-than-window {
    +      overflow-y: auto;
    +    }
    +  }
    +
    +  /* Auto-placed GUI's */
    +  &.a {
    +
    +    float: right;
    +    margin-right: 15px;
    +    overflow-x: hidden;
    +
    +    &.has-save {
    +      margin-top: $row-height;
    +    }
    +
    +    .save-row {
    +      position: fixed;
    +      top: 0;
    +      z-index: 1002;
    +    }
    +
    +  }
    +
    +  /* Line items that don't contain folders. */
    +  li:not(.folder) {
    +    cursor: auto;
    +    height: $row-height;
    +    line-height: $row-height;
    +    overflow: hidden;
    +    padding: 0 4px 0 5px;
    +    @include transition(height, 0.1s, ease-out);
    +  }
    +
    +  li.folder {   
    +      padding: 0;
    +      border-left: $nest-margin solid rgba(0,0,0,0);
    +      
    +  }
    +
    +  /** Folder names */
    +  li.title {
    +    cursor: pointer;
    +    margin-left: -$nest-margin;
    +  }
    +
    +  /** Hides closed items */
    +  .closed li:not(.title),
    +  .closed ul li,
    +  .closed ul li > * {
    +    height: 0;
    +    overflow: hidden;
    +    border: 0;
    +  }
    +  
    +  /** Controller row */ 
    +  .cr {
    +    clear: both;
    +    padding-left: 3px;
    +    height: $row-height;
    +  }
    +
    +  /** Name-half (left) */
    +  .property-name {
    +    cursor: default;
    +    float: left;
    +    clear: left;
    +    width: 40%;
    +    overflow: hidden;
    +    text-overflow: ellipsis;
    +  }
    +
    +  /** Controller-half (right) */
    +  .c  {
    +    float: left;
    +    width: 60%;
    +  }
    +
    +  /** Controller placement */
    +  .c input[type=text] {
    +    border: 0;
    +    margin-top: 4px;
    +    padding: 3px;
    +    width: 100%;
    +    float: right;
    +  }
    +
    +  /** Shorter number boxes when slider is present. */
    +  .has-slider input[type=text] {
    +    width: 30%;
    +    /*display: none;*/
    +    margin-left: 0;
    +  }
    +
    +  .slider {
    +    float: left;
    +    width: 66%;
    +    margin-left: -5px;
    +    margin-right: 0;
    +    height: 19px;
    +    margin-top: 4px;
    +  }
    +
    +  .slider-fg {
    +    height: 100%;
    +  }
    +
    +  .c input[type=checkbox] {
    +    margin-top: 9px;
    +  }
    +
    +  .c select {
    +    margin-top: 5px;
    +  }
    +  
    +	/** Ensure the entire boolean and function row shows a hand */
    +  .cr.function,
    +  .cr.function .property-name, /* Don't know why I need to be this explicit */
    +  .cr.function *,
    +  .cr.boolean,
    +  .cr.boolean * {
    +    cursor: pointer;
    +  }
    +
    +
    +  .selector {
    +    display: none;
    +    position: absolute;
    +    margin-left: -9px;
    +    margin-top: 23px;
    +  }
    +
    +
    +  .c:hover .selector,
    +  .selector.drag {
    +    display: block;
    +    }
    +
    +
    +  li.save-row {
    +
    +    padding: 0;
    +
    +    .button {
    +      display: inline-block;
    +      padding: 0px 6px;
    +    }
    +
    +  }
    +
    +  &.dialogue {
    +    background-color: #222;
    +    width: 460px;
    +    padding: 15px;
    +    font-size: 13px;
    +    line-height: 15px;
    +  }
    +
    +}
    +
    +/* TODO Separate style and structure */
    +#dg-new-constructor {
    +  padding: 10px;
    +  color: #222;
    +  font-family: Monaco, monospace;
    +  font-size: 10px;
    +  border: 0;
    +  resize: none;
    +  box-shadow: inset 1px 1px 1px #888;
    +  word-wrap: break-word;
    +  margin: 12px 0;
    +  display: block;
    +  width: 440px;
    +  overflow-y: scroll;
    +  height: 100px;
    +  position: relative;
    +}
    +
    +#dg-local-explain {
    +  display: none;
    +  font-size: 11px;
    +  line-height: 17px;
    +  border-radius: 3px;
    +  background-color: #333;
    +  padding: 8px;
    +  margin-top: 10px;
    +  code {
    +    font-size: 10px;
    +    }
    +}
    +
    +#dat-gui-save-locally {
    +  display: none;
    +}
    diff --git a/src/dat/gui/saveDialogue.html b/src/dat/gui/saveDialogue.html
    new file mode 100644
    index 0000000..bbb0ff7
    --- /dev/null
    +++ b/src/dat/gui/saveDialogue.html
    @@ -0,0 +1,21 @@
    +<div id="dg-save" class="dg dialogue">
    +
    +  Here's the new load parameter for your <code>GUI</code>'s constructor:
    +
    +  <textarea id="dg-new-constructor"></textarea>
    +
    +  <div id="dg-save-locally">
    +
    +    <input id="dg-local-storage" type="checkbox"/> Automatically save
    +    values to <code>localStorage</code> on exit.
    +
    +    <div id="dg-local-explain">The values saved to <code>localStorage</code> will
    +      override those passed to <code>dat.GUI</code>'s constructor. This makes it
    +      easier to work incrementally, but <code>localStorage</code> is fragile,
    +      and your friends may not see the same values you do.
    +      
    +    </div>
    +    
    +  </div>
    +
    +</div>
    \ No newline at end of file
    diff --git a/src/dat/gui/style.css b/src/dat/gui/style.css
    new file mode 100644
    index 0000000..aab2170
    --- /dev/null
    +++ b/src/dat/gui/style.css
    @@ -0,0 +1,261 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +.dg {
    +  /** Clear list styles */
    +  /* Auto-place container */
    +  /* Auto-placed GUI's */
    +  /* Line items that don't contain folders. */
    +  /** Folder names */
    +  /** Hides closed items */
    +  /** Controller row */
    +  /** Name-half (left) */
    +  /** Controller-half (right) */
    +  /** Controller placement */
    +  /** Shorter number boxes when slider is present. */
    +  /** Ensure the entire boolean and function row shows a hand */ }
    +  .dg ul {
    +    list-style: none;
    +    margin: 0;
    +    padding: 0;
    +    width: 100%;
    +    clear: both; }
    +  .dg.ac {
    +    position: fixed;
    +    top: 0;
    +    left: 0;
    +    right: 0;
    +    height: 0;
    +    z-index: 0; }
    +  .dg.main {
    +    -webkit-transition: opacity 0.1s linear;
    +    -o-transition: opacity 0.1s linear;
    +    -moz-transition: opacity 0.1s linear;
    +    transition: opacity 0.1s linear;
    +    /*overflow-y: hidden;*/ }
    +    .dg.main.taller-than-window {
    +      overflow-y: auto; }
    +  .dg.a {
    +    float: right;
    +    margin-right: 15px;
    +    overflow-x: hidden; }
    +    .dg.a.has-save {
    +      margin-top: 27px; }
    +    .dg.a .save-row {
    +      position: fixed;
    +      top: 0;
    +      z-index: 1002; }
    +  .dg li:not(.folder) {
    +    cursor: auto;
    +    height: 27px;
    +    line-height: 27px;
    +    overflow: hidden;
    +    padding: 0 4px 0 5px;
    +    -webkit-transition: height 0.1s ease-out;
    +    -o-transition: height 0.1s ease-out;
    +    -moz-transition: height 0.1s ease-out;
    +    transition: height 0.1s ease-out; }
    +  .dg li.folder {
    +    padding: 0;
    +    border-left: 4px solid rgba(0, 0, 0, 0); }
    +  .dg li.title {
    +    cursor: pointer;
    +    margin-left: -4px; }
    +  .dg .closed li:not(.title),
    +  .dg .closed ul li,
    +  .dg .closed ul li > * {
    +    height: 0;
    +    overflow: hidden;
    +    border: 0; }
    +  .dg .cr {
    +    clear: both;
    +    padding-left: 3px;
    +    height: 27px; }
    +  .dg .property-name {
    +    cursor: default;
    +    float: left;
    +    clear: left;
    +    width: 40%;
    +    overflow: hidden;
    +    text-overflow: ellipsis; }
    +  .dg .c {
    +    float: left;
    +    width: 60%; }
    +  .dg .c input[type=text] {
    +    border: 0;
    +    margin-top: 4px;
    +    padding: 3px;
    +    width: 100%;
    +    float: right; }
    +  .dg .has-slider input[type=text] {
    +    width: 30%;
    +    /*display: none;*/
    +    margin-left: 0; }
    +  .dg .slider {
    +    float: left;
    +    width: 66%;
    +    margin-left: -5px;
    +    margin-right: 0;
    +    height: 19px;
    +    margin-top: 4px; }
    +  .dg .slider-fg {
    +    height: 100%; }
    +  .dg .c input[type=checkbox] {
    +    margin-top: 9px; }
    +  .dg .c select {
    +    margin-top: 5px; }
    +  .dg .cr.function,
    +  .dg .cr.function .property-name,
    +  .dg .cr.function *,
    +  .dg .cr.boolean,
    +  .dg .cr.boolean * {
    +    cursor: pointer; }
    +  .dg .selector {
    +    display: none;
    +    position: absolute;
    +    margin-left: -9px;
    +    margin-top: 23px; }
    +  .dg .c:hover .selector,
    +  .dg .selector.drag {
    +    display: block; }
    +  .dg li.save-row {
    +    padding: 0; }
    +    .dg li.save-row .button {
    +      display: inline-block;
    +      padding: 0px 6px; }
    +  .dg.dialogue {
    +    background-color: #222;
    +    width: 460px;
    +    padding: 15px;
    +    font-size: 13px;
    +    line-height: 15px; }
    +
    +/* TODO Separate style and structure */
    +#dg-new-constructor {
    +  padding: 10px;
    +  color: #222;
    +  font-family: Monaco, monospace;
    +  font-size: 10px;
    +  border: 0;
    +  resize: none;
    +  box-shadow: inset 1px 1px 1px #888;
    +  word-wrap: break-word;
    +  margin: 12px 0;
    +  display: block;
    +  width: 440px;
    +  overflow-y: scroll;
    +  height: 100px;
    +  position: relative; }
    +
    +#dg-local-explain {
    +  display: none;
    +  font-size: 11px;
    +  line-height: 17px;
    +  border-radius: 3px;
    +  background-color: #333;
    +  padding: 8px;
    +  margin-top: 10px; }
    +  #dg-local-explain code {
    +    font-size: 10px; }
    +
    +#dat-gui-save-locally {
    +  display: none; }
    +
    +/** Main type */
    +.dg {
    +  color: #eee;
    +  font: 11px 'Lucida Grande', sans-serif;
    +  text-shadow: 0 -1px 0 #111111;
    +  /** Auto place */
    +  /* Controller row, <li> */
    +  /** Controllers */ }
    +  .dg.main {
    +    /** Scrollbar */ }
    +    .dg.main::-webkit-scrollbar {
    +      width: 5px;
    +      background: #1a1a1a; }
    +    .dg.main::-webkit-scrollbar-corner {
    +      height: 0;
    +      display: none; }
    +    .dg.main::-webkit-scrollbar-thumb {
    +      border-radius: 5px;
    +      background: #676767; }
    +  .dg li:not(.folder) {
    +    background: #1a1a1a;
    +    border-bottom: 1px solid #2c2c2c; }
    +  .dg li.save-row {
    +    line-height: 25px;
    +    background: #dad5cb;
    +    border: 0; }
    +    .dg li.save-row select {
    +      margin-left: 5px;
    +      width: 108px; }
    +    .dg li.save-row .button {
    +      margin-left: 5px;
    +      margin-top: 1px;
    +      border-radius: 2px;
    +      font-size: 9px;
    +      line-height: 7px;
    +      padding: 4px 4px 5px 4px;
    +      background: #c5bdad;
    +      color: #fff;
    +      text-shadow: 0 1px 0 #b0a58f;
    +      box-shadow: 0 -1px 0 #b0a58f;
    +      cursor: pointer; }
    +      .dg li.save-row .button.gears {
    +        background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;
    +        height: 7px;
    +        width: 8px; }
    +      .dg li.save-row .button:hover {
    +        background-color: #bab19e;
    +        box-shadow: 0 -1px 0 #b0a58f; }
    +  .dg li.folder {
    +    border-bottom: 0; }
    +  .dg li.title {
    +    padding-left: 16px;
    +    background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;
    +    cursor: pointer;
    +    border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
    +  .dg .closed li.title {
    +    background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }
    +  .dg .cr.boolean {
    +    border-left: 3px solid #806787; }
    +  .dg .cr.function {
    +    border-left: 3px solid #e61d5f; }
    +  .dg .cr.number {
    +    border-left: 3px solid #2fa1d6; }
    +    .dg .cr.number input[type=text] {
    +      color: #2fa1d6; }
    +  .dg .cr.string {
    +    border-left: 3px solid #1ed36f; }
    +    .dg .cr.string input[type=text] {
    +      color: #1ed36f; }
    +  .dg .cr.function:hover, .dg .cr.boolean:hover {
    +    background: #111; }
    +  .dg .c input[type=text] {
    +    background: #303030;
    +    outline: none; }
    +    .dg .c input[type=text]:hover {
    +      background: #3c3c3c; }
    +    .dg .c input[type=text]:focus {
    +      background: #494949;
    +      color: #fff; }
    +  .dg .c .slider {
    +    background: #303030;
    +    cursor: ew-resize; }
    +  .dg .c .slider-fg {
    +    background: #2fa1d6; }
    +  .dg .c .slider:hover {
    +    background: #3c3c3c; }
    +    .dg .c .slider:hover .slider-fg {
    +      background: #44abda; }
    diff --git a/src/dat/gui/style.scss b/src/dat/gui/style.scss
    new file mode 100644
    index 0000000..40605e2
    --- /dev/null
    +++ b/src/dat/gui/style.scss
    @@ -0,0 +1,202 @@
    +$background-color: #1a1a1a;
    +
    +$hover-lighten: 5%;
    +$border-lighten: 7%;
    +$active-lighten: 10%;
    +
    +$number-color: #2FA1D6;
    +$boolean-color: #806787;
    +$string-color: #1ed36f;
    +$function-color: #e61d5f;
    +$save-row-color: #dad5cb;
    +$button-color: darken($save-row-color, 10%);
    +
    +$input-color: lighten($background-color, 8.5%);
    +
    +@mixin transition($prop, $time, $curve) {
    +  -webkit-transition: $prop $time $curve;
    +  -o-transition: $prop $time $curve;
    +  -moz-transition: $prop $time $curve;
    +  transition: $prop $time $curve;
    +}
    +
    +@mixin gradient($a, $b) {
    +  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from($a), to($b));
    +  background: -o-gradient(linear, 0% 0%, 0% 100%, from($a), to($b));
    +  background: -moz-gradient(linear, 0% 0%, 0% 100%, from($a), to($b));
    +}
    +
    +@mixin button() {
    +  margin-left: 5px;
    +  margin-top: 1px;
    +  border-radius: 2px;
    +  font-size: 9px;
    +  line-height: 7px;
    +  padding: 4px 4px 5px 4px;
    +  background: $button-color;
    +  color: #fff;
    +  text-shadow: 0 1px 0 darken($button-color, 10%);
    +  box-shadow: 0 -1px 0 darken($button-color, 10%);
    +  cursor: pointer;
    +}
    +
    +@mixin gears() {
    +  background: $button-color url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;
    +  height: 7px;
    +  width: 8px;
    +}
    +
    +@import "structure";
    +
    +/** Main type */
    +.dg {
    +
    +
    +  color: #eee;
    +  font: 11px 'Lucida Grande', sans-serif;
    +  text-shadow: 0 -1px 0 #111;
    +
    +  /** Auto place */
    +  &.main {
    +
    +    /** Scrollbar */
    +    &::-webkit-scrollbar {
    +      width: 5px;
    +      background: $background-color;
    +    }
    +    &::-webkit-scrollbar-corner {
    +      height: 0;
    +      display: none;
    +    }
    +    &::-webkit-scrollbar-thumb {
    +      border-radius: 5px;
    +      background: lighten($background-color, 30%);
    +    }
    +
    +  }
    +
    +  li {
    +
    +    &:not(.folder) {
    +      background: $background-color;
    +      border-bottom: 1px solid lighten($background-color, $border-lighten);
    +    }
    +
    +    &.save-row {
    +
    +      line-height: 25px;
    +      background: $save-row-color;
    +      border: 0;
    +
    +      select {
    +        margin-left: 5px;
    +        width: 108px;
    +
    +      }
    +
    +      .button {
    +
    +        &.gears {
    +          @include gears;
    +        }
    +
    +        @include button;
    +
    +        &:hover {
    +          background-color: darken($button-color, 5%);
    +          box-shadow: 0 -1px 0 darken($button-color, 10%);
    +        }
    +
    +      }
    +
    +    }
    +
    +    &.folder {
    +      border-bottom: 0;
    +    }
    +
    +    &.title {
    +      padding-left: 16px;
    +      background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;
    +      cursor: pointer;
    +      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    +    }
    +
    +  }
    +
    +  .closed li.title {
    +    background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==);
    +  }
    +
    +  /* Controller row, <li> */
    +  .cr {
    +
    +    &.boolean {
    +      border-left: 3px solid $boolean-color;
    +    }
    +
    +    &.function {
    +      border-left: 3px solid $function-color;
    +    }
    +
    +    &.number {
    +      border-left: 3px solid $number-color;
    +      input[type=text] {
    +        color: $number-color;
    +      }
    +    }
    +
    +    &.string {
    +      border-left: 3px solid $string-color;
    +      input[type=text] {
    +        color: $string-color;
    +      }
    +    }
    +
    +    &.function:hover ,
    +    &.boolean:hover {
    +      background: #111;
    +    }
    +
    +  }
    +
    +
    +  /** Controllers */
    +  .c {
    +
    +
    +
    +    input[type=text] {
    +
    +      background: $input-color;
    +      outline: none;
    +      &:hover {
    +        background: lighten($input-color, $hover-lighten);
    +      }
    +      &:focus {
    +        background: lighten($input-color, $active-lighten);
    +        color: #fff;
    +      }
    +
    +    }
    +
    +
    +    .slider {
    +      background: $input-color;
    +      cursor: ew-resize;
    +    }
    +
    +    .slider-fg {
    +      background: $number-color;
    +    }
    +
    +    .slider:hover {
    +      background: lighten($input-color, $hover-lighten);
    +      .slider-fg {
    +        background: lighten($number-color, $hover-lighten);
    +      }
    +    }
    +
    +  }
    +
    +}
    diff --git a/src/dat/utils/common.js b/src/dat/utils/common.js
    new file mode 100644
    index 0000000..99c9e14
    --- /dev/null
    +++ b/src/dat/utils/common.js
    @@ -0,0 +1,139 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +], function() {
    +  
    +  var ARR_EACH = Array.prototype.forEach;
    +  var ARR_SLICE = Array.prototype.slice;
    +
    +  /**
    +   * Band-aid methods for things that should be a lot easier in JavaScript.
    +   * Implementation and structure inspired by underscore.js
    +   * http://documentcloud.github.com/underscore/
    +   */
    +
    +  return { 
    +    
    +    BREAK: {},
    +  
    +    extend: function(target) {
    +      
    +      this.each(ARR_SLICE.call(arguments, 1), function(obj) {
    +        
    +        for (var key in obj)
    +          if (!this.isUndefined(obj[key])) 
    +            target[key] = obj[key];
    +        
    +      }, this);
    +      
    +      return target;
    +      
    +    },
    +    
    +    defaults: function(target) {
    +      
    +      this.each(ARR_SLICE.call(arguments, 1), function(obj) {
    +        
    +        for (var key in obj)
    +          if (this.isUndefined(target[key])) 
    +            target[key] = obj[key];
    +        
    +      }, this);
    +      
    +      return target;
    +    
    +    },
    +    
    +    compose: function() {
    +      var toCall = ARR_SLICE.call(arguments);
    +            return function() {
    +              var args = ARR_SLICE.call(arguments);
    +              for (var i = toCall.length -1; i >= 0; i--) {
    +                args = [toCall[i].apply(this, args)];
    +              }
    +              return args[0];
    +            }
    +    },
    +    
    +    each: function(obj, itr, scope) {
    +
    +      
    +      if (ARR_EACH && obj.forEach === ARR_EACH) { 
    +        
    +        obj.forEach(itr, scope);
    +        
    +      } else if (obj.length === obj.length + 0) { // Is number but not NaN
    +        
    +        for (var key = 0, l = obj.length; key < l; key++)
    +          if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) 
    +            return;
    +            
    +      } else {
    +
    +        for (var key in obj) 
    +          if (itr.call(scope, obj[key], key) === this.BREAK)
    +            return;
    +            
    +      }
    +            
    +    },
    +    
    +    defer: function(fnc) {
    +      setTimeout(fnc, 0);
    +    },
    +    
    +    toArray: function(obj) {
    +      if (obj.toArray) return obj.toArray();
    +      return ARR_SLICE.call(obj);
    +    },
    +
    +    isUndefined: function(obj) {
    +      return obj === undefined;
    +    },
    +    
    +    isNull: function(obj) {
    +      return obj === null;
    +    },
    +    
    +    isNaN: function(obj) {
    +      return obj !== obj;
    +    },
    +    
    +    isArray: Array.isArray || function(obj) {
    +      return obj.constructor === Array;
    +    },
    +    
    +    isObject: function(obj) {
    +      return obj === Object(obj);
    +    },
    +    
    +    isNumber: function(obj) {
    +      return obj === obj+0;
    +    },
    +    
    +    isString: function(obj) {
    +      return obj === obj+'';
    +    },
    +    
    +    isBoolean: function(obj) {
    +      return obj === false || obj === true;
    +    },
    +    
    +    isFunction: function(obj) {
    +      return Object.prototype.toString.call(obj) === '[object Function]';
    +    }
    +  
    +  };
    +    
    +});
    \ No newline at end of file
    diff --git a/src/dat/utils/css.js b/src/dat/utils/css.js
    new file mode 100644
    index 0000000..4b8a926
    --- /dev/null
    +++ b/src/dat/utils/css.js
    @@ -0,0 +1,33 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([],
    +function() {
    +  return {
    +    load: function (url, doc) {
    +      doc = doc || document;
    +      var link = doc.createElement('link');
    +      link.type = 'text/css';
    +      link.rel = 'stylesheet';
    +      link.href = url;
    +      doc.getElementsByTagName('head')[0].appendChild(link);
    +    },
    +    inject: function(css, doc) {
    +      doc = doc || document;
    +      var injected = document.createElement('style');
    +      injected.type = 'text/css';
    +      injected.innerHTML = css;
    +      doc.getElementsByTagName('head')[0].appendChild(injected);
    +    }
    +  }
    +});
    diff --git a/src/dat/utils/requestAnimationFrame.js b/src/dat/utils/requestAnimationFrame.js
    new file mode 100644
    index 0000000..2954316
    --- /dev/null
    +++ b/src/dat/utils/requestAnimationFrame.js
    @@ -0,0 +1,31 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +define([
    +], function() {
    +
    +  /**
    +   * requirejs version of Paul Irish's RequestAnimationFrame
    +   * http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    +   */
    +
    +  return window.webkitRequestAnimationFrame ||
    +      window.mozRequestAnimationFrame ||
    +      window.oRequestAnimationFrame ||
    +      window.msRequestAnimationFrame ||
    +      function(callback, element) {
    +
    +        window.setTimeout(callback, 1000 / 60);
    +
    +      };
    +});
    \ No newline at end of file
    diff --git a/tests/index.html b/tests/index.html
    new file mode 100644
    index 0000000..b007817
    --- /dev/null
    +++ b/tests/index.html
    @@ -0,0 +1,1412 @@
    +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    +    "http://www.w3.org/TR/html4/loose.dtd">
    +<html>
    +<head>
    +
    +  <link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
    +  <script type="text/javascript" src="qunit.js"></script>
    +  <script type="text/javascript" src="jquery.js"></script>
    +  
    +  <script type="text/javascript" src="../build/dat.gui.min.js"></script>
    +  <script type="text/javascript">
    +
    +  $.noConflict();
    +  jQuery(document).ready(function($) {
    +
    +    var math = dat.color.math;
    +    var interpret = dat.color.interpret;
    +    var Color = dat.color.Color;
    +    var dom = dat.dom.dom;
    +    var Controller = dat.controllers.Controller;
    +    var BooleanController = dat.controllers.BooleanController;
    +    var OptionController = dat.controllers.OptionController;
    +    var StringController = dat.controllers.StringController;
    +    var NumberController = dat.controllers.NumberController;
    +    var NumberControllerBox = dat.controllers.NumberControllerBox;
    +    var NumberControllerSlider = dat.controllers.NumberControllerSlider;
    +    var FunctionController = dat.controllers.FunctionController;
    +    var ColorController = dat.controllers.ColorController;
    +    var GUI = dat.gui.GUI;
    +
    +
    +    module("Color Math");
    +
    +    test("rgb_to_hex", function() {
    +
    +      equal(
    +          math.rgb_to_hex(100, 255, 20),
    +          0x64ff14
    +      );
    +
    +    });
    +
    +    test("component_from_hex", function() {
    +
    +      equal(
    +          math.component_from_hex(0xff3366, 0),
    +          0x66,
    +          'get blue'
    +      );
    +
    +      equal(
    +          math.component_from_hex(0xff3366, 1),
    +          0x33,
    +          'get green'
    +      );
    +
    +      equal(
    +          math.component_from_hex(0xff3366, 2),
    +          0xff,
    +          'get red'
    +      );
    +
    +    });
    +
    +    test("hex_with_component", function() {
    +
    +      equal(
    +          math.hex_with_component(0x002203, 0, 0x32),
    +          0x002232,
    +          'replace blue'
    +      );
    +
    +      equal(
    +          math.hex_with_component(0x002203, 1, 0x32),
    +          0x003203,
    +          'replace green'
    +      );
    +
    +      equal(
    +          math.hex_with_component(0x002203, 2, 0x32),
    +          0x322203,
    +          'replace red'
    +      );
    +
    +    });
    +
    +    test("rgb_to_hsv", function() {
    +
    +      match(
    +          math.rgb_to_hsv(173, 52, 141),
    +          {
    +            h: 315.86776859504135,
    +            s: 0.6994219653179191,
    +            v: 0.6784313725490196
    +          });
    +
    +      match(
    +          math.rgb_to_hsv(10, 10, 10),
    +          {
    +            h: NaN,
    +            s: 0,
    +            v: 0.0392156862745098
    +          }, 'grayscale');
    +
    +      match(
    +          math.rgb_to_hsv(0, 0, 0),
    +          {
    +            h: NaN,
    +            s: 0,
    +            v: 0
    +          }, 'black');
    +
    +    });
    +
    +    test("hsv_to_rgb", function() {
    +
    +      match(
    +          math.hsv_to_rgb(255, 0.85, 0.46),
    +          {
    +            r: 42.52125000000001,
    +            g: 17.595000000000006,
    +            b: 117.30000000000001
    +          });
    +
    +      match(
    +          math.hsv_to_rgb(0, 0, 0.46),
    +          {
    +            r: 117.30000000000001,
    +            g: 117.30000000000001,
    +            b: 117.30000000000001
    +          }, 'grayscale');
    +
    +    });
    +
    +    module("Color Interpretations");
    +
    +    test("CSS Strings", function() {
    +
    +      match(
    +          interpret('#ccc'),
    +          {
    +            hex: 0xcccccc,
    +            space: 'HEX',
    +            conversionName: 'THREE_CHAR_HEX'
    +          },
    +          'THREE_CHAR_HEX'
    +      );
    +
    +      match(
    +          interpret('#f09'),
    +          {
    +            hex: 0xff0099,
    +            space: 'HEX',
    +            conversionName: 'THREE_CHAR_HEX'
    +          },
    +          'THREE_CHAR_HEX'
    +      );
    +
    +      match(
    +          interpret('#0f93cd'),
    +          {
    +            hex: 0x0f93cd,
    +            space: 'HEX',
    +            conversionName: 'SIX_CHAR_HEX'
    +          },
    +          'SIX_CHAR_HEX'
    +      );
    +
    +      match(
    +          interpret('rgba(255,10,200,0.3)'),
    +          {
    +            r: 255,
    +            g: 10,
    +            b: 200,
    +            a: 0.3,
    +            space: 'RGB',
    +            conversionName: 'CSS_RGBA'
    +          },
    +          'CSS_RGBA'
    +      );
    +
    +      match(
    +          interpret('rgb(255,10,200)'),
    +          {
    +            r: 255,
    +            g: 10,
    +            b: 200,
    +            space: 'RGB',
    +            conversionName: 'CSS_RGB'
    +          },
    +          'CSS_RGB'
    +      );
    +
    +    });
    +
    +    test("Other", function() {
    +
    +      match(
    +          interpret(0xff3322),
    +          {
    +            hex: 0xff3322,
    +            space: 'HEX',
    +            conversionName: 'HEX'
    +          },
    +          'HEX'
    +      );
    +
    +      match(
    +          interpret([255, 255, 0]),
    +          {
    +            r: 255,
    +            g: 255,
    +            b: 0,
    +            space: 'RGB',
    +            conversionName: 'RGB_ARRAY'
    +          },
    +          'RGB_ARRAY'
    +      );
    +
    +
    +      match(
    +          interpret([0, 110, 255, 0.3]),
    +          {
    +            r: 0,
    +            g: 110,
    +            b: 255,
    +            a: 0.3,
    +            space: 'RGB',
    +            conversionName: 'RGBA_ARRAY'
    +          },
    +          'RGBA_ARRAY'
    +      );
    +
    +      match(
    +          interpret({
    +                r: 255,
    +                g: 255,
    +                b: 200
    +              }),
    +          {
    +            r: 255,
    +            g: 255,
    +            b: 200,
    +            space: 'RGB',
    +            conversionName: 'RGB_OBJ'
    +          },
    +          'RGB_OBJ'
    +      );
    +
    +      match(
    +          interpret({
    +                r: 255,
    +                g: 255,
    +                b: 200,
    +                a: 0.2
    +              }),
    +          {
    +            r: 255,
    +            g: 255,
    +            b: 200,
    +            a: 0.2,
    +            space: 'RGB',
    +            conversionName: 'RGBA_OBJ'
    +          },
    +          'RGBA_OBJ'
    +      );
    +
    +      match(
    +          interpret({
    +                h: 360,
    +                s: 1,
    +                v: 0.5
    +              }),
    +          {
    +            h: 360,
    +            s: 1,
    +            v: 0.5,
    +            space: 'HSV',
    +            conversionName: 'HSV_OBJ'
    +          },
    +          'HSV_OBJ'
    +      );
    +
    +      match(
    +          interpret({
    +                h: 360,
    +                s: 1,
    +                v: 0.5,
    +                a: 0.8
    +              }),
    +          {
    +            h: 360,
    +            s: 1,
    +            v: 0.5,
    +            a: 0.8,
    +            space: 'HSV',
    +            conversionName: 'HSVA_OBJ'
    +          },
    +          'HSVA_OBJ'
    +      );
    +
    +      match(
    +          interpret('Failuuureeee'),
    +          false,
    +          'FAIL'
    +      );
    +
    +    });
    +
    +    module("Color Objects");
    +
    +    test("Creation", function() {
    +
    +      var c = new Color(255, 100, 20, 0.3);
    +
    +      equal(c.r, 255, 'red');
    +      equal(c.g, 100, 'green');
    +      equal(c.b, 20, 'blue');
    +      equal(c.a, 0.3, 'alpha');
    +
    +      equal(c.hex, 0xff6414, 'hex');
    +
    +      equal(Math.round(c.h), 20, 'hue');
    +      equal(Math.round(c.s * 100), 92, 'saturation');
    +      equal(Math.round(c.v * 100), 100, 'value');
    +
    +    });
    +
    +    test("RGB Modification", function() {
    +
    +      var c = new Color(255, 100, 20, 0.3);
    +
    +      c.r -= 100;
    +
    +      equal(c.r, 155, 'green');
    +      equal(c.g, 100, 'green');
    +      equal(c.b, 20, 'blue');
    +      equal(c.a, 0.3, 'alpha');
    +
    +      equal(c.hex, 0x9b6414, 'hex');
    +
    +      equal(Math.round(c.h), 36, 'hue');
    +      equal(Math.round(c.s * 100), 87, 'saturation');
    +      equal(Math.round(c.v * 100), 61, 'value');
    +
    +    });
    +
    +    test("RGB Modification", function() {
    +
    +      var c = new Color(255, 100, 20, 0.3);
    +
    +      c.r -= 100;
    +
    +      equal(c.r, 155, 'green');
    +      equal(c.g, 100, 'green');
    +      equal(c.b, 20, 'blue');
    +      equal(c.a, 0.3, 'alpha');
    +
    +      equal(c.hex, 0x9b6414, 'hex');
    +
    +      equal(Math.round(c.h), 36, 'hue');
    +      equal(Math.round(c.s * 100), 87, 'saturation');
    +      equal(Math.round(c.v * 100), 61, 'value');
    +
    +    });
    +
    +    test("Setting RGB, Modifying HSV", function() {
    +
    +      var c = new Color(255, 0, 100);
    +
    +      c.s = 1;
    +
    +      equal(c.r, 255);
    +      equal(c.g, 0);
    +      equalish(c.b, 100, 0.00001);
    +      equal(c.a, 1);
    +
    +    });
    +
    +
    +    test("Setting HSV, Modifying RGB", function() {
    +
    +      var c = new Color({ h: 340, s: 0.3, v: 0.9 });
    +
    +      c.g = 0;
    +
    +      equal(c.h, 312);
    +      equal(c.s, 1);
    +      equal(c.v, 0.9);
    +      equal(c.a, 1);
    +
    +    });
    +
    +    test("Grayscale Hue", function() {
    +
    +      var c = new Color(120, 100, 20, 0.3);
    +
    +      var prevHue = c.h;
    +
    +      equal(typeof c.h, 'number');
    +
    +      // Make graysale
    +      c.g = c.b = c.r;
    +
    +      equal(c.h, prevHue, 'grayscale, hue intact');
    +
    +    });
    +
    +    test("Black Hue", function() {
    +
    +      var c = new Color(120, 100, 20, 0.3);
    +
    +      var prevHue = c.h;
    +      console.log('heh?');
    +
    +      c.r = 0;
    +      c.b = 0;
    +      c.g = 0;
    +
    +      equal(c.h, prevHue, 'black, hue intact');
    +
    +    });
    +
    +		function match(a, b, msg) {
    +	
    +			for (var i in b) {
    +				if (b[i] !== b[i]) {
    +					ok(a[i] !== a[i], msg)
    +				} else {
    +					equal(b[i], a[i], msg);
    +				}
    +			}
    +	
    +		}
    +		
    +		function equalish(a, b, tolerance, label) {
    +			return ok(Math.abs(a - b) < tolerance, label);
    +		}
    +
    +
    +  
    +
    +    function initObject() {
    +      return {
    +        numberProperty: 10,
    +        stringProperty: 'foo',
    +        booleanProperty: false,
    +        functionProperty: function() {
    +          // do something
    +        },
    +        anotherBooleanProperty: true,
    +        colorProperty: "#ffffff"
    +      };
    +    }
    +
    +    var hidden = document.createElement('div');
    +    hidden.style.display = 'none';
    +    document.body.appendChild(hidden);
    +
    +    module("Controller");
    +
    +    test("Retrieves values", function() {
    +
    +      var object = initObject();
    +
    +      var c1 = new Controller(object, 'numberProperty');
    +      var c2 = new Controller(object, 'stringProperty');
    +      var c3 = new Controller(object, 'booleanProperty');
    +      var c4 = new Controller(object, 'functionProperty');
    +
    +      equal(c1.getValue(), object.numberProperty, "Number property");
    +      equal(c2.getValue(), object.stringProperty, "String property");
    +      equal(c3.getValue(), object.booleanProperty, "Boolean property");
    +      equal(c4.getValue(), object.functionProperty, "Function property");
    +
    +    });
    +
    +    test("Sets values", function() {
    +      var object = initObject();
    +
    +      var c1 = new Controller(object, 'numberProperty');
    +      c1.setValue(40);
    +
    +      equal(40, object.numberProperty);
    +
    +    });
    +
    +    module("BooleanController");
    +
    +    test("Acknowledges original values", function() {
    +
    +      var object = initObject();
    +      var c1 = new BooleanController(object, 'booleanProperty');
    +      var c2 = new BooleanController(object, 'anotherBooleanProperty');
    +
    +      equal($(c1.__checkbox).attr('checked') === 'checked',
    +          object.booleanProperty);
    +      equal($(c2.__checkbox).attr('checked') === 'checked',
    +          object.anotherBooleanProperty);
    +
    +    });
    +
    +    test("Modifies values (starting true)", function() {
    +
    +      var object = { booleanProperty: true };
    +
    +      var c1 = new BooleanController(object, 'booleanProperty');
    +
    +      // Must append this to body for click to work
    +      hidden.appendChild(c1.domElement);
    +
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(false, object.booleanProperty, 'changes');
    +      equal(false, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(true, object.booleanProperty, 'changes back');
    +      equal(true, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +      object.booleanProperty = false;
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(false, object.booleanProperty, 'maintains sync');
    +      equal(false, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +    });
    +
    +    test("Modifies values (starting false)", function() {
    +
    +      var object = { booleanProperty: false };
    +
    +      var c1 = new BooleanController(object, 'booleanProperty');
    +
    +      // Must append this to body for click to work
    +      hidden.appendChild(c1.domElement);
    +
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(true, object.booleanProperty, 'changes');
    +      equal(true, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(false, object.booleanProperty, 'changes back');
    +      equal(false, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +      object.booleanProperty = true;
    +      dom.fakeEvent(c1.__checkbox, 'click');
    +      equal(true, object.booleanProperty, 'maintains sync');
    +      equal(true, $(c1.__checkbox).attr('checked') === 'checked', 'checkbox valid');
    +
    +
    +    });
    +
    +    module("OptionController");
    +
    +    test("Populates with string array", function() {
    +      var object = initObject();
    +      var options = ['Jono', 'Doug', 'George'];
    +
    +      var c1 = new OptionController(object, 'stringProperty',
    +          options);
    +
    +//        hidden.appendChild(c1.domElement);
    +
    +      $(c1.__select).children().each(function(index) {
    +        equal(options[index], this.innerHTML);
    +        equal(options[index], $(this).attr('value'));
    +      });
    +
    +    });
    +
    +    test("Populates with map", function() {
    +      var object = initObject();
    +      var options = {
    +        'Small': 0,
    +        'Medium': 2,
    +        'Large': 10
    +      };
    +
    +      var c1 = new OptionController(object, 'stringProperty',
    +          options);
    +
    +//        hidden.appendChild(c1.domElement);
    +
    +      $(c1.__select).children().each(function(index) {
    +        equal(options[this.innerHTML], $(this).attr('value'));
    +      });
    +
    +    });
    +
    +    test("Acknowledges original value", function() {
    +      var object = initObject();
    +      var options = {
    +        'Small': 0,
    +        'Medium': 2,
    +        'Large': object.numberProperty
    +      };
    +
    +      var c1 = new OptionController(object, 'numberProperty',
    +          options);
    +
    +//        hidden.appendChild(c1.domElement);
    +
    +      equal($(c1.__select).val(), object.numberProperty);
    +
    +    });
    +
    +    test("Modifies values", function() {
    +      var object = initObject();
    +      var options = {
    +        'Small': 0,
    +        'Medium': 2,
    +        'Large': 10
    +      };
    +
    +      var c1 = new OptionController(object, 'numberProperty',
    +          options);
    +
    +      var c2 = new OptionController(object, 'stringProperty', ['a', 'b', 'c']);
    +
    +//        hidden.appendChild(c1.domElement);
    +
    +      var elem = $(c1.__select).val(options['Medium'])[0];
    +      dom.fakeEvent(elem, 'change');
    +
    +      equal(options['Medium'], object.numberProperty, 'Number property');
    +
    +      elem = $(c2.__select).val('b')[0];
    +      dom.fakeEvent(elem, 'change');
    +
    +      equal('b', object.stringProperty, 'String property');
    +
    +    });
    +
    +    module("StringController");
    +
    +    test("Acknowledges original value", function() {
    +      var object = initObject();
    +      var c1 = new StringController(object, 'stringProperty');
    +
    +      equal($(c1.__input).val(), object.stringProperty);
    +
    +    });
    +
    +    test("Modifies values", function() {
    +      var object = initObject();
    +      var c1 = new StringController(object, 'stringProperty');
    +
    +      var newVal = (new Date()).toJSON();
    +
    +      var elem = $(c1.__input).val(newVal)[0];
    +      dom.fakeEvent(elem, 'change');
    +
    +      equal(newVal, object.stringProperty);
    +
    +    });
    +
    +    module("NumberController");
    +
    +    test("Constraints", function() {
    +      var object = initObject();
    +      var params = { min: 0, max: 10, step: 2 };
    +
    +      var c1 = new NumberController(object,
    +          'numberProperty', params);
    +
    +      c1.setValue(12);
    +      equal(object.numberProperty, params.max, "Maximum values");
    +
    +      c1.setValue(-20);
    +      equal(object.numberProperty, params.min, "Minimum values");
    +
    +      c1.setValue(1);
    +      equal(object.numberProperty, 2, "Steps");
    +
    +    });
    +
    +    module("NumberControllerBox");
    +
    +    test("Acknowledges original value", function() {
    +      var object = initObject();
    +      var c1 = new NumberControllerBox(object,
    +          'numberProperty');
    +
    +//        var newVal = Date.now();
    +//
    +//        $(c1.__input).val(newVal).trigger('change');
    +//
    +      equal($(c1.__input).val(), object.numberProperty.toString());
    +
    +    });
    +
    +    test("Modifies value", function() {
    +      var object = initObject();
    +      var c1 = new NumberControllerBox(object,
    +          'numberProperty');
    +
    +      var newVal = Date.now();
    +
    +      var elem = $(c1.__input).val(newVal)[0];
    +      dom.fakeEvent(elem, 'change');
    +
    +      equal(typeof object.numberProperty, 'number');
    +      equal(object.numberProperty, newVal);
    +
    +    });
    +
    +
    +    test("Handles invalid input", function() {
    +      var object = initObject();
    +      var c1 = new NumberControllerBox(object,
    +          'numberProperty');
    +
    +      var newVal = '~! I98* omg this is not a N&^&*^umber.e-083.9';
    +      var prevVal = object.numberProperty;
    +
    +      var elem = $(c1.__input).val(newVal)[0];
    +      dom.fakeEvent(elem, 'change');
    +
    +      equal(typeof object.numberProperty, 'number');
    +      equal(object.numberProperty, prevVal);
    +
    +    });
    +
    +
    +    test("Handles drag", function() {
    +
    +      var object = { numberProperty: 0 };
    +      var params = { step: Math.random() * 21 };
    +
    +      var c1 = new NumberControllerBox(object,
    +          'numberProperty', params);
    +
    +      var prevVal = object.numberProperty;
    +      var disp = Math.round(Math.random() * 100);
    +
    +      var elem = c1.__input;
    +
    +      dom.fakeEvent(elem, 'mousedown', {
    +        x: 0,
    +        y: 0
    +      });
    +      dom.fakeEvent(window, 'mousemove', {
    +        x: 0,
    +        y: disp
    +      });
    +      dom.fakeEvent(window, 'mouseup');
    +
    +      equal(object.numberProperty, prevVal + params.step * -disp);
    +
    +    });
    +
    +    module("NumberControllerSlider");
    +
    +    test("Acknowledges original value", function() {
    +      
    +      var object = initObject();
    +
    +      var min = 0, max = 50;
    +
    +      var c1 = new NumberControllerSlider(object, 'numberProperty', min, max);
    +
    +      document.body.appendChild(c1.domElement);
    +
    +      var bw = dom.getWidth(c1.__background);
    +      var fw = dom.getWidth(c1.__foreground);
    +
    +      document.body.removeChild(c1.domElement);
    +
    +      equalish(fw/bw, (object.numberProperty - min) / (max - min), 0.01, 'Slider width indicative of value.');
    +
    +    });
    +
    +    test("Modifies values", function() {
    +
    +      var object = initObject();
    +
    +      var min = 0, max = 50;
    +
    +      var c1 = new NumberControllerSlider(object, 'numberProperty', min, max, 1);
    +
    +      document.body.appendChild(c1.domElement);
    +
    +      var o = dom.getOffset(c1.domElement);
    +      var w = dom.getWidth(c1.domElement);
    +
    +      dom.fakeEvent(c1.__background, 'mousedown', {
    +        x: o.left + w/2,
    +        y: o.top
    +      });
    +
    +      var bw = dom.getWidth(c1.__background);
    +      var fw = dom.getWidth(c1.__foreground);
    +
    +      equal(object.numberProperty, (min+max)/2, 'Mouse down');
    +
    +      equalish(fw/bw, (object.numberProperty - min) / (max - min), 0.01, 'Slider width still indicative of value.');
    +
    +      dom.fakeEvent(window, 'mousemove', {
    +        x: o.left,
    +        y: o.top
    +      });
    +
    +      fw = dom.getWidth(c1.__foreground);
    +
    +
    +      equal(object.numberProperty, min, 'Mouse move');
    +
    +      equal(fw/bw, (object.numberProperty - min) / (max - min), 'Slider width still indicative of value.');
    +
    +
    +      dom.fakeEvent(window, 'mouseup');
    +      
    +      dom.fakeEvent(window, 'mousemove', {
    +        x: o.left+w,
    +        y: o.top
    +      });
    +
    +      equal(object.numberProperty, min, 'Mouse releases drag');
    +
    +      document.body.removeChild(c1.domElement);
    +
    +
    +    });
    +
    +    module("ColorController");
    +
    +    test("Get Color", function() {
    +      var object = initObject();
    +      var c1 = new ColorController(object, 'colorProperty');
    +      document.body.appendChild(c1.domElement);
    +
    +      var input = c1.domElement.getElementsByTagName("input")[0];
    +      equal(input.value, object.colorProperty, "Input value is the same as the colorProperty");
    +
    +      document.body.removeChild(c1.domElement);
    +    });
    +
    +/*
    +    test("Set Color", function() {
    +      // get from click, get from hover
    +      var object = initObject();
    +      var c1 = new ColorController(object, 'colorProperty');
    +
    +      document.body.appendChild(c1.domElement);
    +      var input = c1.domElement.getElementsByTagName("input")[0];
    +
    +      // type in color
    +      input.value = "#ff0";
    +
    +      // TODO fake events for keys not working
    +      dom.fakeEvent(input, 'keydown', { keyCode: 13 });
    +
    +      // click sv field
    +
    +      // click hue slider
    +
    +      equal(1,0, "TODO: add set color tests.");
    +
    +      document.body.removeChild(c1.domElement);
    +    });
    +*/
    +    module("Controller Events");
    +
    +    test("onChange", function() {
    +
    +      var object = initObject();
    +
    +      var c0 = new NumberControllerSlider(object, 'numberProperty');
    +      var c1 = new NumberControllerBox(object, 'numberProperty');
    +      var c2 = new StringController(object, 'stringProperty');
    +      var c3 = new BooleanController(object, 'booleanProperty');
    +      var c4 = new FunctionController(object, 'functionProperty');
    +      var c5 = new OptionController(object, 'stringProperty', [0,1,2]);
    +
    +      var c0_changed = false;
    +      var c1_changed = false;
    +      var c2_changed = false;
    +      var c3_changed = false;
    +      var c4_changed = false;
    +      var c5_changed = false;
    +
    +      c0.onChange(function() {
    +        c0_changed = true;
    +      });
    +
    +      c1.onChange(function() {
    +        c1_changed = true;
    +      });
    +
    +      c2.onChange(function() {
    +        c2_changed = true;
    +      });
    +
    +      c3.onChange(function() {
    +        c3_changed = true;
    +      });
    +
    +      c4.onChange(function() {
    +        c4_changed = true;
    +      });
    +      
    +      c5.onChange(function() {
    +        c5_changed = true;
    +      });
    +
    +      hidden.appendChild(c3.domElement);
    +
    +      c0.setValue(0.5);
    +      c1.setValue(10);
    +      c2.setValue('hey');
    +      c3.setValue(false);
    +      c4.fire();
    +      c5.setValue('yo');
    +
    +      ok(c1_changed, 'NumberControllerSlider');
    +      ok(c1_changed, 'NumberControllerBox');
    +      ok(c2_changed, 'StringController');
    +      ok(c3_changed, 'BooleanController');
    +      ok(c4_changed, 'FunctionController');
    +      ok(c5_changed, 'OptionController');
    +
    +    });
    +
    +    test("onFinishChange", function() {
    +
    +      var object = initObject();
    +
    +      var min = 0, max = 100;
    +
    +      var c0 = new NumberControllerSlider(object, 'numberProperty', min, max);
    +      var c1 = new NumberControllerBox(object, 'numberProperty');
    +      var c2 = new StringController(object, 'stringProperty');
    +
    +      var c0_changed = false;
    +      var c1_changed = false;
    +      var c2_changed = false;
    +
    +      c0.onFinishChange(function() {
    +        c0_changed = true;
    +      });
    +
    +      document.body.appendChild(c0.domElement);
    +
    +      var o = dom.getOffset(c0.domElement);
    +      var w = dom.getWidth(c0.domElement);
    +
    +      dom.fakeEvent(c0.__background, 'mousedown', {
    +        x: o.left + w/2,
    +        y: o.top
    +      });
    +
    +      ok(!c0_changed, 'NumberControllerSlider didn\'t jump the gun ...');
    +
    +      dom.fakeEvent(window, 'mousemove', {
    +        x: o.left,
    +        y: o.top
    +      });
    +      dom.fakeEvent(window, 'mouseup', {
    +        x: o.left,
    +        y: o.top
    +      });
    +
    +      ok(c0_changed, 'NumberControllerSlider fires when needed.');
    +
    +      document.body.removeChild(c0.domElement);
    +
    +      c1.onFinishChange(function() {
    +        c1_changed = true;
    +      });
    +
    +      document.body.appendChild(c1.domElement);
    +
    +      c1.__input.focus();
    +      c1.__input.value = '1';
    +      ok(!c1_changed, 'NumberControllerBox didn\'t jump the gun ...');
    +      c1.__input.value += '2';
    +      c1.__input.blur();
    +
    +      document.body.removeChild(c1.domElement);
    +
    +      ok(c1_changed, 'NumberControllerBox fires when needed.');
    +
    +      c2.onFinishChange(function() {
    +        c2_changed = true;
    +      });
    +
    +      document.body.appendChild(c2.domElement);
    +
    +      c2.__input.focus();
    +      c2.__input.value = 'friendBudd';
    +      ok(!c2_changed, 'StringController didn\'t jump the gun ...');
    +      c2.__input.value += 'y';
    +      c2.__input.blur();
    +
    +      document.body.removeChild(c2.domElement);
    +
    +      ok(c2_changed, 'StringController fires when needed.');
    +
    +    });
    +
    +		function equalish(a, b, tolerance, label) {
    +			return ok(Math.abs(a - b) < tolerance, label);
    +		}
    +
    +  
    +
    +    module('GUI Appearance');
    +
    +    test('Auto placement', function() {
    +
    +      var gui = new GUI();
    +      gui.add({ x: 0 }, 'x');
    +
    +      var gui2 = new GUI();
    +      gui2.add({ x: 0 }, 'x');
    +
    +      equal($('.dg.ac').length, 1, 'A single auto-place container created');
    +      equal($('.dg.ac').children().length, 2, 'Containing two GUI\'s');
    +
    +      equal(gui.parent, undefined);
    +      equal(gui2.parent, undefined);
    +
    +      $('.dg.ac').children().each(function(key, value) {
    +        ok($(value).hasClass(GUI.CLASS_AUTO_PLACE), 'GUI has auto-place class');
    +        ok($(value).hasClass(GUI.CLASS_MAIN), 'GUI has main class');
    +
    +      });
    +
    +      gui.destroy();
    +      gui2.destroy();
    +
    +    });
    +
    +    test('Auto placement scroll', function() {
    +
    +      var gui = new GUI();
    +
    +      while (dom.getHeight(gui.domElement) < window.innerHeight) {
    +        gui.add({ x: 0 }, 'x');
    +      }
    +
    +      ok($(gui.domElement).hasClass(GUI.CLASS_TOO_TALL), 'GUI has too tall class');
    +      notEqual($(gui.domElement).children('ul')[0].style.height, 'auto');
    +
    +      gui.destroy();
    +
    +
    +    });
    +
    +    test('Folders', function() {
    +
    +      var gui = new GUI();
    +      gui.add({x:0}, 'x');
    +
    +      var name1 = 'name';
    +      var f1 = gui.addFolder(name1);
    +
    +      f1.add({ x: 0 }, 'x');
    +
    +      equal(f1.name, name1, "Accepts name");
    +      equal($(f1.domElement).find('li.title').html(), name1, "Displays name");
    +
    +      equal(f1.closed, true, "Closed by default");
    +      ok($(f1.domElement).find('ul').hasClass(GUI.CLASS_CLOSED), "Has closed class");
    +
    +      var title = $(f1.domElement).find('li.title')[0];
    +
    +      dom.fakeEvent(title, 'click');
    +
    +      equal(f1.closed, false, "Opens on click");
    +      ok(!$(f1.domElement).find('ul').hasClass(GUI.CLASS_CLOSED), "Opens on click");
    +
    +      dom.fakeEvent(title, 'click');
    +
    +      equal(f1.closed, true, "Closes back up");
    +      ok($(f1.domElement).find('ul').hasClass(GUI.CLASS_CLOSED), "Closes back up");
    +
    +      gui.destroy();
    +
    +    });
    +
    +
    +    module("GUI Controller Methods");
    +
    +    test('options', function() {
    +
    +      var gui = new GUI();
    +
    +      var controller = gui.add({ x: 0 }, 'x').options(0, 1, 2, 3, 4);
    +
    +      $(controller.__select).children().each(function(key, value) {
    +        equals(value.innerHTML, key, 'By array name okay');
    +        equals(value.value, key, 'By array value okay');
    +      });
    +
    +      controller = gui.add({ x: 0 }, 'x').options(
    +          {
    +            0: '0',
    +            1: '1',
    +            2: '2',
    +            3: '3',
    +            4: '4'
    +          }
    +      );
    +
    +      $(controller.__select).children().each(function(key, value) {
    +        equals(value.innerHTML, key, 'By array name okay');
    +        equals(value.value, key, 'By array value okay');
    +      });
    +
    +      gui.destroy();
    +
    +    });
    +
    +    test('name', function() {
    +
    +      var gui = new GUI();
    +
    +      var name = 'hey man';
    +      var name2 = 'yoyoo';
    +
    +      var controller = gui.add({ x: 0 }, 'x').name(name);
    +
    +      equals($(controller.__li).find('.property-name').html(), name);
    +
    +      controller.name(name2);
    +      equals($(controller.__li).find('.property-name').html(), name2);
    +
    +      gui.destroy();
    +
    +    });
    +
    +    test('listen', function() {
    +
    +      var gui = new GUI();
    +
    +      var obj = { x: 0 };
    +
    +      var returned1 = gui.add(obj, 'x');
    +      var returned2 = returned1.listen();
    +
    +      obj.x = 10;
    +
    +      setTimeout(function() {
    +        ok(returned1 === returned2, 'Returns self');
    +
    +        equal(returned1.__input.value, obj.x, 'Updates display');
    +        gui.destroy();
    +      }, 0);
    +
    +    });
    +
    +    test('remove', function() {
    +
    +      var gui = new GUI();
    +
    +      var c = gui.add({x:0}, 'x');
    +
    +      ok($.contains(gui.domElement, c.domElement), "Now you see it");
    +      c.remove();
    +
    +      ok(!$.contains(gui.domElement, c.domElement), "Now you don't.");
    +
    +      gui.destroy();
    +
    +    });
    +
    +
    +    test('min, max & step', function() {
    +
    +      var gui = new GUI();
    +
    +      var min = -10;
    +      var max = 200;
    +      var step = 5;
    +
    +      var c = gui.add({ x: 0 }, 'x');
    +
    +      c.min(min);
    +      equals(c.__min, min, 'min');
    +
    +      c.step(step);
    +      equals(c.__step, step, 'step');
    +
    +      var c2 = c.max(max);
    +      equals(c.__max, max, 'max');
    +
    +      notEqual(c2, c, 'Controller has changed.');
    +
    +      ok($(c2.__li).find('.slider').length > 0, 'Slider added');
    +
    +      equals(c.__step, step, 'step intact');
    +
    +      gui.destroy();
    +
    +    });
    +
    +    module("GUI Controller Augmentation");
    +
    +    test('Adds NumberControllerBox to sliders', function() {
    +      var gui = new GUI();
    +
    +      var c = gui.add({ x: 0 }, 'x', 0, 10);
    +
    +      ok($(c.__li).find('input').length > 0, 'NumberControllerBox added');
    +
    +      gui.destroy();
    +
    +    });
    +
    +    test('Clickable rows for BooleanControllers', function() {
    +
    +      var gui = new GUI();
    +
    +      var c = gui.add({ x: false }, 'x');
    +
    +      equal($(c.__checkbox).attr('checked'), undefined, 'Acknowledges original');
    +
    +      dom.fakeEvent(c.__li, 'click');
    +
    +      equal($(c.__checkbox).attr('checked'), 'checked', 'Changes when I click the row');
    +
    +      dom.fakeEvent(c.__li, 'click');
    +
    +      equal($(c.__checkbox).attr('checked'), undefined, 'Changes back');
    +
    +      gui.destroy();
    +
    +    });
    +
    +    test('Clickable rows for FunctionControllers', function() {
    +
    +      expect(3);
    +
    +      var gui = new GUI();
    +
    +      var c = gui.add({ x: function() {
    +        ok(true)
    +      } }, 'x');
    +
    +      dom.fakeEvent(c.__li, 'click');
    +      c.fire();
    +      dom.fakeEvent(c.__li, 'click');
    +
    +      gui.destroy();
    +
    +    });
    +
    +    module('GUI Saving');
    +
    +    test('Remembering values', function() {
    +
    +      var object = {
    +        number: 0,
    +        boolean: false,
    +        string: 'hey'
    +      };
    +
    +      var controllers = {};
    +
    +      var changed = {
    +        number: -20,
    +        boolean: true,
    +        string: 'hang'
    +      };
    +
    +      var gui = new GUI();
    +      gui.remember(object);
    +
    +      for (var i in object) {
    +        controllers[i] = gui.add(object, i);
    +      }
    +
    +      for (i in controllers) {
    +        controllers[i].setValue(changed[i]);
    +      }
    +
    +      var saveObject = gui.getSaveObject();
    +
    +      gui.destroy();
    +
    +      gui = new GUI({
    +            load: saveObject
    +          });
    +
    +      gui.remember(object);
    +
    +      for (i in object) {
    +        controllers[i] = gui.add(object, i);
    +        equal(object[i], changed[i]);
    +      }
    +
    +      ensurePresetSelectDisplay(gui);
    +
    +      gui.destroy();
    +
    +    });
    +
    +    test('Presets', function() {
    +
    +      var presetName = 'New Preset';
    +
    +      var object = {
    +        number: 0,
    +        boolean: false,
    +        string: 'hey'
    +      };
    +
    +      var original = {};
    +
    +      for (var i in object) {
    +        original[i] = object[i];
    +      }
    +
    +      var controllers = {};
    +
    +      var changed = {
    +        number: -20,
    +        boolean: true,
    +        string: 'hang'
    +      };
    +
    +      var gui = new GUI();
    +      gui.remember(object);
    +
    +      for (i in object) {
    +        controllers[i] = gui.add(object, i);
    +      }
    +
    +      for (i in controllers) {
    +        controllers[i].setValue(changed[i]);
    +      }
    +
    +      ensurePresetSelectDisplay(gui);
    +
    +      gui.saveAs(presetName);
    +
    +      ensurePresetSelectDisplay(gui);
    +
    +      var saveObject = gui.getSaveObject();
    +      console.log(saveObject);
    +
    +      gui.destroy();
    +
    +      gui = new GUI({
    +            load: saveObject
    +          });
    +
    +      gui.remember(object);
    +
    +      for (i in object) {
    +        controllers[i] = gui.add(object, i);
    +        equal(object[i], changed[i], "Uses last defined preset");
    +      }
    +
    +      equal(gui.preset, presetName, "Preset value correct");
    +      ensurePresetSelectDisplay(gui);
    +
    +      gui.destroy();
    +
    +      gui = new GUI({
    +            preset: "Default",
    +            load: saveObject
    +          });
    +
    +      gui.remember(object);
    +
    +      for (i in object) {
    +        controllers[i] = gui.add(object, i);
    +        equal(object[i], original[i], "Loads with explicitly set preset");
    +      }
    +
    +      equal(gui.preset, "Default", "Preset value correct");
    +      ensurePresetSelectDisplay(gui);
    +
    +      gui.preset = presetName;
    +
    +      for (i in object) {
    +        equal(object[i], changed[i], "Changes via gui.preset property");
    +      }
    +
    +      $(gui.__preset_select).val('Default');
    +      dom.fakeEvent(gui.__preset_select, 'change');
    +
    +      for (i in object) {
    +        equal(object[i], original[i], "Changes via dropdown");
    +      }
    +
    +      gui.destroy();
    +
    +    });
    +
    +    function ensurePresetSelectDisplay(gui) {
    +
    +      equal($(gui.__preset_select).children('option:selected')[0].value, gui.preset, "Dropdown display matches preset value");
    +
    +    }
    +  
    +});
    +</script>
    +  
    +</head>
    +<body>
    +<h1 id="qunit-header"></h1>
    +
    +<h2 id="qunit-banner"></h2>
    +
    +<div id="qunit-testrunner-toolbar"></div>
    +<h2 id="qunit-userAgent"></h2>
    +<ol id="qunit-tests"></ol>
    +<div id="qunit-fixture">test markup, will be hidden</div>
    +</body>
    +</html>
    \ No newline at end of file
    diff --git a/tests/jquery.js b/tests/jquery.js
    new file mode 100644
    index 0000000..11e6d06
    --- /dev/null
    +++ b/tests/jquery.js
    @@ -0,0 +1,9046 @@
    +/*!
    + * jQuery JavaScript Library v1.6.4
    + * http://jquery.com/
    + *
    + * Copyright 2011, John Resig
    + * Dual licensed under the MIT or GPL Version 2 licenses.
    + * http://jquery.org/license
    + *
    + * Includes Sizzle.js
    + * http://sizzlejs.com/
    + * Copyright 2011, The Dojo Foundation
    + * Released under the MIT, BSD, and GPL Licenses.
    + *
    + * Date: Mon Sep 12 18:54:48 2011 -0400
    + */
    +(function( window, undefined ) {
    +
    +// Use the correct document accordingly with window argument (sandbox)
    +var document = window.document,
    +	navigator = window.navigator,
    +	location = window.location;
    +var jQuery = (function() {
    +
    +// Define a local copy of jQuery
    +var jQuery = function( selector, context ) {
    +		// The jQuery object is actually just the init constructor 'enhanced'
    +		return new jQuery.fn.init( selector, context, rootjQuery );
    +	},
    +
    +	// Map over jQuery in case of overwrite
    +	_jQuery = window.jQuery,
    +
    +	// Map over the $ in case of overwrite
    +	_$ = window.$,
    +
    +	// A central reference to the root jQuery(document)
    +	rootjQuery,
    +
    +	// A simple way to check for HTML strings or ID strings
    +	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
    +	quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
    +
    +	// Check if a string has a non-whitespace character in it
    +	rnotwhite = /\S/,
    +
    +	// Used for trimming whitespace
    +	trimLeft = /^\s+/,
    +	trimRight = /\s+$/,
    +
    +	// Check for digits
    +	rdigit = /\d/,
    +
    +	// Match a standalone tag
    +	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
    +
    +	// JSON RegExp
    +	rvalidchars = /^[\],:{}\s]*$/,
    +	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
    +	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
    +	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
    +
    +	// Useragent RegExp
    +	rwebkit = /(webkit)[ \/]([\w.]+)/,
    +	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
    +	rmsie = /(msie) ([\w.]+)/,
    +	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
    +
    +	// Matches dashed string for camelizing
    +	rdashAlpha = /-([a-z]|[0-9])/ig,
    +	rmsPrefix = /^-ms-/,
    +
    +	// Used by jQuery.camelCase as callback to replace()
    +	fcamelCase = function( all, letter ) {
    +		return ( letter + "" ).toUpperCase();
    +	},
    +
    +	// Keep a UserAgent string for use with jQuery.browser
    +	userAgent = navigator.userAgent,
    +
    +	// For matching the engine and version of the browser
    +	browserMatch,
    +
    +	// The deferred used on DOM ready
    +	readyList,
    +
    +	// The ready event handler
    +	DOMContentLoaded,
    +
    +	// Save a reference to some core methods
    +	toString = Object.prototype.toString,
    +	hasOwn = Object.prototype.hasOwnProperty,
    +	push = Array.prototype.push,
    +	slice = Array.prototype.slice,
    +	trim = String.prototype.trim,
    +	indexOf = Array.prototype.indexOf,
    +
    +	// [[Class]] -> type pairs
    +	class2type = {};
    +
    +jQuery.fn = jQuery.prototype = {
    +	constructor: jQuery,
    +	init: function( selector, context, rootjQuery ) {
    +		var match, elem, ret, doc;
    +
    +		// Handle $(""), $(null), or $(undefined)
    +		if ( !selector ) {
    +			return this;
    +		}
    +
    +		// Handle $(DOMElement)
    +		if ( selector.nodeType ) {
    +			this.context = this[0] = selector;
    +			this.length = 1;
    +			return this;
    +		}
    +
    +		// The body element only exists once, optimize finding it
    +		if ( selector === "body" && !context && document.body ) {
    +			this.context = document;
    +			this[0] = document.body;
    +			this.selector = selector;
    +			this.length = 1;
    +			return this;
    +		}
    +
    +		// Handle HTML strings
    +		if ( typeof selector === "string" ) {
    +			// Are we dealing with HTML string or an ID?
    +			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
    +				// Assume that strings that start and end with <> are HTML and skip the regex check
    +				match = [ null, selector, null ];
    +
    +			} else {
    +				match = quickExpr.exec( selector );
    +			}
    +
    +			// Verify a match, and that no context was specified for #id
    +			if ( match && (match[1] || !context) ) {
    +
    +				// HANDLE: $(html) -> $(array)
    +				if ( match[1] ) {
    +					context = context instanceof jQuery ? context[0] : context;
    +					doc = (context ? context.ownerDocument || context : document);
    +
    +					// If a single string is passed in and it's a single tag
    +					// just do a createElement and skip the rest
    +					ret = rsingleTag.exec( selector );
    +
    +					if ( ret ) {
    +						if ( jQuery.isPlainObject( context ) ) {
    +							selector = [ document.createElement( ret[1] ) ];
    +							jQuery.fn.attr.call( selector, context, true );
    +
    +						} else {
    +							selector = [ doc.createElement( ret[1] ) ];
    +						}
    +
    +					} else {
    +						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
    +						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
    +					}
    +
    +					return jQuery.merge( this, selector );
    +
    +				// HANDLE: $("#id")
    +				} else {
    +					elem = document.getElementById( match[2] );
    +
    +					// Check parentNode to catch when Blackberry 4.6 returns
    +					// nodes that are no longer in the document #6963
    +					if ( elem && elem.parentNode ) {
    +						// Handle the case where IE and Opera return items
    +						// by name instead of ID
    +						if ( elem.id !== match[2] ) {
    +							return rootjQuery.find( selector );
    +						}
    +
    +						// Otherwise, we inject the element directly into the jQuery object
    +						this.length = 1;
    +						this[0] = elem;
    +					}
    +
    +					this.context = document;
    +					this.selector = selector;
    +					return this;
    +				}
    +
    +			// HANDLE: $(expr, $(...))
    +			} else if ( !context || context.jquery ) {
    +				return (context || rootjQuery).find( selector );
    +
    +			// HANDLE: $(expr, context)
    +			// (which is just equivalent to: $(context).find(expr)
    +			} else {
    +				return this.constructor( context ).find( selector );
    +			}
    +
    +		// HANDLE: $(function)
    +		// Shortcut for document ready
    +		} else if ( jQuery.isFunction( selector ) ) {
    +			return rootjQuery.ready( selector );
    +		}
    +
    +		if (selector.selector !== undefined) {
    +			this.selector = selector.selector;
    +			this.context = selector.context;
    +		}
    +
    +		return jQuery.makeArray( selector, this );
    +	},
    +
    +	// Start with an empty selector
    +	selector: "",
    +
    +	// The current version of jQuery being used
    +	jquery: "1.6.4",
    +
    +	// The default length of a jQuery object is 0
    +	length: 0,
    +
    +	// The number of elements contained in the matched element set
    +	size: function() {
    +		return this.length;
    +	},
    +
    +	toArray: function() {
    +		return slice.call( this, 0 );
    +	},
    +
    +	// Get the Nth element in the matched element set OR
    +	// Get the whole matched element set as a clean array
    +	get: function( num ) {
    +		return num == null ?
    +
    +			// Return a 'clean' array
    +			this.toArray() :
    +
    +			// Return just the object
    +			( num < 0 ? this[ this.length + num ] : this[ num ] );
    +	},
    +
    +	// Take an array of elements and push it onto the stack
    +	// (returning the new matched element set)
    +	pushStack: function( elems, name, selector ) {
    +		// Build a new jQuery matched element set
    +		var ret = this.constructor();
    +
    +		if ( jQuery.isArray( elems ) ) {
    +			push.apply( ret, elems );
    +
    +		} else {
    +			jQuery.merge( ret, elems );
    +		}
    +
    +		// Add the old object onto the stack (as a reference)
    +		ret.prevObject = this;
    +
    +		ret.context = this.context;
    +
    +		if ( name === "find" ) {
    +			ret.selector = this.selector + (this.selector ? " " : "") + selector;
    +		} else if ( name ) {
    +			ret.selector = this.selector + "." + name + "(" + selector + ")";
    +		}
    +
    +		// Return the newly-formed element set
    +		return ret;
    +	},
    +
    +	// Execute a callback for every element in the matched set.
    +	// (You can seed the arguments with an array of args, but this is
    +	// only used internally.)
    +	each: function( callback, args ) {
    +		return jQuery.each( this, callback, args );
    +	},
    +
    +	ready: function( fn ) {
    +		// Attach the listeners
    +		jQuery.bindReady();
    +
    +		// Add the callback
    +		readyList.done( fn );
    +
    +		return this;
    +	},
    +
    +	eq: function( i ) {
    +		return i === -1 ?
    +			this.slice( i ) :
    +			this.slice( i, +i + 1 );
    +	},
    +
    +	first: function() {
    +		return this.eq( 0 );
    +	},
    +
    +	last: function() {
    +		return this.eq( -1 );
    +	},
    +
    +	slice: function() {
    +		return this.pushStack( slice.apply( this, arguments ),
    +			"slice", slice.call(arguments).join(",") );
    +	},
    +
    +	map: function( callback ) {
    +		return this.pushStack( jQuery.map(this, function( elem, i ) {
    +			return callback.call( elem, i, elem );
    +		}));
    +	},
    +
    +	end: function() {
    +		return this.prevObject || this.constructor(null);
    +	},
    +
    +	// For internal use only.
    +	// Behaves like an Array's method, not like a jQuery method.
    +	push: push,
    +	sort: [].sort,
    +	splice: [].splice
    +};
    +
    +// Give the init function the jQuery prototype for later instantiation
    +jQuery.fn.init.prototype = jQuery.fn;
    +
    +jQuery.extend = jQuery.fn.extend = function() {
    +	var options, name, src, copy, copyIsArray, clone,
    +		target = arguments[0] || {},
    +		i = 1,
    +		length = arguments.length,
    +		deep = false;
    +
    +	// Handle a deep copy situation
    +	if ( typeof target === "boolean" ) {
    +		deep = target;
    +		target = arguments[1] || {};
    +		// skip the boolean and the target
    +		i = 2;
    +	}
    +
    +	// Handle case when target is a string or something (possible in deep copy)
    +	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
    +		target = {};
    +	}
    +
    +	// extend jQuery itself if only one argument is passed
    +	if ( length === i ) {
    +		target = this;
    +		--i;
    +	}
    +
    +	for ( ; i < length; i++ ) {
    +		// Only deal with non-null/undefined values
    +		if ( (options = arguments[ i ]) != null ) {
    +			// Extend the base object
    +			for ( name in options ) {
    +				src = target[ name ];
    +				copy = options[ name ];
    +
    +				// Prevent never-ending loop
    +				if ( target === copy ) {
    +					continue;
    +				}
    +
    +				// Recurse if we're merging plain objects or arrays
    +				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
    +					if ( copyIsArray ) {
    +						copyIsArray = false;
    +						clone = src && jQuery.isArray(src) ? src : [];
    +
    +					} else {
    +						clone = src && jQuery.isPlainObject(src) ? src : {};
    +					}
    +
    +					// Never move original objects, clone them
    +					target[ name ] = jQuery.extend( deep, clone, copy );
    +
    +				// Don't bring in undefined values
    +				} else if ( copy !== undefined ) {
    +					target[ name ] = copy;
    +				}
    +			}
    +		}
    +	}
    +
    +	// Return the modified object
    +	return target;
    +};
    +
    +jQuery.extend({
    +	noConflict: function( deep ) {
    +		if ( window.$ === jQuery ) {
    +			window.$ = _$;
    +		}
    +
    +		if ( deep && window.jQuery === jQuery ) {
    +			window.jQuery = _jQuery;
    +		}
    +
    +		return jQuery;
    +	},
    +
    +	// Is the DOM ready to be used? Set to true once it occurs.
    +	isReady: false,
    +
    +	// A counter to track how many items to wait for before
    +	// the ready event fires. See #6781
    +	readyWait: 1,
    +
    +	// Hold (or release) the ready event
    +	holdReady: function( hold ) {
    +		if ( hold ) {
    +			jQuery.readyWait++;
    +		} else {
    +			jQuery.ready( true );
    +		}
    +	},
    +
    +	// Handle when the DOM is ready
    +	ready: function( wait ) {
    +		// Either a released hold or an DOMready/load event and not yet ready
    +		if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
    +			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
    +			if ( !document.body ) {
    +				return setTimeout( jQuery.ready, 1 );
    +			}
    +
    +			// Remember that the DOM is ready
    +			jQuery.isReady = true;
    +
    +			// If a normal DOM Ready event fired, decrement, and wait if need be
    +			if ( wait !== true && --jQuery.readyWait > 0 ) {
    +				return;
    +			}
    +
    +			// If there are functions bound, to execute
    +			readyList.resolveWith( document, [ jQuery ] );
    +
    +			// Trigger any bound ready events
    +			if ( jQuery.fn.trigger ) {
    +				jQuery( document ).trigger( "ready" ).unbind( "ready" );
    +			}
    +		}
    +	},
    +
    +	bindReady: function() {
    +		if ( readyList ) {
    +			return;
    +		}
    +
    +		readyList = jQuery._Deferred();
    +
    +		// Catch cases where $(document).ready() is called after the
    +		// browser event has already occurred.
    +		if ( document.readyState === "complete" ) {
    +			// Handle it asynchronously to allow scripts the opportunity to delay ready
    +			return setTimeout( jQuery.ready, 1 );
    +		}
    +
    +		// Mozilla, Opera and webkit nightlies currently support this event
    +		if ( document.addEventListener ) {
    +			// Use the handy event callback
    +			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
    +
    +			// A fallback to window.onload, that will always work
    +			window.addEventListener( "load", jQuery.ready, false );
    +
    +		// If IE event model is used
    +		} else if ( document.attachEvent ) {
    +			// ensure firing before onload,
    +			// maybe late but safe also for iframes
    +			document.attachEvent( "onreadystatechange", DOMContentLoaded );
    +
    +			// A fallback to window.onload, that will always work
    +			window.attachEvent( "onload", jQuery.ready );
    +
    +			// If IE and not a frame
    +			// continually check to see if the document is ready
    +			var toplevel = false;
    +
    +			try {
    +				toplevel = window.frameElement == null;
    +			} catch(e) {}
    +
    +			if ( document.documentElement.doScroll && toplevel ) {
    +				doScrollCheck();
    +			}
    +		}
    +	},
    +
    +	// See test/unit/core.js for details concerning isFunction.
    +	// Since version 1.3, DOM methods and functions like alert
    +	// aren't supported. They return false on IE (#2968).
    +	isFunction: function( obj ) {
    +		return jQuery.type(obj) === "function";
    +	},
    +
    +	isArray: Array.isArray || function( obj ) {
    +		return jQuery.type(obj) === "array";
    +	},
    +
    +	// A crude way of determining if an object is a window
    +	isWindow: function( obj ) {
    +		return obj && typeof obj === "object" && "setInterval" in obj;
    +	},
    +
    +	isNaN: function( obj ) {
    +		return obj == null || !rdigit.test( obj ) || isNaN( obj );
    +	},
    +
    +	type: function( obj ) {
    +		return obj == null ?
    +			String( obj ) :
    +			class2type[ toString.call(obj) ] || "object";
    +	},
    +
    +	isPlainObject: function( obj ) {
    +		// Must be an Object.
    +		// Because of IE, we also have to check the presence of the constructor property.
    +		// Make sure that DOM nodes and window objects don't pass through, as well
    +		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
    +			return false;
    +		}
    +
    +		try {
    +			// Not own constructor property must be Object
    +			if ( obj.constructor &&
    +				!hasOwn.call(obj, "constructor") &&
    +				!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
    +				return false;
    +			}
    +		} catch ( e ) {
    +			// IE8,9 Will throw exceptions on certain host objects #9897
    +			return false;
    +		}
    +
    +		// Own properties are enumerated firstly, so to speed up,
    +		// if last one is own, then all properties are own.
    +
    +		var key;
    +		for ( key in obj ) {}
    +
    +		return key === undefined || hasOwn.call( obj, key );
    +	},
    +
    +	isEmptyObject: function( obj ) {
    +		for ( var name in obj ) {
    +			return false;
    +		}
    +		return true;
    +	},
    +
    +	error: function( msg ) {
    +		throw msg;
    +	},
    +
    +	parseJSON: function( data ) {
    +		if ( typeof data !== "string" || !data ) {
    +			return null;
    +		}
    +
    +		// Make sure leading/trailing whitespace is removed (IE can't handle it)
    +		data = jQuery.trim( data );
    +
    +		// Attempt to parse using the native JSON parser first
    +		if ( window.JSON && window.JSON.parse ) {
    +			return window.JSON.parse( data );
    +		}
    +
    +		// Make sure the incoming data is actual JSON
    +		// Logic borrowed from http://json.org/json2.js
    +		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
    +			.replace( rvalidtokens, "]" )
    +			.replace( rvalidbraces, "")) ) {
    +
    +			return (new Function( "return " + data ))();
    +
    +		}
    +		jQuery.error( "Invalid JSON: " + data );
    +	},
    +
    +	// Cross-browser xml parsing
    +	parseXML: function( data ) {
    +		var xml, tmp;
    +		try {
    +			if ( window.DOMParser ) { // Standard
    +				tmp = new DOMParser();
    +				xml = tmp.parseFromString( data , "text/xml" );
    +			} else { // IE
    +				xml = new ActiveXObject( "Microsoft.XMLDOM" );
    +				xml.async = "false";
    +				xml.loadXML( data );
    +			}
    +		} catch( e ) {
    +			xml = undefined;
    +		}
    +		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
    +			jQuery.error( "Invalid XML: " + data );
    +		}
    +		return xml;
    +	},
    +
    +	noop: function() {},
    +
    +	// Evaluates a script in a global context
    +	// Workarounds based on findings by Jim Driscoll
    +	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
    +	globalEval: function( data ) {
    +		if ( data && rnotwhite.test( data ) ) {
    +			// We use execScript on Internet Explorer
    +			// We use an anonymous function so that context is window
    +			// rather than jQuery in Firefox
    +			( window.execScript || function( data ) {
    +				window[ "eval" ].call( window, data );
    +			} )( data );
    +		}
    +	},
    +
    +	// Convert dashed to camelCase; used by the css and data modules
    +	// Microsoft forgot to hump their vendor prefix (#9572)
    +	camelCase: function( string ) {
    +		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
    +	},
    +
    +	nodeName: function( elem, name ) {
    +		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
    +	},
    +
    +	// args is for internal usage only
    +	each: function( object, callback, args ) {
    +		var name, i = 0,
    +			length = object.length,
    +			isObj = length === undefined || jQuery.isFunction( object );
    +
    +		if ( args ) {
    +			if ( isObj ) {
    +				for ( name in object ) {
    +					if ( callback.apply( object[ name ], args ) === false ) {
    +						break;
    +					}
    +				}
    +			} else {
    +				for ( ; i < length; ) {
    +					if ( callback.apply( object[ i++ ], args ) === false ) {
    +						break;
    +					}
    +				}
    +			}
    +
    +		// A special, fast, case for the most common use of each
    +		} else {
    +			if ( isObj ) {
    +				for ( name in object ) {
    +					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
    +						break;
    +					}
    +				}
    +			} else {
    +				for ( ; i < length; ) {
    +					if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
    +						break;
    +					}
    +				}
    +			}
    +		}
    +
    +		return object;
    +	},
    +
    +	// Use native String.trim function wherever possible
    +	trim: trim ?
    +		function( text ) {
    +			return text == null ?
    +				"" :
    +				trim.call( text );
    +		} :
    +
    +		// Otherwise use our own trimming functionality
    +		function( text ) {
    +			return text == null ?
    +				"" :
    +				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
    +		},
    +
    +	// results is for internal usage only
    +	makeArray: function( array, results ) {
    +		var ret = results || [];
    +
    +		if ( array != null ) {
    +			// The window, strings (and functions) also have 'length'
    +			// The extra typeof function check is to prevent crashes
    +			// in Safari 2 (See: #3039)
    +			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
    +			var type = jQuery.type( array );
    +
    +			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
    +				push.call( ret, array );
    +			} else {
    +				jQuery.merge( ret, array );
    +			}
    +		}
    +
    +		return ret;
    +	},
    +
    +	inArray: function( elem, array ) {
    +		if ( !array ) {
    +			return -1;
    +		}
    +
    +		if ( indexOf ) {
    +			return indexOf.call( array, elem );
    +		}
    +
    +		for ( var i = 0, length = array.length; i < length; i++ ) {
    +			if ( array[ i ] === elem ) {
    +				return i;
    +			}
    +		}
    +
    +		return -1;
    +	},
    +
    +	merge: function( first, second ) {
    +		var i = first.length,
    +			j = 0;
    +
    +		if ( typeof second.length === "number" ) {
    +			for ( var l = second.length; j < l; j++ ) {
    +				first[ i++ ] = second[ j ];
    +			}
    +
    +		} else {
    +			while ( second[j] !== undefined ) {
    +				first[ i++ ] = second[ j++ ];
    +			}
    +		}
    +
    +		first.length = i;
    +
    +		return first;
    +	},
    +
    +	grep: function( elems, callback, inv ) {
    +		var ret = [], retVal;
    +		inv = !!inv;
    +
    +		// Go through the array, only saving the items
    +		// that pass the validator function
    +		for ( var i = 0, length = elems.length; i < length; i++ ) {
    +			retVal = !!callback( elems[ i ], i );
    +			if ( inv !== retVal ) {
    +				ret.push( elems[ i ] );
    +			}
    +		}
    +
    +		return ret;
    +	},
    +
    +	// arg is for internal usage only
    +	map: function( elems, callback, arg ) {
    +		var value, key, ret = [],
    +			i = 0,
    +			length = elems.length,
    +			// jquery objects are treated as arrays
    +			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
    +
    +		// Go through the array, translating each of the items to their
    +		if ( isArray ) {
    +			for ( ; i < length; i++ ) {
    +				value = callback( elems[ i ], i, arg );
    +
    +				if ( value != null ) {
    +					ret[ ret.length ] = value;
    +				}
    +			}
    +
    +		// Go through every key on the object,
    +		} else {
    +			for ( key in elems ) {
    +				value = callback( elems[ key ], key, arg );
    +
    +				if ( value != null ) {
    +					ret[ ret.length ] = value;
    +				}
    +			}
    +		}
    +
    +		// Flatten any nested arrays
    +		return ret.concat.apply( [], ret );
    +	},
    +
    +	// A global GUID counter for objects
    +	guid: 1,
    +
    +	// Bind a function to a context, optionally partially applying any
    +	// arguments.
    +	proxy: function( fn, context ) {
    +		if ( typeof context === "string" ) {
    +			var tmp = fn[ context ];
    +			context = fn;
    +			fn = tmp;
    +		}
    +
    +		// Quick check to determine if target is callable, in the spec
    +		// this throws a TypeError, but we will just return undefined.
    +		if ( !jQuery.isFunction( fn ) ) {
    +			return undefined;
    +		}
    +
    +		// Simulated bind
    +		var args = slice.call( arguments, 2 ),
    +			proxy = function() {
    +				return fn.apply( context, args.concat( slice.call( arguments ) ) );
    +			};
    +
    +		// Set the guid of unique handler to the same of original handler, so it can be removed
    +		proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
    +
    +		return proxy;
    +	},
    +
    +	// Mutifunctional method to get and set values to a collection
    +	// The value/s can optionally be executed if it's a function
    +	access: function( elems, key, value, exec, fn, pass ) {
    +		var length = elems.length;
    +
    +		// Setting many attributes
    +		if ( typeof key === "object" ) {
    +			for ( var k in key ) {
    +				jQuery.access( elems, k, key[k], exec, fn, value );
    +			}
    +			return elems;
    +		}
    +
    +		// Setting one attribute
    +		if ( value !== undefined ) {
    +			// Optionally, function values get executed if exec is true
    +			exec = !pass && exec && jQuery.isFunction(value);
    +
    +			for ( var i = 0; i < length; i++ ) {
    +				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
    +			}
    +
    +			return elems;
    +		}
    +
    +		// Getting an attribute
    +		return length ? fn( elems[0], key ) : undefined;
    +	},
    +
    +	now: function() {
    +		return (new Date()).getTime();
    +	},
    +
    +	// Use of jQuery.browser is frowned upon.
    +	// More details: http://docs.jquery.com/Utilities/jQuery.browser
    +	uaMatch: function( ua ) {
    +		ua = ua.toLowerCase();
    +
    +		var match = rwebkit.exec( ua ) ||
    +			ropera.exec( ua ) ||
    +			rmsie.exec( ua ) ||
    +			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
    +			[];
    +
    +		return { browser: match[1] || "", version: match[2] || "0" };
    +	},
    +
    +	sub: function() {
    +		function jQuerySub( selector, context ) {
    +			return new jQuerySub.fn.init( selector, context );
    +		}
    +		jQuery.extend( true, jQuerySub, this );
    +		jQuerySub.superclass = this;
    +		jQuerySub.fn = jQuerySub.prototype = this();
    +		jQuerySub.fn.constructor = jQuerySub;
    +		jQuerySub.sub = this.sub;
    +		jQuerySub.fn.init = function init( selector, context ) {
    +			if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
    +				context = jQuerySub( context );
    +			}
    +
    +			return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
    +		};
    +		jQuerySub.fn.init.prototype = jQuerySub.fn;
    +		var rootjQuerySub = jQuerySub(document);
    +		return jQuerySub;
    +	},
    +
    +	browser: {}
    +});
    +
    +// Populate the class2type map
    +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
    +	class2type[ "[object " + name + "]" ] = name.toLowerCase();
    +});
    +
    +browserMatch = jQuery.uaMatch( userAgent );
    +if ( browserMatch.browser ) {
    +	jQuery.browser[ browserMatch.browser ] = true;
    +	jQuery.browser.version = browserMatch.version;
    +}
    +
    +// Deprecated, use jQuery.browser.webkit instead
    +if ( jQuery.browser.webkit ) {
    +	jQuery.browser.safari = true;
    +}
    +
    +// IE doesn't match non-breaking spaces with \s
    +if ( rnotwhite.test( "\xA0" ) ) {
    +	trimLeft = /^[\s\xA0]+/;
    +	trimRight = /[\s\xA0]+$/;
    +}
    +
    +// All jQuery objects should point back to these
    +rootjQuery = jQuery(document);
    +
    +// Cleanup functions for the document ready method
    +if ( document.addEventListener ) {
    +	DOMContentLoaded = function() {
    +		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
    +		jQuery.ready();
    +	};
    +
    +} else if ( document.attachEvent ) {
    +	DOMContentLoaded = function() {
    +		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
    +		if ( document.readyState === "complete" ) {
    +			document.detachEvent( "onreadystatechange", DOMContentLoaded );
    +			jQuery.ready();
    +		}
    +	};
    +}
    +
    +// The DOM ready check for Internet Explorer
    +function doScrollCheck() {
    +	if ( jQuery.isReady ) {
    +		return;
    +	}
    +
    +	try {
    +		// If IE is used, use the trick by Diego Perini
    +		// http://javascript.nwbox.com/IEContentLoaded/
    +		document.documentElement.doScroll("left");
    +	} catch(e) {
    +		setTimeout( doScrollCheck, 1 );
    +		return;
    +	}
    +
    +	// and execute any waiting functions
    +	jQuery.ready();
    +}
    +
    +return jQuery;
    +
    +})();
    +
    +
    +var // Promise methods
    +	promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
    +	// Static reference to slice
    +	sliceDeferred = [].slice;
    +
    +jQuery.extend({
    +	// Create a simple deferred (one callbacks list)
    +	_Deferred: function() {
    +		var // callbacks list
    +			callbacks = [],
    +			// stored [ context , args ]
    +			fired,
    +			// to avoid firing when already doing so
    +			firing,
    +			// flag to know if the deferred has been cancelled
    +			cancelled,
    +			// the deferred itself
    +			deferred  = {
    +
    +				// done( f1, f2, ...)
    +				done: function() {
    +					if ( !cancelled ) {
    +						var args = arguments,
    +							i,
    +							length,
    +							elem,
    +							type,
    +							_fired;
    +						if ( fired ) {
    +							_fired = fired;
    +							fired = 0;
    +						}
    +						for ( i = 0, length = args.length; i < length; i++ ) {
    +							elem = args[ i ];
    +							type = jQuery.type( elem );
    +							if ( type === "array" ) {
    +								deferred.done.apply( deferred, elem );
    +							} else if ( type === "function" ) {
    +								callbacks.push( elem );
    +							}
    +						}
    +						if ( _fired ) {
    +							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
    +						}
    +					}
    +					return this;
    +				},
    +
    +				// resolve with given context and args
    +				resolveWith: function( context, args ) {
    +					if ( !cancelled && !fired && !firing ) {
    +						// make sure args are available (#8421)
    +						args = args || [];
    +						firing = 1;
    +						try {
    +							while( callbacks[ 0 ] ) {
    +								callbacks.shift().apply( context, args );
    +							}
    +						}
    +						finally {
    +							fired = [ context, args ];
    +							firing = 0;
    +						}
    +					}
    +					return this;
    +				},
    +
    +				// resolve with this as context and given arguments
    +				resolve: function() {
    +					deferred.resolveWith( this, arguments );
    +					return this;
    +				},
    +
    +				// Has this deferred been resolved?
    +				isResolved: function() {
    +					return !!( firing || fired );
    +				},
    +
    +				// Cancel
    +				cancel: function() {
    +					cancelled = 1;
    +					callbacks = [];
    +					return this;
    +				}
    +			};
    +
    +		return deferred;
    +	},
    +
    +	// Full fledged deferred (two callbacks list)
    +	Deferred: function( func ) {
    +		var deferred = jQuery._Deferred(),
    +			failDeferred = jQuery._Deferred(),
    +			promise;
    +		// Add errorDeferred methods, then and promise
    +		jQuery.extend( deferred, {
    +			then: function( doneCallbacks, failCallbacks ) {
    +				deferred.done( doneCallbacks ).fail( failCallbacks );
    +				return this;
    +			},
    +			always: function() {
    +				return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
    +			},
    +			fail: failDeferred.done,
    +			rejectWith: failDeferred.resolveWith,
    +			reject: failDeferred.resolve,
    +			isRejected: failDeferred.isResolved,
    +			pipe: function( fnDone, fnFail ) {
    +				return jQuery.Deferred(function( newDefer ) {
    +					jQuery.each( {
    +						done: [ fnDone, "resolve" ],
    +						fail: [ fnFail, "reject" ]
    +					}, function( handler, data ) {
    +						var fn = data[ 0 ],
    +							action = data[ 1 ],
    +							returned;
    +						if ( jQuery.isFunction( fn ) ) {
    +							deferred[ handler ](function() {
    +								returned = fn.apply( this, arguments );
    +								if ( returned && jQuery.isFunction( returned.promise ) ) {
    +									returned.promise().then( newDefer.resolve, newDefer.reject );
    +								} else {
    +									newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
    +								}
    +							});
    +						} else {
    +							deferred[ handler ]( newDefer[ action ] );
    +						}
    +					});
    +				}).promise();
    +			},
    +			// Get a promise for this deferred
    +			// If obj is provided, the promise aspect is added to the object
    +			promise: function( obj ) {
    +				if ( obj == null ) {
    +					if ( promise ) {
    +						return promise;
    +					}
    +					promise = obj = {};
    +				}
    +				var i = promiseMethods.length;
    +				while( i-- ) {
    +					obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
    +				}
    +				return obj;
    +			}
    +		});
    +		// Make sure only one callback list will be used
    +		deferred.done( failDeferred.cancel ).fail( deferred.cancel );
    +		// Unexpose cancel
    +		delete deferred.cancel;
    +		// Call given func if any
    +		if ( func ) {
    +			func.call( deferred, deferred );
    +		}
    +		return deferred;
    +	},
    +
    +	// Deferred helper
    +	when: function( firstParam ) {
    +		var args = arguments,
    +			i = 0,
    +			length = args.length,
    +			count = length,
    +			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
    +				firstParam :
    +				jQuery.Deferred();
    +		function resolveFunc( i ) {
    +			return function( value ) {
    +				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
    +				if ( !( --count ) ) {
    +					// Strange bug in FF4:
    +					// Values changed onto the arguments object sometimes end up as undefined values
    +					// outside the $.when method. Cloning the object into a fresh array solves the issue
    +					deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
    +				}
    +			};
    +		}
    +		if ( length > 1 ) {
    +			for( ; i < length; i++ ) {
    +				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
    +					args[ i ].promise().then( resolveFunc(i), deferred.reject );
    +				} else {
    +					--count;
    +				}
    +			}
    +			if ( !count ) {
    +				deferred.resolveWith( deferred, args );
    +			}
    +		} else if ( deferred !== firstParam ) {
    +			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
    +		}
    +		return deferred.promise();
    +	}
    +});
    +
    +
    +
    +jQuery.support = (function() {
    +
    +	var div = document.createElement( "div" ),
    +		documentElement = document.documentElement,
    +		all,
    +		a,
    +		select,
    +		opt,
    +		input,
    +		marginDiv,
    +		support,
    +		fragment,
    +		body,
    +		testElementParent,
    +		testElement,
    +		testElementStyle,
    +		tds,
    +		events,
    +		eventName,
    +		i,
    +		isSupported;
    +
    +	// Preliminary tests
    +	div.setAttribute("className", "t");
    +	div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
    +
    +
    +	all = div.getElementsByTagName( "*" );
    +	a = div.getElementsByTagName( "a" )[ 0 ];
    +
    +	// Can't get basic test support
    +	if ( !all || !all.length || !a ) {
    +		return {};
    +	}
    +
    +	// First batch of supports tests
    +	select = document.createElement( "select" );
    +	opt = select.appendChild( document.createElement("option") );
    +	input = div.getElementsByTagName( "input" )[ 0 ];
    +
    +	support = {
    +		// IE strips leading whitespace when .innerHTML is used
    +		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
    +
    +		// Make sure that tbody elements aren't automatically inserted
    +		// IE will insert them into empty tables
    +		tbody: !div.getElementsByTagName( "tbody" ).length,
    +
    +		// Make sure that link elements get serialized correctly by innerHTML
    +		// This requires a wrapper element in IE
    +		htmlSerialize: !!div.getElementsByTagName( "link" ).length,
    +
    +		// Get the style information from getAttribute
    +		// (IE uses .cssText instead)
    +		style: /top/.test( a.getAttribute("style") ),
    +
    +		// Make sure that URLs aren't manipulated
    +		// (IE normalizes it by default)
    +		hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
    +
    +		// Make sure that element opacity exists
    +		// (IE uses filter instead)
    +		// Use a regex to work around a WebKit issue. See #5145
    +		opacity: /^0.55$/.test( a.style.opacity ),
    +
    +		// Verify style float existence
    +		// (IE uses styleFloat instead of cssFloat)
    +		cssFloat: !!a.style.cssFloat,
    +
    +		// Make sure that if no value is specified for a checkbox
    +		// that it defaults to "on".
    +		// (WebKit defaults to "" instead)
    +		checkOn: ( input.value === "on" ),
    +
    +		// Make sure that a selected-by-default option has a working selected property.
    +		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
    +		optSelected: opt.selected,
    +
    +		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
    +		getSetAttribute: div.className !== "t",
    +
    +		// Will be defined later
    +		submitBubbles: true,
    +		changeBubbles: true,
    +		focusinBubbles: false,
    +		deleteExpando: true,
    +		noCloneEvent: true,
    +		inlineBlockNeedsLayout: false,
    +		shrinkWrapBlocks: false,
    +		reliableMarginRight: true
    +	};
    +
    +	// Make sure checked status is properly cloned
    +	input.checked = true;
    +	support.noCloneChecked = input.cloneNode( true ).checked;
    +
    +	// Make sure that the options inside disabled selects aren't marked as disabled
    +	// (WebKit marks them as disabled)
    +	select.disabled = true;
    +	support.optDisabled = !opt.disabled;
    +
    +	// Test to see if it's possible to delete an expando from an element
    +	// Fails in Internet Explorer
    +	try {
    +		delete div.test;
    +	} catch( e ) {
    +		support.deleteExpando = false;
    +	}
    +
    +	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
    +		div.attachEvent( "onclick", function() {
    +			// Cloning a node shouldn't copy over any
    +			// bound event handlers (IE does this)
    +			support.noCloneEvent = false;
    +		});
    +		div.cloneNode( true ).fireEvent( "onclick" );
    +	}
    +
    +	// Check if a radio maintains it's value
    +	// after being appended to the DOM
    +	input = document.createElement("input");
    +	input.value = "t";
    +	input.setAttribute("type", "radio");
    +	support.radioValue = input.value === "t";
    +
    +	input.setAttribute("checked", "checked");
    +	div.appendChild( input );
    +	fragment = document.createDocumentFragment();
    +	fragment.appendChild( div.firstChild );
    +
    +	// WebKit doesn't clone checked state correctly in fragments
    +	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
    +
    +	div.innerHTML = "";
    +
    +	// Figure out if the W3C box model works as expected
    +	div.style.width = div.style.paddingLeft = "1px";
    +
    +	body = document.getElementsByTagName( "body" )[ 0 ];
    +	// We use our own, invisible, body unless the body is already present
    +	// in which case we use a div (#9239)
    +	testElement = document.createElement( body ? "div" : "body" );
    +	testElementStyle = {
    +		visibility: "hidden",
    +		width: 0,
    +		height: 0,
    +		border: 0,
    +		margin: 0,
    +		background: "none"
    +	};
    +	if ( body ) {
    +		jQuery.extend( testElementStyle, {
    +			position: "absolute",
    +			left: "-1000px",
    +			top: "-1000px"
    +		});
    +	}
    +	for ( i in testElementStyle ) {
    +		testElement.style[ i ] = testElementStyle[ i ];
    +	}
    +	testElement.appendChild( div );
    +	testElementParent = body || documentElement;
    +	testElementParent.insertBefore( testElement, testElementParent.firstChild );
    +
    +	// Check if a disconnected checkbox will retain its checked
    +	// value of true after appended to the DOM (IE6/7)
    +	support.appendChecked = input.checked;
    +
    +	support.boxModel = div.offsetWidth === 2;
    +
    +	if ( "zoom" in div.style ) {
    +		// Check if natively block-level elements act like inline-block
    +		// elements when setting their display to 'inline' and giving
    +		// them layout
    +		// (IE < 8 does this)
    +		div.style.display = "inline";
    +		div.style.zoom = 1;
    +		support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
    +
    +		// Check if elements with layout shrink-wrap their children
    +		// (IE 6 does this)
    +		div.style.display = "";
    +		div.innerHTML = "<div style='width:4px;'></div>";
    +		support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
    +	}
    +
    +	div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
    +	tds = div.getElementsByTagName( "td" );
    +
    +	// Check if table cells still have offsetWidth/Height when they are set
    +	// to display:none and there are still other visible table cells in a
    +	// table row; if so, offsetWidth/Height are not reliable for use when
    +	// determining if an element has been hidden directly using
    +	// display:none (it is still safe to use offsets if a parent element is
    +	// hidden; don safety goggles and see bug #4512 for more information).
    +	// (only IE 8 fails this test)
    +	isSupported = ( tds[ 0 ].offsetHeight === 0 );
    +
    +	tds[ 0 ].style.display = "";
    +	tds[ 1 ].style.display = "none";
    +
    +	// Check if empty table cells still have offsetWidth/Height
    +	// (IE < 8 fail this test)
    +	support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
    +	div.innerHTML = "";
    +
    +	// Check if div with explicit width and no margin-right incorrectly
    +	// gets computed margin-right based on width of container. For more
    +	// info see bug #3333
    +	// Fails in WebKit before Feb 2011 nightlies
    +	// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
    +	if ( document.defaultView && document.defaultView.getComputedStyle ) {
    +		marginDiv = document.createElement( "div" );
    +		marginDiv.style.width = "0";
    +		marginDiv.style.marginRight = "0";
    +		div.appendChild( marginDiv );
    +		support.reliableMarginRight =
    +			( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
    +	}
    +
    +	// Remove the body element we added
    +	testElement.innerHTML = "";
    +	testElementParent.removeChild( testElement );
    +
    +	// Technique from Juriy Zaytsev
    +	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
    +	// We only care about the case where non-standard event systems
    +	// are used, namely in IE. Short-circuiting here helps us to
    +	// avoid an eval call (in setAttribute) which can cause CSP
    +	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
    +	if ( div.attachEvent ) {
    +		for( i in {
    +			submit: 1,
    +			change: 1,
    +			focusin: 1
    +		} ) {
    +			eventName = "on" + i;
    +			isSupported = ( eventName in div );
    +			if ( !isSupported ) {
    +				div.setAttribute( eventName, "return;" );
    +				isSupported = ( typeof div[ eventName ] === "function" );
    +			}
    +			support[ i + "Bubbles" ] = isSupported;
    +		}
    +	}
    +
    +	// Null connected elements to avoid leaks in IE
    +	testElement = fragment = select = opt = body = marginDiv = div = input = null;
    +
    +	return support;
    +})();
    +
    +// Keep track of boxModel
    +jQuery.boxModel = jQuery.support.boxModel;
    +
    +
    +
    +
    +var rbrace = /^(?:\{.*\}|\[.*\])$/,
    +	rmultiDash = /([A-Z])/g;
    +
    +jQuery.extend({
    +	cache: {},
    +
    +	// Please use with caution
    +	uuid: 0,
    +
    +	// Unique for each copy of jQuery on the page
    +	// Non-digits removed to match rinlinejQuery
    +	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
    +
    +	// The following elements throw uncatchable exceptions if you
    +	// attempt to add expando properties to them.
    +	noData: {
    +		"embed": true,
    +		// Ban all objects except for Flash (which handle expandos)
    +		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
    +		"applet": true
    +	},
    +
    +	hasData: function( elem ) {
    +		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
    +
    +		return !!elem && !isEmptyDataObject( elem );
    +	},
    +
    +	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
    +		if ( !jQuery.acceptData( elem ) ) {
    +			return;
    +		}
    +
    +		var thisCache, ret,
    +			internalKey = jQuery.expando,
    +			getByName = typeof name === "string",
    +
    +			// We have to handle DOM nodes and JS objects differently because IE6-7
    +			// can't GC object references properly across the DOM-JS boundary
    +			isNode = elem.nodeType,
    +
    +			// Only DOM nodes need the global jQuery cache; JS object data is
    +			// attached directly to the object so GC can occur automatically
    +			cache = isNode ? jQuery.cache : elem,
    +
    +			// Only defining an ID for JS objects if its cache already exists allows
    +			// the code to shortcut on the same path as a DOM node with no cache
    +			id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
    +
    +		// Avoid doing any more work than we need to when trying to get data on an
    +		// object that has no data at all
    +		if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
    +			return;
    +		}
    +
    +		if ( !id ) {
    +			// Only DOM nodes need a new unique ID for each element since their data
    +			// ends up in the global cache
    +			if ( isNode ) {
    +				elem[ jQuery.expando ] = id = ++jQuery.uuid;
    +			} else {
    +				id = jQuery.expando;
    +			}
    +		}
    +
    +		if ( !cache[ id ] ) {
    +			cache[ id ] = {};
    +
    +			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
    +			// metadata on plain JS objects when the object is serialized using
    +			// JSON.stringify
    +			if ( !isNode ) {
    +				cache[ id ].toJSON = jQuery.noop;
    +			}
    +		}
    +
    +		// An object can be passed to jQuery.data instead of a key/value pair; this gets
    +		// shallow copied over onto the existing cache
    +		if ( typeof name === "object" || typeof name === "function" ) {
    +			if ( pvt ) {
    +				cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
    +			} else {
    +				cache[ id ] = jQuery.extend(cache[ id ], name);
    +			}
    +		}
    +
    +		thisCache = cache[ id ];
    +
    +		// Internal jQuery data is stored in a separate object inside the object's data
    +		// cache in order to avoid key collisions between internal data and user-defined
    +		// data
    +		if ( pvt ) {
    +			if ( !thisCache[ internalKey ] ) {
    +				thisCache[ internalKey ] = {};
    +			}
    +
    +			thisCache = thisCache[ internalKey ];
    +		}
    +
    +		if ( data !== undefined ) {
    +			thisCache[ jQuery.camelCase( name ) ] = data;
    +		}
    +
    +		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
    +		// not attempt to inspect the internal events object using jQuery.data, as this
    +		// internal data object is undocumented and subject to change.
    +		if ( name === "events" && !thisCache[name] ) {
    +			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
    +		}
    +
    +		// Check for both converted-to-camel and non-converted data property names
    +		// If a data property was specified
    +		if ( getByName ) {
    +
    +			// First Try to find as-is property data
    +			ret = thisCache[ name ];
    +
    +			// Test for null|undefined property data
    +			if ( ret == null ) {
    +
    +				// Try to find the camelCased property
    +				ret = thisCache[ jQuery.camelCase( name ) ];
    +			}
    +		} else {
    +			ret = thisCache;
    +		}
    +
    +		return ret;
    +	},
    +
    +	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
    +		if ( !jQuery.acceptData( elem ) ) {
    +			return;
    +		}
    +
    +		var thisCache,
    +
    +			// Reference to internal data cache key
    +			internalKey = jQuery.expando,
    +
    +			isNode = elem.nodeType,
    +
    +			// See jQuery.data for more information
    +			cache = isNode ? jQuery.cache : elem,
    +
    +			// See jQuery.data for more information
    +			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
    +
    +		// If there is already no cache entry for this object, there is no
    +		// purpose in continuing
    +		if ( !cache[ id ] ) {
    +			return;
    +		}
    +
    +		if ( name ) {
    +
    +			thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
    +
    +			if ( thisCache ) {
    +
    +				// Support interoperable removal of hyphenated or camelcased keys
    +				if ( !thisCache[ name ] ) {
    +					name = jQuery.camelCase( name );
    +				}
    +
    +				delete thisCache[ name ];
    +
    +				// If there is no data left in the cache, we want to continue
    +				// and let the cache object itself get destroyed
    +				if ( !isEmptyDataObject(thisCache) ) {
    +					return;
    +				}
    +			}
    +		}
    +
    +		// See jQuery.data for more information
    +		if ( pvt ) {
    +			delete cache[ id ][ internalKey ];
    +
    +			// Don't destroy the parent cache unless the internal data object
    +			// had been the only thing left in it
    +			if ( !isEmptyDataObject(cache[ id ]) ) {
    +				return;
    +			}
    +		}
    +
    +		var internalCache = cache[ id ][ internalKey ];
    +
    +		// Browsers that fail expando deletion also refuse to delete expandos on
    +		// the window, but it will allow it on all other JS objects; other browsers
    +		// don't care
    +		// Ensure that `cache` is not a window object #10080
    +		if ( jQuery.support.deleteExpando || !cache.setInterval ) {
    +			delete cache[ id ];
    +		} else {
    +			cache[ id ] = null;
    +		}
    +
    +		// We destroyed the entire user cache at once because it's faster than
    +		// iterating through each key, but we need to continue to persist internal
    +		// data if it existed
    +		if ( internalCache ) {
    +			cache[ id ] = {};
    +			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
    +			// metadata on plain JS objects when the object is serialized using
    +			// JSON.stringify
    +			if ( !isNode ) {
    +				cache[ id ].toJSON = jQuery.noop;
    +			}
    +
    +			cache[ id ][ internalKey ] = internalCache;
    +
    +		// Otherwise, we need to eliminate the expando on the node to avoid
    +		// false lookups in the cache for entries that no longer exist
    +		} else if ( isNode ) {
    +			// IE does not allow us to delete expando properties from nodes,
    +			// nor does it have a removeAttribute function on Document nodes;
    +			// we must handle all of these cases
    +			if ( jQuery.support.deleteExpando ) {
    +				delete elem[ jQuery.expando ];
    +			} else if ( elem.removeAttribute ) {
    +				elem.removeAttribute( jQuery.expando );
    +			} else {
    +				elem[ jQuery.expando ] = null;
    +			}
    +		}
    +	},
    +
    +	// For internal use only.
    +	_data: function( elem, name, data ) {
    +		return jQuery.data( elem, name, data, true );
    +	},
    +
    +	// A method for determining if a DOM node can handle the data expando
    +	acceptData: function( elem ) {
    +		if ( elem.nodeName ) {
    +			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
    +
    +			if ( match ) {
    +				return !(match === true || elem.getAttribute("classid") !== match);
    +			}
    +		}
    +
    +		return true;
    +	}
    +});
    +
    +jQuery.fn.extend({
    +	data: function( key, value ) {
    +		var data = null;
    +
    +		if ( typeof key === "undefined" ) {
    +			if ( this.length ) {
    +				data = jQuery.data( this[0] );
    +
    +				if ( this[0].nodeType === 1 ) {
    +			    var attr = this[0].attributes, name;
    +					for ( var i = 0, l = attr.length; i < l; i++ ) {
    +						name = attr[i].name;
    +
    +						if ( name.indexOf( "data-" ) === 0 ) {
    +							name = jQuery.camelCase( name.substring(5) );
    +
    +							dataAttr( this[0], name, data[ name ] );
    +						}
    +					}
    +				}
    +			}
    +
    +			return data;
    +
    +		} else if ( typeof key === "object" ) {
    +			return this.each(function() {
    +				jQuery.data( this, key );
    +			});
    +		}
    +
    +		var parts = key.split(".");
    +		parts[1] = parts[1] ? "." + parts[1] : "";
    +
    +		if ( value === undefined ) {
    +			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
    +
    +			// Try to fetch any internally stored data first
    +			if ( data === undefined && this.length ) {
    +				data = jQuery.data( this[0], key );
    +				data = dataAttr( this[0], key, data );
    +			}
    +
    +			return data === undefined && parts[1] ?
    +				this.data( parts[0] ) :
    +				data;
    +
    +		} else {
    +			return this.each(function() {
    +				var $this = jQuery( this ),
    +					args = [ parts[0], value ];
    +
    +				$this.triggerHandler( "setData" + parts[1] + "!", args );
    +				jQuery.data( this, key, value );
    +				$this.triggerHandler( "changeData" + parts[1] + "!", args );
    +			});
    +		}
    +	},
    +
    +	removeData: function( key ) {
    +		return this.each(function() {
    +			jQuery.removeData( this, key );
    +		});
    +	}
    +});
    +
    +function dataAttr( elem, key, data ) {
    +	// If nothing was found internally, try to fetch any
    +	// data from the HTML5 data-* attribute
    +	if ( data === undefined && elem.nodeType === 1 ) {
    +
    +		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
    +
    +		data = elem.getAttribute( name );
    +
    +		if ( typeof data === "string" ) {
    +			try {
    +				data = data === "true" ? true :
    +				data === "false" ? false :
    +				data === "null" ? null :
    +				!jQuery.isNaN( data ) ? parseFloat( data ) :
    +					rbrace.test( data ) ? jQuery.parseJSON( data ) :
    +					data;
    +			} catch( e ) {}
    +
    +			// Make sure we set the data so it isn't changed later
    +			jQuery.data( elem, key, data );
    +
    +		} else {
    +			data = undefined;
    +		}
    +	}
    +
    +	return data;
    +}
    +
    +// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
    +// property to be considered empty objects; this property always exists in
    +// order to make sure JSON.stringify does not expose internal metadata
    +function isEmptyDataObject( obj ) {
    +	for ( var name in obj ) {
    +		if ( name !== "toJSON" ) {
    +			return false;
    +		}
    +	}
    +
    +	return true;
    +}
    +
    +
    +
    +
    +function handleQueueMarkDefer( elem, type, src ) {
    +	var deferDataKey = type + "defer",
    +		queueDataKey = type + "queue",
    +		markDataKey = type + "mark",
    +		defer = jQuery.data( elem, deferDataKey, undefined, true );
    +	if ( defer &&
    +		( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
    +		( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
    +		// Give room for hard-coded callbacks to fire first
    +		// and eventually mark/queue something else on the element
    +		setTimeout( function() {
    +			if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
    +				!jQuery.data( elem, markDataKey, undefined, true ) ) {
    +				jQuery.removeData( elem, deferDataKey, true );
    +				defer.resolve();
    +			}
    +		}, 0 );
    +	}
    +}
    +
    +jQuery.extend({
    +
    +	_mark: function( elem, type ) {
    +		if ( elem ) {
    +			type = (type || "fx") + "mark";
    +			jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
    +		}
    +	},
    +
    +	_unmark: function( force, elem, type ) {
    +		if ( force !== true ) {
    +			type = elem;
    +			elem = force;
    +			force = false;
    +		}
    +		if ( elem ) {
    +			type = type || "fx";
    +			var key = type + "mark",
    +				count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
    +			if ( count ) {
    +				jQuery.data( elem, key, count, true );
    +			} else {
    +				jQuery.removeData( elem, key, true );
    +				handleQueueMarkDefer( elem, type, "mark" );
    +			}
    +		}
    +	},
    +
    +	queue: function( elem, type, data ) {
    +		if ( elem ) {
    +			type = (type || "fx") + "queue";
    +			var q = jQuery.data( elem, type, undefined, true );
    +			// Speed up dequeue by getting out quickly if this is just a lookup
    +			if ( data ) {
    +				if ( !q || jQuery.isArray(data) ) {
    +					q = jQuery.data( elem, type, jQuery.makeArray(data), true );
    +				} else {
    +					q.push( data );
    +				}
    +			}
    +			return q || [];
    +		}
    +	},
    +
    +	dequeue: function( elem, type ) {
    +		type = type || "fx";
    +
    +		var queue = jQuery.queue( elem, type ),
    +			fn = queue.shift(),
    +			defer;
    +
    +		// If the fx queue is dequeued, always remove the progress sentinel
    +		if ( fn === "inprogress" ) {
    +			fn = queue.shift();
    +		}
    +
    +		if ( fn ) {
    +			// Add a progress sentinel to prevent the fx queue from being
    +			// automatically dequeued
    +			if ( type === "fx" ) {
    +				queue.unshift("inprogress");
    +			}
    +
    +			fn.call(elem, function() {
    +				jQuery.dequeue(elem, type);
    +			});
    +		}
    +
    +		if ( !queue.length ) {
    +			jQuery.removeData( elem, type + "queue", true );
    +			handleQueueMarkDefer( elem, type, "queue" );
    +		}
    +	}
    +});
    +
    +jQuery.fn.extend({
    +	queue: function( type, data ) {
    +		if ( typeof type !== "string" ) {
    +			data = type;
    +			type = "fx";
    +		}
    +
    +		if ( data === undefined ) {
    +			return jQuery.queue( this[0], type );
    +		}
    +		return this.each(function() {
    +			var queue = jQuery.queue( this, type, data );
    +
    +			if ( type === "fx" && queue[0] !== "inprogress" ) {
    +				jQuery.dequeue( this, type );
    +			}
    +		});
    +	},
    +	dequeue: function( type ) {
    +		return this.each(function() {
    +			jQuery.dequeue( this, type );
    +		});
    +	},
    +	// Based off of the plugin by Clint Helfers, with permission.
    +	// http://blindsignals.com/index.php/2009/07/jquery-delay/
    +	delay: function( time, type ) {
    +		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
    +		type = type || "fx";
    +
    +		return this.queue( type, function() {
    +			var elem = this;
    +			setTimeout(function() {
    +				jQuery.dequeue( elem, type );
    +			}, time );
    +		});
    +	},
    +	clearQueue: function( type ) {
    +		return this.queue( type || "fx", [] );
    +	},
    +	// Get a promise resolved when queues of a certain type
    +	// are emptied (fx is the type by default)
    +	promise: function( type, object ) {
    +		if ( typeof type !== "string" ) {
    +			object = type;
    +			type = undefined;
    +		}
    +		type = type || "fx";
    +		var defer = jQuery.Deferred(),
    +			elements = this,
    +			i = elements.length,
    +			count = 1,
    +			deferDataKey = type + "defer",
    +			queueDataKey = type + "queue",
    +			markDataKey = type + "mark",
    +			tmp;
    +		function resolve() {
    +			if ( !( --count ) ) {
    +				defer.resolveWith( elements, [ elements ] );
    +			}
    +		}
    +		while( i-- ) {
    +			if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
    +					( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
    +						jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
    +					jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
    +				count++;
    +				tmp.done( resolve );
    +			}
    +		}
    +		resolve();
    +		return defer.promise();
    +	}
    +});
    +
    +
    +
    +
    +var rclass = /[\n\t\r]/g,
    +	rspace = /\s+/,
    +	rreturn = /\r/g,
    +	rtype = /^(?:button|input)$/i,
    +	rfocusable = /^(?:button|input|object|select|textarea)$/i,
    +	rclickable = /^a(?:rea)?$/i,
    +	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
    +	nodeHook, boolHook;
    +
    +jQuery.fn.extend({
    +	attr: function( name, value ) {
    +		return jQuery.access( this, name, value, true, jQuery.attr );
    +	},
    +
    +	removeAttr: function( name ) {
    +		return this.each(function() {
    +			jQuery.removeAttr( this, name );
    +		});
    +	},
    +	
    +	prop: function( name, value ) {
    +		return jQuery.access( this, name, value, true, jQuery.prop );
    +	},
    +	
    +	removeProp: function( name ) {
    +		name = jQuery.propFix[ name ] || name;
    +		return this.each(function() {
    +			// try/catch handles cases where IE balks (such as removing a property on window)
    +			try {
    +				this[ name ] = undefined;
    +				delete this[ name ];
    +			} catch( e ) {}
    +		});
    +	},
    +
    +	addClass: function( value ) {
    +		var classNames, i, l, elem,
    +			setClass, c, cl;
    +
    +		if ( jQuery.isFunction( value ) ) {
    +			return this.each(function( j ) {
    +				jQuery( this ).addClass( value.call(this, j, this.className) );
    +			});
    +		}
    +
    +		if ( value && typeof value === "string" ) {
    +			classNames = value.split( rspace );
    +
    +			for ( i = 0, l = this.length; i < l; i++ ) {
    +				elem = this[ i ];
    +
    +				if ( elem.nodeType === 1 ) {
    +					if ( !elem.className && classNames.length === 1 ) {
    +						elem.className = value;
    +
    +					} else {
    +						setClass = " " + elem.className + " ";
    +
    +						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
    +							if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
    +								setClass += classNames[ c ] + " ";
    +							}
    +						}
    +						elem.className = jQuery.trim( setClass );
    +					}
    +				}
    +			}
    +		}
    +
    +		return this;
    +	},
    +
    +	removeClass: function( value ) {
    +		var classNames, i, l, elem, className, c, cl;
    +
    +		if ( jQuery.isFunction( value ) ) {
    +			return this.each(function( j ) {
    +				jQuery( this ).removeClass( value.call(this, j, this.className) );
    +			});
    +		}
    +
    +		if ( (value && typeof value === "string") || value === undefined ) {
    +			classNames = (value || "").split( rspace );
    +
    +			for ( i = 0, l = this.length; i < l; i++ ) {
    +				elem = this[ i ];
    +
    +				if ( elem.nodeType === 1 && elem.className ) {
    +					if ( value ) {
    +						className = (" " + elem.className + " ").replace( rclass, " " );
    +						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
    +							className = className.replace(" " + classNames[ c ] + " ", " ");
    +						}
    +						elem.className = jQuery.trim( className );
    +
    +					} else {
    +						elem.className = "";
    +					}
    +				}
    +			}
    +		}
    +
    +		return this;
    +	},
    +
    +	toggleClass: function( value, stateVal ) {
    +		var type = typeof value,
    +			isBool = typeof stateVal === "boolean";
    +
    +		if ( jQuery.isFunction( value ) ) {
    +			return this.each(function( i ) {
    +				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
    +			});
    +		}
    +
    +		return this.each(function() {
    +			if ( type === "string" ) {
    +				// toggle individual class names
    +				var className,
    +					i = 0,
    +					self = jQuery( this ),
    +					state = stateVal,
    +					classNames = value.split( rspace );
    +
    +				while ( (className = classNames[ i++ ]) ) {
    +					// check each className given, space seperated list
    +					state = isBool ? state : !self.hasClass( className );
    +					self[ state ? "addClass" : "removeClass" ]( className );
    +				}
    +
    +			} else if ( type === "undefined" || type === "boolean" ) {
    +				if ( this.className ) {
    +					// store className if set
    +					jQuery._data( this, "__className__", this.className );
    +				}
    +
    +				// toggle whole className
    +				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
    +			}
    +		});
    +	},
    +
    +	hasClass: function( selector ) {
    +		var className = " " + selector + " ";
    +		for ( var i = 0, l = this.length; i < l; i++ ) {
    +			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
    +				return true;
    +			}
    +		}
    +
    +		return false;
    +	},
    +
    +	val: function( value ) {
    +		var hooks, ret,
    +			elem = this[0];
    +		
    +		if ( !arguments.length ) {
    +			if ( elem ) {
    +				hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
    +
    +				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
    +					return ret;
    +				}
    +
    +				ret = elem.value;
    +
    +				return typeof ret === "string" ? 
    +					// handle most common string cases
    +					ret.replace(rreturn, "") : 
    +					// handle cases where value is null/undef or number
    +					ret == null ? "" : ret;
    +			}
    +
    +			return undefined;
    +		}
    +
    +		var isFunction = jQuery.isFunction( value );
    +
    +		return this.each(function( i ) {
    +			var self = jQuery(this), val;
    +
    +			if ( this.nodeType !== 1 ) {
    +				return;
    +			}
    +
    +			if ( isFunction ) {
    +				val = value.call( this, i, self.val() );
    +			} else {
    +				val = value;
    +			}
    +
    +			// Treat null/undefined as ""; convert numbers to string
    +			if ( val == null ) {
    +				val = "";
    +			} else if ( typeof val === "number" ) {
    +				val += "";
    +			} else if ( jQuery.isArray( val ) ) {
    +				val = jQuery.map(val, function ( value ) {
    +					return value == null ? "" : value + "";
    +				});
    +			}
    +
    +			hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
    +
    +			// If set returns undefined, fall back to normal setting
    +			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
    +				this.value = val;
    +			}
    +		});
    +	}
    +});
    +
    +jQuery.extend({
    +	valHooks: {
    +		option: {
    +			get: function( elem ) {
    +				// attributes.value is undefined in Blackberry 4.7 but
    +				// uses .value. See #6932
    +				var val = elem.attributes.value;
    +				return !val || val.specified ? elem.value : elem.text;
    +			}
    +		},
    +		select: {
    +			get: function( elem ) {
    +				var value,
    +					index = elem.selectedIndex,
    +					values = [],
    +					options = elem.options,
    +					one = elem.type === "select-one";
    +
    +				// Nothing was selected
    +				if ( index < 0 ) {
    +					return null;
    +				}
    +
    +				// Loop through all the selected options
    +				for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
    +					var option = options[ i ];
    +
    +					// Don't return options that are disabled or in a disabled optgroup
    +					if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
    +							(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
    +
    +						// Get the specific value for the option
    +						value = jQuery( option ).val();
    +
    +						// We don't need an array for one selects
    +						if ( one ) {
    +							return value;
    +						}
    +
    +						// Multi-Selects return an array
    +						values.push( value );
    +					}
    +				}
    +
    +				// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
    +				if ( one && !values.length && options.length ) {
    +					return jQuery( options[ index ] ).val();
    +				}
    +
    +				return values;
    +			},
    +
    +			set: function( elem, value ) {
    +				var values = jQuery.makeArray( value );
    +
    +				jQuery(elem).find("option").each(function() {
    +					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
    +				});
    +
    +				if ( !values.length ) {
    +					elem.selectedIndex = -1;
    +				}
    +				return values;
    +			}
    +		}
    +	},
    +
    +	attrFn: {
    +		val: true,
    +		css: true,
    +		html: true,
    +		text: true,
    +		data: true,
    +		width: true,
    +		height: true,
    +		offset: true
    +	},
    +	
    +	attrFix: {
    +		// Always normalize to ensure hook usage
    +		tabindex: "tabIndex"
    +	},
    +	
    +	attr: function( elem, name, value, pass ) {
    +		var nType = elem.nodeType;
    +		
    +		// don't get/set attributes on text, comment and attribute nodes
    +		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
    +			return undefined;
    +		}
    +
    +		if ( pass && name in jQuery.attrFn ) {
    +			return jQuery( elem )[ name ]( value );
    +		}
    +
    +		// Fallback to prop when attributes are not supported
    +		if ( !("getAttribute" in elem) ) {
    +			return jQuery.prop( elem, name, value );
    +		}
    +
    +		var ret, hooks,
    +			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
    +
    +		// Normalize the name if needed
    +		if ( notxml ) {
    +			name = jQuery.attrFix[ name ] || name;
    +
    +			hooks = jQuery.attrHooks[ name ];
    +
    +			if ( !hooks ) {
    +				// Use boolHook for boolean attributes
    +				if ( rboolean.test( name ) ) {
    +					hooks = boolHook;
    +
    +				// Use nodeHook if available( IE6/7 )
    +				} else if ( nodeHook ) {
    +					hooks = nodeHook;
    +				}
    +			}
    +		}
    +
    +		if ( value !== undefined ) {
    +
    +			if ( value === null ) {
    +				jQuery.removeAttr( elem, name );
    +				return undefined;
    +
    +			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
    +				return ret;
    +
    +			} else {
    +				elem.setAttribute( name, "" + value );
    +				return value;
    +			}
    +
    +		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
    +			return ret;
    +
    +		} else {
    +
    +			ret = elem.getAttribute( name );
    +
    +			// Non-existent attributes return null, we normalize to undefined
    +			return ret === null ?
    +				undefined :
    +				ret;
    +		}
    +	},
    +
    +	removeAttr: function( elem, name ) {
    +		var propName;
    +		if ( elem.nodeType === 1 ) {
    +			name = jQuery.attrFix[ name ] || name;
    +
    +			jQuery.attr( elem, name, "" );
    +			elem.removeAttribute( name );
    +
    +			// Set corresponding property to false for boolean attributes
    +			if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
    +				elem[ propName ] = false;
    +			}
    +		}
    +	},
    +
    +	attrHooks: {
    +		type: {
    +			set: function( elem, value ) {
    +				// We can't allow the type property to be changed (since it causes problems in IE)
    +				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
    +					jQuery.error( "type property can't be changed" );
    +				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
    +					// Setting the type on a radio button after the value resets the value in IE6-9
    +					// Reset value to it's default in case type is set after value
    +					// This is for element creation
    +					var val = elem.value;
    +					elem.setAttribute( "type", value );
    +					if ( val ) {
    +						elem.value = val;
    +					}
    +					return value;
    +				}
    +			}
    +		},
    +		// Use the value property for back compat
    +		// Use the nodeHook for button elements in IE6/7 (#1954)
    +		value: {
    +			get: function( elem, name ) {
    +				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
    +					return nodeHook.get( elem, name );
    +				}
    +				return name in elem ?
    +					elem.value :
    +					null;
    +			},
    +			set: function( elem, value, name ) {
    +				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
    +					return nodeHook.set( elem, value, name );
    +				}
    +				// Does not return so that setAttribute is also used
    +				elem.value = value;
    +			}
    +		}
    +	},
    +
    +	propFix: {
    +		tabindex: "tabIndex",
    +		readonly: "readOnly",
    +		"for": "htmlFor",
    +		"class": "className",
    +		maxlength: "maxLength",
    +		cellspacing: "cellSpacing",
    +		cellpadding: "cellPadding",
    +		rowspan: "rowSpan",
    +		colspan: "colSpan",
    +		usemap: "useMap",
    +		frameborder: "frameBorder",
    +		contenteditable: "contentEditable"
    +	},
    +	
    +	prop: function( elem, name, value ) {
    +		var nType = elem.nodeType;
    +
    +		// don't get/set properties on text, comment and attribute nodes
    +		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
    +			return undefined;
    +		}
    +
    +		var ret, hooks,
    +			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
    +
    +		if ( notxml ) {
    +			// Fix name and attach hooks
    +			name = jQuery.propFix[ name ] || name;
    +			hooks = jQuery.propHooks[ name ];
    +		}
    +
    +		if ( value !== undefined ) {
    +			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
    +				return ret;
    +
    +			} else {
    +				return (elem[ name ] = value);
    +			}
    +
    +		} else {
    +			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
    +				return ret;
    +
    +			} else {
    +				return elem[ name ];
    +			}
    +		}
    +	},
    +	
    +	propHooks: {
    +		tabIndex: {
    +			get: function( elem ) {
    +				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
    +				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
    +				var attributeNode = elem.getAttributeNode("tabindex");
    +
    +				return attributeNode && attributeNode.specified ?
    +					parseInt( attributeNode.value, 10 ) :
    +					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
    +						0 :
    +						undefined;
    +			}
    +		}
    +	}
    +});
    +
    +// Add the tabindex propHook to attrHooks for back-compat
    +jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
    +
    +// Hook for boolean attributes
    +boolHook = {
    +	get: function( elem, name ) {
    +		// Align boolean attributes with corresponding properties
    +		// Fall back to attribute presence where some booleans are not supported
    +		var attrNode;
    +		return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
    +			name.toLowerCase() :
    +			undefined;
    +	},
    +	set: function( elem, value, name ) {
    +		var propName;
    +		if ( value === false ) {
    +			// Remove boolean attributes when set to false
    +			jQuery.removeAttr( elem, name );
    +		} else {
    +			// value is true since we know at this point it's type boolean and not false
    +			// Set boolean attributes to the same name and set the DOM property
    +			propName = jQuery.propFix[ name ] || name;
    +			if ( propName in elem ) {
    +				// Only set the IDL specifically if it already exists on the element
    +				elem[ propName ] = true;
    +			}
    +
    +			elem.setAttribute( name, name.toLowerCase() );
    +		}
    +		return name;
    +	}
    +};
    +
    +// IE6/7 do not support getting/setting some attributes with get/setAttribute
    +if ( !jQuery.support.getSetAttribute ) {
    +	
    +	// Use this for any attribute in IE6/7
    +	// This fixes almost every IE6/7 issue
    +	nodeHook = jQuery.valHooks.button = {
    +		get: function( elem, name ) {
    +			var ret;
    +			ret = elem.getAttributeNode( name );
    +			// Return undefined if nodeValue is empty string
    +			return ret && ret.nodeValue !== "" ?
    +				ret.nodeValue :
    +				undefined;
    +		},
    +		set: function( elem, value, name ) {
    +			// Set the existing or create a new attribute node
    +			var ret = elem.getAttributeNode( name );
    +			if ( !ret ) {
    +				ret = document.createAttribute( name );
    +				elem.setAttributeNode( ret );
    +			}
    +			return (ret.nodeValue = value + "");
    +		}
    +	};
    +
    +	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
    +	// This is for removals
    +	jQuery.each([ "width", "height" ], function( i, name ) {
    +		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
    +			set: function( elem, value ) {
    +				if ( value === "" ) {
    +					elem.setAttribute( name, "auto" );
    +					return value;
    +				}
    +			}
    +		});
    +	});
    +}
    +
    +
    +// Some attributes require a special call on IE
    +if ( !jQuery.support.hrefNormalized ) {
    +	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
    +		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
    +			get: function( elem ) {
    +				var ret = elem.getAttribute( name, 2 );
    +				return ret === null ? undefined : ret;
    +			}
    +		});
    +	});
    +}
    +
    +if ( !jQuery.support.style ) {
    +	jQuery.attrHooks.style = {
    +		get: function( elem ) {
    +			// Return undefined in the case of empty string
    +			// Normalize to lowercase since IE uppercases css property names
    +			return elem.style.cssText.toLowerCase() || undefined;
    +		},
    +		set: function( elem, value ) {
    +			return (elem.style.cssText = "" + value);
    +		}
    +	};
    +}
    +
    +// Safari mis-reports the default selected property of an option
    +// Accessing the parent's selectedIndex property fixes it
    +if ( !jQuery.support.optSelected ) {
    +	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
    +		get: function( elem ) {
    +			var parent = elem.parentNode;
    +
    +			if ( parent ) {
    +				parent.selectedIndex;
    +
    +				// Make sure that it also works with optgroups, see #5701
    +				if ( parent.parentNode ) {
    +					parent.parentNode.selectedIndex;
    +				}
    +			}
    +			return null;
    +		}
    +	});
    +}
    +
    +// Radios and checkboxes getter/setter
    +if ( !jQuery.support.checkOn ) {
    +	jQuery.each([ "radio", "checkbox" ], function() {
    +		jQuery.valHooks[ this ] = {
    +			get: function( elem ) {
    +				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
    +				return elem.getAttribute("value") === null ? "on" : elem.value;
    +			}
    +		};
    +	});
    +}
    +jQuery.each([ "radio", "checkbox" ], function() {
    +	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
    +		set: function( elem, value ) {
    +			if ( jQuery.isArray( value ) ) {
    +				return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
    +			}
    +		}
    +	});
    +});
    +
    +
    +
    +
    +var rnamespaces = /\.(.*)$/,
    +	rformElems = /^(?:textarea|input|select)$/i,
    +	rperiod = /\./g,
    +	rspaces = / /g,
    +	rescape = /[^\w\s.|`]/g,
    +	fcleanup = function( nm ) {
    +		return nm.replace(rescape, "\\$&");
    +	};
    +
    +/*
    + * A number of helper functions used for managing events.
    + * Many of the ideas behind this code originated from
    + * Dean Edwards' addEvent library.
    + */
    +jQuery.event = {
    +
    +	// Bind an event to an element
    +	// Original by Dean Edwards
    +	add: function( elem, types, handler, data ) {
    +		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
    +			return;
    +		}
    +
    +		if ( handler === false ) {
    +			handler = returnFalse;
    +		} else if ( !handler ) {
    +			// Fixes bug #7229. Fix recommended by jdalton
    +			return;
    +		}
    +
    +		var handleObjIn, handleObj;
    +
    +		if ( handler.handler ) {
    +			handleObjIn = handler;
    +			handler = handleObjIn.handler;
    +		}
    +
    +		// Make sure that the function being executed has a unique ID
    +		if ( !handler.guid ) {
    +			handler.guid = jQuery.guid++;
    +		}
    +
    +		// Init the element's event structure
    +		var elemData = jQuery._data( elem );
    +
    +		// If no elemData is found then we must be trying to bind to one of the
    +		// banned noData elements
    +		if ( !elemData ) {
    +			return;
    +		}
    +
    +		var events = elemData.events,
    +			eventHandle = elemData.handle;
    +
    +		if ( !events ) {
    +			elemData.events = events = {};
    +		}
    +
    +		if ( !eventHandle ) {
    +			elemData.handle = eventHandle = function( e ) {
    +				// Discard the second event of a jQuery.event.trigger() and
    +				// when an event is called after a page has unloaded
    +				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
    +					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
    +					undefined;
    +			};
    +		}
    +
    +		// Add elem as a property of the handle function
    +		// This is to prevent a memory leak with non-native events in IE.
    +		eventHandle.elem = elem;
    +
    +		// Handle multiple events separated by a space
    +		// jQuery(...).bind("mouseover mouseout", fn);
    +		types = types.split(" ");
    +
    +		var type, i = 0, namespaces;
    +
    +		while ( (type = types[ i++ ]) ) {
    +			handleObj = handleObjIn ?
    +				jQuery.extend({}, handleObjIn) :
    +				{ handler: handler, data: data };
    +
    +			// Namespaced event handlers
    +			if ( type.indexOf(".") > -1 ) {
    +				namespaces = type.split(".");
    +				type = namespaces.shift();
    +				handleObj.namespace = namespaces.slice(0).sort().join(".");
    +
    +			} else {
    +				namespaces = [];
    +				handleObj.namespace = "";
    +			}
    +
    +			handleObj.type = type;
    +			if ( !handleObj.guid ) {
    +				handleObj.guid = handler.guid;
    +			}
    +
    +			// Get the current list of functions bound to this event
    +			var handlers = events[ type ],
    +				special = jQuery.event.special[ type ] || {};
    +
    +			// Init the event handler queue
    +			if ( !handlers ) {
    +				handlers = events[ type ] = [];
    +
    +				// Check for a special event handler
    +				// Only use addEventListener/attachEvent if the special
    +				// events handler returns false
    +				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
    +					// Bind the global event handler to the element
    +					if ( elem.addEventListener ) {
    +						elem.addEventListener( type, eventHandle, false );
    +
    +					} else if ( elem.attachEvent ) {
    +						elem.attachEvent( "on" + type, eventHandle );
    +					}
    +				}
    +			}
    +
    +			if ( special.add ) {
    +				special.add.call( elem, handleObj );
    +
    +				if ( !handleObj.handler.guid ) {
    +					handleObj.handler.guid = handler.guid;
    +				}
    +			}
    +
    +			// Add the function to the element's handler list
    +			handlers.push( handleObj );
    +
    +			// Keep track of which events have been used, for event optimization
    +			jQuery.event.global[ type ] = true;
    +		}
    +
    +		// Nullify elem to prevent memory leaks in IE
    +		elem = null;
    +	},
    +
    +	global: {},
    +
    +	// Detach an event or set of events from an element
    +	remove: function( elem, types, handler, pos ) {
    +		// don't do events on text and comment nodes
    +		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
    +			return;
    +		}
    +
    +		if ( handler === false ) {
    +			handler = returnFalse;
    +		}
    +
    +		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
    +			elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
    +			events = elemData && elemData.events;
    +
    +		if ( !elemData || !events ) {
    +			return;
    +		}
    +
    +		// types is actually an event object here
    +		if ( types && types.type ) {
    +			handler = types.handler;
    +			types = types.type;
    +		}
    +
    +		// Unbind all events for the element
    +		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
    +			types = types || "";
    +
    +			for ( type in events ) {
    +				jQuery.event.remove( elem, type + types );
    +			}
    +
    +			return;
    +		}
    +
    +		// Handle multiple events separated by a space
    +		// jQuery(...).unbind("mouseover mouseout", fn);
    +		types = types.split(" ");
    +
    +		while ( (type = types[ i++ ]) ) {
    +			origType = type;
    +			handleObj = null;
    +			all = type.indexOf(".") < 0;
    +			namespaces = [];
    +
    +			if ( !all ) {
    +				// Namespaced event handlers
    +				namespaces = type.split(".");
    +				type = namespaces.shift();
    +
    +				namespace = new RegExp("(^|\\.)" +
    +					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
    +			}
    +
    +			eventType = events[ type ];
    +
    +			if ( !eventType ) {
    +				continue;
    +			}
    +
    +			if ( !handler ) {
    +				for ( j = 0; j < eventType.length; j++ ) {
    +					handleObj = eventType[ j ];
    +
    +					if ( all || namespace.test( handleObj.namespace ) ) {
    +						jQuery.event.remove( elem, origType, handleObj.handler, j );
    +						eventType.splice( j--, 1 );
    +					}
    +				}
    +
    +				continue;
    +			}
    +
    +			special = jQuery.event.special[ type ] || {};
    +
    +			for ( j = pos || 0; j < eventType.length; j++ ) {
    +				handleObj = eventType[ j ];
    +
    +				if ( handler.guid === handleObj.guid ) {
    +					// remove the given handler for the given type
    +					if ( all || namespace.test( handleObj.namespace ) ) {
    +						if ( pos == null ) {
    +							eventType.splice( j--, 1 );
    +						}
    +
    +						if ( special.remove ) {
    +							special.remove.call( elem, handleObj );
    +						}
    +					}
    +
    +					if ( pos != null ) {
    +						break;
    +					}
    +				}
    +			}
    +
    +			// remove generic event handler if no more handlers exist
    +			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
    +				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
    +					jQuery.removeEvent( elem, type, elemData.handle );
    +				}
    +
    +				ret = null;
    +				delete events[ type ];
    +			}
    +		}
    +
    +		// Remove the expando if it's no longer used
    +		if ( jQuery.isEmptyObject( events ) ) {
    +			var handle = elemData.handle;
    +			if ( handle ) {
    +				handle.elem = null;
    +			}
    +
    +			delete elemData.events;
    +			delete elemData.handle;
    +
    +			if ( jQuery.isEmptyObject( elemData ) ) {
    +				jQuery.removeData( elem, undefined, true );
    +			}
    +		}
    +	},
    +	
    +	// Events that are safe to short-circuit if no handlers are attached.
    +	// Native DOM events should not be added, they may have inline handlers.
    +	customEvent: {
    +		"getData": true,
    +		"setData": true,
    +		"changeData": true
    +	},
    +
    +	trigger: function( event, data, elem, onlyHandlers ) {
    +		// Event object or event type
    +		var type = event.type || event,
    +			namespaces = [],
    +			exclusive;
    +
    +		if ( type.indexOf("!") >= 0 ) {
    +			// Exclusive events trigger only for the exact event (no namespaces)
    +			type = type.slice(0, -1);
    +			exclusive = true;
    +		}
    +
    +		if ( type.indexOf(".") >= 0 ) {
    +			// Namespaced trigger; create a regexp to match event type in handle()
    +			namespaces = type.split(".");
    +			type = namespaces.shift();
    +			namespaces.sort();
    +		}
    +
    +		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
    +			// No jQuery handlers for this event type, and it can't have inline handlers
    +			return;
    +		}
    +
    +		// Caller can pass in an Event, Object, or just an event type string
    +		event = typeof event === "object" ?
    +			// jQuery.Event object
    +			event[ jQuery.expando ] ? event :
    +			// Object literal
    +			new jQuery.Event( type, event ) :
    +			// Just the event type (string)
    +			new jQuery.Event( type );
    +
    +		event.type = type;
    +		event.exclusive = exclusive;
    +		event.namespace = namespaces.join(".");
    +		event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
    +		
    +		// triggerHandler() and global events don't bubble or run the default action
    +		if ( onlyHandlers || !elem ) {
    +			event.preventDefault();
    +			event.stopPropagation();
    +		}
    +
    +		// Handle a global trigger
    +		if ( !elem ) {
    +			// TODO: Stop taunting the data cache; remove global events and always attach to document
    +			jQuery.each( jQuery.cache, function() {
    +				// internalKey variable is just used to make it easier to find
    +				// and potentially change this stuff later; currently it just
    +				// points to jQuery.expando
    +				var internalKey = jQuery.expando,
    +					internalCache = this[ internalKey ];
    +				if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
    +					jQuery.event.trigger( event, data, internalCache.handle.elem );
    +				}
    +			});
    +			return;
    +		}
    +
    +		// Don't do events on text and comment nodes
    +		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
    +			return;
    +		}
    +
    +		// Clean up the event in case it is being reused
    +		event.result = undefined;
    +		event.target = elem;
    +
    +		// Clone any incoming data and prepend the event, creating the handler arg list
    +		data = data != null ? jQuery.makeArray( data ) : [];
    +		data.unshift( event );
    +
    +		var cur = elem,
    +			// IE doesn't like method names with a colon (#3533, #8272)
    +			ontype = type.indexOf(":") < 0 ? "on" + type : "";
    +
    +		// Fire event on the current element, then bubble up the DOM tree
    +		do {
    +			var handle = jQuery._data( cur, "handle" );
    +
    +			event.currentTarget = cur;
    +			if ( handle ) {
    +				handle.apply( cur, data );
    +			}
    +
    +			// Trigger an inline bound script
    +			if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
    +				event.result = false;
    +				event.preventDefault();
    +			}
    +
    +			// Bubble up to document, then to window
    +			cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
    +		} while ( cur && !event.isPropagationStopped() );
    +
    +		// If nobody prevented the default action, do it now
    +		if ( !event.isDefaultPrevented() ) {
    +			var old,
    +				special = jQuery.event.special[ type ] || {};
    +
    +			if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
    +				!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
    +
    +				// Call a native DOM method on the target with the same name name as the event.
    +				// Can't use an .isFunction)() check here because IE6/7 fails that test.
    +				// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
    +				try {
    +					if ( ontype && elem[ type ] ) {
    +						// Don't re-trigger an onFOO event when we call its FOO() method
    +						old = elem[ ontype ];
    +
    +						if ( old ) {
    +							elem[ ontype ] = null;
    +						}
    +
    +						jQuery.event.triggered = type;
    +						elem[ type ]();
    +					}
    +				} catch ( ieError ) {}
    +
    +				if ( old ) {
    +					elem[ ontype ] = old;
    +				}
    +
    +				jQuery.event.triggered = undefined;
    +			}
    +		}
    +		
    +		return event.result;
    +	},
    +
    +	handle: function( event ) {
    +		event = jQuery.event.fix( event || window.event );
    +		// Snapshot the handlers list since a called handler may add/remove events.
    +		var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
    +			run_all = !event.exclusive && !event.namespace,
    +			args = Array.prototype.slice.call( arguments, 0 );
    +
    +		// Use the fix-ed Event rather than the (read-only) native event
    +		args[0] = event;
    +		event.currentTarget = this;
    +
    +		for ( var j = 0, l = handlers.length; j < l; j++ ) {
    +			var handleObj = handlers[ j ];
    +
    +			// Triggered event must 1) be non-exclusive and have no namespace, or
    +			// 2) have namespace(s) a subset or equal to those in the bound event.
    +			if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
    +				// Pass in a reference to the handler function itself
    +				// So that we can later remove it
    +				event.handler = handleObj.handler;
    +				event.data = handleObj.data;
    +				event.handleObj = handleObj;
    +
    +				var ret = handleObj.handler.apply( this, args );
    +
    +				if ( ret !== undefined ) {
    +					event.result = ret;
    +					if ( ret === false ) {
    +						event.preventDefault();
    +						event.stopPropagation();
    +					}
    +				}
    +
    +				if ( event.isImmediatePropagationStopped() ) {
    +					break;
    +				}
    +			}
    +		}
    +		return event.result;
    +	},
    +
    +	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
    +
    +	fix: function( event ) {
    +		if ( event[ jQuery.expando ] ) {
    +			return event;
    +		}
    +
    +		// store a copy of the original event object
    +		// and "clone" to set read-only properties
    +		var originalEvent = event;
    +		event = jQuery.Event( originalEvent );
    +
    +		for ( var i = this.props.length, prop; i; ) {
    +			prop = this.props[ --i ];
    +			event[ prop ] = originalEvent[ prop ];
    +		}
    +
    +		// Fix target property, if necessary
    +		if ( !event.target ) {
    +			// Fixes #1925 where srcElement might not be defined either
    +			event.target = event.srcElement || document;
    +		}
    +
    +		// check if target is a textnode (safari)
    +		if ( event.target.nodeType === 3 ) {
    +			event.target = event.target.parentNode;
    +		}
    +
    +		// Add relatedTarget, if necessary
    +		if ( !event.relatedTarget && event.fromElement ) {
    +			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
    +		}
    +
    +		// Calculate pageX/Y if missing and clientX/Y available
    +		if ( event.pageX == null && event.clientX != null ) {
    +			var eventDocument = event.target.ownerDocument || document,
    +				doc = eventDocument.documentElement,
    +				body = eventDocument.body;
    +
    +			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
    +			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
    +		}
    +
    +		// Add which for key events
    +		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
    +			event.which = event.charCode != null ? event.charCode : event.keyCode;
    +		}
    +
    +		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
    +		if ( !event.metaKey && event.ctrlKey ) {
    +			event.metaKey = event.ctrlKey;
    +		}
    +
    +		// Add which for click: 1 === left; 2 === middle; 3 === right
    +		// Note: button is not normalized, so don't use it
    +		if ( !event.which && event.button !== undefined ) {
    +			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
    +		}
    +
    +		return event;
    +	},
    +
    +	// Deprecated, use jQuery.guid instead
    +	guid: 1E8,
    +
    +	// Deprecated, use jQuery.proxy instead
    +	proxy: jQuery.proxy,
    +
    +	special: {
    +		ready: {
    +			// Make sure the ready event is setup
    +			setup: jQuery.bindReady,
    +			teardown: jQuery.noop
    +		},
    +
    +		live: {
    +			add: function( handleObj ) {
    +				jQuery.event.add( this,
    +					liveConvert( handleObj.origType, handleObj.selector ),
    +					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
    +			},
    +
    +			remove: function( handleObj ) {
    +				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
    +			}
    +		},
    +
    +		beforeunload: {
    +			setup: function( data, namespaces, eventHandle ) {
    +				// We only want to do this special case on windows
    +				if ( jQuery.isWindow( this ) ) {
    +					this.onbeforeunload = eventHandle;
    +				}
    +			},
    +
    +			teardown: function( namespaces, eventHandle ) {
    +				if ( this.onbeforeunload === eventHandle ) {
    +					this.onbeforeunload = null;
    +				}
    +			}
    +		}
    +	}
    +};
    +
    +jQuery.removeEvent = document.removeEventListener ?
    +	function( elem, type, handle ) {
    +		if ( elem.removeEventListener ) {
    +			elem.removeEventListener( type, handle, false );
    +		}
    +	} :
    +	function( elem, type, handle ) {
    +		if ( elem.detachEvent ) {
    +			elem.detachEvent( "on" + type, handle );
    +		}
    +	};
    +
    +jQuery.Event = function( src, props ) {
    +	// Allow instantiation without the 'new' keyword
    +	if ( !this.preventDefault ) {
    +		return new jQuery.Event( src, props );
    +	}
    +
    +	// Event object
    +	if ( src && src.type ) {
    +		this.originalEvent = src;
    +		this.type = src.type;
    +
    +		// Events bubbling up the document may have been marked as prevented
    +		// by a handler lower down the tree; reflect the correct value.
    +		this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
    +			src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
    +
    +	// Event type
    +	} else {
    +		this.type = src;
    +	}
    +
    +	// Put explicitly provided properties onto the event object
    +	if ( props ) {
    +		jQuery.extend( this, props );
    +	}
    +
    +	// timeStamp is buggy for some events on Firefox(#3843)
    +	// So we won't rely on the native value
    +	this.timeStamp = jQuery.now();
    +
    +	// Mark it as fixed
    +	this[ jQuery.expando ] = true;
    +};
    +
    +function returnFalse() {
    +	return false;
    +}
    +function returnTrue() {
    +	return true;
    +}
    +
    +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
    +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
    +jQuery.Event.prototype = {
    +	preventDefault: function() {
    +		this.isDefaultPrevented = returnTrue;
    +
    +		var e = this.originalEvent;
    +		if ( !e ) {
    +			return;
    +		}
    +
    +		// if preventDefault exists run it on the original event
    +		if ( e.preventDefault ) {
    +			e.preventDefault();
    +
    +		// otherwise set the returnValue property of the original event to false (IE)
    +		} else {
    +			e.returnValue = false;
    +		}
    +	},
    +	stopPropagation: function() {
    +		this.isPropagationStopped = returnTrue;
    +
    +		var e = this.originalEvent;
    +		if ( !e ) {
    +			return;
    +		}
    +		// if stopPropagation exists run it on the original event
    +		if ( e.stopPropagation ) {
    +			e.stopPropagation();
    +		}
    +		// otherwise set the cancelBubble property of the original event to true (IE)
    +		e.cancelBubble = true;
    +	},
    +	stopImmediatePropagation: function() {
    +		this.isImmediatePropagationStopped = returnTrue;
    +		this.stopPropagation();
    +	},
    +	isDefaultPrevented: returnFalse,
    +	isPropagationStopped: returnFalse,
    +	isImmediatePropagationStopped: returnFalse
    +};
    +
    +// Checks if an event happened on an element within another element
    +// Used in jQuery.event.special.mouseenter and mouseleave handlers
    +var withinElement = function( event ) {
    +
    +	// Check if mouse(over|out) are still within the same parent element
    +	var related = event.relatedTarget,
    +		inside = false,
    +		eventType = event.type;
    +
    +	event.type = event.data;
    +
    +	if ( related !== this ) {
    +
    +		if ( related ) {
    +			inside = jQuery.contains( this, related );
    +		}
    +
    +		if ( !inside ) {
    +
    +			jQuery.event.handle.apply( this, arguments );
    +
    +			event.type = eventType;
    +		}
    +	}
    +},
    +
    +// In case of event delegation, we only need to rename the event.type,
    +// liveHandler will take care of the rest.
    +delegate = function( event ) {
    +	event.type = event.data;
    +	jQuery.event.handle.apply( this, arguments );
    +};
    +
    +// Create mouseenter and mouseleave events
    +jQuery.each({
    +	mouseenter: "mouseover",
    +	mouseleave: "mouseout"
    +}, function( orig, fix ) {
    +	jQuery.event.special[ orig ] = {
    +		setup: function( data ) {
    +			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
    +		},
    +		teardown: function( data ) {
    +			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
    +		}
    +	};
    +});
    +
    +// submit delegation
    +if ( !jQuery.support.submitBubbles ) {
    +
    +	jQuery.event.special.submit = {
    +		setup: function( data, namespaces ) {
    +			if ( !jQuery.nodeName( this, "form" ) ) {
    +				jQuery.event.add(this, "click.specialSubmit", function( e ) {
    +					// Avoid triggering error on non-existent type attribute in IE VML (#7071)
    +					var elem = e.target,
    +						type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
    +
    +					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
    +						trigger( "submit", this, arguments );
    +					}
    +				});
    +
    +				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
    +					var elem = e.target,
    +						type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
    +
    +					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
    +						trigger( "submit", this, arguments );
    +					}
    +				});
    +
    +			} else {
    +				return false;
    +			}
    +		},
    +
    +		teardown: function( namespaces ) {
    +			jQuery.event.remove( this, ".specialSubmit" );
    +		}
    +	};
    +
    +}
    +
    +// change delegation, happens here so we have bind.
    +if ( !jQuery.support.changeBubbles ) {
    +
    +	var changeFilters,
    +
    +	getVal = function( elem ) {
    +		var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
    +			val = elem.value;
    +
    +		if ( type === "radio" || type === "checkbox" ) {
    +			val = elem.checked;
    +
    +		} else if ( type === "select-multiple" ) {
    +			val = elem.selectedIndex > -1 ?
    +				jQuery.map( elem.options, function( elem ) {
    +					return elem.selected;
    +				}).join("-") :
    +				"";
    +
    +		} else if ( jQuery.nodeName( elem, "select" ) ) {
    +			val = elem.selectedIndex;
    +		}
    +
    +		return val;
    +	},
    +
    +	testChange = function testChange( e ) {
    +		var elem = e.target, data, val;
    +
    +		if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
    +			return;
    +		}
    +
    +		data = jQuery._data( elem, "_change_data" );
    +		val = getVal(elem);
    +
    +		// the current data will be also retrieved by beforeactivate
    +		if ( e.type !== "focusout" || elem.type !== "radio" ) {
    +			jQuery._data( elem, "_change_data", val );
    +		}
    +
    +		if ( data === undefined || val === data ) {
    +			return;
    +		}
    +
    +		if ( data != null || val ) {
    +			e.type = "change";
    +			e.liveFired = undefined;
    +			jQuery.event.trigger( e, arguments[1], elem );
    +		}
    +	};
    +
    +	jQuery.event.special.change = {
    +		filters: {
    +			focusout: testChange,
    +
    +			beforedeactivate: testChange,
    +
    +			click: function( e ) {
    +				var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
    +
    +				if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
    +					testChange.call( this, e );
    +				}
    +			},
    +
    +			// Change has to be called before submit
    +			// Keydown will be called before keypress, which is used in submit-event delegation
    +			keydown: function( e ) {
    +				var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
    +
    +				if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
    +					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
    +					type === "select-multiple" ) {
    +					testChange.call( this, e );
    +				}
    +			},
    +
    +			// Beforeactivate happens also before the previous element is blurred
    +			// with this event you can't trigger a change event, but you can store
    +			// information
    +			beforeactivate: function( e ) {
    +				var elem = e.target;
    +				jQuery._data( elem, "_change_data", getVal(elem) );
    +			}
    +		},
    +
    +		setup: function( data, namespaces ) {
    +			if ( this.type === "file" ) {
    +				return false;
    +			}
    +
    +			for ( var type in changeFilters ) {
    +				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
    +			}
    +
    +			return rformElems.test( this.nodeName );
    +		},
    +
    +		teardown: function( namespaces ) {
    +			jQuery.event.remove( this, ".specialChange" );
    +
    +			return rformElems.test( this.nodeName );
    +		}
    +	};
    +
    +	changeFilters = jQuery.event.special.change.filters;
    +
    +	// Handle when the input is .focus()'d
    +	changeFilters.focus = changeFilters.beforeactivate;
    +}
    +
    +function trigger( type, elem, args ) {
    +	// Piggyback on a donor event to simulate a different one.
    +	// Fake originalEvent to avoid donor's stopPropagation, but if the
    +	// simulated event prevents default then we do the same on the donor.
    +	// Don't pass args or remember liveFired; they apply to the donor event.
    +	var event = jQuery.extend( {}, args[ 0 ] );
    +	event.type = type;
    +	event.originalEvent = {};
    +	event.liveFired = undefined;
    +	jQuery.event.handle.call( elem, event );
    +	if ( event.isDefaultPrevented() ) {
    +		args[ 0 ].preventDefault();
    +	}
    +}
    +
    +// Create "bubbling" focus and blur events
    +if ( !jQuery.support.focusinBubbles ) {
    +	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
    +
    +		// Attach a single capturing handler while someone wants focusin/focusout
    +		var attaches = 0;
    +
    +		jQuery.event.special[ fix ] = {
    +			setup: function() {
    +				if ( attaches++ === 0 ) {
    +					document.addEventListener( orig, handler, true );
    +				}
    +			},
    +			teardown: function() {
    +				if ( --attaches === 0 ) {
    +					document.removeEventListener( orig, handler, true );
    +				}
    +			}
    +		};
    +
    +		function handler( donor ) {
    +			// Donor event is always a native one; fix it and switch its type.
    +			// Let focusin/out handler cancel the donor focus/blur event.
    +			var e = jQuery.event.fix( donor );
    +			e.type = fix;
    +			e.originalEvent = {};
    +			jQuery.event.trigger( e, null, e.target );
    +			if ( e.isDefaultPrevented() ) {
    +				donor.preventDefault();
    +			}
    +		}
    +	});
    +}
    +
    +jQuery.each(["bind", "one"], function( i, name ) {
    +	jQuery.fn[ name ] = function( type, data, fn ) {
    +		var handler;
    +
    +		// Handle object literals
    +		if ( typeof type === "object" ) {
    +			for ( var key in type ) {
    +				this[ name ](key, data, type[key], fn);
    +			}
    +			return this;
    +		}
    +
    +		if ( arguments.length === 2 || data === false ) {
    +			fn = data;
    +			data = undefined;
    +		}
    +
    +		if ( name === "one" ) {
    +			handler = function( event ) {
    +				jQuery( this ).unbind( event, handler );
    +				return fn.apply( this, arguments );
    +			};
    +			handler.guid = fn.guid || jQuery.guid++;
    +		} else {
    +			handler = fn;
    +		}
    +
    +		if ( type === "unload" && name !== "one" ) {
    +			this.one( type, data, fn );
    +
    +		} else {
    +			for ( var i = 0, l = this.length; i < l; i++ ) {
    +				jQuery.event.add( this[i], type, handler, data );
    +			}
    +		}
    +
    +		return this;
    +	};
    +});
    +
    +jQuery.fn.extend({
    +	unbind: function( type, fn ) {
    +		// Handle object literals
    +		if ( typeof type === "object" && !type.preventDefault ) {
    +			for ( var key in type ) {
    +				this.unbind(key, type[key]);
    +			}
    +
    +		} else {
    +			for ( var i = 0, l = this.length; i < l; i++ ) {
    +				jQuery.event.remove( this[i], type, fn );
    +			}
    +		}
    +
    +		return this;
    +	},
    +
    +	delegate: function( selector, types, data, fn ) {
    +		return this.live( types, data, fn, selector );
    +	},
    +
    +	undelegate: function( selector, types, fn ) {
    +		if ( arguments.length === 0 ) {
    +			return this.unbind( "live" );
    +
    +		} else {
    +			return this.die( types, null, fn, selector );
    +		}
    +	},
    +
    +	trigger: function( type, data ) {
    +		return this.each(function() {
    +			jQuery.event.trigger( type, data, this );
    +		});
    +	},
    +
    +	triggerHandler: function( type, data ) {
    +		if ( this[0] ) {
    +			return jQuery.event.trigger( type, data, this[0], true );
    +		}
    +	},
    +
    +	toggle: function( fn ) {
    +		// Save reference to arguments for access in closure
    +		var args = arguments,
    +			guid = fn.guid || jQuery.guid++,
    +			i = 0,
    +			toggler = function( event ) {
    +				// Figure out which function to execute
    +				var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
    +				jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
    +
    +				// Make sure that clicks stop
    +				event.preventDefault();
    +
    +				// and execute the function
    +				return args[ lastToggle ].apply( this, arguments ) || false;
    +			};
    +
    +		// link all the functions, so any of them can unbind this click handler
    +		toggler.guid = guid;
    +		while ( i < args.length ) {
    +			args[ i++ ].guid = guid;
    +		}
    +
    +		return this.click( toggler );
    +	},
    +
    +	hover: function( fnOver, fnOut ) {
    +		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
    +	}
    +});
    +
    +var liveMap = {
    +	focus: "focusin",
    +	blur: "focusout",
    +	mouseenter: "mouseover",
    +	mouseleave: "mouseout"
    +};
    +
    +jQuery.each(["live", "die"], function( i, name ) {
    +	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
    +		var type, i = 0, match, namespaces, preType,
    +			selector = origSelector || this.selector,
    +			context = origSelector ? this : jQuery( this.context );
    +
    +		if ( typeof types === "object" && !types.preventDefault ) {
    +			for ( var key in types ) {
    +				context[ name ]( key, data, types[key], selector );
    +			}
    +
    +			return this;
    +		}
    +
    +		if ( name === "die" && !types &&
    +					origSelector && origSelector.charAt(0) === "." ) {
    +
    +			context.unbind( origSelector );
    +
    +			return this;
    +		}
    +
    +		if ( data === false || jQuery.isFunction( data ) ) {
    +			fn = data || returnFalse;
    +			data = undefined;
    +		}
    +
    +		types = (types || "").split(" ");
    +
    +		while ( (type = types[ i++ ]) != null ) {
    +			match = rnamespaces.exec( type );
    +			namespaces = "";
    +
    +			if ( match )  {
    +				namespaces = match[0];
    +				type = type.replace( rnamespaces, "" );
    +			}
    +
    +			if ( type === "hover" ) {
    +				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
    +				continue;
    +			}
    +
    +			preType = type;
    +
    +			if ( liveMap[ type ] ) {
    +				types.push( liveMap[ type ] + namespaces );
    +				type = type + namespaces;
    +
    +			} else {
    +				type = (liveMap[ type ] || type) + namespaces;
    +			}
    +
    +			if ( name === "live" ) {
    +				// bind live handler
    +				for ( var j = 0, l = context.length; j < l; j++ ) {
    +					jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
    +						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
    +				}
    +
    +			} else {
    +				// unbind live handler
    +				context.unbind( "live." + liveConvert( type, selector ), fn );
    +			}
    +		}
    +
    +		return this;
    +	};
    +});
    +
    +function liveHandler( event ) {
    +	var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
    +		elems = [],
    +		selectors = [],
    +		events = jQuery._data( this, "events" );
    +
    +	// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
    +	if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
    +		return;
    +	}
    +
    +	if ( event.namespace ) {
    +		namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
    +	}
    +
    +	event.liveFired = this;
    +
    +	var live = events.live.slice(0);
    +
    +	for ( j = 0; j < live.length; j++ ) {
    +		handleObj = live[j];
    +
    +		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
    +			selectors.push( handleObj.selector );
    +
    +		} else {
    +			live.splice( j--, 1 );
    +		}
    +	}
    +
    +	match = jQuery( event.target ).closest( selectors, event.currentTarget );
    +
    +	for ( i = 0, l = match.length; i < l; i++ ) {
    +		close = match[i];
    +
    +		for ( j = 0; j < live.length; j++ ) {
    +			handleObj = live[j];
    +
    +			if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
    +				elem = close.elem;
    +				related = null;
    +
    +				// Those two events require additional checking
    +				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
    +					event.type = handleObj.preType;
    +					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
    +
    +					// Make sure not to accidentally match a child element with the same selector
    +					if ( related && jQuery.contains( elem, related ) ) {
    +						related = elem;
    +					}
    +				}
    +
    +				if ( !related || related !== elem ) {
    +					elems.push({ elem: elem, handleObj: handleObj, level: close.level });
    +				}
    +			}
    +		}
    +	}
    +
    +	for ( i = 0, l = elems.length; i < l; i++ ) {
    +		match = elems[i];
    +
    +		if ( maxLevel && match.level > maxLevel ) {
    +			break;
    +		}
    +
    +		event.currentTarget = match.elem;
    +		event.data = match.handleObj.data;
    +		event.handleObj = match.handleObj;
    +
    +		ret = match.handleObj.origHandler.apply( match.elem, arguments );
    +
    +		if ( ret === false || event.isPropagationStopped() ) {
    +			maxLevel = match.level;
    +
    +			if ( ret === false ) {
    +				stop = false;
    +			}
    +			if ( event.isImmediatePropagationStopped() ) {
    +				break;
    +			}
    +		}
    +	}
    +
    +	return stop;
    +}
    +
    +function liveConvert( type, selector ) {
    +	return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
    +}
    +
    +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
    +	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
    +	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
    +
    +	// Handle event binding
    +	jQuery.fn[ name ] = function( data, fn ) {
    +		if ( fn == null ) {
    +			fn = data;
    +			data = null;
    +		}
    +
    +		return arguments.length > 0 ?
    +			this.bind( name, data, fn ) :
    +			this.trigger( name );
    +	};
    +
    +	if ( jQuery.attrFn ) {
    +		jQuery.attrFn[ name ] = true;
    +	}
    +});
    +
    +
    +
    +/*!
    + * Sizzle CSS Selector Engine
    + *  Copyright 2011, The Dojo Foundation
    + *  Released under the MIT, BSD, and GPL Licenses.
    + *  More information: http://sizzlejs.com/
    + */
    +(function(){
    +
    +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
    +	done = 0,
    +	toString = Object.prototype.toString,
    +	hasDuplicate = false,
    +	baseHasDuplicate = true,
    +	rBackslash = /\\/g,
    +	rNonWord = /\W/;
    +
    +// Here we check if the JavaScript engine is using some sort of
    +// optimization where it does not always call our comparision
    +// function. If that is the case, discard the hasDuplicate value.
    +//   Thus far that includes Google Chrome.
    +[0, 0].sort(function() {
    +	baseHasDuplicate = false;
    +	return 0;
    +});
    +
    +var Sizzle = function( selector, context, results, seed ) {
    +	results = results || [];
    +	context = context || document;
    +
    +	var origContext = context;
    +
    +	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
    +		return [];
    +	}
    +	
    +	if ( !selector || typeof selector !== "string" ) {
    +		return results;
    +	}
    +
    +	var m, set, checkSet, extra, ret, cur, pop, i,
    +		prune = true,
    +		contextXML = Sizzle.isXML( context ),
    +		parts = [],
    +		soFar = selector;
    +	
    +	// Reset the position of the chunker regexp (start from head)
    +	do {
    +		chunker.exec( "" );
    +		m = chunker.exec( soFar );
    +
    +		if ( m ) {
    +			soFar = m[3];
    +		
    +			parts.push( m[1] );
    +		
    +			if ( m[2] ) {
    +				extra = m[3];
    +				break;
    +			}
    +		}
    +	} while ( m );
    +
    +	if ( parts.length > 1 && origPOS.exec( selector ) ) {
    +
    +		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
    +			set = posProcess( parts[0] + parts[1], context );
    +
    +		} else {
    +			set = Expr.relative[ parts[0] ] ?
    +				[ context ] :
    +				Sizzle( parts.shift(), context );
    +
    +			while ( parts.length ) {
    +				selector = parts.shift();
    +
    +				if ( Expr.relative[ selector ] ) {
    +					selector += parts.shift();
    +				}
    +				
    +				set = posProcess( selector, set );
    +			}
    +		}
    +
    +	} else {
    +		// Take a shortcut and set the context if the root selector is an ID
    +		// (but not if it'll be faster if the inner selector is an ID)
    +		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
    +				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
    +
    +			ret = Sizzle.find( parts.shift(), context, contextXML );
    +			context = ret.expr ?
    +				Sizzle.filter( ret.expr, ret.set )[0] :
    +				ret.set[0];
    +		}
    +
    +		if ( context ) {
    +			ret = seed ?
    +				{ expr: parts.pop(), set: makeArray(seed) } :
    +				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
    +
    +			set = ret.expr ?
    +				Sizzle.filter( ret.expr, ret.set ) :
    +				ret.set;
    +
    +			if ( parts.length > 0 ) {
    +				checkSet = makeArray( set );
    +
    +			} else {
    +				prune = false;
    +			}
    +
    +			while ( parts.length ) {
    +				cur = parts.pop();
    +				pop = cur;
    +
    +				if ( !Expr.relative[ cur ] ) {
    +					cur = "";
    +				} else {
    +					pop = parts.pop();
    +				}
    +
    +				if ( pop == null ) {
    +					pop = context;
    +				}
    +
    +				Expr.relative[ cur ]( checkSet, pop, contextXML );
    +			}
    +
    +		} else {
    +			checkSet = parts = [];
    +		}
    +	}
    +
    +	if ( !checkSet ) {
    +		checkSet = set;
    +	}
    +
    +	if ( !checkSet ) {
    +		Sizzle.error( cur || selector );
    +	}
    +
    +	if ( toString.call(checkSet) === "[object Array]" ) {
    +		if ( !prune ) {
    +			results.push.apply( results, checkSet );
    +
    +		} else if ( context && context.nodeType === 1 ) {
    +			for ( i = 0; checkSet[i] != null; i++ ) {
    +				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
    +					results.push( set[i] );
    +				}
    +			}
    +
    +		} else {
    +			for ( i = 0; checkSet[i] != null; i++ ) {
    +				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
    +					results.push( set[i] );
    +				}
    +			}
    +		}
    +
    +	} else {
    +		makeArray( checkSet, results );
    +	}
    +
    +	if ( extra ) {
    +		Sizzle( extra, origContext, results, seed );
    +		Sizzle.uniqueSort( results );
    +	}
    +
    +	return results;
    +};
    +
    +Sizzle.uniqueSort = function( results ) {
    +	if ( sortOrder ) {
    +		hasDuplicate = baseHasDuplicate;
    +		results.sort( sortOrder );
    +
    +		if ( hasDuplicate ) {
    +			for ( var i = 1; i < results.length; i++ ) {
    +				if ( results[i] === results[ i - 1 ] ) {
    +					results.splice( i--, 1 );
    +				}
    +			}
    +		}
    +	}
    +
    +	return results;
    +};
    +
    +Sizzle.matches = function( expr, set ) {
    +	return Sizzle( expr, null, null, set );
    +};
    +
    +Sizzle.matchesSelector = function( node, expr ) {
    +	return Sizzle( expr, null, null, [node] ).length > 0;
    +};
    +
    +Sizzle.find = function( expr, context, isXML ) {
    +	var set;
    +
    +	if ( !expr ) {
    +		return [];
    +	}
    +
    +	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
    +		var match,
    +			type = Expr.order[i];
    +		
    +		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
    +			var left = match[1];
    +			match.splice( 1, 1 );
    +
    +			if ( left.substr( left.length - 1 ) !== "\\" ) {
    +				match[1] = (match[1] || "").replace( rBackslash, "" );
    +				set = Expr.find[ type ]( match, context, isXML );
    +
    +				if ( set != null ) {
    +					expr = expr.replace( Expr.match[ type ], "" );
    +					break;
    +				}
    +			}
    +		}
    +	}
    +
    +	if ( !set ) {
    +		set = typeof context.getElementsByTagName !== "undefined" ?
    +			context.getElementsByTagName( "*" ) :
    +			[];
    +	}
    +
    +	return { set: set, expr: expr };
    +};
    +
    +Sizzle.filter = function( expr, set, inplace, not ) {
    +	var match, anyFound,
    +		old = expr,
    +		result = [],
    +		curLoop = set,
    +		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
    +
    +	while ( expr && set.length ) {
    +		for ( var type in Expr.filter ) {
    +			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
    +				var found, item,
    +					filter = Expr.filter[ type ],
    +					left = match[1];
    +
    +				anyFound = false;
    +
    +				match.splice(1,1);
    +
    +				if ( left.substr( left.length - 1 ) === "\\" ) {
    +					continue;
    +				}
    +
    +				if ( curLoop === result ) {
    +					result = [];
    +				}
    +
    +				if ( Expr.preFilter[ type ] ) {
    +					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
    +
    +					if ( !match ) {
    +						anyFound = found = true;
    +
    +					} else if ( match === true ) {
    +						continue;
    +					}
    +				}
    +
    +				if ( match ) {
    +					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
    +						if ( item ) {
    +							found = filter( item, match, i, curLoop );
    +							var pass = not ^ !!found;
    +
    +							if ( inplace && found != null ) {
    +								if ( pass ) {
    +									anyFound = true;
    +
    +								} else {
    +									curLoop[i] = false;
    +								}
    +
    +							} else if ( pass ) {
    +								result.push( item );
    +								anyFound = true;
    +							}
    +						}
    +					}
    +				}
    +
    +				if ( found !== undefined ) {
    +					if ( !inplace ) {
    +						curLoop = result;
    +					}
    +
    +					expr = expr.replace( Expr.match[ type ], "" );
    +
    +					if ( !anyFound ) {
    +						return [];
    +					}
    +
    +					break;
    +				}
    +			}
    +		}
    +
    +		// Improper expression
    +		if ( expr === old ) {
    +			if ( anyFound == null ) {
    +				Sizzle.error( expr );
    +
    +			} else {
    +				break;
    +			}
    +		}
    +
    +		old = expr;
    +	}
    +
    +	return curLoop;
    +};
    +
    +Sizzle.error = function( msg ) {
    +	throw "Syntax error, unrecognized expression: " + msg;
    +};
    +
    +var Expr = Sizzle.selectors = {
    +	order: [ "ID", "NAME", "TAG" ],
    +
    +	match: {
    +		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
    +		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
    +		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
    +		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
    +		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
    +		CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
    +		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
    +		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
    +	},
    +
    +	leftMatch: {},
    +
    +	attrMap: {
    +		"class": "className",
    +		"for": "htmlFor"
    +	},
    +
    +	attrHandle: {
    +		href: function( elem ) {
    +			return elem.getAttribute( "href" );
    +		},
    +		type: function( elem ) {
    +			return elem.getAttribute( "type" );
    +		}
    +	},
    +
    +	relative: {
    +		"+": function(checkSet, part){
    +			var isPartStr = typeof part === "string",
    +				isTag = isPartStr && !rNonWord.test( part ),
    +				isPartStrNotTag = isPartStr && !isTag;
    +
    +			if ( isTag ) {
    +				part = part.toLowerCase();
    +			}
    +
    +			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
    +				if ( (elem = checkSet[i]) ) {
    +					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
    +
    +					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
    +						elem || false :
    +						elem === part;
    +				}
    +			}
    +
    +			if ( isPartStrNotTag ) {
    +				Sizzle.filter( part, checkSet, true );
    +			}
    +		},
    +
    +		">": function( checkSet, part ) {
    +			var elem,
    +				isPartStr = typeof part === "string",
    +				i = 0,
    +				l = checkSet.length;
    +
    +			if ( isPartStr && !rNonWord.test( part ) ) {
    +				part = part.toLowerCase();
    +
    +				for ( ; i < l; i++ ) {
    +					elem = checkSet[i];
    +
    +					if ( elem ) {
    +						var parent = elem.parentNode;
    +						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
    +					}
    +				}
    +
    +			} else {
    +				for ( ; i < l; i++ ) {
    +					elem = checkSet[i];
    +
    +					if ( elem ) {
    +						checkSet[i] = isPartStr ?
    +							elem.parentNode :
    +							elem.parentNode === part;
    +					}
    +				}
    +
    +				if ( isPartStr ) {
    +					Sizzle.filter( part, checkSet, true );
    +				}
    +			}
    +		},
    +
    +		"": function(checkSet, part, isXML){
    +			var nodeCheck,
    +				doneName = done++,
    +				checkFn = dirCheck;
    +
    +			if ( typeof part === "string" && !rNonWord.test( part ) ) {
    +				part = part.toLowerCase();
    +				nodeCheck = part;
    +				checkFn = dirNodeCheck;
    +			}
    +
    +			checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
    +		},
    +
    +		"~": function( checkSet, part, isXML ) {
    +			var nodeCheck,
    +				doneName = done++,
    +				checkFn = dirCheck;
    +
    +			if ( typeof part === "string" && !rNonWord.test( part ) ) {
    +				part = part.toLowerCase();
    +				nodeCheck = part;
    +				checkFn = dirNodeCheck;
    +			}
    +
    +			checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
    +		}
    +	},
    +
    +	find: {
    +		ID: function( match, context, isXML ) {
    +			if ( typeof context.getElementById !== "undefined" && !isXML ) {
    +				var m = context.getElementById(match[1]);
    +				// Check parentNode to catch when Blackberry 4.6 returns
    +				// nodes that are no longer in the document #6963
    +				return m && m.parentNode ? [m] : [];
    +			}
    +		},
    +
    +		NAME: function( match, context ) {
    +			if ( typeof context.getElementsByName !== "undefined" ) {
    +				var ret = [],
    +					results = context.getElementsByName( match[1] );
    +
    +				for ( var i = 0, l = results.length; i < l; i++ ) {
    +					if ( results[i].getAttribute("name") === match[1] ) {
    +						ret.push( results[i] );
    +					}
    +				}
    +
    +				return ret.length === 0 ? null : ret;
    +			}
    +		},
    +
    +		TAG: function( match, context ) {
    +			if ( typeof context.getElementsByTagName !== "undefined" ) {
    +				return context.getElementsByTagName( match[1] );
    +			}
    +		}
    +	},
    +	preFilter: {
    +		CLASS: function( match, curLoop, inplace, result, not, isXML ) {
    +			match = " " + match[1].replace( rBackslash, "" ) + " ";
    +
    +			if ( isXML ) {
    +				return match;
    +			}
    +
    +			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
    +				if ( elem ) {
    +					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
    +						if ( !inplace ) {
    +							result.push( elem );
    +						}
    +
    +					} else if ( inplace ) {
    +						curLoop[i] = false;
    +					}
    +				}
    +			}
    +
    +			return false;
    +		},
    +
    +		ID: function( match ) {
    +			return match[1].replace( rBackslash, "" );
    +		},
    +
    +		TAG: function( match, curLoop ) {
    +			return match[1].replace( rBackslash, "" ).toLowerCase();
    +		},
    +
    +		CHILD: function( match ) {
    +			if ( match[1] === "nth" ) {
    +				if ( !match[2] ) {
    +					Sizzle.error( match[0] );
    +				}
    +
    +				match[2] = match[2].replace(/^\+|\s*/g, '');
    +
    +				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
    +				var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
    +					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
    +					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
    +
    +				// calculate the numbers (first)n+(last) including if they are negative
    +				match[2] = (test[1] + (test[2] || 1)) - 0;
    +				match[3] = test[3] - 0;
    +			}
    +			else if ( match[2] ) {
    +				Sizzle.error( match[0] );
    +			}
    +
    +			// TODO: Move to normal caching system
    +			match[0] = done++;
    +
    +			return match;
    +		},
    +
    +		ATTR: function( match, curLoop, inplace, result, not, isXML ) {
    +			var name = match[1] = match[1].replace( rBackslash, "" );
    +			
    +			if ( !isXML && Expr.attrMap[name] ) {
    +				match[1] = Expr.attrMap[name];
    +			}
    +
    +			// Handle if an un-quoted value was used
    +			match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
    +
    +			if ( match[2] === "~=" ) {
    +				match[4] = " " + match[4] + " ";
    +			}
    +
    +			return match;
    +		},
    +
    +		PSEUDO: function( match, curLoop, inplace, result, not ) {
    +			if ( match[1] === "not" ) {
    +				// If we're dealing with a complex expression, or a simple one
    +				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
    +					match[3] = Sizzle(match[3], null, null, curLoop);
    +
    +				} else {
    +					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
    +
    +					if ( !inplace ) {
    +						result.push.apply( result, ret );
    +					}
    +
    +					return false;
    +				}
    +
    +			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
    +				return true;
    +			}
    +			
    +			return match;
    +		},
    +
    +		POS: function( match ) {
    +			match.unshift( true );
    +
    +			return match;
    +		}
    +	},
    +	
    +	filters: {
    +		enabled: function( elem ) {
    +			return elem.disabled === false && elem.type !== "hidden";
    +		},
    +
    +		disabled: function( elem ) {
    +			return elem.disabled === true;
    +		},
    +
    +		checked: function( elem ) {
    +			return elem.checked === true;
    +		},
    +		
    +		selected: function( elem ) {
    +			// Accessing this property makes selected-by-default
    +			// options in Safari work properly
    +			if ( elem.parentNode ) {
    +				elem.parentNode.selectedIndex;
    +			}
    +			
    +			return elem.selected === true;
    +		},
    +
    +		parent: function( elem ) {
    +			return !!elem.firstChild;
    +		},
    +
    +		empty: function( elem ) {
    +			return !elem.firstChild;
    +		},
    +
    +		has: function( elem, i, match ) {
    +			return !!Sizzle( match[3], elem ).length;
    +		},
    +
    +		header: function( elem ) {
    +			return (/h\d/i).test( elem.nodeName );
    +		},
    +
    +		text: function( elem ) {
    +			var attr = elem.getAttribute( "type" ), type = elem.type;
    +			// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 
    +			// use getAttribute instead to test this case
    +			return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
    +		},
    +
    +		radio: function( elem ) {
    +			return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
    +		},
    +
    +		checkbox: function( elem ) {
    +			return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
    +		},
    +
    +		file: function( elem ) {
    +			return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
    +		},
    +
    +		password: function( elem ) {
    +			return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
    +		},
    +
    +		submit: function( elem ) {
    +			var name = elem.nodeName.toLowerCase();
    +			return (name === "input" || name === "button") && "submit" === elem.type;
    +		},
    +
    +		image: function( elem ) {
    +			return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
    +		},
    +
    +		reset: function( elem ) {
    +			var name = elem.nodeName.toLowerCase();
    +			return (name === "input" || name === "button") && "reset" === elem.type;
    +		},
    +
    +		button: function( elem ) {
    +			var name = elem.nodeName.toLowerCase();
    +			return name === "input" && "button" === elem.type || name === "button";
    +		},
    +
    +		input: function( elem ) {
    +			return (/input|select|textarea|button/i).test( elem.nodeName );
    +		},
    +
    +		focus: function( elem ) {
    +			return elem === elem.ownerDocument.activeElement;
    +		}
    +	},
    +	setFilters: {
    +		first: function( elem, i ) {
    +			return i === 0;
    +		},
    +
    +		last: function( elem, i, match, array ) {
    +			return i === array.length - 1;
    +		},
    +
    +		even: function( elem, i ) {
    +			return i % 2 === 0;
    +		},
    +
    +		odd: function( elem, i ) {
    +			return i % 2 === 1;
    +		},
    +
    +		lt: function( elem, i, match ) {
    +			return i < match[3] - 0;
    +		},
    +
    +		gt: function( elem, i, match ) {
    +			return i > match[3] - 0;
    +		},
    +
    +		nth: function( elem, i, match ) {
    +			return match[3] - 0 === i;
    +		},
    +
    +		eq: function( elem, i, match ) {
    +			return match[3] - 0 === i;
    +		}
    +	},
    +	filter: {
    +		PSEUDO: function( elem, match, i, array ) {
    +			var name = match[1],
    +				filter = Expr.filters[ name ];
    +
    +			if ( filter ) {
    +				return filter( elem, i, match, array );
    +
    +			} else if ( name === "contains" ) {
    +				return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
    +
    +			} else if ( name === "not" ) {
    +				var not = match[3];
    +
    +				for ( var j = 0, l = not.length; j < l; j++ ) {
    +					if ( not[j] === elem ) {
    +						return false;
    +					}
    +				}
    +
    +				return true;
    +
    +			} else {
    +				Sizzle.error( name );
    +			}
    +		},
    +
    +		CHILD: function( elem, match ) {
    +			var type = match[1],
    +				node = elem;
    +
    +			switch ( type ) {
    +				case "only":
    +				case "first":
    +					while ( (node = node.previousSibling) )	 {
    +						if ( node.nodeType === 1 ) { 
    +							return false; 
    +						}
    +					}
    +
    +					if ( type === "first" ) { 
    +						return true; 
    +					}
    +
    +					node = elem;
    +
    +				case "last":
    +					while ( (node = node.nextSibling) )	 {
    +						if ( node.nodeType === 1 ) { 
    +							return false; 
    +						}
    +					}
    +
    +					return true;
    +
    +				case "nth":
    +					var first = match[2],
    +						last = match[3];
    +
    +					if ( first === 1 && last === 0 ) {
    +						return true;
    +					}
    +					
    +					var doneName = match[0],
    +						parent = elem.parentNode;
    +	
    +					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
    +						var count = 0;
    +						
    +						for ( node = parent.firstChild; node; node = node.nextSibling ) {
    +							if ( node.nodeType === 1 ) {
    +								node.nodeIndex = ++count;
    +							}
    +						} 
    +
    +						parent.sizcache = doneName;
    +					}
    +					
    +					var diff = elem.nodeIndex - last;
    +
    +					if ( first === 0 ) {
    +						return diff === 0;
    +
    +					} else {
    +						return ( diff % first === 0 && diff / first >= 0 );
    +					}
    +			}
    +		},
    +
    +		ID: function( elem, match ) {
    +			return elem.nodeType === 1 && elem.getAttribute("id") === match;
    +		},
    +
    +		TAG: function( elem, match ) {
    +			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
    +		},
    +		
    +		CLASS: function( elem, match ) {
    +			return (" " + (elem.className || elem.getAttribute("class")) + " ")
    +				.indexOf( match ) > -1;
    +		},
    +
    +		ATTR: function( elem, match ) {
    +			var name = match[1],
    +				result = Expr.attrHandle[ name ] ?
    +					Expr.attrHandle[ name ]( elem ) :
    +					elem[ name ] != null ?
    +						elem[ name ] :
    +						elem.getAttribute( name ),
    +				value = result + "",
    +				type = match[2],
    +				check = match[4];
    +
    +			return result == null ?
    +				type === "!=" :
    +				type === "=" ?
    +				value === check :
    +				type === "*=" ?
    +				value.indexOf(check) >= 0 :
    +				type === "~=" ?
    +				(" " + value + " ").indexOf(check) >= 0 :
    +				!check ?
    +				value && result !== false :
    +				type === "!=" ?
    +				value !== check :
    +				type === "^=" ?
    +				value.indexOf(check) === 0 :
    +				type === "$=" ?
    +				value.substr(value.length - check.length) === check :
    +				type === "|=" ?
    +				value === check || value.substr(0, check.length + 1) === check + "-" :
    +				false;
    +		},
    +
    +		POS: function( elem, match, i, array ) {
    +			var name = match[2],
    +				filter = Expr.setFilters[ name ];
    +
    +			if ( filter ) {
    +				return filter( elem, i, match, array );
    +			}
    +		}
    +	}
    +};
    +
    +var origPOS = Expr.match.POS,
    +	fescape = function(all, num){
    +		return "\\" + (num - 0 + 1);
    +	};
    +
    +for ( var type in Expr.match ) {
    +	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
    +	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
    +}
    +
    +var makeArray = function( array, results ) {
    +	array = Array.prototype.slice.call( array, 0 );
    +
    +	if ( results ) {
    +		results.push.apply( results, array );
    +		return results;
    +	}
    +	
    +	return array;
    +};
    +
    +// Perform a simple check to determine if the browser is capable of
    +// converting a NodeList to an array using builtin methods.
    +// Also verifies that the returned array holds DOM nodes
    +// (which is not the case in the Blackberry browser)
    +try {
    +	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
    +
    +// Provide a fallback method if it does not work
    +} catch( e ) {
    +	makeArray = function( array, results ) {
    +		var i = 0,
    +			ret = results || [];
    +
    +		if ( toString.call(array) === "[object Array]" ) {
    +			Array.prototype.push.apply( ret, array );
    +
    +		} else {
    +			if ( typeof array.length === "number" ) {
    +				for ( var l = array.length; i < l; i++ ) {
    +					ret.push( array[i] );
    +				}
    +
    +			} else {
    +				for ( ; array[i]; i++ ) {
    +					ret.push( array[i] );
    +				}
    +			}
    +		}
    +
    +		return ret;
    +	};
    +}
    +
    +var sortOrder, siblingCheck;
    +
    +if ( document.documentElement.compareDocumentPosition ) {
    +	sortOrder = function( a, b ) {
    +		if ( a === b ) {
    +			hasDuplicate = true;
    +			return 0;
    +		}
    +
    +		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
    +			return a.compareDocumentPosition ? -1 : 1;
    +		}
    +
    +		return a.compareDocumentPosition(b) & 4 ? -1 : 1;
    +	};
    +
    +} else {
    +	sortOrder = function( a, b ) {
    +		// The nodes are identical, we can exit early
    +		if ( a === b ) {
    +			hasDuplicate = true;
    +			return 0;
    +
    +		// Fallback to using sourceIndex (in IE) if it's available on both nodes
    +		} else if ( a.sourceIndex && b.sourceIndex ) {
    +			return a.sourceIndex - b.sourceIndex;
    +		}
    +
    +		var al, bl,
    +			ap = [],
    +			bp = [],
    +			aup = a.parentNode,
    +			bup = b.parentNode,
    +			cur = aup;
    +
    +		// If the nodes are siblings (or identical) we can do a quick check
    +		if ( aup === bup ) {
    +			return siblingCheck( a, b );
    +
    +		// If no parents were found then the nodes are disconnected
    +		} else if ( !aup ) {
    +			return -1;
    +
    +		} else if ( !bup ) {
    +			return 1;
    +		}
    +
    +		// Otherwise they're somewhere else in the tree so we need
    +		// to build up a full list of the parentNodes for comparison
    +		while ( cur ) {
    +			ap.unshift( cur );
    +			cur = cur.parentNode;
    +		}
    +
    +		cur = bup;
    +
    +		while ( cur ) {
    +			bp.unshift( cur );
    +			cur = cur.parentNode;
    +		}
    +
    +		al = ap.length;
    +		bl = bp.length;
    +
    +		// Start walking down the tree looking for a discrepancy
    +		for ( var i = 0; i < al && i < bl; i++ ) {
    +			if ( ap[i] !== bp[i] ) {
    +				return siblingCheck( ap[i], bp[i] );
    +			}
    +		}
    +
    +		// We ended someplace up the tree so do a sibling check
    +		return i === al ?
    +			siblingCheck( a, bp[i], -1 ) :
    +			siblingCheck( ap[i], b, 1 );
    +	};
    +
    +	siblingCheck = function( a, b, ret ) {
    +		if ( a === b ) {
    +			return ret;
    +		}
    +
    +		var cur = a.nextSibling;
    +
    +		while ( cur ) {
    +			if ( cur === b ) {
    +				return -1;
    +			}
    +
    +			cur = cur.nextSibling;
    +		}
    +
    +		return 1;
    +	};
    +}
    +
    +// Utility function for retreiving the text value of an array of DOM nodes
    +Sizzle.getText = function( elems ) {
    +	var ret = "", elem;
    +
    +	for ( var i = 0; elems[i]; i++ ) {
    +		elem = elems[i];
    +
    +		// Get the text from text nodes and CDATA nodes
    +		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
    +			ret += elem.nodeValue;
    +
    +		// Traverse everything else, except comment nodes
    +		} else if ( elem.nodeType !== 8 ) {
    +			ret += Sizzle.getText( elem.childNodes );
    +		}
    +	}
    +
    +	return ret;
    +};
    +
    +// Check to see if the browser returns elements by name when
    +// querying by getElementById (and provide a workaround)
    +(function(){
    +	// We're going to inject a fake input element with a specified name
    +	var form = document.createElement("div"),
    +		id = "script" + (new Date()).getTime(),
    +		root = document.documentElement;
    +
    +	form.innerHTML = "<a name='" + id + "'/>";
    +
    +	// Inject it into the root element, check its status, and remove it quickly
    +	root.insertBefore( form, root.firstChild );
    +
    +	// The workaround has to do additional checks after a getElementById
    +	// Which slows things down for other browsers (hence the branching)
    +	if ( document.getElementById( id ) ) {
    +		Expr.find.ID = function( match, context, isXML ) {
    +			if ( typeof context.getElementById !== "undefined" && !isXML ) {
    +				var m = context.getElementById(match[1]);
    +
    +				return m ?
    +					m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
    +						[m] :
    +						undefined :
    +					[];
    +			}
    +		};
    +
    +		Expr.filter.ID = function( elem, match ) {
    +			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
    +
    +			return elem.nodeType === 1 && node && node.nodeValue === match;
    +		};
    +	}
    +
    +	root.removeChild( form );
    +
    +	// release memory in IE
    +	root = form = null;
    +})();
    +
    +(function(){
    +	// Check to see if the browser returns only elements
    +	// when doing getElementsByTagName("*")
    +
    +	// Create a fake element
    +	var div = document.createElement("div");
    +	div.appendChild( document.createComment("") );
    +
    +	// Make sure no comments are found
    +	if ( div.getElementsByTagName("*").length > 0 ) {
    +		Expr.find.TAG = function( match, context ) {
    +			var results = context.getElementsByTagName( match[1] );
    +
    +			// Filter out possible comments
    +			if ( match[1] === "*" ) {
    +				var tmp = [];
    +
    +				for ( var i = 0; results[i]; i++ ) {
    +					if ( results[i].nodeType === 1 ) {
    +						tmp.push( results[i] );
    +					}
    +				}
    +
    +				results = tmp;
    +			}
    +
    +			return results;
    +		};
    +	}
    +
    +	// Check to see if an attribute returns normalized href attributes
    +	div.innerHTML = "<a href='#'></a>";
    +
    +	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
    +			div.firstChild.getAttribute("href") !== "#" ) {
    +
    +		Expr.attrHandle.href = function( elem ) {
    +			return elem.getAttribute( "href", 2 );
    +		};
    +	}
    +
    +	// release memory in IE
    +	div = null;
    +})();
    +
    +if ( document.querySelectorAll ) {
    +	(function(){
    +		var oldSizzle = Sizzle,
    +			div = document.createElement("div"),
    +			id = "__sizzle__";
    +
    +		div.innerHTML = "<p class='TEST'></p>";
    +
    +		// Safari can't handle uppercase or unicode characters when
    +		// in quirks mode.
    +		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
    +			return;
    +		}
    +	
    +		Sizzle = function( query, context, extra, seed ) {
    +			context = context || document;
    +
    +			// Only use querySelectorAll on non-XML documents
    +			// (ID selectors don't work in non-HTML documents)
    +			if ( !seed && !Sizzle.isXML(context) ) {
    +				// See if we find a selector to speed up
    +				var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
    +				
    +				if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
    +					// Speed-up: Sizzle("TAG")
    +					if ( match[1] ) {
    +						return makeArray( context.getElementsByTagName( query ), extra );
    +					
    +					// Speed-up: Sizzle(".CLASS")
    +					} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
    +						return makeArray( context.getElementsByClassName( match[2] ), extra );
    +					}
    +				}
    +				
    +				if ( context.nodeType === 9 ) {
    +					// Speed-up: Sizzle("body")
    +					// The body element only exists once, optimize finding it
    +					if ( query === "body" && context.body ) {
    +						return makeArray( [ context.body ], extra );
    +						
    +					// Speed-up: Sizzle("#ID")
    +					} else if ( match && match[3] ) {
    +						var elem = context.getElementById( match[3] );
    +
    +						// Check parentNode to catch when Blackberry 4.6 returns
    +						// nodes that are no longer in the document #6963
    +						if ( elem && elem.parentNode ) {
    +							// Handle the case where IE and Opera return items
    +							// by name instead of ID
    +							if ( elem.id === match[3] ) {
    +								return makeArray( [ elem ], extra );
    +							}
    +							
    +						} else {
    +							return makeArray( [], extra );
    +						}
    +					}
    +					
    +					try {
    +						return makeArray( context.querySelectorAll(query), extra );
    +					} catch(qsaError) {}
    +
    +				// qSA works strangely on Element-rooted queries
    +				// We can work around this by specifying an extra ID on the root
    +				// and working up from there (Thanks to Andrew Dupont for the technique)
    +				// IE 8 doesn't work on object elements
    +				} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
    +					var oldContext = context,
    +						old = context.getAttribute( "id" ),
    +						nid = old || id,
    +						hasParent = context.parentNode,
    +						relativeHierarchySelector = /^\s*[+~]/.test( query );
    +
    +					if ( !old ) {
    +						context.setAttribute( "id", nid );
    +					} else {
    +						nid = nid.replace( /'/g, "\\$&" );
    +					}
    +					if ( relativeHierarchySelector && hasParent ) {
    +						context = context.parentNode;
    +					}
    +
    +					try {
    +						if ( !relativeHierarchySelector || hasParent ) {
    +							return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
    +						}
    +
    +					} catch(pseudoError) {
    +					} finally {
    +						if ( !old ) {
    +							oldContext.removeAttribute( "id" );
    +						}
    +					}
    +				}
    +			}
    +		
    +			return oldSizzle(query, context, extra, seed);
    +		};
    +
    +		for ( var prop in oldSizzle ) {
    +			Sizzle[ prop ] = oldSizzle[ prop ];
    +		}
    +
    +		// release memory in IE
    +		div = null;
    +	})();
    +}
    +
    +(function(){
    +	var html = document.documentElement,
    +		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
    +
    +	if ( matches ) {
    +		// Check to see if it's possible to do matchesSelector
    +		// on a disconnected node (IE 9 fails this)
    +		var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
    +			pseudoWorks = false;
    +
    +		try {
    +			// This should fail with an exception
    +			// Gecko does not error, returns false instead
    +			matches.call( document.documentElement, "[test!='']:sizzle" );
    +	
    +		} catch( pseudoError ) {
    +			pseudoWorks = true;
    +		}
    +
    +		Sizzle.matchesSelector = function( node, expr ) {
    +			// Make sure that attribute selectors are quoted
    +			expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
    +
    +			if ( !Sizzle.isXML( node ) ) {
    +				try { 
    +					if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
    +						var ret = matches.call( node, expr );
    +
    +						// IE 9's matchesSelector returns false on disconnected nodes
    +						if ( ret || !disconnectedMatch ||
    +								// As well, disconnected nodes are said to be in a document
    +								// fragment in IE 9, so check for that
    +								node.document && node.document.nodeType !== 11 ) {
    +							return ret;
    +						}
    +					}
    +				} catch(e) {}
    +			}
    +
    +			return Sizzle(expr, null, null, [node]).length > 0;
    +		};
    +	}
    +})();
    +
    +(function(){
    +	var div = document.createElement("div");
    +
    +	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
    +
    +	// Opera can't find a second classname (in 9.6)
    +	// Also, make sure that getElementsByClassName actually exists
    +	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
    +		return;
    +	}
    +
    +	// Safari caches class attributes, doesn't catch changes (in 3.2)
    +	div.lastChild.className = "e";
    +
    +	if ( div.getElementsByClassName("e").length === 1 ) {
    +		return;
    +	}
    +	
    +	Expr.order.splice(1, 0, "CLASS");
    +	Expr.find.CLASS = function( match, context, isXML ) {
    +		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
    +			return context.getElementsByClassName(match[1]);
    +		}
    +	};
    +
    +	// release memory in IE
    +	div = null;
    +})();
    +
    +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
    +	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    +		var elem = checkSet[i];
    +
    +		if ( elem ) {
    +			var match = false;
    +
    +			elem = elem[dir];
    +
    +			while ( elem ) {
    +				if ( elem.sizcache === doneName ) {
    +					match = checkSet[elem.sizset];
    +					break;
    +				}
    +
    +				if ( elem.nodeType === 1 && !isXML ){
    +					elem.sizcache = doneName;
    +					elem.sizset = i;
    +				}
    +
    +				if ( elem.nodeName.toLowerCase() === cur ) {
    +					match = elem;
    +					break;
    +				}
    +
    +				elem = elem[dir];
    +			}
    +
    +			checkSet[i] = match;
    +		}
    +	}
    +}
    +
    +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
    +	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    +		var elem = checkSet[i];
    +
    +		if ( elem ) {
    +			var match = false;
    +			
    +			elem = elem[dir];
    +
    +			while ( elem ) {
    +				if ( elem.sizcache === doneName ) {
    +					match = checkSet[elem.sizset];
    +					break;
    +				}
    +
    +				if ( elem.nodeType === 1 ) {
    +					if ( !isXML ) {
    +						elem.sizcache = doneName;
    +						elem.sizset = i;
    +					}
    +
    +					if ( typeof cur !== "string" ) {
    +						if ( elem === cur ) {
    +							match = true;
    +							break;
    +						}
    +
    +					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
    +						match = elem;
    +						break;
    +					}
    +				}
    +
    +				elem = elem[dir];
    +			}
    +
    +			checkSet[i] = match;
    +		}
    +	}
    +}
    +
    +if ( document.documentElement.contains ) {
    +	Sizzle.contains = function( a, b ) {
    +		return a !== b && (a.contains ? a.contains(b) : true);
    +	};
    +
    +} else if ( document.documentElement.compareDocumentPosition ) {
    +	Sizzle.contains = function( a, b ) {
    +		return !!(a.compareDocumentPosition(b) & 16);
    +	};
    +
    +} else {
    +	Sizzle.contains = function() {
    +		return false;
    +	};
    +}
    +
    +Sizzle.isXML = function( elem ) {
    +	// documentElement is verified for cases where it doesn't yet exist
    +	// (such as loading iframes in IE - #4833) 
    +	var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
    +
    +	return documentElement ? documentElement.nodeName !== "HTML" : false;
    +};
    +
    +var posProcess = function( selector, context ) {
    +	var match,
    +		tmpSet = [],
    +		later = "",
    +		root = context.nodeType ? [context] : context;
    +
    +	// Position selectors must be done after the filter
    +	// And so must :not(positional) so we move all PSEUDOs to the end
    +	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
    +		later += match[0];
    +		selector = selector.replace( Expr.match.PSEUDO, "" );
    +	}
    +
    +	selector = Expr.relative[selector] ? selector + "*" : selector;
    +
    +	for ( var i = 0, l = root.length; i < l; i++ ) {
    +		Sizzle( selector, root[i], tmpSet );
    +	}
    +
    +	return Sizzle.filter( later, tmpSet );
    +};
    +
    +// EXPOSE
    +jQuery.find = Sizzle;
    +jQuery.expr = Sizzle.selectors;
    +jQuery.expr[":"] = jQuery.expr.filters;
    +jQuery.unique = Sizzle.uniqueSort;
    +jQuery.text = Sizzle.getText;
    +jQuery.isXMLDoc = Sizzle.isXML;
    +jQuery.contains = Sizzle.contains;
    +
    +
    +})();
    +
    +
    +var runtil = /Until$/,
    +	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
    +	// Note: This RegExp should be improved, or likely pulled from Sizzle
    +	rmultiselector = /,/,
    +	isSimple = /^.[^:#\[\.,]*$/,
    +	slice = Array.prototype.slice,
    +	POS = jQuery.expr.match.POS,
    +	// methods guaranteed to produce a unique set when starting from a unique set
    +	guaranteedUnique = {
    +		children: true,
    +		contents: true,
    +		next: true,
    +		prev: true
    +	};
    +
    +jQuery.fn.extend({
    +	find: function( selector ) {
    +		var self = this,
    +			i, l;
    +
    +		if ( typeof selector !== "string" ) {
    +			return jQuery( selector ).filter(function() {
    +				for ( i = 0, l = self.length; i < l; i++ ) {
    +					if ( jQuery.contains( self[ i ], this ) ) {
    +						return true;
    +					}
    +				}
    +			});
    +		}
    +
    +		var ret = this.pushStack( "", "find", selector ),
    +			length, n, r;
    +
    +		for ( i = 0, l = this.length; i < l; i++ ) {
    +			length = ret.length;
    +			jQuery.find( selector, this[i], ret );
    +
    +			if ( i > 0 ) {
    +				// Make sure that the results are unique
    +				for ( n = length; n < ret.length; n++ ) {
    +					for ( r = 0; r < length; r++ ) {
    +						if ( ret[r] === ret[n] ) {
    +							ret.splice(n--, 1);
    +							break;
    +						}
    +					}
    +				}
    +			}
    +		}
    +
    +		return ret;
    +	},
    +
    +	has: function( target ) {
    +		var targets = jQuery( target );
    +		return this.filter(function() {
    +			for ( var i = 0, l = targets.length; i < l; i++ ) {
    +				if ( jQuery.contains( this, targets[i] ) ) {
    +					return true;
    +				}
    +			}
    +		});
    +	},
    +
    +	not: function( selector ) {
    +		return this.pushStack( winnow(this, selector, false), "not", selector);
    +	},
    +
    +	filter: function( selector ) {
    +		return this.pushStack( winnow(this, selector, true), "filter", selector );
    +	},
    +
    +	is: function( selector ) {
    +		return !!selector && ( typeof selector === "string" ?
    +			jQuery.filter( selector, this ).length > 0 :
    +			this.filter( selector ).length > 0 );
    +	},
    +
    +	closest: function( selectors, context ) {
    +		var ret = [], i, l, cur = this[0];
    +		
    +		// Array
    +		if ( jQuery.isArray( selectors ) ) {
    +			var match, selector,
    +				matches = {},
    +				level = 1;
    +
    +			if ( cur && selectors.length ) {
    +				for ( i = 0, l = selectors.length; i < l; i++ ) {
    +					selector = selectors[i];
    +
    +					if ( !matches[ selector ] ) {
    +						matches[ selector ] = POS.test( selector ) ?
    +							jQuery( selector, context || this.context ) :
    +							selector;
    +					}
    +				}
    +
    +				while ( cur && cur.ownerDocument && cur !== context ) {
    +					for ( selector in matches ) {
    +						match = matches[ selector ];
    +
    +						if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
    +							ret.push({ selector: selector, elem: cur, level: level });
    +						}
    +					}
    +
    +					cur = cur.parentNode;
    +					level++;
    +				}
    +			}
    +
    +			return ret;
    +		}
    +
    +		// String
    +		var pos = POS.test( selectors ) || typeof selectors !== "string" ?
    +				jQuery( selectors, context || this.context ) :
    +				0;
    +
    +		for ( i = 0, l = this.length; i < l; i++ ) {
    +			cur = this[i];
    +
    +			while ( cur ) {
    +				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
    +					ret.push( cur );
    +					break;
    +
    +				} else {
    +					cur = cur.parentNode;
    +					if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
    +						break;
    +					}
    +				}
    +			}
    +		}
    +
    +		ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
    +
    +		return this.pushStack( ret, "closest", selectors );
    +	},
    +
    +	// Determine the position of an element within
    +	// the matched set of elements
    +	index: function( elem ) {
    +
    +		// No argument, return index in parent
    +		if ( !elem ) {
    +			return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
    +		}
    +
    +		// index in selector
    +		if ( typeof elem === "string" ) {
    +			return jQuery.inArray( this[0], jQuery( elem ) );
    +		}
    +
    +		// Locate the position of the desired element
    +		return jQuery.inArray(
    +			// If it receives a jQuery object, the first element is used
    +			elem.jquery ? elem[0] : elem, this );
    +	},
    +
    +	add: function( selector, context ) {
    +		var set = typeof selector === "string" ?
    +				jQuery( selector, context ) :
    +				jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
    +			all = jQuery.merge( this.get(), set );
    +
    +		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
    +			all :
    +			jQuery.unique( all ) );
    +	},
    +
    +	andSelf: function() {
    +		return this.add( this.prevObject );
    +	}
    +});
    +
    +// A painfully simple check to see if an element is disconnected
    +// from a document (should be improved, where feasible).
    +function isDisconnected( node ) {
    +	return !node || !node.parentNode || node.parentNode.nodeType === 11;
    +}
    +
    +jQuery.each({
    +	parent: function( elem ) {
    +		var parent = elem.parentNode;
    +		return parent && parent.nodeType !== 11 ? parent : null;
    +	},
    +	parents: function( elem ) {
    +		return jQuery.dir( elem, "parentNode" );
    +	},
    +	parentsUntil: function( elem, i, until ) {
    +		return jQuery.dir( elem, "parentNode", until );
    +	},
    +	next: function( elem ) {
    +		return jQuery.nth( elem, 2, "nextSibling" );
    +	},
    +	prev: function( elem ) {
    +		return jQuery.nth( elem, 2, "previousSibling" );
    +	},
    +	nextAll: function( elem ) {
    +		return jQuery.dir( elem, "nextSibling" );
    +	},
    +	prevAll: function( elem ) {
    +		return jQuery.dir( elem, "previousSibling" );
    +	},
    +	nextUntil: function( elem, i, until ) {
    +		return jQuery.dir( elem, "nextSibling", until );
    +	},
    +	prevUntil: function( elem, i, until ) {
    +		return jQuery.dir( elem, "previousSibling", until );
    +	},
    +	siblings: function( elem ) {
    +		return jQuery.sibling( elem.parentNode.firstChild, elem );
    +	},
    +	children: function( elem ) {
    +		return jQuery.sibling( elem.firstChild );
    +	},
    +	contents: function( elem ) {
    +		return jQuery.nodeName( elem, "iframe" ) ?
    +			elem.contentDocument || elem.contentWindow.document :
    +			jQuery.makeArray( elem.childNodes );
    +	}
    +}, function( name, fn ) {
    +	jQuery.fn[ name ] = function( until, selector ) {
    +		var ret = jQuery.map( this, fn, until ),
    +			// The variable 'args' was introduced in
    +			// https://github.com/jquery/jquery/commit/52a0238
    +			// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
    +			// http://code.google.com/p/v8/issues/detail?id=1050
    +			args = slice.call(arguments);
    +
    +		if ( !runtil.test( name ) ) {
    +			selector = until;
    +		}
    +
    +		if ( selector && typeof selector === "string" ) {
    +			ret = jQuery.filter( selector, ret );
    +		}
    +
    +		ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
    +
    +		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
    +			ret = ret.reverse();
    +		}
    +
    +		return this.pushStack( ret, name, args.join(",") );
    +	};
    +});
    +
    +jQuery.extend({
    +	filter: function( expr, elems, not ) {
    +		if ( not ) {
    +			expr = ":not(" + expr + ")";
    +		}
    +
    +		return elems.length === 1 ?
    +			jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
    +			jQuery.find.matches(expr, elems);
    +	},
    +
    +	dir: function( elem, dir, until ) {
    +		var matched = [],
    +			cur = elem[ dir ];
    +
    +		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
    +			if ( cur.nodeType === 1 ) {
    +				matched.push( cur );
    +			}
    +			cur = cur[dir];
    +		}
    +		return matched;
    +	},
    +
    +	nth: function( cur, result, dir, elem ) {
    +		result = result || 1;
    +		var num = 0;
    +
    +		for ( ; cur; cur = cur[dir] ) {
    +			if ( cur.nodeType === 1 && ++num === result ) {
    +				break;
    +			}
    +		}
    +
    +		return cur;
    +	},
    +
    +	sibling: function( n, elem ) {
    +		var r = [];
    +
    +		for ( ; n; n = n.nextSibling ) {
    +			if ( n.nodeType === 1 && n !== elem ) {
    +				r.push( n );
    +			}
    +		}
    +
    +		return r;
    +	}
    +});
    +
    +// Implement the identical functionality for filter and not
    +function winnow( elements, qualifier, keep ) {
    +
    +	// Can't pass null or undefined to indexOf in Firefox 4
    +	// Set to 0 to skip string check
    +	qualifier = qualifier || 0;
    +
    +	if ( jQuery.isFunction( qualifier ) ) {
    +		return jQuery.grep(elements, function( elem, i ) {
    +			var retVal = !!qualifier.call( elem, i, elem );
    +			return retVal === keep;
    +		});
    +
    +	} else if ( qualifier.nodeType ) {
    +		return jQuery.grep(elements, function( elem, i ) {
    +			return (elem === qualifier) === keep;
    +		});
    +
    +	} else if ( typeof qualifier === "string" ) {
    +		var filtered = jQuery.grep(elements, function( elem ) {
    +			return elem.nodeType === 1;
    +		});
    +
    +		if ( isSimple.test( qualifier ) ) {
    +			return jQuery.filter(qualifier, filtered, !keep);
    +		} else {
    +			qualifier = jQuery.filter( qualifier, filtered );
    +		}
    +	}
    +
    +	return jQuery.grep(elements, function( elem, i ) {
    +		return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
    +	});
    +}
    +
    +
    +
    +
    +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
    +	rleadingWhitespace = /^\s+/,
    +	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
    +	rtagName = /<([\w:]+)/,
    +	rtbody = /<tbody/i,
    +	rhtml = /<|&#?\w+;/,
    +	rnocache = /<(?:script|object|embed|option|style)/i,
    +	// checked="checked" or checked
    +	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
    +	rscriptType = /\/(java|ecma)script/i,
    +	rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
    +	wrapMap = {
    +		option: [ 1, "<select multiple='multiple'>", "</select>" ],
    +		legend: [ 1, "<fieldset>", "</fieldset>" ],
    +		thead: [ 1, "<table>", "</table>" ],
    +		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
    +		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
    +		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
    +		area: [ 1, "<map>", "</map>" ],
    +		_default: [ 0, "", "" ]
    +	};
    +
    +wrapMap.optgroup = wrapMap.option;
    +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
    +wrapMap.th = wrapMap.td;
    +
    +// IE can't serialize <link> and <script> tags normally
    +if ( !jQuery.support.htmlSerialize ) {
    +	wrapMap._default = [ 1, "div<div>", "</div>" ];
    +}
    +
    +jQuery.fn.extend({
    +	text: function( text ) {
    +		if ( jQuery.isFunction(text) ) {
    +			return this.each(function(i) {
    +				var self = jQuery( this );
    +
    +				self.text( text.call(this, i, self.text()) );
    +			});
    +		}
    +
    +		if ( typeof text !== "object" && text !== undefined ) {
    +			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
    +		}
    +
    +		return jQuery.text( this );
    +	},
    +
    +	wrapAll: function( html ) {
    +		if ( jQuery.isFunction( html ) ) {
    +			return this.each(function(i) {
    +				jQuery(this).wrapAll( html.call(this, i) );
    +			});
    +		}
    +
    +		if ( this[0] ) {
    +			// The elements to wrap the target around
    +			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
    +
    +			if ( this[0].parentNode ) {
    +				wrap.insertBefore( this[0] );
    +			}
    +
    +			wrap.map(function() {
    +				var elem = this;
    +
    +				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
    +					elem = elem.firstChild;
    +				}
    +
    +				return elem;
    +			}).append( this );
    +		}
    +
    +		return this;
    +	},
    +
    +	wrapInner: function( html ) {
    +		if ( jQuery.isFunction( html ) ) {
    +			return this.each(function(i) {
    +				jQuery(this).wrapInner( html.call(this, i) );
    +			});
    +		}
    +
    +		return this.each(function() {
    +			var self = jQuery( this ),
    +				contents = self.contents();
    +
    +			if ( contents.length ) {
    +				contents.wrapAll( html );
    +
    +			} else {
    +				self.append( html );
    +			}
    +		});
    +	},
    +
    +	wrap: function( html ) {
    +		return this.each(function() {
    +			jQuery( this ).wrapAll( html );
    +		});
    +	},
    +
    +	unwrap: function() {
    +		return this.parent().each(function() {
    +			if ( !jQuery.nodeName( this, "body" ) ) {
    +				jQuery( this ).replaceWith( this.childNodes );
    +			}
    +		}).end();
    +	},
    +
    +	append: function() {
    +		return this.domManip(arguments, true, function( elem ) {
    +			if ( this.nodeType === 1 ) {
    +				this.appendChild( elem );
    +			}
    +		});
    +	},
    +
    +	prepend: function() {
    +		return this.domManip(arguments, true, function( elem ) {
    +			if ( this.nodeType === 1 ) {
    +				this.insertBefore( elem, this.firstChild );
    +			}
    +		});
    +	},
    +
    +	before: function() {
    +		if ( this[0] && this[0].parentNode ) {
    +			return this.domManip(arguments, false, function( elem ) {
    +				this.parentNode.insertBefore( elem, this );
    +			});
    +		} else if ( arguments.length ) {
    +			var set = jQuery(arguments[0]);
    +			set.push.apply( set, this.toArray() );
    +			return this.pushStack( set, "before", arguments );
    +		}
    +	},
    +
    +	after: function() {
    +		if ( this[0] && this[0].parentNode ) {
    +			return this.domManip(arguments, false, function( elem ) {
    +				this.parentNode.insertBefore( elem, this.nextSibling );
    +			});
    +		} else if ( arguments.length ) {
    +			var set = this.pushStack( this, "after", arguments );
    +			set.push.apply( set, jQuery(arguments[0]).toArray() );
    +			return set;
    +		}
    +	},
    +
    +	// keepData is for internal use only--do not document
    +	remove: function( selector, keepData ) {
    +		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
    +			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
    +				if ( !keepData && elem.nodeType === 1 ) {
    +					jQuery.cleanData( elem.getElementsByTagName("*") );
    +					jQuery.cleanData( [ elem ] );
    +				}
    +
    +				if ( elem.parentNode ) {
    +					elem.parentNode.removeChild( elem );
    +				}
    +			}
    +		}
    +
    +		return this;
    +	},
    +
    +	empty: function() {
    +		for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
    +			// Remove element nodes and prevent memory leaks
    +			if ( elem.nodeType === 1 ) {
    +				jQuery.cleanData( elem.getElementsByTagName("*") );
    +			}
    +
    +			// Remove any remaining nodes
    +			while ( elem.firstChild ) {
    +				elem.removeChild( elem.firstChild );
    +			}
    +		}
    +
    +		return this;
    +	},
    +
    +	clone: function( dataAndEvents, deepDataAndEvents ) {
    +		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
    +		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
    +
    +		return this.map( function () {
    +			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
    +		});
    +	},
    +
    +	html: function( value ) {
    +		if ( value === undefined ) {
    +			return this[0] && this[0].nodeType === 1 ?
    +				this[0].innerHTML.replace(rinlinejQuery, "") :
    +				null;
    +
    +		// See if we can take a shortcut and just use innerHTML
    +		} else if ( typeof value === "string" && !rnocache.test( value ) &&
    +			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
    +			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
    +
    +			value = value.replace(rxhtmlTag, "<$1></$2>");
    +
    +			try {
    +				for ( var i = 0, l = this.length; i < l; i++ ) {
    +					// Remove element nodes and prevent memory leaks
    +					if ( this[i].nodeType === 1 ) {
    +						jQuery.cleanData( this[i].getElementsByTagName("*") );
    +						this[i].innerHTML = value;
    +					}
    +				}
    +
    +			// If using innerHTML throws an exception, use the fallback method
    +			} catch(e) {
    +				this.empty().append( value );
    +			}
    +
    +		} else if ( jQuery.isFunction( value ) ) {
    +			this.each(function(i){
    +				var self = jQuery( this );
    +
    +				self.html( value.call(this, i, self.html()) );
    +			});
    +
    +		} else {
    +			this.empty().append( value );
    +		}
    +
    +		return this;
    +	},
    +
    +	replaceWith: function( value ) {
    +		if ( this[0] && this[0].parentNode ) {
    +			// Make sure that the elements are removed from the DOM before they are inserted
    +			// this can help fix replacing a parent with child elements
    +			if ( jQuery.isFunction( value ) ) {
    +				return this.each(function(i) {
    +					var self = jQuery(this), old = self.html();
    +					self.replaceWith( value.call( this, i, old ) );
    +				});
    +			}
    +
    +			if ( typeof value !== "string" ) {
    +				value = jQuery( value ).detach();
    +			}
    +
    +			return this.each(function() {
    +				var next = this.nextSibling,
    +					parent = this.parentNode;
    +
    +				jQuery( this ).remove();
    +
    +				if ( next ) {
    +					jQuery(next).before( value );
    +				} else {
    +					jQuery(parent).append( value );
    +				}
    +			});
    +		} else {
    +			return this.length ?
    +				this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
    +				this;
    +		}
    +	},
    +
    +	detach: function( selector ) {
    +		return this.remove( selector, true );
    +	},
    +
    +	domManip: function( args, table, callback ) {
    +		var results, first, fragment, parent,
    +			value = args[0],
    +			scripts = [];
    +
    +		// We can't cloneNode fragments that contain checked, in WebKit
    +		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
    +			return this.each(function() {
    +				jQuery(this).domManip( args, table, callback, true );
    +			});
    +		}
    +
    +		if ( jQuery.isFunction(value) ) {
    +			return this.each(function(i) {
    +				var self = jQuery(this);
    +				args[0] = value.call(this, i, table ? self.html() : undefined);
    +				self.domManip( args, table, callback );
    +			});
    +		}
    +
    +		if ( this[0] ) {
    +			parent = value && value.parentNode;
    +
    +			// If we're in a fragment, just use that instead of building a new one
    +			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
    +				results = { fragment: parent };
    +
    +			} else {
    +				results = jQuery.buildFragment( args, this, scripts );
    +			}
    +
    +			fragment = results.fragment;
    +
    +			if ( fragment.childNodes.length === 1 ) {
    +				first = fragment = fragment.firstChild;
    +			} else {
    +				first = fragment.firstChild;
    +			}
    +
    +			if ( first ) {
    +				table = table && jQuery.nodeName( first, "tr" );
    +
    +				for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
    +					callback.call(
    +						table ?
    +							root(this[i], first) :
    +							this[i],
    +						// Make sure that we do not leak memory by inadvertently discarding
    +						// the original fragment (which might have attached data) instead of
    +						// using it; in addition, use the original fragment object for the last
    +						// item instead of first because it can end up being emptied incorrectly
    +						// in certain situations (Bug #8070).
    +						// Fragments from the fragment cache must always be cloned and never used
    +						// in place.
    +						results.cacheable || (l > 1 && i < lastIndex) ?
    +							jQuery.clone( fragment, true, true ) :
    +							fragment
    +					);
    +				}
    +			}
    +
    +			if ( scripts.length ) {
    +				jQuery.each( scripts, evalScript );
    +			}
    +		}
    +
    +		return this;
    +	}
    +});
    +
    +function root( elem, cur ) {
    +	return jQuery.nodeName(elem, "table") ?
    +		(elem.getElementsByTagName("tbody")[0] ||
    +		elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
    +		elem;
    +}
    +
    +function cloneCopyEvent( src, dest ) {
    +
    +	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
    +		return;
    +	}
    +
    +	var internalKey = jQuery.expando,
    +		oldData = jQuery.data( src ),
    +		curData = jQuery.data( dest, oldData );
    +
    +	// Switch to use the internal data object, if it exists, for the next
    +	// stage of data copying
    +	if ( (oldData = oldData[ internalKey ]) ) {
    +		var events = oldData.events;
    +				curData = curData[ internalKey ] = jQuery.extend({}, oldData);
    +
    +		if ( events ) {
    +			delete curData.handle;
    +			curData.events = {};
    +
    +			for ( var type in events ) {
    +				for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
    +					jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
    +				}
    +			}
    +		}
    +	}
    +}
    +
    +function cloneFixAttributes( src, dest ) {
    +	var nodeName;
    +
    +	// We do not need to do anything for non-Elements
    +	if ( dest.nodeType !== 1 ) {
    +		return;
    +	}
    +
    +	// clearAttributes removes the attributes, which we don't want,
    +	// but also removes the attachEvent events, which we *do* want
    +	if ( dest.clearAttributes ) {
    +		dest.clearAttributes();
    +	}
    +
    +	// mergeAttributes, in contrast, only merges back on the
    +	// original attributes, not the events
    +	if ( dest.mergeAttributes ) {
    +		dest.mergeAttributes( src );
    +	}
    +
    +	nodeName = dest.nodeName.toLowerCase();
    +
    +	// IE6-8 fail to clone children inside object elements that use
    +	// the proprietary classid attribute value (rather than the type
    +	// attribute) to identify the type of content to display
    +	if ( nodeName === "object" ) {
    +		dest.outerHTML = src.outerHTML;
    +
    +	} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
    +		// IE6-8 fails to persist the checked state of a cloned checkbox
    +		// or radio button. Worse, IE6-7 fail to give the cloned element
    +		// a checked appearance if the defaultChecked value isn't also set
    +		if ( src.checked ) {
    +			dest.defaultChecked = dest.checked = src.checked;
    +		}
    +
    +		// IE6-7 get confused and end up setting the value of a cloned
    +		// checkbox/radio button to an empty string instead of "on"
    +		if ( dest.value !== src.value ) {
    +			dest.value = src.value;
    +		}
    +
    +	// IE6-8 fails to return the selected option to the default selected
    +	// state when cloning options
    +	} else if ( nodeName === "option" ) {
    +		dest.selected = src.defaultSelected;
    +
    +	// IE6-8 fails to set the defaultValue to the correct value when
    +	// cloning other types of input fields
    +	} else if ( nodeName === "input" || nodeName === "textarea" ) {
    +		dest.defaultValue = src.defaultValue;
    +	}
    +
    +	// Event data gets referenced instead of copied if the expando
    +	// gets copied too
    +	dest.removeAttribute( jQuery.expando );
    +}
    +
    +jQuery.buildFragment = function( args, nodes, scripts ) {
    +	var fragment, cacheable, cacheresults, doc;
    +
    +  // nodes may contain either an explicit document object,
    +  // a jQuery collection or context object.
    +  // If nodes[0] contains a valid object to assign to doc
    +  if ( nodes && nodes[0] ) {
    +    doc = nodes[0].ownerDocument || nodes[0];
    +  }
    +
    +  // Ensure that an attr object doesn't incorrectly stand in as a document object
    +	// Chrome and Firefox seem to allow this to occur and will throw exception
    +	// Fixes #8950
    +	if ( !doc.createDocumentFragment ) {
    +		doc = document;
    +	}
    +
    +	// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
    +	// Cloning options loses the selected state, so don't cache them
    +	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
    +	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
    +	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
    +		args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
    +
    +		cacheable = true;
    +
    +		cacheresults = jQuery.fragments[ args[0] ];
    +		if ( cacheresults && cacheresults !== 1 ) {
    +			fragment = cacheresults;
    +		}
    +	}
    +
    +	if ( !fragment ) {
    +		fragment = doc.createDocumentFragment();
    +		jQuery.clean( args, doc, fragment, scripts );
    +	}
    +
    +	if ( cacheable ) {
    +		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
    +	}
    +
    +	return { fragment: fragment, cacheable: cacheable };
    +};
    +
    +jQuery.fragments = {};
    +
    +jQuery.each({
    +	appendTo: "append",
    +	prependTo: "prepend",
    +	insertBefore: "before",
    +	insertAfter: "after",
    +	replaceAll: "replaceWith"
    +}, function( name, original ) {
    +	jQuery.fn[ name ] = function( selector ) {
    +		var ret = [],
    +			insert = jQuery( selector ),
    +			parent = this.length === 1 && this[0].parentNode;
    +
    +		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
    +			insert[ original ]( this[0] );
    +			return this;
    +
    +		} else {
    +			for ( var i = 0, l = insert.length; i < l; i++ ) {
    +				var elems = (i > 0 ? this.clone(true) : this).get();
    +				jQuery( insert[i] )[ original ]( elems );
    +				ret = ret.concat( elems );
    +			}
    +
    +			return this.pushStack( ret, name, insert.selector );
    +		}
    +	};
    +});
    +
    +function getAll( elem ) {
    +	if ( "getElementsByTagName" in elem ) {
    +		return elem.getElementsByTagName( "*" );
    +
    +	} else if ( "querySelectorAll" in elem ) {
    +		return elem.querySelectorAll( "*" );
    +
    +	} else {
    +		return [];
    +	}
    +}
    +
    +// Used in clean, fixes the defaultChecked property
    +function fixDefaultChecked( elem ) {
    +	if ( elem.type === "checkbox" || elem.type === "radio" ) {
    +		elem.defaultChecked = elem.checked;
    +	}
    +}
    +// Finds all inputs and passes them to fixDefaultChecked
    +function findInputs( elem ) {
    +	if ( jQuery.nodeName( elem, "input" ) ) {
    +		fixDefaultChecked( elem );
    +	} else if ( "getElementsByTagName" in elem ) {
    +		jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
    +	}
    +}
    +
    +jQuery.extend({
    +	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
    +		var clone = elem.cloneNode(true),
    +				srcElements,
    +				destElements,
    +				i;
    +
    +		if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
    +				(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
    +			// IE copies events bound via attachEvent when using cloneNode.
    +			// Calling detachEvent on the clone will also remove the events
    +			// from the original. In order to get around this, we use some
    +			// proprietary methods to clear the events. Thanks to MooTools
    +			// guys for this hotness.
    +
    +			cloneFixAttributes( elem, clone );
    +
    +			// Using Sizzle here is crazy slow, so we use getElementsByTagName
    +			// instead
    +			srcElements = getAll( elem );
    +			destElements = getAll( clone );
    +
    +			// Weird iteration because IE will replace the length property
    +			// with an element if you are cloning the body and one of the
    +			// elements on the page has a name or id of "length"
    +			for ( i = 0; srcElements[i]; ++i ) {
    +				// Ensure that the destination node is not null; Fixes #9587
    +				if ( destElements[i] ) {
    +					cloneFixAttributes( srcElements[i], destElements[i] );
    +				}
    +			}
    +		}
    +
    +		// Copy the events from the original to the clone
    +		if ( dataAndEvents ) {
    +			cloneCopyEvent( elem, clone );
    +
    +			if ( deepDataAndEvents ) {
    +				srcElements = getAll( elem );
    +				destElements = getAll( clone );
    +
    +				for ( i = 0; srcElements[i]; ++i ) {
    +					cloneCopyEvent( srcElements[i], destElements[i] );
    +				}
    +			}
    +		}
    +
    +		srcElements = destElements = null;
    +
    +		// Return the cloned set
    +		return clone;
    +	},
    +
    +	clean: function( elems, context, fragment, scripts ) {
    +		var checkScriptType;
    +
    +		context = context || document;
    +
    +		// !context.createElement fails in IE with an error but returns typeof 'object'
    +		if ( typeof context.createElement === "undefined" ) {
    +			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
    +		}
    +
    +		var ret = [], j;
    +
    +		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
    +			if ( typeof elem === "number" ) {
    +				elem += "";
    +			}
    +
    +			if ( !elem ) {
    +				continue;
    +			}
    +
    +			// Convert html string into DOM nodes
    +			if ( typeof elem === "string" ) {
    +				if ( !rhtml.test( elem ) ) {
    +					elem = context.createTextNode( elem );
    +				} else {
    +					// Fix "XHTML"-style tags in all browsers
    +					elem = elem.replace(rxhtmlTag, "<$1></$2>");
    +
    +					// Trim whitespace, otherwise indexOf won't work as expected
    +					var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
    +						wrap = wrapMap[ tag ] || wrapMap._default,
    +						depth = wrap[0],
    +						div = context.createElement("div");
    +
    +					// Go to html and back, then peel off extra wrappers
    +					div.innerHTML = wrap[1] + elem + wrap[2];
    +
    +					// Move to the right depth
    +					while ( depth-- ) {
    +						div = div.lastChild;
    +					}
    +
    +					// Remove IE's autoinserted <tbody> from table fragments
    +					if ( !jQuery.support.tbody ) {
    +
    +						// String was a <table>, *may* have spurious <tbody>
    +						var hasBody = rtbody.test(elem),
    +							tbody = tag === "table" && !hasBody ?
    +								div.firstChild && div.firstChild.childNodes :
    +
    +								// String was a bare <thead> or <tfoot>
    +								wrap[1] === "<table>" && !hasBody ?
    +									div.childNodes :
    +									[];
    +
    +						for ( j = tbody.length - 1; j >= 0 ; --j ) {
    +							if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
    +								tbody[ j ].parentNode.removeChild( tbody[ j ] );
    +							}
    +						}
    +					}
    +
    +					// IE completely kills leading whitespace when innerHTML is used
    +					if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
    +						div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
    +					}
    +
    +					elem = div.childNodes;
    +				}
    +			}
    +
    +			// Resets defaultChecked for any radios and checkboxes
    +			// about to be appended to the DOM in IE 6/7 (#8060)
    +			var len;
    +			if ( !jQuery.support.appendChecked ) {
    +				if ( elem[0] && typeof (len = elem.length) === "number" ) {
    +					for ( j = 0; j < len; j++ ) {
    +						findInputs( elem[j] );
    +					}
    +				} else {
    +					findInputs( elem );
    +				}
    +			}
    +
    +			if ( elem.nodeType ) {
    +				ret.push( elem );
    +			} else {
    +				ret = jQuery.merge( ret, elem );
    +			}
    +		}
    +
    +		if ( fragment ) {
    +			checkScriptType = function( elem ) {
    +				return !elem.type || rscriptType.test( elem.type );
    +			};
    +			for ( i = 0; ret[i]; i++ ) {
    +				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
    +					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
    +
    +				} else {
    +					if ( ret[i].nodeType === 1 ) {
    +						var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
    +
    +						ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
    +					}
    +					fragment.appendChild( ret[i] );
    +				}
    +			}
    +		}
    +
    +		return ret;
    +	},
    +
    +	cleanData: function( elems ) {
    +		var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
    +			deleteExpando = jQuery.support.deleteExpando;
    +
    +		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
    +			if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
    +				continue;
    +			}
    +
    +			id = elem[ jQuery.expando ];
    +
    +			if ( id ) {
    +				data = cache[ id ] && cache[ id ][ internalKey ];
    +
    +				if ( data && data.events ) {
    +					for ( var type in data.events ) {
    +						if ( special[ type ] ) {
    +							jQuery.event.remove( elem, type );
    +
    +						// This is a shortcut to avoid jQuery.event.remove's overhead
    +						} else {
    +							jQuery.removeEvent( elem, type, data.handle );
    +						}
    +					}
    +
    +					// Null the DOM reference to avoid IE6/7/8 leak (#7054)
    +					if ( data.handle ) {
    +						data.handle.elem = null;
    +					}
    +				}
    +
    +				if ( deleteExpando ) {
    +					delete elem[ jQuery.expando ];
    +
    +				} else if ( elem.removeAttribute ) {
    +					elem.removeAttribute( jQuery.expando );
    +				}
    +
    +				delete cache[ id ];
    +			}
    +		}
    +	}
    +});
    +
    +function evalScript( i, elem ) {
    +	if ( elem.src ) {
    +		jQuery.ajax({
    +			url: elem.src,
    +			async: false,
    +			dataType: "script"
    +		});
    +	} else {
    +		jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
    +	}
    +
    +	if ( elem.parentNode ) {
    +		elem.parentNode.removeChild( elem );
    +	}
    +}
    +
    +
    +
    +
    +var ralpha = /alpha\([^)]*\)/i,
    +	ropacity = /opacity=([^)]*)/,
    +	// fixed for IE9, see #8346
    +	rupper = /([A-Z]|^ms)/g,
    +	rnumpx = /^-?\d+(?:px)?$/i,
    +	rnum = /^-?\d/,
    +	rrelNum = /^([\-+])=([\-+.\de]+)/,
    +
    +	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
    +	cssWidth = [ "Left", "Right" ],
    +	cssHeight = [ "Top", "Bottom" ],
    +	curCSS,
    +
    +	getComputedStyle,
    +	currentStyle;
    +
    +jQuery.fn.css = function( name, value ) {
    +	// Setting 'undefined' is a no-op
    +	if ( arguments.length === 2 && value === undefined ) {
    +		return this;
    +	}
    +
    +	return jQuery.access( this, name, value, true, function( elem, name, value ) {
    +		return value !== undefined ?
    +			jQuery.style( elem, name, value ) :
    +			jQuery.css( elem, name );
    +	});
    +};
    +
    +jQuery.extend({
    +	// Add in style property hooks for overriding the default
    +	// behavior of getting and setting a style property
    +	cssHooks: {
    +		opacity: {
    +			get: function( elem, computed ) {
    +				if ( computed ) {
    +					// We should always get a number back from opacity
    +					var ret = curCSS( elem, "opacity", "opacity" );
    +					return ret === "" ? "1" : ret;
    +
    +				} else {
    +					return elem.style.opacity;
    +				}
    +			}
    +		}
    +	},
    +
    +	// Exclude the following css properties to add px
    +	cssNumber: {
    +		"fillOpacity": true,
    +		"fontWeight": true,
    +		"lineHeight": true,
    +		"opacity": true,
    +		"orphans": true,
    +		"widows": true,
    +		"zIndex": true,
    +		"zoom": true
    +	},
    +
    +	// Add in properties whose names you wish to fix before
    +	// setting or getting the value
    +	cssProps: {
    +		// normalize float css property
    +		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
    +	},
    +
    +	// Get and set the style property on a DOM Node
    +	style: function( elem, name, value, extra ) {
    +		// Don't set styles on text and comment nodes
    +		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
    +			return;
    +		}
    +
    +		// Make sure that we're working with the right name
    +		var ret, type, origName = jQuery.camelCase( name ),
    +			style = elem.style, hooks = jQuery.cssHooks[ origName ];
    +
    +		name = jQuery.cssProps[ origName ] || origName;
    +
    +		// Check if we're setting a value
    +		if ( value !== undefined ) {
    +			type = typeof value;
    +
    +			// convert relative number strings (+= or -=) to relative numbers. #7345
    +			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
    +				value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
    +				// Fixes bug #9237
    +				type = "number";
    +			}
    +
    +			// Make sure that NaN and null values aren't set. See: #7116
    +			if ( value == null || type === "number" && isNaN( value ) ) {
    +				return;
    +			}
    +
    +			// If a number was passed in, add 'px' to the (except for certain CSS properties)
    +			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
    +				value += "px";
    +			}
    +
    +			// If a hook was provided, use that value, otherwise just set the specified value
    +			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
    +				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
    +				// Fixes bug #5509
    +				try {
    +					style[ name ] = value;
    +				} catch(e) {}
    +			}
    +
    +		} else {
    +			// If a hook was provided get the non-computed value from there
    +			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
    +				return ret;
    +			}
    +
    +			// Otherwise just get the value from the style object
    +			return style[ name ];
    +		}
    +	},
    +
    +	css: function( elem, name, extra ) {
    +		var ret, hooks;
    +
    +		// Make sure that we're working with the right name
    +		name = jQuery.camelCase( name );
    +		hooks = jQuery.cssHooks[ name ];
    +		name = jQuery.cssProps[ name ] || name;
    +
    +		// cssFloat needs a special treatment
    +		if ( name === "cssFloat" ) {
    +			name = "float";
    +		}
    +
    +		// If a hook was provided get the computed value from there
    +		if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
    +			return ret;
    +
    +		// Otherwise, if a way to get the computed value exists, use that
    +		} else if ( curCSS ) {
    +			return curCSS( elem, name );
    +		}
    +	},
    +
    +	// A method for quickly swapping in/out CSS properties to get correct calculations
    +	swap: function( elem, options, callback ) {
    +		var old = {};
    +
    +		// Remember the old values, and insert the new ones
    +		for ( var name in options ) {
    +			old[ name ] = elem.style[ name ];
    +			elem.style[ name ] = options[ name ];
    +		}
    +
    +		callback.call( elem );
    +
    +		// Revert the old values
    +		for ( name in options ) {
    +			elem.style[ name ] = old[ name ];
    +		}
    +	}
    +});
    +
    +// DEPRECATED, Use jQuery.css() instead
    +jQuery.curCSS = jQuery.css;
    +
    +jQuery.each(["height", "width"], function( i, name ) {
    +	jQuery.cssHooks[ name ] = {
    +		get: function( elem, computed, extra ) {
    +			var val;
    +
    +			if ( computed ) {
    +				if ( elem.offsetWidth !== 0 ) {
    +					return getWH( elem, name, extra );
    +				} else {
    +					jQuery.swap( elem, cssShow, function() {
    +						val = getWH( elem, name, extra );
    +					});
    +				}
    +
    +				return val;
    +			}
    +		},
    +
    +		set: function( elem, value ) {
    +			if ( rnumpx.test( value ) ) {
    +				// ignore negative width and height values #1599
    +				value = parseFloat( value );
    +
    +				if ( value >= 0 ) {
    +					return value + "px";
    +				}
    +
    +			} else {
    +				return value;
    +			}
    +		}
    +	};
    +});
    +
    +if ( !jQuery.support.opacity ) {
    +	jQuery.cssHooks.opacity = {
    +		get: function( elem, computed ) {
    +			// IE uses filters for opacity
    +			return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
    +				( parseFloat( RegExp.$1 ) / 100 ) + "" :
    +				computed ? "1" : "";
    +		},
    +
    +		set: function( elem, value ) {
    +			var style = elem.style,
    +				currentStyle = elem.currentStyle,
    +				opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
    +				filter = currentStyle && currentStyle.filter || style.filter || "";
    +
    +			// IE has trouble with opacity if it does not have layout
    +			// Force it by setting the zoom level
    +			style.zoom = 1;
    +
    +			// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
    +			if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
    +
    +				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
    +				// if "filter:" is present at all, clearType is disabled, we want to avoid this
    +				// style.removeAttribute is IE Only, but so apparently is this code path...
    +				style.removeAttribute( "filter" );
    +
    +				// if there there is no filter style applied in a css rule, we are done
    +				if ( currentStyle && !currentStyle.filter ) {
    +					return;
    +				}
    +			}
    +
    +			// otherwise, set new filter values
    +			style.filter = ralpha.test( filter ) ?
    +				filter.replace( ralpha, opacity ) :
    +				filter + " " + opacity;
    +		}
    +	};
    +}
    +
    +jQuery(function() {
    +	// This hook cannot be added until DOM ready because the support test
    +	// for it is not run until after DOM ready
    +	if ( !jQuery.support.reliableMarginRight ) {
    +		jQuery.cssHooks.marginRight = {
    +			get: function( elem, computed ) {
    +				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
    +				// Work around by temporarily setting element display to inline-block
    +				var ret;
    +				jQuery.swap( elem, { "display": "inline-block" }, function() {
    +					if ( computed ) {
    +						ret = curCSS( elem, "margin-right", "marginRight" );
    +					} else {
    +						ret = elem.style.marginRight;
    +					}
    +				});
    +				return ret;
    +			}
    +		};
    +	}
    +});
    +
    +if ( document.defaultView && document.defaultView.getComputedStyle ) {
    +	getComputedStyle = function( elem, name ) {
    +		var ret, defaultView, computedStyle;
    +
    +		name = name.replace( rupper, "-$1" ).toLowerCase();
    +
    +		if ( !(defaultView = elem.ownerDocument.defaultView) ) {
    +			return undefined;
    +		}
    +
    +		if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
    +			ret = computedStyle.getPropertyValue( name );
    +			if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
    +				ret = jQuery.style( elem, name );
    +			}
    +		}
    +
    +		return ret;
    +	};
    +}
    +
    +if ( document.documentElement.currentStyle ) {
    +	currentStyle = function( elem, name ) {
    +		var left,
    +			ret = elem.currentStyle && elem.currentStyle[ name ],
    +			rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
    +			style = elem.style;
    +
    +		// From the awesome hack by Dean Edwards
    +		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
    +
    +		// If we're not dealing with a regular pixel number
    +		// but a number that has a weird ending, we need to convert it to pixels
    +		if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
    +			// Remember the original values
    +			left = style.left;
    +
    +			// Put in the new values to get a computed value out
    +			if ( rsLeft ) {
    +				elem.runtimeStyle.left = elem.currentStyle.left;
    +			}
    +			style.left = name === "fontSize" ? "1em" : (ret || 0);
    +			ret = style.pixelLeft + "px";
    +
    +			// Revert the changed values
    +			style.left = left;
    +			if ( rsLeft ) {
    +				elem.runtimeStyle.left = rsLeft;
    +			}
    +		}
    +
    +		return ret === "" ? "auto" : ret;
    +	};
    +}
    +
    +curCSS = getComputedStyle || currentStyle;
    +
    +function getWH( elem, name, extra ) {
    +
    +	// Start with offset property
    +	var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
    +		which = name === "width" ? cssWidth : cssHeight;
    +
    +	if ( val > 0 ) {
    +		if ( extra !== "border" ) {
    +			jQuery.each( which, function() {
    +				if ( !extra ) {
    +					val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
    +				}
    +				if ( extra === "margin" ) {
    +					val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
    +				} else {
    +					val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
    +				}
    +			});
    +		}
    +
    +		return val + "px";
    +	}
    +
    +	// Fall back to computed then uncomputed css if necessary
    +	val = curCSS( elem, name, name );
    +	if ( val < 0 || val == null ) {
    +		val = elem.style[ name ] || 0;
    +	}
    +	// Normalize "", auto, and prepare for extra
    +	val = parseFloat( val ) || 0;
    +
    +	// Add padding, border, margin
    +	if ( extra ) {
    +		jQuery.each( which, function() {
    +			val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
    +			if ( extra !== "padding" ) {
    +				val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
    +			}
    +			if ( extra === "margin" ) {
    +				val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
    +			}
    +		});
    +	}
    +
    +	return val + "px";
    +}
    +
    +if ( jQuery.expr && jQuery.expr.filters ) {
    +	jQuery.expr.filters.hidden = function( elem ) {
    +		var width = elem.offsetWidth,
    +			height = elem.offsetHeight;
    +
    +		return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
    +	};
    +
    +	jQuery.expr.filters.visible = function( elem ) {
    +		return !jQuery.expr.filters.hidden( elem );
    +	};
    +}
    +
    +
    +
    +
    +var r20 = /%20/g,
    +	rbracket = /\[\]$/,
    +	rCRLF = /\r?\n/g,
    +	rhash = /#.*$/,
    +	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
    +	rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
    +	// #7653, #8125, #8152: local protocol detection
    +	rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
    +	rnoContent = /^(?:GET|HEAD)$/,
    +	rprotocol = /^\/\//,
    +	rquery = /\?/,
    +	rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
    +	rselectTextarea = /^(?:select|textarea)/i,
    +	rspacesAjax = /\s+/,
    +	rts = /([?&])_=[^&]*/,
    +	rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
    +
    +	// Keep a copy of the old load method
    +	_load = jQuery.fn.load,
    +
    +	/* Prefilters
    +	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
    +	 * 2) These are called:
    +	 *    - BEFORE asking for a transport
    +	 *    - AFTER param serialization (s.data is a string if s.processData is true)
    +	 * 3) key is the dataType
    +	 * 4) the catchall symbol "*" can be used
    +	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
    +	 */
    +	prefilters = {},
    +
    +	/* Transports bindings
    +	 * 1) key is the dataType
    +	 * 2) the catchall symbol "*" can be used
    +	 * 3) selection will start with transport dataType and THEN go to "*" if needed
    +	 */
    +	transports = {},
    +
    +	// Document location
    +	ajaxLocation,
    +
    +	// Document location segments
    +	ajaxLocParts,
    +	
    +	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
    +	allTypes = ["*/"] + ["*"];
    +
    +// #8138, IE may throw an exception when accessing
    +// a field from window.location if document.domain has been set
    +try {
    +	ajaxLocation = location.href;
    +} catch( e ) {
    +	// Use the href attribute of an A element
    +	// since IE will modify it given document.location
    +	ajaxLocation = document.createElement( "a" );
    +	ajaxLocation.href = "";
    +	ajaxLocation = ajaxLocation.href;
    +}
    +
    +// Segment location into parts
    +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
    +
    +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
    +function addToPrefiltersOrTransports( structure ) {
    +
    +	// dataTypeExpression is optional and defaults to "*"
    +	return function( dataTypeExpression, func ) {
    +
    +		if ( typeof dataTypeExpression !== "string" ) {
    +			func = dataTypeExpression;
    +			dataTypeExpression = "*";
    +		}
    +
    +		if ( jQuery.isFunction( func ) ) {
    +			var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
    +				i = 0,
    +				length = dataTypes.length,
    +				dataType,
    +				list,
    +				placeBefore;
    +
    +			// For each dataType in the dataTypeExpression
    +			for(; i < length; i++ ) {
    +				dataType = dataTypes[ i ];
    +				// We control if we're asked to add before
    +				// any existing element
    +				placeBefore = /^\+/.test( dataType );
    +				if ( placeBefore ) {
    +					dataType = dataType.substr( 1 ) || "*";
    +				}
    +				list = structure[ dataType ] = structure[ dataType ] || [];
    +				// then we add to the structure accordingly
    +				list[ placeBefore ? "unshift" : "push" ]( func );
    +			}
    +		}
    +	};
    +}
    +
    +// Base inspection function for prefilters and transports
    +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
    +		dataType /* internal */, inspected /* internal */ ) {
    +
    +	dataType = dataType || options.dataTypes[ 0 ];
    +	inspected = inspected || {};
    +
    +	inspected[ dataType ] = true;
    +
    +	var list = structure[ dataType ],
    +		i = 0,
    +		length = list ? list.length : 0,
    +		executeOnly = ( structure === prefilters ),
    +		selection;
    +
    +	for(; i < length && ( executeOnly || !selection ); i++ ) {
    +		selection = list[ i ]( options, originalOptions, jqXHR );
    +		// If we got redirected to another dataType
    +		// we try there if executing only and not done already
    +		if ( typeof selection === "string" ) {
    +			if ( !executeOnly || inspected[ selection ] ) {
    +				selection = undefined;
    +			} else {
    +				options.dataTypes.unshift( selection );
    +				selection = inspectPrefiltersOrTransports(
    +						structure, options, originalOptions, jqXHR, selection, inspected );
    +			}
    +		}
    +	}
    +	// If we're only executing or nothing was selected
    +	// we try the catchall dataType if not done already
    +	if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
    +		selection = inspectPrefiltersOrTransports(
    +				structure, options, originalOptions, jqXHR, "*", inspected );
    +	}
    +	// unnecessary when only executing (prefilters)
    +	// but it'll be ignored by the caller in that case
    +	return selection;
    +}
    +
    +// A special extend for ajax options
    +// that takes "flat" options (not to be deep extended)
    +// Fixes #9887
    +function ajaxExtend( target, src ) {
    +	var key, deep,
    +		flatOptions = jQuery.ajaxSettings.flatOptions || {};
    +	for( key in src ) {
    +		if ( src[ key ] !== undefined ) {
    +			( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
    +		}
    +	}
    +	if ( deep ) {
    +		jQuery.extend( true, target, deep );
    +	}
    +}
    +
    +jQuery.fn.extend({
    +	load: function( url, params, callback ) {
    +		if ( typeof url !== "string" && _load ) {
    +			return _load.apply( this, arguments );
    +
    +		// Don't do a request if no elements are being requested
    +		} else if ( !this.length ) {
    +			return this;
    +		}
    +
    +		var off = url.indexOf( " " );
    +		if ( off >= 0 ) {
    +			var selector = url.slice( off, url.length );
    +			url = url.slice( 0, off );
    +		}
    +
    +		// Default to a GET request
    +		var type = "GET";
    +
    +		// If the second parameter was provided
    +		if ( params ) {
    +			// If it's a function
    +			if ( jQuery.isFunction( params ) ) {
    +				// We assume that it's the callback
    +				callback = params;
    +				params = undefined;
    +
    +			// Otherwise, build a param string
    +			} else if ( typeof params === "object" ) {
    +				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
    +				type = "POST";
    +			}
    +		}
    +
    +		var self = this;
    +
    +		// Request the remote document
    +		jQuery.ajax({
    +			url: url,
    +			type: type,
    +			dataType: "html",
    +			data: params,
    +			// Complete callback (responseText is used internally)
    +			complete: function( jqXHR, status, responseText ) {
    +				// Store the response as specified by the jqXHR object
    +				responseText = jqXHR.responseText;
    +				// If successful, inject the HTML into all the matched elements
    +				if ( jqXHR.isResolved() ) {
    +					// #4825: Get the actual response in case
    +					// a dataFilter is present in ajaxSettings
    +					jqXHR.done(function( r ) {
    +						responseText = r;
    +					});
    +					// See if a selector was specified
    +					self.html( selector ?
    +						// Create a dummy div to hold the results
    +						jQuery("<div>")
    +							// inject the contents of the document in, removing the scripts
    +							// to avoid any 'Permission Denied' errors in IE
    +							.append(responseText.replace(rscript, ""))
    +
    +							// Locate the specified elements
    +							.find(selector) :
    +
    +						// If not, just inject the full result
    +						responseText );
    +				}
    +
    +				if ( callback ) {
    +					self.each( callback, [ responseText, status, jqXHR ] );
    +				}
    +			}
    +		});
    +
    +		return this;
    +	},
    +
    +	serialize: function() {
    +		return jQuery.param( this.serializeArray() );
    +	},
    +
    +	serializeArray: function() {
    +		return this.map(function(){
    +			return this.elements ? jQuery.makeArray( this.elements ) : this;
    +		})
    +		.filter(function(){
    +			return this.name && !this.disabled &&
    +				( this.checked || rselectTextarea.test( this.nodeName ) ||
    +					rinput.test( this.type ) );
    +		})
    +		.map(function( i, elem ){
    +			var val = jQuery( this ).val();
    +
    +			return val == null ?
    +				null :
    +				jQuery.isArray( val ) ?
    +					jQuery.map( val, function( val, i ){
    +						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
    +					}) :
    +					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
    +		}).get();
    +	}
    +});
    +
    +// Attach a bunch of functions for handling common AJAX events
    +jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
    +	jQuery.fn[ o ] = function( f ){
    +		return this.bind( o, f );
    +	};
    +});
    +
    +jQuery.each( [ "get", "post" ], function( i, method ) {
    +	jQuery[ method ] = function( url, data, callback, type ) {
    +		// shift arguments if data argument was omitted
    +		if ( jQuery.isFunction( data ) ) {
    +			type = type || callback;
    +			callback = data;
    +			data = undefined;
    +		}
    +
    +		return jQuery.ajax({
    +			type: method,
    +			url: url,
    +			data: data,
    +			success: callback,
    +			dataType: type
    +		});
    +	};
    +});
    +
    +jQuery.extend({
    +
    +	getScript: function( url, callback ) {
    +		return jQuery.get( url, undefined, callback, "script" );
    +	},
    +
    +	getJSON: function( url, data, callback ) {
    +		return jQuery.get( url, data, callback, "json" );
    +	},
    +
    +	// Creates a full fledged settings object into target
    +	// with both ajaxSettings and settings fields.
    +	// If target is omitted, writes into ajaxSettings.
    +	ajaxSetup: function( target, settings ) {
    +		if ( settings ) {
    +			// Building a settings object
    +			ajaxExtend( target, jQuery.ajaxSettings );
    +		} else {
    +			// Extending ajaxSettings
    +			settings = target;
    +			target = jQuery.ajaxSettings;
    +		}
    +		ajaxExtend( target, settings );
    +		return target;
    +	},
    +
    +	ajaxSettings: {
    +		url: ajaxLocation,
    +		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
    +		global: true,
    +		type: "GET",
    +		contentType: "application/x-www-form-urlencoded",
    +		processData: true,
    +		async: true,
    +		/*
    +		timeout: 0,
    +		data: null,
    +		dataType: null,
    +		username: null,
    +		password: null,
    +		cache: null,
    +		traditional: false,
    +		headers: {},
    +		*/
    +
    +		accepts: {
    +			xml: "application/xml, text/xml",
    +			html: "text/html",
    +			text: "text/plain",
    +			json: "application/json, text/javascript",
    +			"*": allTypes
    +		},
    +
    +		contents: {
    +			xml: /xml/,
    +			html: /html/,
    +			json: /json/
    +		},
    +
    +		responseFields: {
    +			xml: "responseXML",
    +			text: "responseText"
    +		},
    +
    +		// List of data converters
    +		// 1) key format is "source_type destination_type" (a single space in-between)
    +		// 2) the catchall symbol "*" can be used for source_type
    +		converters: {
    +
    +			// Convert anything to text
    +			"* text": window.String,
    +
    +			// Text to html (true = no transformation)
    +			"text html": true,
    +
    +			// Evaluate text as a json expression
    +			"text json": jQuery.parseJSON,
    +
    +			// Parse text as xml
    +			"text xml": jQuery.parseXML
    +		},
    +
    +		// For options that shouldn't be deep extended:
    +		// you can add your own custom options here if
    +		// and when you create one that shouldn't be
    +		// deep extended (see ajaxExtend)
    +		flatOptions: {
    +			context: true,
    +			url: true
    +		}
    +	},
    +
    +	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
    +	ajaxTransport: addToPrefiltersOrTransports( transports ),
    +
    +	// Main method
    +	ajax: function( url, options ) {
    +
    +		// If url is an object, simulate pre-1.5 signature
    +		if ( typeof url === "object" ) {
    +			options = url;
    +			url = undefined;
    +		}
    +
    +		// Force options to be an object
    +		options = options || {};
    +
    +		var // Create the final options object
    +			s = jQuery.ajaxSetup( {}, options ),
    +			// Callbacks context
    +			callbackContext = s.context || s,
    +			// Context for global events
    +			// It's the callbackContext if one was provided in the options
    +			// and if it's a DOM node or a jQuery collection
    +			globalEventContext = callbackContext !== s &&
    +				( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
    +						jQuery( callbackContext ) : jQuery.event,
    +			// Deferreds
    +			deferred = jQuery.Deferred(),
    +			completeDeferred = jQuery._Deferred(),
    +			// Status-dependent callbacks
    +			statusCode = s.statusCode || {},
    +			// ifModified key
    +			ifModifiedKey,
    +			// Headers (they are sent all at once)
    +			requestHeaders = {},
    +			requestHeadersNames = {},
    +			// Response headers
    +			responseHeadersString,
    +			responseHeaders,
    +			// transport
    +			transport,
    +			// timeout handle
    +			timeoutTimer,
    +			// Cross-domain detection vars
    +			parts,
    +			// The jqXHR state
    +			state = 0,
    +			// To know if global events are to be dispatched
    +			fireGlobals,
    +			// Loop variable
    +			i,
    +			// Fake xhr
    +			jqXHR = {
    +
    +				readyState: 0,
    +
    +				// Caches the header
    +				setRequestHeader: function( name, value ) {
    +					if ( !state ) {
    +						var lname = name.toLowerCase();
    +						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
    +						requestHeaders[ name ] = value;
    +					}
    +					return this;
    +				},
    +
    +				// Raw string
    +				getAllResponseHeaders: function() {
    +					return state === 2 ? responseHeadersString : null;
    +				},
    +
    +				// Builds headers hashtable if needed
    +				getResponseHeader: function( key ) {
    +					var match;
    +					if ( state === 2 ) {
    +						if ( !responseHeaders ) {
    +							responseHeaders = {};
    +							while( ( match = rheaders.exec( responseHeadersString ) ) ) {
    +								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
    +							}
    +						}
    +						match = responseHeaders[ key.toLowerCase() ];
    +					}
    +					return match === undefined ? null : match;
    +				},
    +
    +				// Overrides response content-type header
    +				overrideMimeType: function( type ) {
    +					if ( !state ) {
    +						s.mimeType = type;
    +					}
    +					return this;
    +				},
    +
    +				// Cancel the request
    +				abort: function( statusText ) {
    +					statusText = statusText || "abort";
    +					if ( transport ) {
    +						transport.abort( statusText );
    +					}
    +					done( 0, statusText );
    +					return this;
    +				}
    +			};
    +
    +		// Callback for when everything is done
    +		// It is defined here because jslint complains if it is declared
    +		// at the end of the function (which would be more logical and readable)
    +		function done( status, nativeStatusText, responses, headers ) {
    +
    +			// Called once
    +			if ( state === 2 ) {
    +				return;
    +			}
    +
    +			// State is "done" now
    +			state = 2;
    +
    +			// Clear timeout if it exists
    +			if ( timeoutTimer ) {
    +				clearTimeout( timeoutTimer );
    +			}
    +
    +			// Dereference transport for early garbage collection
    +			// (no matter how long the jqXHR object will be used)
    +			transport = undefined;
    +
    +			// Cache response headers
    +			responseHeadersString = headers || "";
    +
    +			// Set readyState
    +			jqXHR.readyState = status > 0 ? 4 : 0;
    +
    +			var isSuccess,
    +				success,
    +				error,
    +				statusText = nativeStatusText,
    +				response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
    +				lastModified,
    +				etag;
    +
    +			// If successful, handle type chaining
    +			if ( status >= 200 && status < 300 || status === 304 ) {
    +
    +				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
    +				if ( s.ifModified ) {
    +
    +					if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
    +						jQuery.lastModified[ ifModifiedKey ] = lastModified;
    +					}
    +					if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
    +						jQuery.etag[ ifModifiedKey ] = etag;
    +					}
    +				}
    +
    +				// If not modified
    +				if ( status === 304 ) {
    +
    +					statusText = "notmodified";
    +					isSuccess = true;
    +
    +				// If we have data
    +				} else {
    +
    +					try {
    +						success = ajaxConvert( s, response );
    +						statusText = "success";
    +						isSuccess = true;
    +					} catch(e) {
    +						// We have a parsererror
    +						statusText = "parsererror";
    +						error = e;
    +					}
    +				}
    +			} else {
    +				// We extract error from statusText
    +				// then normalize statusText and status for non-aborts
    +				error = statusText;
    +				if( !statusText || status ) {
    +					statusText = "error";
    +					if ( status < 0 ) {
    +						status = 0;
    +					}
    +				}
    +			}
    +
    +			// Set data for the fake xhr object
    +			jqXHR.status = status;
    +			jqXHR.statusText = "" + ( nativeStatusText || statusText );
    +
    +			// Success/Error
    +			if ( isSuccess ) {
    +				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
    +			} else {
    +				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
    +			}
    +
    +			// Status-dependent callbacks
    +			jqXHR.statusCode( statusCode );
    +			statusCode = undefined;
    +
    +			if ( fireGlobals ) {
    +				globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
    +						[ jqXHR, s, isSuccess ? success : error ] );
    +			}
    +
    +			// Complete
    +			completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
    +
    +			if ( fireGlobals ) {
    +				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
    +				// Handle the global AJAX counter
    +				if ( !( --jQuery.active ) ) {
    +					jQuery.event.trigger( "ajaxStop" );
    +				}
    +			}
    +		}
    +
    +		// Attach deferreds
    +		deferred.promise( jqXHR );
    +		jqXHR.success = jqXHR.done;
    +		jqXHR.error = jqXHR.fail;
    +		jqXHR.complete = completeDeferred.done;
    +
    +		// Status-dependent callbacks
    +		jqXHR.statusCode = function( map ) {
    +			if ( map ) {
    +				var tmp;
    +				if ( state < 2 ) {
    +					for( tmp in map ) {
    +						statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
    +					}
    +				} else {
    +					tmp = map[ jqXHR.status ];
    +					jqXHR.then( tmp, tmp );
    +				}
    +			}
    +			return this;
    +		};
    +
    +		// Remove hash character (#7531: and string promotion)
    +		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
    +		// We also use the url parameter if available
    +		s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
    +
    +		// Extract dataTypes list
    +		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
    +
    +		// Determine if a cross-domain request is in order
    +		if ( s.crossDomain == null ) {
    +			parts = rurl.exec( s.url.toLowerCase() );
    +			s.crossDomain = !!( parts &&
    +				( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
    +					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
    +						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
    +			);
    +		}
    +
    +		// Convert data if not already a string
    +		if ( s.data && s.processData && typeof s.data !== "string" ) {
    +			s.data = jQuery.param( s.data, s.traditional );
    +		}
    +
    +		// Apply prefilters
    +		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
    +
    +		// If request was aborted inside a prefiler, stop there
    +		if ( state === 2 ) {
    +			return false;
    +		}
    +
    +		// We can fire global events as of now if asked to
    +		fireGlobals = s.global;
    +
    +		// Uppercase the type
    +		s.type = s.type.toUpperCase();
    +
    +		// Determine if request has content
    +		s.hasContent = !rnoContent.test( s.type );
    +
    +		// Watch for a new set of requests
    +		if ( fireGlobals && jQuery.active++ === 0 ) {
    +			jQuery.event.trigger( "ajaxStart" );
    +		}
    +
    +		// More options handling for requests with no content
    +		if ( !s.hasContent ) {
    +
    +			// If data is available, append data to url
    +			if ( s.data ) {
    +				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
    +				// #9682: remove data so that it's not used in an eventual retry
    +				delete s.data;
    +			}
    +
    +			// Get ifModifiedKey before adding the anti-cache parameter
    +			ifModifiedKey = s.url;
    +
    +			// Add anti-cache in url if needed
    +			if ( s.cache === false ) {
    +
    +				var ts = jQuery.now(),
    +					// try replacing _= if it is there
    +					ret = s.url.replace( rts, "$1_=" + ts );
    +
    +				// if nothing was replaced, add timestamp to the end
    +				s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
    +			}
    +		}
    +
    +		// Set the correct header, if data is being sent
    +		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
    +			jqXHR.setRequestHeader( "Content-Type", s.contentType );
    +		}
    +
    +		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
    +		if ( s.ifModified ) {
    +			ifModifiedKey = ifModifiedKey || s.url;
    +			if ( jQuery.lastModified[ ifModifiedKey ] ) {
    +				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
    +			}
    +			if ( jQuery.etag[ ifModifiedKey ] ) {
    +				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
    +			}
    +		}
    +
    +		// Set the Accepts header for the server, depending on the dataType
    +		jqXHR.setRequestHeader(
    +			"Accept",
    +			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
    +				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
    +				s.accepts[ "*" ]
    +		);
    +
    +		// Check for headers option
    +		for ( i in s.headers ) {
    +			jqXHR.setRequestHeader( i, s.headers[ i ] );
    +		}
    +
    +		// Allow custom headers/mimetypes and early abort
    +		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
    +				// Abort if not done already
    +				jqXHR.abort();
    +				return false;
    +
    +		}
    +
    +		// Install callbacks on deferreds
    +		for ( i in { success: 1, error: 1, complete: 1 } ) {
    +			jqXHR[ i ]( s[ i ] );
    +		}
    +
    +		// Get transport
    +		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
    +
    +		// If no transport, we auto-abort
    +		if ( !transport ) {
    +			done( -1, "No Transport" );
    +		} else {
    +			jqXHR.readyState = 1;
    +			// Send global event
    +			if ( fireGlobals ) {
    +				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
    +			}
    +			// Timeout
    +			if ( s.async && s.timeout > 0 ) {
    +				timeoutTimer = setTimeout( function(){
    +					jqXHR.abort( "timeout" );
    +				}, s.timeout );
    +			}
    +
    +			try {
    +				state = 1;
    +				transport.send( requestHeaders, done );
    +			} catch (e) {
    +				// Propagate exception as error if not done
    +				if ( state < 2 ) {
    +					done( -1, e );
    +				// Simply rethrow otherwise
    +				} else {
    +					jQuery.error( e );
    +				}
    +			}
    +		}
    +
    +		return jqXHR;
    +	},
    +
    +	// Serialize an array of form elements or a set of
    +	// key/values into a query string
    +	param: function( a, traditional ) {
    +		var s = [],
    +			add = function( key, value ) {
    +				// If value is a function, invoke it and return its value
    +				value = jQuery.isFunction( value ) ? value() : value;
    +				s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
    +			};
    +
    +		// Set traditional to true for jQuery <= 1.3.2 behavior.
    +		if ( traditional === undefined ) {
    +			traditional = jQuery.ajaxSettings.traditional;
    +		}
    +
    +		// If an array was passed in, assume that it is an array of form elements.
    +		if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
    +			// Serialize the form elements
    +			jQuery.each( a, function() {
    +				add( this.name, this.value );
    +			});
    +
    +		} else {
    +			// If traditional, encode the "old" way (the way 1.3.2 or older
    +			// did it), otherwise encode params recursively.
    +			for ( var prefix in a ) {
    +				buildParams( prefix, a[ prefix ], traditional, add );
    +			}
    +		}
    +
    +		// Return the resulting serialization
    +		return s.join( "&" ).replace( r20, "+" );
    +	}
    +});
    +
    +function buildParams( prefix, obj, traditional, add ) {
    +	if ( jQuery.isArray( obj ) ) {
    +		// Serialize array item.
    +		jQuery.each( obj, function( i, v ) {
    +			if ( traditional || rbracket.test( prefix ) ) {
    +				// Treat each array item as a scalar.
    +				add( prefix, v );
    +
    +			} else {
    +				// If array item is non-scalar (array or object), encode its
    +				// numeric index to resolve deserialization ambiguity issues.
    +				// Note that rack (as of 1.0.0) can't currently deserialize
    +				// nested arrays properly, and attempting to do so may cause
    +				// a server error. Possible fixes are to modify rack's
    +				// deserialization algorithm or to provide an option or flag
    +				// to force array serialization to be shallow.
    +				buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
    +			}
    +		});
    +
    +	} else if ( !traditional && obj != null && typeof obj === "object" ) {
    +		// Serialize object item.
    +		for ( var name in obj ) {
    +			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
    +		}
    +
    +	} else {
    +		// Serialize scalar item.
    +		add( prefix, obj );
    +	}
    +}
    +
    +// This is still on the jQuery object... for now
    +// Want to move this to jQuery.ajax some day
    +jQuery.extend({
    +
    +	// Counter for holding the number of active queries
    +	active: 0,
    +
    +	// Last-Modified header cache for next request
    +	lastModified: {},
    +	etag: {}
    +
    +});
    +
    +/* Handles responses to an ajax request:
    + * - sets all responseXXX fields accordingly
    + * - finds the right dataType (mediates between content-type and expected dataType)
    + * - returns the corresponding response
    + */
    +function ajaxHandleResponses( s, jqXHR, responses ) {
    +
    +	var contents = s.contents,
    +		dataTypes = s.dataTypes,
    +		responseFields = s.responseFields,
    +		ct,
    +		type,
    +		finalDataType,
    +		firstDataType;
    +
    +	// Fill responseXXX fields
    +	for( type in responseFields ) {
    +		if ( type in responses ) {
    +			jqXHR[ responseFields[type] ] = responses[ type ];
    +		}
    +	}
    +
    +	// Remove auto dataType and get content-type in the process
    +	while( dataTypes[ 0 ] === "*" ) {
    +		dataTypes.shift();
    +		if ( ct === undefined ) {
    +			ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
    +		}
    +	}
    +
    +	// Check if we're dealing with a known content-type
    +	if ( ct ) {
    +		for ( type in contents ) {
    +			if ( contents[ type ] && contents[ type ].test( ct ) ) {
    +				dataTypes.unshift( type );
    +				break;
    +			}
    +		}
    +	}
    +
    +	// Check to see if we have a response for the expected dataType
    +	if ( dataTypes[ 0 ] in responses ) {
    +		finalDataType = dataTypes[ 0 ];
    +	} else {
    +		// Try convertible dataTypes
    +		for ( type in responses ) {
    +			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
    +				finalDataType = type;
    +				break;
    +			}
    +			if ( !firstDataType ) {
    +				firstDataType = type;
    +			}
    +		}
    +		// Or just use first one
    +		finalDataType = finalDataType || firstDataType;
    +	}
    +
    +	// If we found a dataType
    +	// We add the dataType to the list if needed
    +	// and return the corresponding response
    +	if ( finalDataType ) {
    +		if ( finalDataType !== dataTypes[ 0 ] ) {
    +			dataTypes.unshift( finalDataType );
    +		}
    +		return responses[ finalDataType ];
    +	}
    +}
    +
    +// Chain conversions given the request and the original response
    +function ajaxConvert( s, response ) {
    +
    +	// Apply the dataFilter if provided
    +	if ( s.dataFilter ) {
    +		response = s.dataFilter( response, s.dataType );
    +	}
    +
    +	var dataTypes = s.dataTypes,
    +		converters = {},
    +		i,
    +		key,
    +		length = dataTypes.length,
    +		tmp,
    +		// Current and previous dataTypes
    +		current = dataTypes[ 0 ],
    +		prev,
    +		// Conversion expression
    +		conversion,
    +		// Conversion function
    +		conv,
    +		// Conversion functions (transitive conversion)
    +		conv1,
    +		conv2;
    +
    +	// For each dataType in the chain
    +	for( i = 1; i < length; i++ ) {
    +
    +		// Create converters map
    +		// with lowercased keys
    +		if ( i === 1 ) {
    +			for( key in s.converters ) {
    +				if( typeof key === "string" ) {
    +					converters[ key.toLowerCase() ] = s.converters[ key ];
    +				}
    +			}
    +		}
    +
    +		// Get the dataTypes
    +		prev = current;
    +		current = dataTypes[ i ];
    +
    +		// If current is auto dataType, update it to prev
    +		if( current === "*" ) {
    +			current = prev;
    +		// If no auto and dataTypes are actually different
    +		} else if ( prev !== "*" && prev !== current ) {
    +
    +			// Get the converter
    +			conversion = prev + " " + current;
    +			conv = converters[ conversion ] || converters[ "* " + current ];
    +
    +			// If there is no direct converter, search transitively
    +			if ( !conv ) {
    +				conv2 = undefined;
    +				for( conv1 in converters ) {
    +					tmp = conv1.split( " " );
    +					if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
    +						conv2 = converters[ tmp[1] + " " + current ];
    +						if ( conv2 ) {
    +							conv1 = converters[ conv1 ];
    +							if ( conv1 === true ) {
    +								conv = conv2;
    +							} else if ( conv2 === true ) {
    +								conv = conv1;
    +							}
    +							break;
    +						}
    +					}
    +				}
    +			}
    +			// If we found no converter, dispatch an error
    +			if ( !( conv || conv2 ) ) {
    +				jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
    +			}
    +			// If found converter is not an equivalence
    +			if ( conv !== true ) {
    +				// Convert with 1 or 2 converters accordingly
    +				response = conv ? conv( response ) : conv2( conv1(response) );
    +			}
    +		}
    +	}
    +	return response;
    +}
    +
    +
    +
    +
    +var jsc = jQuery.now(),
    +	jsre = /(\=)\?(&|$)|\?\?/i;
    +
    +// Default jsonp settings
    +jQuery.ajaxSetup({
    +	jsonp: "callback",
    +	jsonpCallback: function() {
    +		return jQuery.expando + "_" + ( jsc++ );
    +	}
    +});
    +
    +// Detect, normalize options and install callbacks for jsonp requests
    +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
    +
    +	var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
    +		( typeof s.data === "string" );
    +
    +	if ( s.dataTypes[ 0 ] === "jsonp" ||
    +		s.jsonp !== false && ( jsre.test( s.url ) ||
    +				inspectData && jsre.test( s.data ) ) ) {
    +
    +		var responseContainer,
    +			jsonpCallback = s.jsonpCallback =
    +				jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
    +			previous = window[ jsonpCallback ],
    +			url = s.url,
    +			data = s.data,
    +			replace = "$1" + jsonpCallback + "$2";
    +
    +		if ( s.jsonp !== false ) {
    +			url = url.replace( jsre, replace );
    +			if ( s.url === url ) {
    +				if ( inspectData ) {
    +					data = data.replace( jsre, replace );
    +				}
    +				if ( s.data === data ) {
    +					// Add callback manually
    +					url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
    +				}
    +			}
    +		}
    +
    +		s.url = url;
    +		s.data = data;
    +
    +		// Install callback
    +		window[ jsonpCallback ] = function( response ) {
    +			responseContainer = [ response ];
    +		};
    +
    +		// Clean-up function
    +		jqXHR.always(function() {
    +			// Set callback back to previous value
    +			window[ jsonpCallback ] = previous;
    +			// Call if it was a function and we have a response
    +			if ( responseContainer && jQuery.isFunction( previous ) ) {
    +				window[ jsonpCallback ]( responseContainer[ 0 ] );
    +			}
    +		});
    +
    +		// Use data converter to retrieve json after script execution
    +		s.converters["script json"] = function() {
    +			if ( !responseContainer ) {
    +				jQuery.error( jsonpCallback + " was not called" );
    +			}
    +			return responseContainer[ 0 ];
    +		};
    +
    +		// force json dataType
    +		s.dataTypes[ 0 ] = "json";
    +
    +		// Delegate to script
    +		return "script";
    +	}
    +});
    +
    +
    +
    +
    +// Install script dataType
    +jQuery.ajaxSetup({
    +	accepts: {
    +		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
    +	},
    +	contents: {
    +		script: /javascript|ecmascript/
    +	},
    +	converters: {
    +		"text script": function( text ) {
    +			jQuery.globalEval( text );
    +			return text;
    +		}
    +	}
    +});
    +
    +// Handle cache's special case and global
    +jQuery.ajaxPrefilter( "script", function( s ) {
    +	if ( s.cache === undefined ) {
    +		s.cache = false;
    +	}
    +	if ( s.crossDomain ) {
    +		s.type = "GET";
    +		s.global = false;
    +	}
    +});
    +
    +// Bind script tag hack transport
    +jQuery.ajaxTransport( "script", function(s) {
    +
    +	// This transport only deals with cross domain requests
    +	if ( s.crossDomain ) {
    +
    +		var script,
    +			head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
    +
    +		return {
    +
    +			send: function( _, callback ) {
    +
    +				script = document.createElement( "script" );
    +
    +				script.async = "async";
    +
    +				if ( s.scriptCharset ) {
    +					script.charset = s.scriptCharset;
    +				}
    +
    +				script.src = s.url;
    +
    +				// Attach handlers for all browsers
    +				script.onload = script.onreadystatechange = function( _, isAbort ) {
    +
    +					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
    +
    +						// Handle memory leak in IE
    +						script.onload = script.onreadystatechange = null;
    +
    +						// Remove the script
    +						if ( head && script.parentNode ) {
    +							head.removeChild( script );
    +						}
    +
    +						// Dereference the script
    +						script = undefined;
    +
    +						// Callback if not abort
    +						if ( !isAbort ) {
    +							callback( 200, "success" );
    +						}
    +					}
    +				};
    +				// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
    +				// This arises when a base node is used (#2709 and #4378).
    +				head.insertBefore( script, head.firstChild );
    +			},
    +
    +			abort: function() {
    +				if ( script ) {
    +					script.onload( 0, 1 );
    +				}
    +			}
    +		};
    +	}
    +});
    +
    +
    +
    +
    +var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
    +	xhrOnUnloadAbort = window.ActiveXObject ? function() {
    +		// Abort all pending requests
    +		for ( var key in xhrCallbacks ) {
    +			xhrCallbacks[ key ]( 0, 1 );
    +		}
    +	} : false,
    +	xhrId = 0,
    +	xhrCallbacks;
    +
    +// Functions to create xhrs
    +function createStandardXHR() {
    +	try {
    +		return new window.XMLHttpRequest();
    +	} catch( e ) {}
    +}
    +
    +function createActiveXHR() {
    +	try {
    +		return new window.ActiveXObject( "Microsoft.XMLHTTP" );
    +	} catch( e ) {}
    +}
    +
    +// Create the request object
    +// (This is still attached to ajaxSettings for backward compatibility)
    +jQuery.ajaxSettings.xhr = window.ActiveXObject ?
    +	/* Microsoft failed to properly
    +	 * implement the XMLHttpRequest in IE7 (can't request local files),
    +	 * so we use the ActiveXObject when it is available
    +	 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
    +	 * we need a fallback.
    +	 */
    +	function() {
    +		return !this.isLocal && createStandardXHR() || createActiveXHR();
    +	} :
    +	// For all other browsers, use the standard XMLHttpRequest object
    +	createStandardXHR;
    +
    +// Determine support properties
    +(function( xhr ) {
    +	jQuery.extend( jQuery.support, {
    +		ajax: !!xhr,
    +		cors: !!xhr && ( "withCredentials" in xhr )
    +	});
    +})( jQuery.ajaxSettings.xhr() );
    +
    +// Create transport if the browser can provide an xhr
    +if ( jQuery.support.ajax ) {
    +
    +	jQuery.ajaxTransport(function( s ) {
    +		// Cross domain only allowed if supported through XMLHttpRequest
    +		if ( !s.crossDomain || jQuery.support.cors ) {
    +
    +			var callback;
    +
    +			return {
    +				send: function( headers, complete ) {
    +
    +					// Get a new xhr
    +					var xhr = s.xhr(),
    +						handle,
    +						i;
    +
    +					// Open the socket
    +					// Passing null username, generates a login popup on Opera (#2865)
    +					if ( s.username ) {
    +						xhr.open( s.type, s.url, s.async, s.username, s.password );
    +					} else {
    +						xhr.open( s.type, s.url, s.async );
    +					}
    +
    +					// Apply custom fields if provided
    +					if ( s.xhrFields ) {
    +						for ( i in s.xhrFields ) {
    +							xhr[ i ] = s.xhrFields[ i ];
    +						}
    +					}
    +
    +					// Override mime type if needed
    +					if ( s.mimeType && xhr.overrideMimeType ) {
    +						xhr.overrideMimeType( s.mimeType );
    +					}
    +
    +					// X-Requested-With header
    +					// For cross-domain requests, seeing as conditions for a preflight are
    +					// akin to a jigsaw puzzle, we simply never set it to be sure.
    +					// (it can always be set on a per-request basis or even using ajaxSetup)
    +					// For same-domain requests, won't change header if already provided.
    +					if ( !s.crossDomain && !headers["X-Requested-With"] ) {
    +						headers[ "X-Requested-With" ] = "XMLHttpRequest";
    +					}
    +
    +					// Need an extra try/catch for cross domain requests in Firefox 3
    +					try {
    +						for ( i in headers ) {
    +							xhr.setRequestHeader( i, headers[ i ] );
    +						}
    +					} catch( _ ) {}
    +
    +					// Do send the request
    +					// This may raise an exception which is actually
    +					// handled in jQuery.ajax (so no try/catch here)
    +					xhr.send( ( s.hasContent && s.data ) || null );
    +
    +					// Listener
    +					callback = function( _, isAbort ) {
    +
    +						var status,
    +							statusText,
    +							responseHeaders,
    +							responses,
    +							xml;
    +
    +						// Firefox throws exceptions when accessing properties
    +						// of an xhr when a network error occured
    +						// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
    +						try {
    +
    +							// Was never called and is aborted or complete
    +							if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
    +
    +								// Only called once
    +								callback = undefined;
    +
    +								// Do not keep as active anymore
    +								if ( handle ) {
    +									xhr.onreadystatechange = jQuery.noop;
    +									if ( xhrOnUnloadAbort ) {
    +										delete xhrCallbacks[ handle ];
    +									}
    +								}
    +
    +								// If it's an abort
    +								if ( isAbort ) {
    +									// Abort it manually if needed
    +									if ( xhr.readyState !== 4 ) {
    +										xhr.abort();
    +									}
    +								} else {
    +									status = xhr.status;
    +									responseHeaders = xhr.getAllResponseHeaders();
    +									responses = {};
    +									xml = xhr.responseXML;
    +
    +									// Construct response list
    +									if ( xml && xml.documentElement /* #4958 */ ) {
    +										responses.xml = xml;
    +									}
    +									responses.text = xhr.responseText;
    +
    +									// Firefox throws an exception when accessing
    +									// statusText for faulty cross-domain requests
    +									try {
    +										statusText = xhr.statusText;
    +									} catch( e ) {
    +										// We normalize with Webkit giving an empty statusText
    +										statusText = "";
    +									}
    +
    +									// Filter status for non standard behaviors
    +
    +									// If the request is local and we have data: assume a success
    +									// (success with no data won't get notified, that's the best we
    +									// can do given current implementations)
    +									if ( !status && s.isLocal && !s.crossDomain ) {
    +										status = responses.text ? 200 : 404;
    +									// IE - #1450: sometimes returns 1223 when it should be 204
    +									} else if ( status === 1223 ) {
    +										status = 204;
    +									}
    +								}
    +							}
    +						} catch( firefoxAccessException ) {
    +							if ( !isAbort ) {
    +								complete( -1, firefoxAccessException );
    +							}
    +						}
    +
    +						// Call complete if needed
    +						if ( responses ) {
    +							complete( status, statusText, responses, responseHeaders );
    +						}
    +					};
    +
    +					// if we're in sync mode or it's in cache
    +					// and has been retrieved directly (IE6 & IE7)
    +					// we need to manually fire the callback
    +					if ( !s.async || xhr.readyState === 4 ) {
    +						callback();
    +					} else {
    +						handle = ++xhrId;
    +						if ( xhrOnUnloadAbort ) {
    +							// Create the active xhrs callbacks list if needed
    +							// and attach the unload handler
    +							if ( !xhrCallbacks ) {
    +								xhrCallbacks = {};
    +								jQuery( window ).unload( xhrOnUnloadAbort );
    +							}
    +							// Add to list of active xhrs callbacks
    +							xhrCallbacks[ handle ] = callback;
    +						}
    +						xhr.onreadystatechange = callback;
    +					}
    +				},
    +
    +				abort: function() {
    +					if ( callback ) {
    +						callback(0,1);
    +					}
    +				}
    +			};
    +		}
    +	});
    +}
    +
    +
    +
    +
    +var elemdisplay = {},
    +	iframe, iframeDoc,
    +	rfxtypes = /^(?:toggle|show|hide)$/,
    +	rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
    +	timerId,
    +	fxAttrs = [
    +		// height animations
    +		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
    +		// width animations
    +		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
    +		// opacity animations
    +		[ "opacity" ]
    +	],
    +	fxNow;
    +
    +jQuery.fn.extend({
    +	show: function( speed, easing, callback ) {
    +		var elem, display;
    +
    +		if ( speed || speed === 0 ) {
    +			return this.animate( genFx("show", 3), speed, easing, callback);
    +
    +		} else {
    +			for ( var i = 0, j = this.length; i < j; i++ ) {
    +				elem = this[i];
    +
    +				if ( elem.style ) {
    +					display = elem.style.display;
    +
    +					// Reset the inline display of this element to learn if it is
    +					// being hidden by cascaded rules or not
    +					if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
    +						display = elem.style.display = "";
    +					}
    +
    +					// Set elements which have been overridden with display: none
    +					// in a stylesheet to whatever the default browser style is
    +					// for such an element
    +					if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
    +						jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
    +					}
    +				}
    +			}
    +
    +			// Set the display of most of the elements in a second loop
    +			// to avoid the constant reflow
    +			for ( i = 0; i < j; i++ ) {
    +				elem = this[i];
    +
    +				if ( elem.style ) {
    +					display = elem.style.display;
    +
    +					if ( display === "" || display === "none" ) {
    +						elem.style.display = jQuery._data(elem, "olddisplay") || "";
    +					}
    +				}
    +			}
    +
    +			return this;
    +		}
    +	},
    +
    +	hide: function( speed, easing, callback ) {
    +		if ( speed || speed === 0 ) {
    +			return this.animate( genFx("hide", 3), speed, easing, callback);
    +
    +		} else {
    +			for ( var i = 0, j = this.length; i < j; i++ ) {
    +				if ( this[i].style ) {
    +					var display = jQuery.css( this[i], "display" );
    +
    +					if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
    +						jQuery._data( this[i], "olddisplay", display );
    +					}
    +				}
    +			}
    +
    +			// Set the display of the elements in a second loop
    +			// to avoid the constant reflow
    +			for ( i = 0; i < j; i++ ) {
    +				if ( this[i].style ) {
    +					this[i].style.display = "none";
    +				}
    +			}
    +
    +			return this;
    +		}
    +	},
    +
    +	// Save the old toggle function
    +	_toggle: jQuery.fn.toggle,
    +
    +	toggle: function( fn, fn2, callback ) {
    +		var bool = typeof fn === "boolean";
    +
    +		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
    +			this._toggle.apply( this, arguments );
    +
    +		} else if ( fn == null || bool ) {
    +			this.each(function() {
    +				var state = bool ? fn : jQuery(this).is(":hidden");
    +				jQuery(this)[ state ? "show" : "hide" ]();
    +			});
    +
    +		} else {
    +			this.animate(genFx("toggle", 3), fn, fn2, callback);
    +		}
    +
    +		return this;
    +	},
    +
    +	fadeTo: function( speed, to, easing, callback ) {
    +		return this.filter(":hidden").css("opacity", 0).show().end()
    +					.animate({opacity: to}, speed, easing, callback);
    +	},
    +
    +	animate: function( prop, speed, easing, callback ) {
    +		var optall = jQuery.speed(speed, easing, callback);
    +
    +		if ( jQuery.isEmptyObject( prop ) ) {
    +			return this.each( optall.complete, [ false ] );
    +		}
    +
    +		// Do not change referenced properties as per-property easing will be lost
    +		prop = jQuery.extend( {}, prop );
    +
    +		return this[ optall.queue === false ? "each" : "queue" ](function() {
    +			// XXX 'this' does not always have a nodeName when running the
    +			// test suite
    +
    +			if ( optall.queue === false ) {
    +				jQuery._mark( this );
    +			}
    +
    +			var opt = jQuery.extend( {}, optall ),
    +				isElement = this.nodeType === 1,
    +				hidden = isElement && jQuery(this).is(":hidden"),
    +				name, val, p,
    +				display, e,
    +				parts, start, end, unit;
    +
    +			// will store per property easing and be used to determine when an animation is complete
    +			opt.animatedProperties = {};
    +
    +			for ( p in prop ) {
    +
    +				// property name normalization
    +				name = jQuery.camelCase( p );
    +				if ( p !== name ) {
    +					prop[ name ] = prop[ p ];
    +					delete prop[ p ];
    +				}
    +
    +				val = prop[ name ];
    +
    +				// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
    +				if ( jQuery.isArray( val ) ) {
    +					opt.animatedProperties[ name ] = val[ 1 ];
    +					val = prop[ name ] = val[ 0 ];
    +				} else {
    +					opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
    +				}
    +
    +				if ( val === "hide" && hidden || val === "show" && !hidden ) {
    +					return opt.complete.call( this );
    +				}
    +
    +				if ( isElement && ( name === "height" || name === "width" ) ) {
    +					// Make sure that nothing sneaks out
    +					// Record all 3 overflow attributes because IE does not
    +					// change the overflow attribute when overflowX and
    +					// overflowY are set to the same value
    +					opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
    +
    +					// Set display property to inline-block for height/width
    +					// animations on inline elements that are having width/height
    +					// animated
    +					if ( jQuery.css( this, "display" ) === "inline" &&
    +							jQuery.css( this, "float" ) === "none" ) {
    +						if ( !jQuery.support.inlineBlockNeedsLayout ) {
    +							this.style.display = "inline-block";
    +
    +						} else {
    +							display = defaultDisplay( this.nodeName );
    +
    +							// inline-level elements accept inline-block;
    +							// block-level elements need to be inline with layout
    +							if ( display === "inline" ) {
    +								this.style.display = "inline-block";
    +
    +							} else {
    +								this.style.display = "inline";
    +								this.style.zoom = 1;
    +							}
    +						}
    +					}
    +				}
    +			}
    +
    +			if ( opt.overflow != null ) {
    +				this.style.overflow = "hidden";
    +			}
    +
    +			for ( p in prop ) {
    +				e = new jQuery.fx( this, opt, p );
    +				val = prop[ p ];
    +
    +				if ( rfxtypes.test(val) ) {
    +					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
    +
    +				} else {
    +					parts = rfxnum.exec( val );
    +					start = e.cur();
    +
    +					if ( parts ) {
    +						end = parseFloat( parts[2] );
    +						unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
    +
    +						// We need to compute starting value
    +						if ( unit !== "px" ) {
    +							jQuery.style( this, p, (end || 1) + unit);
    +							start = ((end || 1) / e.cur()) * start;
    +							jQuery.style( this, p, start + unit);
    +						}
    +
    +						// If a +=/-= token was provided, we're doing a relative animation
    +						if ( parts[1] ) {
    +							end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
    +						}
    +
    +						e.custom( start, end, unit );
    +
    +					} else {
    +						e.custom( start, val, "" );
    +					}
    +				}
    +			}
    +
    +			// For JS strict compliance
    +			return true;
    +		});
    +	},
    +
    +	stop: function( clearQueue, gotoEnd ) {
    +		if ( clearQueue ) {
    +			this.queue([]);
    +		}
    +
    +		this.each(function() {
    +			var timers = jQuery.timers,
    +				i = timers.length;
    +			// clear marker counters if we know they won't be
    +			if ( !gotoEnd ) {
    +				jQuery._unmark( true, this );
    +			}
    +			while ( i-- ) {
    +				if ( timers[i].elem === this ) {
    +					if (gotoEnd) {
    +						// force the next step to be the last
    +						timers[i](true);
    +					}
    +
    +					timers.splice(i, 1);
    +				}
    +			}
    +		});
    +
    +		// start the next in the queue if the last step wasn't forced
    +		if ( !gotoEnd ) {
    +			this.dequeue();
    +		}
    +
    +		return this;
    +	}
    +
    +});
    +
    +// Animations created synchronously will run synchronously
    +function createFxNow() {
    +	setTimeout( clearFxNow, 0 );
    +	return ( fxNow = jQuery.now() );
    +}
    +
    +function clearFxNow() {
    +	fxNow = undefined;
    +}
    +
    +// Generate parameters to create a standard animation
    +function genFx( type, num ) {
    +	var obj = {};
    +
    +	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
    +		obj[ this ] = type;
    +	});
    +
    +	return obj;
    +}
    +
    +// Generate shortcuts for custom animations
    +jQuery.each({
    +	slideDown: genFx("show", 1),
    +	slideUp: genFx("hide", 1),
    +	slideToggle: genFx("toggle", 1),
    +	fadeIn: { opacity: "show" },
    +	fadeOut: { opacity: "hide" },
    +	fadeToggle: { opacity: "toggle" }
    +}, function( name, props ) {
    +	jQuery.fn[ name ] = function( speed, easing, callback ) {
    +		return this.animate( props, speed, easing, callback );
    +	};
    +});
    +
    +jQuery.extend({
    +	speed: function( speed, easing, fn ) {
    +		var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
    +			complete: fn || !fn && easing ||
    +				jQuery.isFunction( speed ) && speed,
    +			duration: speed,
    +			easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
    +		};
    +
    +		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
    +			opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
    +
    +		// Queueing
    +		opt.old = opt.complete;
    +		opt.complete = function( noUnmark ) {
    +			if ( jQuery.isFunction( opt.old ) ) {
    +				opt.old.call( this );
    +			}
    +
    +			if ( opt.queue !== false ) {
    +				jQuery.dequeue( this );
    +			} else if ( noUnmark !== false ) {
    +				jQuery._unmark( this );
    +			}
    +		};
    +
    +		return opt;
    +	},
    +
    +	easing: {
    +		linear: function( p, n, firstNum, diff ) {
    +			return firstNum + diff * p;
    +		},
    +		swing: function( p, n, firstNum, diff ) {
    +			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
    +		}
    +	},
    +
    +	timers: [],
    +
    +	fx: function( elem, options, prop ) {
    +		this.options = options;
    +		this.elem = elem;
    +		this.prop = prop;
    +
    +		options.orig = options.orig || {};
    +	}
    +
    +});
    +
    +jQuery.fx.prototype = {
    +	// Simple function for setting a style value
    +	update: function() {
    +		if ( this.options.step ) {
    +			this.options.step.call( this.elem, this.now, this );
    +		}
    +
    +		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
    +	},
    +
    +	// Get the current size
    +	cur: function() {
    +		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
    +			return this.elem[ this.prop ];
    +		}
    +
    +		var parsed,
    +			r = jQuery.css( this.elem, this.prop );
    +		// Empty strings, null, undefined and "auto" are converted to 0,
    +		// complex values such as "rotate(1rad)" are returned as is,
    +		// simple values such as "10px" are parsed to Float.
    +		return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
    +	},
    +
    +	// Start an animation from one number to another
    +	custom: function( from, to, unit ) {
    +		var self = this,
    +			fx = jQuery.fx;
    +
    +		this.startTime = fxNow || createFxNow();
    +		this.start = from;
    +		this.end = to;
    +		this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
    +		this.now = this.start;
    +		this.pos = this.state = 0;
    +
    +		function t( gotoEnd ) {
    +			return self.step(gotoEnd);
    +		}
    +
    +		t.elem = this.elem;
    +
    +		if ( t() && jQuery.timers.push(t) && !timerId ) {
    +			timerId = setInterval( fx.tick, fx.interval );
    +		}
    +	},
    +
    +	// Simple 'show' function
    +	show: function() {
    +		// Remember where we started, so that we can go back to it later
    +		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
    +		this.options.show = true;
    +
    +		// Begin the animation
    +		// Make sure that we start at a small width/height to avoid any
    +		// flash of content
    +		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
    +
    +		// Start by showing the element
    +		jQuery( this.elem ).show();
    +	},
    +
    +	// Simple 'hide' function
    +	hide: function() {
    +		// Remember where we started, so that we can go back to it later
    +		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
    +		this.options.hide = true;
    +
    +		// Begin the animation
    +		this.custom(this.cur(), 0);
    +	},
    +
    +	// Each step of an animation
    +	step: function( gotoEnd ) {
    +		var t = fxNow || createFxNow(),
    +			done = true,
    +			elem = this.elem,
    +			options = this.options,
    +			i, n;
    +
    +		if ( gotoEnd || t >= options.duration + this.startTime ) {
    +			this.now = this.end;
    +			this.pos = this.state = 1;
    +			this.update();
    +
    +			options.animatedProperties[ this.prop ] = true;
    +
    +			for ( i in options.animatedProperties ) {
    +				if ( options.animatedProperties[i] !== true ) {
    +					done = false;
    +				}
    +			}
    +
    +			if ( done ) {
    +				// Reset the overflow
    +				if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
    +
    +					jQuery.each( [ "", "X", "Y" ], function (index, value) {
    +						elem.style[ "overflow" + value ] = options.overflow[index];
    +					});
    +				}
    +
    +				// Hide the element if the "hide" operation was done
    +				if ( options.hide ) {
    +					jQuery(elem).hide();
    +				}
    +
    +				// Reset the properties, if the item has been hidden or shown
    +				if ( options.hide || options.show ) {
    +					for ( var p in options.animatedProperties ) {
    +						jQuery.style( elem, p, options.orig[p] );
    +					}
    +				}
    +
    +				// Execute the complete function
    +				options.complete.call( elem );
    +			}
    +
    +			return false;
    +
    +		} else {
    +			// classical easing cannot be used with an Infinity duration
    +			if ( options.duration == Infinity ) {
    +				this.now = t;
    +			} else {
    +				n = t - this.startTime;
    +				this.state = n / options.duration;
    +
    +				// Perform the easing function, defaults to swing
    +				this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
    +				this.now = this.start + ((this.end - this.start) * this.pos);
    +			}
    +			// Perform the next step of the animation
    +			this.update();
    +		}
    +
    +		return true;
    +	}
    +};
    +
    +jQuery.extend( jQuery.fx, {
    +	tick: function() {
    +		for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
    +			if ( !timers[i]() ) {
    +				timers.splice(i--, 1);
    +			}
    +		}
    +
    +		if ( !timers.length ) {
    +			jQuery.fx.stop();
    +		}
    +	},
    +
    +	interval: 13,
    +
    +	stop: function() {
    +		clearInterval( timerId );
    +		timerId = null;
    +	},
    +
    +	speeds: {
    +		slow: 600,
    +		fast: 200,
    +		// Default speed
    +		_default: 400
    +	},
    +
    +	step: {
    +		opacity: function( fx ) {
    +			jQuery.style( fx.elem, "opacity", fx.now );
    +		},
    +
    +		_default: function( fx ) {
    +			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
    +				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
    +			} else {
    +				fx.elem[ fx.prop ] = fx.now;
    +			}
    +		}
    +	}
    +});
    +
    +if ( jQuery.expr && jQuery.expr.filters ) {
    +	jQuery.expr.filters.animated = function( elem ) {
    +		return jQuery.grep(jQuery.timers, function( fn ) {
    +			return elem === fn.elem;
    +		}).length;
    +	};
    +}
    +
    +// Try to restore the default display value of an element
    +function defaultDisplay( nodeName ) {
    +
    +	if ( !elemdisplay[ nodeName ] ) {
    +
    +		var body = document.body,
    +			elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
    +			display = elem.css( "display" );
    +
    +		elem.remove();
    +
    +		// If the simple way fails,
    +		// get element's real default display by attaching it to a temp iframe
    +		if ( display === "none" || display === "" ) {
    +			// No iframe to use yet, so create it
    +			if ( !iframe ) {
    +				iframe = document.createElement( "iframe" );
    +				iframe.frameBorder = iframe.width = iframe.height = 0;
    +			}
    +
    +			body.appendChild( iframe );
    +
    +			// Create a cacheable copy of the iframe document on first call.
    +			// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
    +			// document to it; WebKit & Firefox won't allow reusing the iframe document.
    +			if ( !iframeDoc || !iframe.createElement ) {
    +				iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
    +				iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
    +				iframeDoc.close();
    +			}
    +
    +			elem = iframeDoc.createElement( nodeName );
    +
    +			iframeDoc.body.appendChild( elem );
    +
    +			display = jQuery.css( elem, "display" );
    +
    +			body.removeChild( iframe );
    +		}
    +
    +		// Store the correct default display
    +		elemdisplay[ nodeName ] = display;
    +	}
    +
    +	return elemdisplay[ nodeName ];
    +}
    +
    +
    +
    +
    +var rtable = /^t(?:able|d|h)$/i,
    +	rroot = /^(?:body|html)$/i;
    +
    +if ( "getBoundingClientRect" in document.documentElement ) {
    +	jQuery.fn.offset = function( options ) {
    +		var elem = this[0], box;
    +
    +		if ( options ) {
    +			return this.each(function( i ) {
    +				jQuery.offset.setOffset( this, options, i );
    +			});
    +		}
    +
    +		if ( !elem || !elem.ownerDocument ) {
    +			return null;
    +		}
    +
    +		if ( elem === elem.ownerDocument.body ) {
    +			return jQuery.offset.bodyOffset( elem );
    +		}
    +
    +		try {
    +			box = elem.getBoundingClientRect();
    +		} catch(e) {}
    +
    +		var doc = elem.ownerDocument,
    +			docElem = doc.documentElement;
    +
    +		// Make sure we're not dealing with a disconnected DOM node
    +		if ( !box || !jQuery.contains( docElem, elem ) ) {
    +			return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
    +		}
    +
    +		var body = doc.body,
    +			win = getWindow(doc),
    +			clientTop  = docElem.clientTop  || body.clientTop  || 0,
    +			clientLeft = docElem.clientLeft || body.clientLeft || 0,
    +			scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
    +			scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
    +			top  = box.top  + scrollTop  - clientTop,
    +			left = box.left + scrollLeft - clientLeft;
    +
    +		return { top: top, left: left };
    +	};
    +
    +} else {
    +	jQuery.fn.offset = function( options ) {
    +		var elem = this[0];
    +
    +		if ( options ) {
    +			return this.each(function( i ) {
    +				jQuery.offset.setOffset( this, options, i );
    +			});
    +		}
    +
    +		if ( !elem || !elem.ownerDocument ) {
    +			return null;
    +		}
    +
    +		if ( elem === elem.ownerDocument.body ) {
    +			return jQuery.offset.bodyOffset( elem );
    +		}
    +
    +		jQuery.offset.initialize();
    +
    +		var computedStyle,
    +			offsetParent = elem.offsetParent,
    +			prevOffsetParent = elem,
    +			doc = elem.ownerDocument,
    +			docElem = doc.documentElement,
    +			body = doc.body,
    +			defaultView = doc.defaultView,
    +			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
    +			top = elem.offsetTop,
    +			left = elem.offsetLeft;
    +
    +		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
    +			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
    +				break;
    +			}
    +
    +			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
    +			top  -= elem.scrollTop;
    +			left -= elem.scrollLeft;
    +
    +			if ( elem === offsetParent ) {
    +				top  += elem.offsetTop;
    +				left += elem.offsetLeft;
    +
    +				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
    +					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
    +					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
    +				}
    +
    +				prevOffsetParent = offsetParent;
    +				offsetParent = elem.offsetParent;
    +			}
    +
    +			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
    +				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
    +				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
    +			}
    +
    +			prevComputedStyle = computedStyle;
    +		}
    +
    +		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
    +			top  += body.offsetTop;
    +			left += body.offsetLeft;
    +		}
    +
    +		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
    +			top  += Math.max( docElem.scrollTop, body.scrollTop );
    +			left += Math.max( docElem.scrollLeft, body.scrollLeft );
    +		}
    +
    +		return { top: top, left: left };
    +	};
    +}
    +
    +jQuery.offset = {
    +	initialize: function() {
    +		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
    +			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
    +
    +		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
    +
    +		container.innerHTML = html;
    +		body.insertBefore( container, body.firstChild );
    +		innerDiv = container.firstChild;
    +		checkDiv = innerDiv.firstChild;
    +		td = innerDiv.nextSibling.firstChild.firstChild;
    +
    +		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
    +		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
    +
    +		checkDiv.style.position = "fixed";
    +		checkDiv.style.top = "20px";
    +
    +		// safari subtracts parent border width here which is 5px
    +		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
    +		checkDiv.style.position = checkDiv.style.top = "";
    +
    +		innerDiv.style.overflow = "hidden";
    +		innerDiv.style.position = "relative";
    +
    +		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
    +
    +		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
    +
    +		body.removeChild( container );
    +		jQuery.offset.initialize = jQuery.noop;
    +	},
    +
    +	bodyOffset: function( body ) {
    +		var top = body.offsetTop,
    +			left = body.offsetLeft;
    +
    +		jQuery.offset.initialize();
    +
    +		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
    +			top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
    +			left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
    +		}
    +
    +		return { top: top, left: left };
    +	},
    +
    +	setOffset: function( elem, options, i ) {
    +		var position = jQuery.css( elem, "position" );
    +
    +		// set position first, in-case top/left are set even on static elem
    +		if ( position === "static" ) {
    +			elem.style.position = "relative";
    +		}
    +
    +		var curElem = jQuery( elem ),
    +			curOffset = curElem.offset(),
    +			curCSSTop = jQuery.css( elem, "top" ),
    +			curCSSLeft = jQuery.css( elem, "left" ),
    +			calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
    +			props = {}, curPosition = {}, curTop, curLeft;
    +
    +		// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
    +		if ( calculatePosition ) {
    +			curPosition = curElem.position();
    +			curTop = curPosition.top;
    +			curLeft = curPosition.left;
    +		} else {
    +			curTop = parseFloat( curCSSTop ) || 0;
    +			curLeft = parseFloat( curCSSLeft ) || 0;
    +		}
    +
    +		if ( jQuery.isFunction( options ) ) {
    +			options = options.call( elem, i, curOffset );
    +		}
    +
    +		if (options.top != null) {
    +			props.top = (options.top - curOffset.top) + curTop;
    +		}
    +		if (options.left != null) {
    +			props.left = (options.left - curOffset.left) + curLeft;
    +		}
    +
    +		if ( "using" in options ) {
    +			options.using.call( elem, props );
    +		} else {
    +			curElem.css( props );
    +		}
    +	}
    +};
    +
    +
    +jQuery.fn.extend({
    +	position: function() {
    +		if ( !this[0] ) {
    +			return null;
    +		}
    +
    +		var elem = this[0],
    +
    +		// Get *real* offsetParent
    +		offsetParent = this.offsetParent(),
    +
    +		// Get correct offsets
    +		offset       = this.offset(),
    +		parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
    +
    +		// Subtract element margins
    +		// note: when an element has margin: auto the offsetLeft and marginLeft
    +		// are the same in Safari causing offset.left to incorrectly be 0
    +		offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
    +		offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
    +
    +		// Add offsetParent borders
    +		parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
    +		parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
    +
    +		// Subtract the two offsets
    +		return {
    +			top:  offset.top  - parentOffset.top,
    +			left: offset.left - parentOffset.left
    +		};
    +	},
    +
    +	offsetParent: function() {
    +		return this.map(function() {
    +			var offsetParent = this.offsetParent || document.body;
    +			while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
    +				offsetParent = offsetParent.offsetParent;
    +			}
    +			return offsetParent;
    +		});
    +	}
    +});
    +
    +
    +// Create scrollLeft and scrollTop methods
    +jQuery.each( ["Left", "Top"], function( i, name ) {
    +	var method = "scroll" + name;
    +
    +	jQuery.fn[ method ] = function( val ) {
    +		var elem, win;
    +
    +		if ( val === undefined ) {
    +			elem = this[ 0 ];
    +
    +			if ( !elem ) {
    +				return null;
    +			}
    +
    +			win = getWindow( elem );
    +
    +			// Return the scroll offset
    +			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
    +				jQuery.support.boxModel && win.document.documentElement[ method ] ||
    +					win.document.body[ method ] :
    +				elem[ method ];
    +		}
    +
    +		// Set the scroll offset
    +		return this.each(function() {
    +			win = getWindow( this );
    +
    +			if ( win ) {
    +				win.scrollTo(
    +					!i ? val : jQuery( win ).scrollLeft(),
    +					 i ? val : jQuery( win ).scrollTop()
    +				);
    +
    +			} else {
    +				this[ method ] = val;
    +			}
    +		});
    +	};
    +});
    +
    +function getWindow( elem ) {
    +	return jQuery.isWindow( elem ) ?
    +		elem :
    +		elem.nodeType === 9 ?
    +			elem.defaultView || elem.parentWindow :
    +			false;
    +}
    +
    +
    +
    +
    +// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
    +jQuery.each([ "Height", "Width" ], function( i, name ) {
    +
    +	var type = name.toLowerCase();
    +
    +	// innerHeight and innerWidth
    +	jQuery.fn[ "inner" + name ] = function() {
    +		var elem = this[0];
    +		return elem && elem.style ?
    +			parseFloat( jQuery.css( elem, type, "padding" ) ) :
    +			null;
    +	};
    +
    +	// outerHeight and outerWidth
    +	jQuery.fn[ "outer" + name ] = function( margin ) {
    +		var elem = this[0];
    +		return elem && elem.style ?
    +			parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
    +			null;
    +	};
    +
    +	jQuery.fn[ type ] = function( size ) {
    +		// Get window width or height
    +		var elem = this[0];
    +		if ( !elem ) {
    +			return size == null ? null : this;
    +		}
    +
    +		if ( jQuery.isFunction( size ) ) {
    +			return this.each(function( i ) {
    +				var self = jQuery( this );
    +				self[ type ]( size.call( this, i, self[ type ]() ) );
    +			});
    +		}
    +
    +		if ( jQuery.isWindow( elem ) ) {
    +			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
    +			// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
    +			var docElemProp = elem.document.documentElement[ "client" + name ],
    +				body = elem.document.body;
    +			return elem.document.compatMode === "CSS1Compat" && docElemProp ||
    +				body && body[ "client" + name ] || docElemProp;
    +
    +		// Get document width or height
    +		} else if ( elem.nodeType === 9 ) {
    +			// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
    +			return Math.max(
    +				elem.documentElement["client" + name],
    +				elem.body["scroll" + name], elem.documentElement["scroll" + name],
    +				elem.body["offset" + name], elem.documentElement["offset" + name]
    +			);
    +
    +		// Get or set width or height on the element
    +		} else if ( size === undefined ) {
    +			var orig = jQuery.css( elem, type ),
    +				ret = parseFloat( orig );
    +
    +			return jQuery.isNaN( ret ) ? orig : ret;
    +
    +		// Set the width or height on the element (default to pixels if value is unitless)
    +		} else {
    +			return this.css( type, typeof size === "string" ? size : size + "px" );
    +		}
    +	};
    +
    +});
    +
    +
    +// Expose jQuery to the global object
    +window.jQuery = window.$ = jQuery;
    +})(window);
    diff --git a/tests/qunit.css b/tests/qunit.css
    new file mode 100644
    index 0000000..e114ea0
    --- /dev/null
    +++ b/tests/qunit.css
    @@ -0,0 +1,226 @@
    +/**
    + * QUnit 1.2.0pre - A JavaScript Unit Testing Framework
    + *
    + * http://docs.jquery.com/QUnit
    + *
    + * Copyright (c) 2011 John Resig, Jörn Zaefferer
    + * Dual licensed under the MIT (MIT-LICENSE.txt)
    + * or GPL (GPL-LICENSE.txt) licenses.
    + */
    +
    +/** Font Family and Sizes */
    +
    +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
    +	font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
    +}
    +
    +#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
    +#qunit-tests { font-size: smaller; }
    +
    +
    +/** Resets */
    +
    +#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
    +	margin: 0;
    +	padding: 0;
    +}
    +
    +
    +/** Header */
    +
    +#qunit-header {
    +	padding: 0.5em 0 0.5em 1em;
    +
    +	color: #8699a4;
    +	background-color: #0d3349;
    +
    +	font-size: 1.5em;
    +	line-height: 1em;
    +	font-weight: normal;
    +
    +	border-radius: 15px 15px 0 0;
    +	-moz-border-radius: 15px 15px 0 0;
    +	-webkit-border-top-right-radius: 15px;
    +	-webkit-border-top-left-radius: 15px;
    +}
    +
    +#qunit-header a {
    +	text-decoration: none;
    +	color: #c2ccd1;
    +}
    +
    +#qunit-header a:hover,
    +#qunit-header a:focus {
    +	color: #fff;
    +}
    +
    +#qunit-banner {
    +	height: 5px;
    +}
    +
    +#qunit-testrunner-toolbar {
    +	padding: 0.5em 0 0.5em 2em;
    +	color: #5E740B;
    +	background-color: #eee;
    +}
    +
    +#qunit-userAgent {
    +	padding: 0.5em 0 0.5em 2.5em;
    +	background-color: #2b81af;
    +	color: #fff;
    +	text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
    +}
    +
    +
    +/** Tests: Pass/Fail */
    +
    +#qunit-tests {
    +	list-style-position: inside;
    +}
    +
    +#qunit-tests li {
    +	padding: 0.4em 0.5em 0.4em 2.5em;
    +	border-bottom: 1px solid #fff;
    +	list-style-position: inside;
    +}
    +
    +#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running  {
    +	display: none;
    +}
    +
    +#qunit-tests li strong {
    +	cursor: pointer;
    +}
    +
    +#qunit-tests li a {
    +	padding: 0.5em;
    +	color: #c2ccd1;
    +	text-decoration: none;
    +}
    +#qunit-tests li a:hover,
    +#qunit-tests li a:focus {
    +	color: #000;
    +}
    +
    +#qunit-tests ol {
    +	margin-top: 0.5em;
    +	padding: 0.5em;
    +
    +	background-color: #fff;
    +
    +	border-radius: 15px;
    +	-moz-border-radius: 15px;
    +	-webkit-border-radius: 15px;
    +
    +	box-shadow: inset 0px 2px 13px #999;
    +	-moz-box-shadow: inset 0px 2px 13px #999;
    +	-webkit-box-shadow: inset 0px 2px 13px #999;
    +}
    +
    +#qunit-tests table {
    +	border-collapse: collapse;
    +	margin-top: .2em;
    +}
    +
    +#qunit-tests th {
    +	text-align: right;
    +	vertical-align: top;
    +	padding: 0 .5em 0 0;
    +}
    +
    +#qunit-tests td {
    +	vertical-align: top;
    +}
    +
    +#qunit-tests pre {
    +	margin: 0;
    +	white-space: pre-wrap;
    +	word-wrap: break-word;
    +}
    +
    +#qunit-tests del {
    +	background-color: #e0f2be;
    +	color: #374e0c;
    +	text-decoration: none;
    +}
    +
    +#qunit-tests ins {
    +	background-color: #ffcaca;
    +	color: #500;
    +	text-decoration: none;
    +}
    +
    +/*** Test Counts */
    +
    +#qunit-tests b.counts                       { color: black; }
    +#qunit-tests b.passed                       { color: #5E740B; }
    +#qunit-tests b.failed                       { color: #710909; }
    +
    +#qunit-tests li li {
    +	margin: 0.5em;
    +	padding: 0.4em 0.5em 0.4em 0.5em;
    +	background-color: #fff;
    +	border-bottom: none;
    +	list-style-position: inside;
    +}
    +
    +/*** Passing Styles */
    +
    +#qunit-tests li li.pass {
    +	color: #5E740B;
    +	background-color: #fff;
    +	border-left: 26px solid #C6E746;
    +}
    +
    +#qunit-tests .pass                          { color: #528CE0; background-color: #D2E0E6; }
    +#qunit-tests .pass .test-name               { color: #366097; }
    +
    +#qunit-tests .pass .test-actual,
    +#qunit-tests .pass .test-expected           { color: #999999; }
    +
    +#qunit-banner.qunit-pass                    { background-color: #C6E746; }
    +
    +/*** Failing Styles */
    +
    +#qunit-tests li li.fail {
    +	color: #710909;
    +	background-color: #fff;
    +	border-left: 26px solid #EE5757;
    +	white-space: pre;
    +}
    +
    +#qunit-tests > li:last-child {
    +	border-radius: 0 0 15px 15px;
    +	-moz-border-radius: 0 0 15px 15px;
    +	-webkit-border-bottom-right-radius: 15px;
    +	-webkit-border-bottom-left-radius: 15px;
    +}
    +
    +#qunit-tests .fail                          { color: #000000; background-color: #EE5757; }
    +#qunit-tests .fail .test-name,
    +#qunit-tests .fail .module-name             { color: #000000; }
    +
    +#qunit-tests .fail .test-actual             { color: #EE5757; }
    +#qunit-tests .fail .test-expected           { color: green;   }
    +
    +#qunit-banner.qunit-fail                    { background-color: #EE5757; }
    +
    +
    +/** Result */
    +
    +#qunit-testresult {
    +	padding: 0.5em 0.5em 0.5em 2.5em;
    +
    +	color: #2b81af;
    +	background-color: #D2E0E6;
    +
    +	border-bottom: 1px solid white;
    +}
    +
    +/** Fixture */
    +
    +#qunit-fixture {
    +	position: absolute;
    +	top: -10000px;
    +	left: -10000px;
    +}
    diff --git a/tests/qunit.js b/tests/qunit.js
    new file mode 100644
    index 0000000..d630c43
    --- /dev/null
    +++ b/tests/qunit.js
    @@ -0,0 +1,1587 @@
    +/**
    + * QUnit 1.2.0pre - A JavaScript Unit Testing Framework
    + *
    + * http://docs.jquery.com/QUnit
    + *
    + * Copyright (c) 2011 John Resig, Jörn Zaefferer
    + * Dual licensed under the MIT (MIT-LICENSE.txt)
    + * or GPL (GPL-LICENSE.txt) licenses.
    + */
    +
    +(function(window) {
    +
    +var defined = {
    +	setTimeout: typeof window.setTimeout !== "undefined",
    +	sessionStorage: (function() {
    +		try {
    +			return !!sessionStorage.getItem;
    +		} catch(e) {
    +			return false;
    +		}
    +	})()
    +};
    +
    +var	testId = 0,
    +	toString = Object.prototype.toString,
    +	hasOwn = Object.prototype.hasOwnProperty;
    +
    +var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
    +	this.name = name;
    +	this.testName = testName;
    +	this.expected = expected;
    +	this.testEnvironmentArg = testEnvironmentArg;
    +	this.async = async;
    +	this.callback = callback;
    +	this.assertions = [];
    +};
    +Test.prototype = {
    +	init: function() {
    +		var tests = id("qunit-tests");
    +		if (tests) {
    +			var b = document.createElement("strong");
    +				b.innerHTML = "Running " + this.name;
    +			var li = document.createElement("li");
    +				li.appendChild( b );
    +				li.className = "running";
    +				li.id = this.id = "test-output" + testId++;
    +			tests.appendChild( li );
    +		}
    +	},
    +	setup: function() {
    +		if (this.module != config.previousModule) {
    +			if ( config.previousModule ) {
    +				runLoggingCallbacks('moduleDone', QUnit, {
    +					name: config.previousModule,
    +					failed: config.moduleStats.bad,
    +					passed: config.moduleStats.all - config.moduleStats.bad,
    +					total: config.moduleStats.all
    +				} );
    +			}
    +			config.previousModule = this.module;
    +			config.moduleStats = { all: 0, bad: 0 };
    +			runLoggingCallbacks( 'moduleStart', QUnit, {
    +				name: this.module
    +			} );
    +		}
    +
    +		config.current = this;
    +		this.testEnvironment = extend({
    +			setup: function() {},
    +			teardown: function() {}
    +		}, this.moduleTestEnvironment);
    +		if (this.testEnvironmentArg) {
    +			extend(this.testEnvironment, this.testEnvironmentArg);
    +		}
    +
    +		runLoggingCallbacks( 'testStart', QUnit, {
    +			name: this.testName,
    +			module: this.module
    +		});
    +
    +		// allow utility functions to access the current test environment
    +		// TODO why??
    +		QUnit.current_testEnvironment = this.testEnvironment;
    +
    +		try {
    +			if ( !config.pollution ) {
    +				saveGlobal();
    +			}
    +
    +			this.testEnvironment.setup.call(this.testEnvironment);
    +		} catch(e) {
    +			QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
    +		}
    +	},
    +	run: function() {
    +		config.current = this;
    +		if ( this.async ) {
    +			QUnit.stop();
    +		}
    +
    +		if ( config.notrycatch ) {
    +			this.callback.call(this.testEnvironment);
    +			return;
    +		}
    +		try {
    +			this.callback.call(this.testEnvironment);
    +		} catch(e) {
    +			fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
    +			QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
    +			// else next test will carry the responsibility
    +			saveGlobal();
    +
    +			// Restart the tests if they're blocking
    +			if ( config.blocking ) {
    +				QUnit.start();
    +			}
    +		}
    +	},
    +	teardown: function() {
    +		config.current = this;
    +		try {
    +			this.testEnvironment.teardown.call(this.testEnvironment);
    +			checkPollution();
    +		} catch(e) {
    +			QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
    +		}
    +	},
    +	finish: function() {
    +		config.current = this;
    +		if ( this.expected != null && this.expected != this.assertions.length ) {
    +			QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
    +		}
    +
    +		var good = 0, bad = 0,
    +			tests = id("qunit-tests");
    +
    +		config.stats.all += this.assertions.length;
    +		config.moduleStats.all += this.assertions.length;
    +
    +		if ( tests ) {
    +			var ol = document.createElement("ol");
    +
    +			for ( var i = 0; i < this.assertions.length; i++ ) {
    +				var assertion = this.assertions[i];
    +
    +				var li = document.createElement("li");
    +				li.className = assertion.result ? "pass" : "fail";
    +				li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
    +				ol.appendChild( li );
    +
    +				if ( assertion.result ) {
    +					good++;
    +				} else {
    +					bad++;
    +					config.stats.bad++;
    +					config.moduleStats.bad++;
    +				}
    +			}
    +
    +			// store result when possible
    +			if ( QUnit.config.reorder && defined.sessionStorage ) {
    +				if (bad) {
    +					sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad);
    +				} else {
    +					sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName);
    +				}
    +			}
    +
    +			if (bad == 0) {
    +				ol.style.display = "none";
    +			}
    +
    +			var b = document.createElement("strong");
    +			b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
    +
    +			var a = document.createElement("a");
    +			a.innerHTML = "Rerun";
    +			a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
    +
    +			addEvent(b, "click", function() {
    +				var next = b.nextSibling.nextSibling,
    +					display = next.style.display;
    +				next.style.display = display === "none" ? "block" : "none";
    +			});
    +
    +			addEvent(b, "dblclick", function(e) {
    +				var target = e && e.target ? e.target : window.event.srcElement;
    +				if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
    +					target = target.parentNode;
    +				}
    +				if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
    +					window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
    +				}
    +			});
    +
    +			var li = id(this.id);
    +			li.className = bad ? "fail" : "pass";
    +			li.removeChild( li.firstChild );
    +			li.appendChild( b );
    +			li.appendChild( a );
    +			li.appendChild( ol );
    +
    +		} else {
    +			for ( var i = 0; i < this.assertions.length; i++ ) {
    +				if ( !this.assertions[i].result ) {
    +					bad++;
    +					config.stats.bad++;
    +					config.moduleStats.bad++;
    +				}
    +			}
    +		}
    +
    +		try {
    +			QUnit.reset();
    +		} catch(e) {
    +			fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
    +		}
    +
    +		runLoggingCallbacks( 'testDone', QUnit, {
    +			name: this.testName,
    +			module: this.module,
    +			failed: bad,
    +			passed: this.assertions.length - bad,
    +			total: this.assertions.length
    +		} );
    +	},
    +
    +	queue: function() {
    +		var test = this;
    +		synchronize(function() {
    +			test.init();
    +		});
    +		function run() {
    +			// each of these can by async
    +			synchronize(function() {
    +				test.setup();
    +			});
    +			synchronize(function() {
    +				test.run();
    +			});
    +			synchronize(function() {
    +				test.teardown();
    +			});
    +			synchronize(function() {
    +				test.finish();
    +			});
    +		}
    +		// defer when previous test run passed, if storage is available
    +		var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.module + "-" + this.testName);
    +		if (bad) {
    +			run();
    +		} else {
    +			synchronize(run, true);
    +		};
    +	}
    +
    +};
    +
    +var QUnit = {
    +
    +	// call on start of module test to prepend name to all tests
    +	module: function(name, testEnvironment) {
    +		config.currentModule = name;
    +		config.currentModuleTestEnviroment = testEnvironment;
    +	},
    +
    +	asyncTest: function(testName, expected, callback) {
    +		if ( arguments.length === 2 ) {
    +			callback = expected;
    +			expected = null;
    +		}
    +
    +		QUnit.test(testName, expected, callback, true);
    +	},
    +
    +	test: function(testName, expected, callback, async) {
    +		var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
    +
    +		if ( arguments.length === 2 ) {
    +			callback = expected;
    +			expected = null;
    +		}
    +		// is 2nd argument a testEnvironment?
    +		if ( expected && typeof expected === 'object') {
    +			testEnvironmentArg = expected;
    +			expected = null;
    +		}
    +
    +		if ( config.currentModule ) {
    +			name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
    +		}
    +
    +		if ( !validTest(config.currentModule + ": " + testName) ) {
    +			return;
    +		}
    +
    +		var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
    +		test.module = config.currentModule;
    +		test.moduleTestEnvironment = config.currentModuleTestEnviroment;
    +		test.queue();
    +	},
    +
    +	/**
    +	 * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
    +	 */
    +	expect: function(asserts) {
    +		config.current.expected = asserts;
    +	},
    +
    +	/**
    +	 * Asserts true.
    +	 * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
    +	 */
    +	ok: function(a, msg) {
    +		a = !!a;
    +		var details = {
    +			result: a,
    +			message: msg
    +		};
    +		msg = escapeInnerText(msg);
    +		runLoggingCallbacks( 'log', QUnit, details );
    +		config.current.assertions.push({
    +			result: a,
    +			message: msg
    +		});
    +	},
    +
    +	/**
    +	 * Checks that the first two arguments are equal, with an optional message.
    +	 * Prints out both actual and expected values.
    +	 *
    +	 * Prefered to ok( actual == expected, message )
    +	 *
    +	 * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
    +	 *
    +	 * @param Object actual
    +	 * @param Object expected
    +	 * @param String message (optional)
    +	 */
    +	equal: function(actual, expected, message) {
    +		QUnit.push(expected == actual, actual, expected, message);
    +	},
    +
    +	notEqual: function(actual, expected, message) {
    +		QUnit.push(expected != actual, actual, expected, message);
    +	},
    +
    +	deepEqual: function(actual, expected, message) {
    +		QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
    +	},
    +
    +	notDeepEqual: function(actual, expected, message) {
    +		QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
    +	},
    +
    +	strictEqual: function(actual, expected, message) {
    +		QUnit.push(expected === actual, actual, expected, message);
    +	},
    +
    +	notStrictEqual: function(actual, expected, message) {
    +		QUnit.push(expected !== actual, actual, expected, message);
    +	},
    +
    +	raises: function(block, expected, message) {
    +		var actual, ok = false;
    +
    +		if (typeof expected === 'string') {
    +			message = expected;
    +			expected = null;
    +		}
    +
    +		try {
    +			block();
    +		} catch (e) {
    +			actual = e;
    +		}
    +
    +		if (actual) {
    +			// we don't want to validate thrown error
    +			if (!expected) {
    +				ok = true;
    +			// expected is a regexp
    +			} else if (QUnit.objectType(expected) === "regexp") {
    +				ok = expected.test(actual);
    +			// expected is a constructor
    +			} else if (actual instanceof expected) {
    +				ok = true;
    +			// expected is a validation function which returns true is validation passed
    +			} else if (expected.call({}, actual) === true) {
    +				ok = true;
    +			}
    +		}
    +
    +		QUnit.ok(ok, message);
    +	},
    +
    +	start: function(count) {
    +		config.semaphore -= count || 1;
    +		if (config.semaphore > 0) {
    +			// don't start until equal number of stop-calls
    +			return;
    +		}
    +		if (config.semaphore < 0) {
    +			// ignore if start is called more often then stop
    +			config.semaphore = 0;
    +		}
    +		// A slight delay, to avoid any current callbacks
    +		if ( defined.setTimeout ) {
    +			window.setTimeout(function() {
    +				if (config.semaphore > 0) {
    +					return;
    +				}
    +				if ( config.timeout ) {
    +					clearTimeout(config.timeout);
    +				}
    +
    +				config.blocking = false;
    +				process(true);
    +			}, 13);
    +		} else {
    +			config.blocking = false;
    +			process(true);
    +		}
    +	},
    +
    +	stop: function(count) {
    +		config.semaphore += count || 1;
    +		config.blocking = true;
    +
    +		if ( config.testTimeout && defined.setTimeout ) {
    +			clearTimeout(config.timeout);
    +			config.timeout = window.setTimeout(function() {
    +				QUnit.ok( false, "Test timed out" );
    +				config.semaphore = 1;
    +				QUnit.start();
    +			}, config.testTimeout);
    +		}
    +	}
    +};
    +
    +//We want access to the constructor's prototype
    +(function() {
    +	function F(){};
    +	F.prototype = QUnit;
    +	QUnit = new F();
    +	//Make F QUnit's constructor so that we can add to the prototype later
    +	QUnit.constructor = F;
    +})();
    +
    +// Backwards compatibility, deprecated
    +QUnit.equals = QUnit.equal;
    +QUnit.same = QUnit.deepEqual;
    +
    +// Maintain internal state
    +var config = {
    +	// The queue of tests to run
    +	queue: [],
    +
    +	// block until document ready
    +	blocking: true,
    +
    +	// when enabled, show only failing tests
    +	// gets persisted through sessionStorage and can be changed in UI via checkbox
    +	hidepassed: false,
    +
    +	// by default, run previously failed tests first
    +	// very useful in combination with "Hide passed tests" checked
    +	reorder: true,
    +
    +	// by default, modify document.title when suite is done
    +	altertitle: true,
    +
    +	urlConfig: ['noglobals', 'notrycatch'],
    +
    +	//logging callback queues
    +	begin: [],
    +	done: [],
    +	log: [],
    +	testStart: [],
    +	testDone: [],
    +	moduleStart: [],
    +	moduleDone: []
    +};
    +
    +// Load paramaters
    +(function() {
    +	var location = window.location || { search: "", protocol: "file:" },
    +		params = location.search.slice( 1 ).split( "&" ),
    +		length = params.length,
    +		urlParams = {},
    +		current;
    +
    +	if ( params[ 0 ] ) {
    +		for ( var i = 0; i < length; i++ ) {
    +			current = params[ i ].split( "=" );
    +			current[ 0 ] = decodeURIComponent( current[ 0 ] );
    +			// allow just a key to turn on a flag, e.g., test.html?noglobals
    +			current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true;
    +			urlParams[ current[ 0 ] ] = current[ 1 ];
    +		}
    +	}
    +
    +	QUnit.urlParams = urlParams;
    +	config.filter = urlParams.filter;
    +
    +	// Figure out if we're running the tests from a server or not
    +	QUnit.isLocal = !!(location.protocol === 'file:');
    +})();
    +
    +// Expose the API as global variables, unless an 'exports'
    +// object exists, in that case we assume we're in CommonJS
    +if ( typeof exports === "undefined" || typeof require === "undefined" ) {
    +	extend(window, QUnit);
    +	window.QUnit = QUnit;
    +} else {
    +	extend(exports, QUnit);
    +	exports.QUnit = QUnit;
    +}
    +
    +// define these after exposing globals to keep them in these QUnit namespace only
    +extend(QUnit, {
    +	config: config,
    +
    +	// Initialize the configuration options
    +	init: function() {
    +		extend(config, {
    +			stats: { all: 0, bad: 0 },
    +			moduleStats: { all: 0, bad: 0 },
    +			started: +new Date,
    +			updateRate: 1000,
    +			blocking: false,
    +			autostart: true,
    +			autorun: false,
    +			filter: "",
    +			queue: [],
    +			semaphore: 0
    +		});
    +
    +		var tests = id( "qunit-tests" ),
    +			banner = id( "qunit-banner" ),
    +			result = id( "qunit-testresult" );
    +
    +		if ( tests ) {
    +			tests.innerHTML = "";
    +		}
    +
    +		if ( banner ) {
    +			banner.className = "";
    +		}
    +
    +		if ( result ) {
    +			result.parentNode.removeChild( result );
    +		}
    +
    +		if ( tests ) {
    +			result = document.createElement( "p" );
    +			result.id = "qunit-testresult";
    +			result.className = "result";
    +			tests.parentNode.insertBefore( result, tests );
    +			result.innerHTML = 'Running...<br/>&nbsp;';
    +		}
    +	},
    +
    +	/**
    +	 * Resets the test setup. Useful for tests that modify the DOM.
    +	 *
    +	 * If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
    +	 */
    +	reset: function() {
    +		if ( window.jQuery ) {
    +			jQuery( "#qunit-fixture" ).html( config.fixture );
    +		} else {
    +			var main = id( 'qunit-fixture' );
    +			if ( main ) {
    +				main.innerHTML = config.fixture;
    +			}
    +		}
    +	},
    +
    +	/**
    +	 * Trigger an event on an element.
    +	 *
    +	 * @example triggerEvent( document.body, "click" );
    +	 *
    +	 * @param DOMElement elem
    +	 * @param String type
    +	 */
    +	triggerEvent: function( elem, type, event ) {
    +		if ( document.createEvent ) {
    +			event = document.createEvent("MouseEvents");
    +			event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
    +				0, 0, 0, 0, 0, false, false, false, false, 0, null);
    +			elem.dispatchEvent( event );
    +
    +		} else if ( elem.fireEvent ) {
    +			elem.fireEvent("on"+type);
    +		}
    +	},
    +
    +	// Safe object type checking
    +	is: function( type, obj ) {
    +		return QUnit.objectType( obj ) == type;
    +	},
    +
    +	objectType: function( obj ) {
    +		if (typeof obj === "undefined") {
    +				return "undefined";
    +
    +		// consider: typeof null === object
    +		}
    +		if (obj === null) {
    +				return "null";
    +		}
    +
    +		var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || '';
    +
    +		switch (type) {
    +				case 'Number':
    +						if (isNaN(obj)) {
    +								return "nan";
    +						} else {
    +								return "number";
    +						}
    +				case 'String':
    +				case 'Boolean':
    +				case 'Array':
    +				case 'Date':
    +				case 'RegExp':
    +				case 'Function':
    +						return type.toLowerCase();
    +		}
    +		if (typeof obj === "object") {
    +				return "object";
    +		}
    +		return undefined;
    +	},
    +
    +	push: function(result, actual, expected, message) {
    +		var details = {
    +			result: result,
    +			message: message,
    +			actual: actual,
    +			expected: expected
    +		};
    +
    +		message = escapeInnerText(message) || (result ? "okay" : "failed");
    +		message = '<span class="test-message">' + message + "</span>";
    +		expected = escapeInnerText(QUnit.jsDump.parse(expected));
    +		actual = escapeInnerText(QUnit.jsDump.parse(actual));
    +		var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
    +		if (actual != expected) {
    +			output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
    +			output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
    +		}
    +		if (!result) {
    +			var source = sourceFromStacktrace();
    +			if (source) {
    +				details.source = source;
    +				output += '<tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr>';
    +			}
    +		}
    +		output += "</table>";
    +
    +		runLoggingCallbacks( 'log', QUnit, details );
    +
    +		config.current.assertions.push({
    +			result: !!result,
    +			message: output
    +		});
    +	},
    +
    +	url: function( params ) {
    +		params = extend( extend( {}, QUnit.urlParams ), params );
    +		var querystring = "?",
    +			key;
    +		for ( key in params ) {
    +			if ( !hasOwn.call( params, key ) ) {
    +				continue;
    +			}
    +			querystring += encodeURIComponent( key ) + "=" +
    +				encodeURIComponent( params[ key ] ) + "&";
    +		}
    +		return window.location.pathname + querystring.slice( 0, -1 );
    +	},
    +
    +	extend: extend,
    +	id: id,
    +	addEvent: addEvent
    +});
    +
    +//QUnit.constructor is set to the empty F() above so that we can add to it's prototype later
    +//Doing this allows us to tell if the following methods have been overwritten on the actual
    +//QUnit object, which is a deprecated way of using the callbacks.
    +extend(QUnit.constructor.prototype, {
    +	// Logging callbacks; all receive a single argument with the listed properties
    +	// run test/logs.html for any related changes
    +	begin: registerLoggingCallback('begin'),
    +	// done: { failed, passed, total, runtime }
    +	done: registerLoggingCallback('done'),
    +	// log: { result, actual, expected, message }
    +	log: registerLoggingCallback('log'),
    +	// testStart: { name }
    +	testStart: registerLoggingCallback('testStart'),
    +	// testDone: { name, failed, passed, total }
    +	testDone: registerLoggingCallback('testDone'),
    +	// moduleStart: { name }
    +	moduleStart: registerLoggingCallback('moduleStart'),
    +	// moduleDone: { name, failed, passed, total }
    +	moduleDone: registerLoggingCallback('moduleDone')
    +});
    +
    +if ( typeof document === "undefined" || document.readyState === "complete" ) {
    +	config.autorun = true;
    +}
    +
    +QUnit.load = function() {
    +	runLoggingCallbacks( 'begin', QUnit, {} );
    +
    +	// Initialize the config, saving the execution queue
    +	var oldconfig = extend({}, config);
    +	QUnit.init();
    +	extend(config, oldconfig);
    +
    +	config.blocking = false;
    +
    +	var urlConfigHtml = '', len = config.urlConfig.length;
    +	for ( var i = 0, val; i < len, val = config.urlConfig[i]; i++ ) {
    +		config[val] = QUnit.urlParams[val];
    +		urlConfigHtml += '<label><input name="' + val + '" type="checkbox"' + ( config[val] ? ' checked="checked"' : '' ) + '>' + val + '</label>';
    +	}
    +
    +	var userAgent = id("qunit-userAgent");
    +	if ( userAgent ) {
    +		userAgent.innerHTML = navigator.userAgent;
    +	}
    +	var banner = id("qunit-header");
    +	if ( banner ) {
    +		banner.innerHTML = '<a href="' + QUnit.url({ filter: undefined }) + '"> ' + banner.innerHTML + '</a> ' + urlConfigHtml;
    +		addEvent( banner, "change", function( event ) {
    +			var params = {};
    +			params[ event.target.name ] = event.target.checked ? true : undefined;
    +			window.location = QUnit.url( params );
    +		});
    +	}
    +
    +	var toolbar = id("qunit-testrunner-toolbar");
    +	if ( toolbar ) {
    +		var filter = document.createElement("input");
    +		filter.type = "checkbox";
    +		filter.id = "qunit-filter-pass";
    +		addEvent( filter, "click", function() {
    +			var ol = document.getElementById("qunit-tests");
    +			if ( filter.checked ) {
    +				ol.className = ol.className + " hidepass";
    +			} else {
    +				var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
    +				ol.className = tmp.replace(/ hidepass /, " ");
    +			}
    +			if ( defined.sessionStorage ) {
    +				if (filter.checked) {
    +					sessionStorage.setItem("qunit-filter-passed-tests", "true");
    +				} else {
    +					sessionStorage.removeItem("qunit-filter-passed-tests");
    +				}
    +			}
    +		});
    +		if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
    +			filter.checked = true;
    +			var ol = document.getElementById("qunit-tests");
    +			ol.className = ol.className + " hidepass";
    +		}
    +		toolbar.appendChild( filter );
    +
    +		var label = document.createElement("label");
    +		label.setAttribute("for", "qunit-filter-pass");
    +		label.innerHTML = "Hide passed tests";
    +		toolbar.appendChild( label );
    +	}
    +
    +	var main = id('qunit-fixture');
    +	if ( main ) {
    +		config.fixture = main.innerHTML;
    +	}
    +
    +	if (config.autostart) {
    +		QUnit.start();
    +	}
    +};
    +
    +addEvent(window, "load", QUnit.load);
    +
    +// addEvent(window, "error") gives us a useless event object
    +window.onerror = function( message, file, line ) {
    +	if ( QUnit.config.current ) {
    +		ok( false, message + ", " + file + ":" + line );
    +	} else {
    +		test( "global failure", function() {
    +			ok( false, message + ", " + file + ":" + line );
    +		});
    +	}
    +};
    +
    +function done() {
    +	config.autorun = true;
    +
    +	// Log the last module results
    +	if ( config.currentModule ) {
    +		runLoggingCallbacks( 'moduleDone', QUnit, {
    +			name: config.currentModule,
    +			failed: config.moduleStats.bad,
    +			passed: config.moduleStats.all - config.moduleStats.bad,
    +			total: config.moduleStats.all
    +		} );
    +	}
    +
    +	var banner = id("qunit-banner"),
    +		tests = id("qunit-tests"),
    +		runtime = +new Date - config.started,
    +		passed = config.stats.all - config.stats.bad,
    +		html = [
    +			'Tests completed in ',
    +			runtime,
    +			' milliseconds.<br/>',
    +			'<span class="passed">',
    +			passed,
    +			'</span> tests of <span class="total">',
    +			config.stats.all,
    +			'</span> passed, <span class="failed">',
    +			config.stats.bad,
    +			'</span> failed.'
    +		].join('');
    +
    +	if ( banner ) {
    +		banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
    +	}
    +
    +	if ( tests ) {
    +		id( "qunit-testresult" ).innerHTML = html;
    +	}
    +
    +	if ( config.altertitle && typeof document !== "undefined" && document.title ) {
    +		// show ✖ for good, ✔ for bad suite result in title
    +		// use escape sequences in case file gets loaded with non-utf-8-charset
    +		document.title = [
    +			(config.stats.bad ? "\u2716" : "\u2714"),
    +			document.title.replace(/^[\u2714\u2716] /i, "")
    +		].join(" ");
    +	}
    +
    +	runLoggingCallbacks( 'done', QUnit, {
    +		failed: config.stats.bad,
    +		passed: passed,
    +		total: config.stats.all,
    +		runtime: runtime
    +	} );
    +}
    +
    +function validTest( name ) {
    +	var filter = config.filter,
    +		run = false;
    +
    +	if ( !filter ) {
    +		return true;
    +	}
    +
    +	var not = filter.charAt( 0 ) === "!";
    +	if ( not ) {
    +		filter = filter.slice( 1 );
    +	}
    +
    +	if ( name.indexOf( filter ) !== -1 ) {
    +		return !not;
    +	}
    +
    +	if ( not ) {
    +		run = true;
    +	}
    +
    +	return run;
    +}
    +
    +// so far supports only Firefox, Chrome and Opera (buggy)
    +// could be extended in the future to use something like https://github.com/csnover/TraceKit
    +function sourceFromStacktrace() {
    +	try {
    +		throw new Error();
    +	} catch ( e ) {
    +		if (e.stacktrace) {
    +			// Opera
    +			return e.stacktrace.split("\n")[6];
    +		} else if (e.stack) {
    +			// Firefox, Chrome
    +			return e.stack.split("\n")[4];
    +		} else if (e.sourceURL) {
    +			// Safari, PhantomJS
    +			// TODO sourceURL points at the 'throw new Error' line above, useless
    +			//return e.sourceURL + ":" + e.line;
    +		}
    +	}
    +}
    +
    +function escapeInnerText(s) {
    +	if (!s) {
    +		return "";
    +	}
    +	s = s + "";
    +	return s.replace(/[\&<>]/g, function(s) {
    +		switch(s) {
    +			case "&": return "&amp;";
    +			case "<": return "&lt;";
    +			case ">": return "&gt;";
    +			default: return s;
    +		}
    +	});
    +}
    +
    +function synchronize( callback, last ) {
    +	config.queue.push( callback );
    +
    +	if ( config.autorun && !config.blocking ) {
    +		process(last);
    +	}
    +}
    +
    +function process( last ) {
    +	var start = new Date().getTime();
    +	config.depth = config.depth ? config.depth + 1 : 1;
    +
    +	while ( config.queue.length && !config.blocking ) {
    +		if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) {
    +			config.queue.shift()();
    +		} else {
    +			window.setTimeout( function(){
    +				process( last );
    +			}, 13 );
    +			break;
    +		}
    +	}
    +	config.depth--;
    +	if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) {
    +		done();
    +	}
    +}
    +
    +function saveGlobal() {
    +	config.pollution = [];
    +
    +	if ( config.noglobals ) {
    +		for ( var key in window ) {
    +			if ( !hasOwn.call( window, key ) ) {
    +				continue;
    +			}
    +			config.pollution.push( key );
    +		}
    +	}
    +}
    +
    +function checkPollution( name ) {
    +	var old = config.pollution;
    +	saveGlobal();
    +
    +	var newGlobals = diff( config.pollution, old );
    +	if ( newGlobals.length > 0 ) {
    +		ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
    +	}
    +
    +	var deletedGlobals = diff( old, config.pollution );
    +	if ( deletedGlobals.length > 0 ) {
    +		ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
    +	}
    +}
    +
    +// returns a new Array with the elements that are in a but not in b
    +function diff( a, b ) {
    +	var result = a.slice();
    +	for ( var i = 0; i < result.length; i++ ) {
    +		for ( var j = 0; j < b.length; j++ ) {
    +			if ( result[i] === b[j] ) {
    +				result.splice(i, 1);
    +				i--;
    +				break;
    +			}
    +		}
    +	}
    +	return result;
    +}
    +
    +function fail(message, exception, callback) {
    +	if ( typeof console !== "undefined" && console.error && console.warn ) {
    +		console.error(message);
    +		console.error(exception);
    +		console.warn(callback.toString());
    +
    +	} else if ( window.opera && opera.postError ) {
    +		opera.postError(message, exception, callback.toString);
    +	}
    +}
    +
    +function extend(a, b) {
    +	for ( var prop in b ) {
    +		if ( b[prop] === undefined ) {
    +			delete a[prop];
    +
    +		// Avoid "Member not found" error in IE8 caused by setting window.constructor
    +		} else if ( prop !== "constructor" || a !== window ) {
    +			a[prop] = b[prop];
    +		}
    +	}
    +
    +	return a;
    +}
    +
    +function addEvent(elem, type, fn) {
    +	if ( elem.addEventListener ) {
    +		elem.addEventListener( type, fn, false );
    +	} else if ( elem.attachEvent ) {
    +		elem.attachEvent( "on" + type, fn );
    +	} else {
    +		fn();
    +	}
    +}
    +
    +function id(name) {
    +	return !!(typeof document !== "undefined" && document && document.getElementById) &&
    +		document.getElementById( name );
    +}
    +
    +function registerLoggingCallback(key){
    +	return function(callback){
    +		config[key].push( callback );
    +	};
    +}
    +
    +// Supports deprecated method of completely overwriting logging callbacks
    +function runLoggingCallbacks(key, scope, args) {
    +	//debugger;
    +	var callbacks;
    +	if ( QUnit.hasOwnProperty(key) ) {
    +		QUnit[key].call(scope, args);
    +	} else {
    +		callbacks = config[key];
    +		for( var i = 0; i < callbacks.length; i++ ) {
    +			callbacks[i].call( scope, args );
    +		}
    +	}
    +}
    +
    +// Test for equality any JavaScript type.
    +// Author: Philippe Rathé <prathe@gmail.com>
    +QUnit.equiv = function () {
    +
    +	var innerEquiv; // the real equiv function
    +	var callers = []; // stack to decide between skip/abort functions
    +	var parents = []; // stack to avoiding loops from circular referencing
    +
    +	// Call the o related callback with the given arguments.
    +	function bindCallbacks(o, callbacks, args) {
    +		var prop = QUnit.objectType(o);
    +		if (prop) {
    +			if (QUnit.objectType(callbacks[prop]) === "function") {
    +				return callbacks[prop].apply(callbacks, args);
    +			} else {
    +				return callbacks[prop]; // or undefined
    +			}
    +		}
    +	}
    +
    +	var callbacks = function () {
    +
    +		// for string, boolean, number and null
    +		function useStrictEquality(b, a) {
    +			if (b instanceof a.constructor || a instanceof b.constructor) {
    +				// to catch short annotaion VS 'new' annotation of a
    +				// declaration
    +				// e.g. var i = 1;
    +				// var j = new Number(1);
    +				return a == b;
    +			} else {
    +				return a === b;
    +			}
    +		}
    +
    +		return {
    +			"string" : useStrictEquality,
    +			"boolean" : useStrictEquality,
    +			"number" : useStrictEquality,
    +			"null" : useStrictEquality,
    +			"undefined" : useStrictEquality,
    +
    +			"nan" : function(b) {
    +				return isNaN(b);
    +			},
    +
    +			"date" : function(b, a) {
    +				return QUnit.objectType(b) === "date"
    +						&& a.valueOf() === b.valueOf();
    +			},
    +
    +			"regexp" : function(b, a) {
    +				return QUnit.objectType(b) === "regexp"
    +						&& a.source === b.source && // the regex itself
    +						a.global === b.global && // and its modifers
    +													// (gmi) ...
    +						a.ignoreCase === b.ignoreCase
    +						&& a.multiline === b.multiline;
    +			},
    +
    +			// - skip when the property is a method of an instance (OOP)
    +			// - abort otherwise,
    +			// initial === would have catch identical references anyway
    +			"function" : function() {
    +				var caller = callers[callers.length - 1];
    +				return caller !== Object && typeof caller !== "undefined";
    +			},
    +
    +			"array" : function(b, a) {
    +				var i, j, loop;
    +				var len;
    +
    +				// b could be an object literal here
    +				if (!(QUnit.objectType(b) === "array")) {
    +					return false;
    +				}
    +
    +				len = a.length;
    +				if (len !== b.length) { // safe and faster
    +					return false;
    +				}
    +
    +				// track reference to avoid circular references
    +				parents.push(a);
    +				for (i = 0; i < len; i++) {
    +					loop = false;
    +					for (j = 0; j < parents.length; j++) {
    +						if (parents[j] === a[i]) {
    +							loop = true;// dont rewalk array
    +						}
    +					}
    +					if (!loop && !innerEquiv(a[i], b[i])) {
    +						parents.pop();
    +						return false;
    +					}
    +				}
    +				parents.pop();
    +				return true;
    +			},
    +
    +			"object" : function(b, a) {
    +				var i, j, loop;
    +				var eq = true; // unless we can proove it
    +				var aProperties = [], bProperties = []; // collection of
    +														// strings
    +
    +				// comparing constructors is more strict than using
    +				// instanceof
    +				if (a.constructor !== b.constructor) {
    +					return false;
    +				}
    +
    +				// stack constructor before traversing properties
    +				callers.push(a.constructor);
    +				// track reference to avoid circular references
    +				parents.push(a);
    +
    +				for (i in a) { // be strict: don't ensures hasOwnProperty
    +								// and go deep
    +					loop = false;
    +					for (j = 0; j < parents.length; j++) {
    +						if (parents[j] === a[i])
    +							loop = true; // don't go down the same path
    +											// twice
    +					}
    +					aProperties.push(i); // collect a's properties
    +
    +					if (!loop && !innerEquiv(a[i], b[i])) {
    +						eq = false;
    +						break;
    +					}
    +				}
    +
    +				callers.pop(); // unstack, we are done
    +				parents.pop();
    +
    +				for (i in b) {
    +					bProperties.push(i); // collect b's properties
    +				}
    +
    +				// Ensures identical properties name
    +				return eq
    +						&& innerEquiv(aProperties.sort(), bProperties
    +								.sort());
    +			}
    +		};
    +	}();
    +
    +	innerEquiv = function() { // can take multiple arguments
    +		var args = Array.prototype.slice.apply(arguments);
    +		if (args.length < 2) {
    +			return true; // end transition
    +		}
    +
    +		return (function(a, b) {
    +			if (a === b) {
    +				return true; // catch the most you can
    +			} else if (a === null || b === null || typeof a === "undefined"
    +					|| typeof b === "undefined"
    +					|| QUnit.objectType(a) !== QUnit.objectType(b)) {
    +				return false; // don't lose time with error prone cases
    +			} else {
    +				return bindCallbacks(a, callbacks, [ b, a ]);
    +			}
    +
    +			// apply transition with (1..n) arguments
    +		})(args[0], args[1])
    +				&& arguments.callee.apply(this, args.splice(1,
    +						args.length - 1));
    +	};
    +
    +	return innerEquiv;
    +
    +}();
    +
    +/**
    + * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com |
    + * http://flesler.blogspot.com Licensed under BSD
    + * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008
    + *
    + * @projectDescription Advanced and extensible data dumping for Javascript.
    + * @version 1.0.0
    + * @author Ariel Flesler
    + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
    + */
    +QUnit.jsDump = (function() {
    +	function quote( str ) {
    +		return '"' + str.toString().replace(/"/g, '\\"') + '"';
    +	};
    +	function literal( o ) {
    +		return o + '';
    +	};
    +	function join( pre, arr, post ) {
    +		var s = jsDump.separator(),
    +			base = jsDump.indent(),
    +			inner = jsDump.indent(1);
    +		if ( arr.join )
    +			arr = arr.join( ',' + s + inner );
    +		if ( !arr )
    +			return pre + post;
    +		return [ pre, inner + arr, base + post ].join(s);
    +	};
    +	function array( arr, stack ) {
    +		var i = arr.length, ret = Array(i);
    +		this.up();
    +		while ( i-- )
    +			ret[i] = this.parse( arr[i] , undefined , stack);
    +		this.down();
    +		return join( '[', ret, ']' );
    +	};
    +
    +	var reName = /^function (\w+)/;
    +
    +	var jsDump = {
    +		parse:function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance
    +			stack = stack || [ ];
    +			var parser = this.parsers[ type || this.typeOf(obj) ];
    +			type = typeof parser;
    +			var inStack = inArray(obj, stack);
    +			if (inStack != -1) {
    +				return 'recursion('+(inStack - stack.length)+')';
    +			}
    +			//else
    +			if (type == 'function')  {
    +					stack.push(obj);
    +					var res = parser.call( this, obj, stack );
    +					stack.pop();
    +					return res;
    +			}
    +			// else
    +			return (type == 'string') ? parser : this.parsers.error;
    +		},
    +		typeOf:function( obj ) {
    +			var type;
    +			if ( obj === null ) {
    +				type = "null";
    +			} else if (typeof obj === "undefined") {
    +				type = "undefined";
    +			} else if (QUnit.is("RegExp", obj)) {
    +				type = "regexp";
    +			} else if (QUnit.is("Date", obj)) {
    +				type = "date";
    +			} else if (QUnit.is("Function", obj)) {
    +				type = "function";
    +			} else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
    +				type = "window";
    +			} else if (obj.nodeType === 9) {
    +				type = "document";
    +			} else if (obj.nodeType) {
    +				type = "node";
    +			} else if (
    +				// native arrays
    +				toString.call( obj ) === "[object Array]" ||
    +				// NodeList objects
    +				( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) )
    +			) {
    +				type = "array";
    +			} else {
    +				type = typeof obj;
    +			}
    +			return type;
    +		},
    +		separator:function() {
    +			return this.multiline ?	this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
    +		},
    +		indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
    +			if ( !this.multiline )
    +				return '';
    +			var chr = this.indentChar;
    +			if ( this.HTML )
    +				chr = chr.replace(/\t/g,'   ').replace(/ /g,'&nbsp;');
    +			return Array( this._depth_ + (extra||0) ).join(chr);
    +		},
    +		up:function( a ) {
    +			this._depth_ += a || 1;
    +		},
    +		down:function( a ) {
    +			this._depth_ -= a || 1;
    +		},
    +		setParser:function( name, parser ) {
    +			this.parsers[name] = parser;
    +		},
    +		// The next 3 are exposed so you can use them
    +		quote:quote,
    +		literal:literal,
    +		join:join,
    +		//
    +		_depth_: 1,
    +		// This is the list of parsers, to modify them, use jsDump.setParser
    +		parsers:{
    +			window: '[Window]',
    +			document: '[Document]',
    +			error:'[ERROR]', //when no parser is found, shouldn't happen
    +			unknown: '[Unknown]',
    +			'null':'null',
    +			'undefined':'undefined',
    +			'function':function( fn ) {
    +				var ret = 'function',
    +					name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
    +				if ( name )
    +					ret += ' ' + name;
    +				ret += '(';
    +
    +				ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
    +				return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
    +			},
    +			array: array,
    +			nodelist: array,
    +			arguments: array,
    +			object:function( map, stack ) {
    +				var ret = [ ];
    +				QUnit.jsDump.up();
    +				for ( var key in map ) {
    +				    var val = map[key];
    +					ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(val, undefined, stack));
    +                }
    +				QUnit.jsDump.down();
    +				return join( '{', ret, '}' );
    +			},
    +			node:function( node ) {
    +				var open = QUnit.jsDump.HTML ? '&lt;' : '<',
    +					close = QUnit.jsDump.HTML ? '&gt;' : '>';
    +
    +				var tag = node.nodeName.toLowerCase(),
    +					ret = open + tag;
    +
    +				for ( var a in QUnit.jsDump.DOMAttrs ) {
    +					var val = node[QUnit.jsDump.DOMAttrs[a]];
    +					if ( val )
    +						ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
    +				}
    +				return ret + close + open + '/' + tag + close;
    +			},
    +			functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
    +				var l = fn.length;
    +				if ( !l ) return '';
    +
    +				var args = Array(l);
    +				while ( l-- )
    +					args[l] = String.fromCharCode(97+l);//97 is 'a'
    +				return ' ' + args.join(', ') + ' ';
    +			},
    +			key:quote, //object calls it internally, the key part of an item in a map
    +			functionCode:'[code]', //function calls it internally, it's the content of the function
    +			attribute:quote, //node calls it internally, it's an html attribute value
    +			string:quote,
    +			date:quote,
    +			regexp:literal, //regex
    +			number:literal,
    +			'boolean':literal
    +		},
    +		DOMAttrs:{//attributes to dump from nodes, name=>realName
    +			id:'id',
    +			name:'name',
    +			'class':'className'
    +		},
    +		HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
    +		indentChar:'  ',//indentation unit
    +		multiline:true //if true, items in a collection, are separated by a \n, else just a space.
    +	};
    +
    +	return jsDump;
    +})();
    +
    +// from Sizzle.js
    +function getText( elems ) {
    +	var ret = "", elem;
    +
    +	for ( var i = 0; elems[i]; i++ ) {
    +		elem = elems[i];
    +
    +		// Get the text from text nodes and CDATA nodes
    +		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
    +			ret += elem.nodeValue;
    +
    +		// Traverse everything else, except comment nodes
    +		} else if ( elem.nodeType !== 8 ) {
    +			ret += getText( elem.childNodes );
    +		}
    +	}
    +
    +	return ret;
    +};
    +
    +//from jquery.js
    +function inArray( elem, array ) {
    +	if ( array.indexOf ) {
    +		return array.indexOf( elem );
    +	}
    +
    +	for ( var i = 0, length = array.length; i < length; i++ ) {
    +		if ( array[ i ] === elem ) {
    +			return i;
    +		}
    +	}
    +
    +	return -1;
    +}
    +
    +/*
    + * Javascript Diff Algorithm
    + *  By John Resig (http://ejohn.org/)
    + *  Modified by Chu Alan "sprite"
    + *
    + * Released under the MIT license.
    + *
    + * More Info:
    + *  http://ejohn.org/projects/javascript-diff-algorithm/
    + *
    + * Usage: QUnit.diff(expected, actual)
    + *
    + * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the  quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
    + */
    +QUnit.diff = (function() {
    +	function diff(o, n) {
    +		var ns = {};
    +		var os = {};
    +
    +		for (var i = 0; i < n.length; i++) {
    +			if (ns[n[i]] == null)
    +				ns[n[i]] = {
    +					rows: [],
    +					o: null
    +				};
    +			ns[n[i]].rows.push(i);
    +		}
    +
    +		for (var i = 0; i < o.length; i++) {
    +			if (os[o[i]] == null)
    +				os[o[i]] = {
    +					rows: [],
    +					n: null
    +				};
    +			os[o[i]].rows.push(i);
    +		}
    +
    +		for (var i in ns) {
    +			if ( !hasOwn.call( ns, i ) ) {
    +				continue;
    +			}
    +			if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
    +				n[ns[i].rows[0]] = {
    +					text: n[ns[i].rows[0]],
    +					row: os[i].rows[0]
    +				};
    +				o[os[i].rows[0]] = {
    +					text: o[os[i].rows[0]],
    +					row: ns[i].rows[0]
    +				};
    +			}
    +		}
    +
    +		for (var i = 0; i < n.length - 1; i++) {
    +			if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
    +			n[i + 1] == o[n[i].row + 1]) {
    +				n[i + 1] = {
    +					text: n[i + 1],
    +					row: n[i].row + 1
    +				};
    +				o[n[i].row + 1] = {
    +					text: o[n[i].row + 1],
    +					row: i + 1
    +				};
    +			}
    +		}
    +
    +		for (var i = n.length - 1; i > 0; i--) {
    +			if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
    +			n[i - 1] == o[n[i].row - 1]) {
    +				n[i - 1] = {
    +					text: n[i - 1],
    +					row: n[i].row - 1
    +				};
    +				o[n[i].row - 1] = {
    +					text: o[n[i].row - 1],
    +					row: i - 1
    +				};
    +			}
    +		}
    +
    +		return {
    +			o: o,
    +			n: n
    +		};
    +	}
    +
    +	return function(o, n) {
    +		o = o.replace(/\s+$/, '');
    +		n = n.replace(/\s+$/, '');
    +		var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
    +
    +		var str = "";
    +
    +		var oSpace = o.match(/\s+/g);
    +		if (oSpace == null) {
    +			oSpace = [" "];
    +		}
    +		else {
    +			oSpace.push(" ");
    +		}
    +		var nSpace = n.match(/\s+/g);
    +		if (nSpace == null) {
    +			nSpace = [" "];
    +		}
    +		else {
    +			nSpace.push(" ");
    +		}
    +
    +		if (out.n.length == 0) {
    +			for (var i = 0; i < out.o.length; i++) {
    +				str += '<del>' + out.o[i] + oSpace[i] + "</del>";
    +			}
    +		}
    +		else {
    +			if (out.n[0].text == null) {
    +				for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
    +					str += '<del>' + out.o[n] + oSpace[n] + "</del>";
    +				}
    +			}
    +
    +			for (var i = 0; i < out.n.length; i++) {
    +				if (out.n[i].text == null) {
    +					str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
    +				}
    +				else {
    +					var pre = "";
    +
    +					for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
    +						pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
    +					}
    +					str += " " + out.n[i].text + nSpace[i] + pre;
    +				}
    +			}
    +		}
    +
    +		return str;
    +	};
    +})();
    +
    +})(this);
    diff --git a/utils/build.py b/utils/build.py
    deleted file mode 100644
    index eef69c0..0000000
    --- a/utils/build.py
    +++ /dev/null
    @@ -1,186 +0,0 @@
    -#/usr/bin/env python
    -
    -from optparse import OptionParser
    -import httplib, urllib
    -import os, fnmatch, shutil, re
    -
    -usage = """usage: %prog [options] command
    -
    -Commands:
    -  build                 build the script
    -  debug                 print the header to include js files
    -  clean                 remove any built files
    -"""
    -parser = OptionParser(usage=usage)
    -parser.add_option('-l', '--level', dest='level', default='SIMPLE_OPTIMIZATIONS',
    -                  help='Closure compilation level [WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, \
    -                  ADVANCED_OPTIMIZATIONS]')
    -
    -UTILS = os.path.dirname(os.path.relpath(__file__))
    -PREFIX = os.path.join(UTILS,'..')
    -SRC_ROOT= os.path.join(PREFIX,'src')
    -BUILD_ROOT = os.path.join(PREFIX,'build')
    -INDEX = os.path.join(PREFIX,'index.html')
    -BUILD_NAME = 'DAT.GUI'
    -ALL_JS = ['DAT.GUI.js','DAT.GUI']
    -
    -LICENSE = """/**
    - * dat.gui Javascript Controller Library
    - * http://dataarts.github.com/dat.gui
    - *
    - * Copyright 2011 Data Arts Team, Google Creative Lab
    - *
    - * Licensed under the Apache License, Version 2.0 (the "License");
    - * you may not use this file except in compliance with the License.
    - * You may obtain a copy of the License at
    - *
    - * http://www.apache.org/licenses/LICENSE-2.0
    - */
    -"""
    -
    -def flatten(l, ltypes=(list, tuple)):
    -    ltype = type(l)
    -    l = list(l)
    -    i = 0
    -    while i < len(l):
    -        while isinstance(l[i], ltypes):
    -            if not l[i]:
    -                l.pop(i)
    -                i -= 1
    -                break
    -            else:
    -                l[i:i + 1] = l[i]
    -        i += 1
    -    return ltype(l)
    -
    -def expand(path, globby):
    -  matches = []
    -  path = path.split('.')
    -  path.insert(0,SRC_ROOT)
    -  filename = "%s.%s"%(path[-2],path[-1])
    -  if fnmatch.fnmatch(filename, globby):
    -    tmppath = os.path.join(*(path[:-1]+[filename]))
    -    if os.path.exists(tmppath):
    -      path[-1] = filename
    -    else:
    -      path = path[:-2]+[filename]
    -  path = os.path.join(*path)
    -  if os.path.isdir(path):
    -    for root, dirnames, filenames in os.walk(path):
    -      for filename in fnmatch.filter(filenames, globby):
    -        matches.append(os.path.join(root, filename))
    -  else:
    -    matches.append(path)
    -  return matches
    -
    -def unique(seq, idfun=None):
    -  """Ordered uniquify function
    -  if in 2.7 use:
    -   OrderedDict.fromkeys(seq).keys()
    -  """
    -  if idfun is None:
    -    def idfun(x): return x
    -  seen = {}
    -  result = []
    -  for item in seq:
    -    marker = idfun(item)
    -    if marker in seen: continue
    -    seen[marker] = 1
    -    result.append(item)
    -  return result
    -
    -def source_list(src, globby='*.js'):
    -  def expander(f):
    -    return expand(f,globby)
    -  return unique(flatten(map(expander, src)))
    -
    -def compile(code):
    -  params = urllib.urlencode([
    -      ('js_code', code),
    -      ('compilation_level', options.level),
    -      ('output_format', 'text'),
    -      ('output_info', 'compiled_code'),
    -    ])
    -  headers = { 'Content-type': 'application/x-www-form-urlencoded' }
    -  conn = httplib.HTTPConnection('closure-compiler.appspot.com')
    -  conn.request('POST', '/compile', params, headers)
    -  response = conn.getresponse()
    -  data = response.read()
    -  conn.close()
    -  return data
    -
    -def bytes_to_kb(b,digits=1):
    -  return round(0.0009765625 * b, digits)
    -
    -def clean():
    -  if os.path.exists(BUILD_ROOT):
    -    shutil.rmtree(BUILD_ROOT)
    -    print('DONE. Removed %s'%(BUILD_ROOT,))
    -  else:
    -    print('DONE. Nothing to clean')
    -
    -def build(jssrc, csssrc=list([''])):
    -  if not os.path.exists(BUILD_ROOT):
    -    os.makedirs(BUILD_ROOT)
    -
    -  if csssrc:
    -    cssfiles = source_list(csssrc, '*.css')
    -    print('CSS files being compiled: ', cssfiles)
    -    css = '\n'.join([open(f).read() for f in cssfiles])
    -    css = re.sub(r'[ \t\n\r]+',' ',css)
    -
    -  jsfiles = source_list(jssrc, '*.js')
    -  print('JS files being compiled: ', jsfiles)
    -  code = '\n'.join([open(f).read() for f in jsfiles])
    -  if csssrc:
    -    code += """DAT.GUI.inlineCSS = '%s';\n"""%(css,)
    -
    -  outpath = os.path.join(BUILD_ROOT, BUILD_NAME+'.js')
    -  with open(outpath,'w') as f:
    -    f.write(LICENSE)
    -    f.write(code)
    -
    -  compiled = compile(code)
    -  outpathmin = os.path.join(BUILD_ROOT, BUILD_NAME+'.min.js')
    -  with open(outpathmin,'w') as f:
    -    f.write(LICENSE)
    -    f.write(compiled)
    -
    -  size = bytes_to_kb(os.path.getsize(outpath))
    -  sizemin = bytes_to_kb(os.path.getsize(outpathmin))
    -  with open(INDEX,'r') as f:
    -    index = f.read()
    -  with open(INDEX,'w') as f:
    -    index = re.sub(r'<small id=\'buildsize\'>\[[0-9.]+kb\]','<small id=\'buildsize\'>[%skb]'%(size,),index)
    -    index = re.sub(r'<small id=\'buildsizemin\'>\[[0-9.]+kb\]','<small id=\'buildsizemin\'>[%skb]'%(sizemin,),index)
    -    f.write(index)
    -
    -  print('DONE. Built files in %s.'%(BUILD_ROOT,))
    -
    -def debug(jssrc, csssrc=list([''])):
    -  head = ""
    -  files = source_list(csssrc, '*.css')
    -  for f in files:
    -    f = f.replace(PREFIX+'/','')
    -    head += '<link href="%s" media="screen" rel="stylesheet" type="text/css"/>\n'%(f,)
    -  files = source_list(jssrc, '*.js')
    -  for f in files:
    -    f = f.replace(PREFIX+'/','')
    -    head += '<script type="text/javascript" src="%s"></script>\n'%(f,)
    -  print(head)
    -
    -if __name__ == '__main__':
    -  global options
    -  (options, args) = parser.parse_args()
    -  if len(args) != 1:
    -    print(parser.usage)
    -    exit(0)
    -  command = args[0]
    -  if command == 'build':
    -    build(ALL_JS)
    -  elif command == 'clean':
    -    clean()
    -  elif command == 'debug':
    -    debug(ALL_JS)
    -
    -
    diff --git a/utils/build_color.js b/utils/build_color.js
    new file mode 100644
    index 0000000..7f035a7
    --- /dev/null
    +++ b/utils/build_color.js
    @@ -0,0 +1,8 @@
    +require('./builder.js').build({
    +   "baseUrl": "../src/",
    +   "main": "dat/color/Color",
    +   "out": "../build/dat.color.js",
    +   "minify": false,
    +   "shortcut": "dat.Color",
    +   "paths": {}
    +});
    \ No newline at end of file
    diff --git a/utils/build_gui.js b/utils/build_gui.js
    new file mode 100644
    index 0000000..acca53e
    --- /dev/null
    +++ b/utils/build_gui.js
    @@ -0,0 +1,8 @@
    +require('./builder.js').build({
    +   "baseUrl": "../src/",
    +   "main": "dat/gui/GUI",
    +   "out": "../build/dat.gui.js",
    +   "minify": false,
    +   "shortcut": "dat.GUI",
    +   "paths": {}
    +});
    \ No newline at end of file
    diff --git a/utils/builder.js b/utils/builder.js
    new file mode 100644
    index 0000000..42adbe2
    --- /dev/null
    +++ b/utils/builder.js
    @@ -0,0 +1,284 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */
    +
    +var fs = require('fs'),
    +    closure = require('./closure'),
    +    params,
    +    defined,
    +    third_party,
    +    request_counts,
    +    namespaces,
    +    next_load = '',
    +    next_path = '';
    +
    +exports.build = build;
    +exports.file_exists = file_exists;
    +exports.read_file = read_file;
    +exports.tab = tab;
    +
    +exports.license = read_file('license.txt');
    +
    +function build(_params) {
    +
    +  params = _params;
    +
    +  defined = {};
    +  third_party = {};
    +  request_counts = {};
    +  namespaces = {};
    +
    +  var deps = [];
    +
    +  load_module(params.baseUrl + params.main + '.js', params.main);
    +
    +  for (var i in defined) {
    +    if (params.verbose) console.log('Loaded: ' + defined[i].path);
    +    deps.push(defined[i].path);
    +    if (defined[i].module) {
    +      var namespace = i.substr(0, i.lastIndexOf('/'));
    +      namespaces[namespace] = true;
    +    }
    +  }
    +
    +  var to_write = '';
    +  var ensured = {};
    +
    +
    +  for (var name in params.paths) {
    +    var path = params.baseUrl + params.paths[name] + '.js';
    +    var str = read_file(path);
    +    if (str === false) {
    +      console.log('Failed to locate dependency \'' + name + '\' at ' + path);
    +      fail();
    +    }
    +    third_party[name] = str;
    +    to_write += third_party[name] + "\n\n";
    +    if (params.verbose) console.log('Loaded: ' + path);
    +    //deps.push(path);
    +  }
    +
    +  // Ensure namespaces
    +  for (i in namespaces) {
    +
    +    var split = i.split('/');
    +
    +    for (var j = 0; j < split.length; j++) {
    +      var cur = [];
    +      if (j == 0 && !ensured[split[j]]) {
    +        to_write += '/** @namespace */\n';
    +        to_write += 'var ' + split[j] + ' = ' + split[j] + ' || {};\n\n';
    +        ensured[split[j]] = true;
    +      } else {
    +        for (var k = 0; k <= j; k++) {
    +          cur.push(split[k]);
    +        }
    +        var curn = cur.join('.');
    +        if (!ensured[curn]) {
    +          to_write += '/** @namespace */\n';
    +          to_write += curn + ' = ' + curn + ' || {};\n\n';
    +        }
    +        ensured[curn] = true;
    +      }
    +    }
    +
    +  }
    +
    +  var shared_count = 0;
    +  for (i in request_counts) {
    +    var count = request_counts[i];
    +    if (count > 1) {
    +      if (i in defined) {
    +        var new_shared = i.replace(/\//g, '.');
    +        var v = new_shared + ' = ' + defined[i].getClosure() + ';\n';
    +        to_write += v + "\n\n";
    +        defined[i].shared = new_shared;
    +        shared_count++;
    +      }
    +    }
    +  }
    +  
    +
    +  to_write += params.shortcut + ' = ' + params.main.replace(/\//g, '.') + ' = ' + defined[params.main].getClosure() + ';';
    +
    +  if (params.verbose) console.log('Exported: ' + params.main + ' to window.' + params.shortcut);
    +
    +  if (params.minify) {
    +
    +    console.log('Compiling minified source ...');
    +
    +
    +    closure.compile(to_write, function(error, code) {
    +      if (error) {
    +        console.log(error);
    +      } else {
    +        write(exports.license + code);
    +      }
    +      if (params.on_compile) {
    +        params.on_compile();
    +      }
    +    });
    +
    +  } else {
    +
    +    write(exports.license + "\n" + to_write);
    +
    +  }
    +
    +  return deps;
    +
    +}
    +
    +function define(deps, callback) {
    +
    +  this.name = next_load;
    +  this.path = next_path;
    +  this.shared = false;
    +
    +  defined[this.name] = this;
    +
    +  if (Array.isArray(deps)) {
    +
    +    this.deps = deps;
    +    this.callback = callback.toString();
    +    this.module = true;
    +
    +    // Simple define call, just an object
    +  } else if (typeof deps === 'object') {
    +
    +    var props = [];
    +    for (var i in deps) {
    +      props.push(i + ':' + deps[i].toString())
    +    }
    +    this.callback = '{' + props.join(',') + '}';
    +    this.module = true;
    +
    +  } else {
    +
    +    this.deps = deps;
    +    this.callback = callback;
    +
    +  }
    +
    +  this.getClosure = function() {
    +    if (this.shared) return this.shared;
    +    if (!this.deps || this.text) return this.callback;
    +    var arg_string = '(';
    +    var args = [];
    +    for (var i in this.deps) {
    +      var dep = this.deps[i];
    +      if (dep in defined) {
    +        var closure = defined[dep].getClosure();
    +        if (!defined[dep].shared && !defined[dep].text) {
    +          closure = defined[dep].name.replace(/\//g, '.') + ' = ' + closure;
    +        }
    +        args.push(closure);
    +      }
    +    }
    +    arg_string += args.join(',\n');
    +    arg_string += ')';
    +    return '(' + this.callback + ')' + arg_string;
    +
    +  };
    +
    +  this.recurseDeps = function() {
    +
    +    if (!this.deps) return;
    +
    +    for (var i in this.deps) {
    +
    +      var dep = this.deps[i];
    +
    +      if (dep in params.paths) continue;
    +
    +      var path = params.baseUrl + dep;
    +
    +      // Define module?
    +      if (file_exists(path + '.js')) {
    +        load_module(path + '.js', dep);
    +
    +        // Text module?
    +      } else if (path.match(/text!/) != null) {
    +        load_text(path.replace('text!', ''), dep);
    +      }
    +
    +      // up the request count
    +      if (dep in request_counts) {
    +        request_counts[dep]++
    +      } else {
    +        request_counts[dep] = 1;
    +      }
    +
    +    }
    +
    +  };
    +
    +  this.recurseDeps();
    +
    +}
    +
    +function file_exists(path) {
    +  try {
    +    var stats = fs.lstatSync(path)
    +    return stats.isFile();
    +  } catch (e) {
    +    return false;
    +  }
    +}
    +
    +function read_file(path) {
    +  try {
    +    return fs.readFileSync(path).toString();
    +  } catch (e) {
    +    return false;
    +  }
    +}
    +
    +function load_module(path, name) {
    +  name = name || path;
    +  if (name in defined) return;
    +  next_load = name;
    +  next_path = path;
    +  eval('new ' + read_file(path));
    +}
    +
    +function load_text(path, name) {
    +  name = name || path;
    +  if (name in defined) return;
    +  var text = read_file(path);
    +  text = text.replace(/\r/g, "\\r");
    +  text = text.replace(/\n/g, "\\n");
    +  text = text.replace(/"/g, "\\\"");
    +  next_load = name;
    +  next_path = path;
    +  var d = new define([], '"' + text + '"');
    +  d.text = true;
    +  d.module = false;
    +}
    +
    +function tab(str, tabs) {
    +  var lines = str.split("\n");
    +  for (var i in lines) {
    +    lines[i] = tabs + lines[i];
    +  }
    +  return lines.join("\n");
    +}
    +
    +function write(str) {
    +  fs.writeFile(params.out, str);
    +  console.log('Saved to ' + params.out);
    +}
    +
    +function fail() {
    +  console.log('Build failed.');
    +  process.exit(0);
    +}
    \ No newline at end of file
    diff --git a/utils/closure.js b/utils/closure.js
    new file mode 100644
    index 0000000..3287fb0
    --- /dev/null
    +++ b/utils/closure.js
    @@ -0,0 +1,108 @@
    +/// # Google Closure Compiler Service #
    +/// https://github.com/weaver/scribbles/blob/master/node/google-closure/lib/closure.js
    +/// Compress javascript with Node.js using the Closure Compiler
    +/// Service.
    +
    +var sys = require('sys');
    +
    +exports.compile = compile;
    +
    +// Use the Google Closure Compiler Service to compress Javascript
    +// code.
    +//
    +// + code - String of javascript to compress
    +// + next - Function callback that accepts.
    +//
    +// This method will POST the `code` to the compiler service.  If an
    +// error occurs, `next()` will be called with an `Error` object as the
    +// first argument.  Otherwise, the `next()` will be called with `null`
    +// as the first argument and a String of compressed javascript as the
    +// second argument.
    +//
    +//     compile('... javascript ...', function(err, result) {
    +//       if (err) throw err;
    +//
    +//       ... do something with result ...
    +//     });
    +//
    +// Returns nothing.
    +function compile(code, next) {
    +  try {
    +    var qs = require('querystring'),
    +        http = require('http'),
    +        host = 'closure-compiler.appspot.com',
    +        body = qs.stringify({
    +          js_code: code.toString('utf-8'),
    +          compilation_level: 'SIMPLE_OPTIMIZATIONS',
    +          output_format: 'json',
    +          output_info: 'compiled_code'
    +        }),
    +        client = http.createClient(80, host).on('error', next),
    +        req = client.request('POST', '/compile', {
    +          'Host': host,
    +          'Content-Length': body.length,
    +          'Content-Type': 'application/x-www-form-urlencoded'
    +        });
    +
    +    req.on('error', next).end(body);
    +
    +    req.on('response', function(res) {
    +      if (res.statusCode != 200)
    +        next(new Error('Unexpected HTTP response: ' + res.statusCode));
    +      else
    +        capture(res, 'utf-8', parseResponse);
    +    });
    +
    +    function parseResponse(err, data) {
    +      err ? next(err) : loadJSON(data, function(err, obj) {
    +        var error;
    +        if (err)
    +          next(err);
    +        else if ((error = obj.errors || obj.serverErrors || obj.warnings))
    +          next(new Error('Failed to compile: ' + sys.inspect(error)));
    +        else
    +          next(null, obj.compiledCode);
    +      });
    +    }
    +  } catch (err) {
    +    next(err);
    +  }
    +}
    +
    +// Convert a Stream to a String.
    +//
    +// + input    - Stream object
    +// + encoding - String input encoding
    +// + next     - Function error/success callback
    +//
    +// Returns nothing.
    +function capture(input, encoding, next) {
    +  var buffer = '';
    +
    +  input.on('data', function(chunk) {
    +    buffer += chunk.toString(encoding);
    +  });
    +
    +  input.on('end', function() {
    +    next(null, buffer);
    +  });
    +
    +  input.on('error', next);
    +}
    +
    +// Convert JSON.load() to callback-style.
    +//
    +// + data - String value to load
    +// + next - Function error/success callback
    +//
    +// Returns nothing.
    +function loadJSON(data, next) {
    +  var err, obj;
    +
    +  try {
    +    obj = JSON.parse(data);
    +  } catch (x) {
    +    err = x;
    +  }
    +  next(err, obj);
    +}
    \ No newline at end of file
    diff --git a/utils/license.txt b/utils/license.txt
    new file mode 100644
    index 0000000..dd7aa97
    --- /dev/null
    +++ b/utils/license.txt
    @@ -0,0 +1,12 @@
    +/**
    + * dat-gui JavaScript Controller Library
    + * http://code.google.com/p/dat-gui
    + *
    + * Copyright 2011 Data Arts Team, Google Creative Lab
    + *
    + * Licensed under the Apache License, Version 2.0 (the "License");
    + * you may not use this file except in compliance with the License.
    + * You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + */