├── lib └── Ostric │ ├── DOM │ ├── Node.php │ └── Document.php │ ├── Model.php │ ├── Behaviourial │ ├── IObserver.php │ └── IObservable.php │ ├── Markup │ ├── MarkupParser.php │ └── Page.php │ ├── Util │ ├── Yaml.php │ └── Inflector.php │ ├── Model │ └── Type.php │ ├── Dependency.php │ ├── WebApplication.php │ ├── Reflection │ ├── ReflectionClass.php │ └── ReflectionProperty.php │ ├── Object.php │ ├── Creational │ └── AbstractSingleton.php │ ├── Storage.php │ ├── Markup.php │ ├── Loader.php │ ├── Component.php │ └── ActiveRecord.php ├── components └── data-model │ └── lib │ ├── new file │ └── DataModel │ ├── Model.php │ ├── Query.php │ ├── Property │ ├── DateProperty.php │ ├── EmailProperty.php │ ├── ListProperty.php │ ├── TimeProperty.php │ └── Base │ │ ├── BlobProperty.php │ │ ├── FloatProperty.php │ │ ├── TextProperty.php │ │ ├── BooleanProperty.php │ │ ├── IntegerProperty.php │ │ ├── DateTimeProperty.php │ │ ├── ReferenceProperty.php │ │ └── StringProperty.php │ └── Property.php ├── .gitignore ├── README ├── example ├── Goal │ ├── SideBarPanel.html │ ├── BasePage.php │ ├── GuestPage.html │ ├── SideBarPanel.php │ ├── GuestPage.php │ └── BasePage.html ├── GoalApplication.php └── static │ └── js │ └── mootools.js └── tests ├── build.xml └── Ostric └── Util └── InflectorTest.php /lib/Ostric/DOM/Node.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Ostric/Model.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/data-model/lib/new file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Ostric/Behaviourial/IObserver.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | experimental 2 | componets 3 | -------------------------------------------------------------------------------- /components/data-model/lib/DataModel/Model.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/data-model/lib/DataModel/Query.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/Ostric/Behaviourial/IObservable.php: -------------------------------------------------------------------------------- 1 | Sidebar 3 | 14 | -------------------------------------------------------------------------------- /tests/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/Ostric/Dependency.php: -------------------------------------------------------------------------------- 1 | getHomePage(); 14 | 15 | $page->render(); 16 | 17 | } 18 | 19 | public function inject($key, $object) 20 | { 21 | 22 | } 23 | 24 | abstract public function getHomePage(); 25 | } 26 | -------------------------------------------------------------------------------- /lib/Ostric/Reflection/ReflectionClass.php: -------------------------------------------------------------------------------- 1 | getDocComment(); 10 | preg_match('/(?P[@inject])/i', $doc, $match); 11 | if(array_key_exists('inject',$match)) { 12 | return true; 13 | } 14 | 15 | return false; 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/Ostric/Reflection/ReflectionProperty.php: -------------------------------------------------------------------------------- 1 | getDocComment(); 10 | preg_match('/(?P[@inject])/i', $doc, $match); 11 | if(array_key_exists('inject',$match)) { 12 | return true; 13 | } 14 | 15 | return false; 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/Goal/BasePage.php: -------------------------------------------------------------------------------- 1 | add($this->getTitle()); 14 | $this->add(new SideBarPanel('sidebar')); 15 | 16 | } 17 | 18 | public function getTitle() 19 | { 20 | return new Label('title','Base Page'); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /lib/Ostric/Markup/Page.php: -------------------------------------------------------------------------------- 1 | 'NameSpace\ClassName', 20 | * ); 21 | */ 22 | public function getUrlMapping() 23 | { 24 | return array( 25 | '/costume/url' => 'Namespace\To\ClassName', 26 | '/*' => '*' 27 | ); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /example/Goal/GuestPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Guest Book

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Comments

12 |
13 |

14 | Ata
15 | Hohoho... 16 |

17 | 18 |

19 | Ata
20 | Hohoho... 21 |

22 |

23 | Ata
24 | Hohoho... 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /lib/Ostric/Object.php: -------------------------------------------------------------------------------- 1 | _class != null) { 12 | return $this->_class; 13 | } 14 | $this->_class = new \ReflectionClass(get_class($this)); 15 | return $this->_class; 16 | } 17 | 18 | 19 | public function getParentClass() 20 | { 21 | return $this->getClass()->getParentClass(); 22 | } 23 | 24 | public function getFileName() 25 | { 26 | return $this->getClass()->getFileName(); 27 | } 28 | 29 | public function getNamespace() 30 | { 31 | return $this->getClass()->getFileName(); 32 | } 33 | 34 | public function getShortName() 35 | { 36 | return $this->getClass()->getShortName(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /example/Goal/SideBarPanel.php: -------------------------------------------------------------------------------- 1 | add($sidemenus); 17 | // example data for datalist 18 | $urls = array( 'google' => 'http://google.com', 19 | 'yahoo' => 'http://yahoo.com' 20 | 'facebook' => 'http://facebook.com'); 21 | 22 | // entry data for list item 23 | foreach($urls as $label => $url) 24 | { 25 | $menulink = new Link('menulink',$url); 26 | $sidemenus->addItem($menulink); 27 | $menulink->add(new Label('menulabel')); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Ostric/Creational/AbstractSingleton.php: -------------------------------------------------------------------------------- 1 | attributes = attributes; 21 | } 22 | 23 | /** 24 | * Costume template path 25 | * @return void 26 | */ 27 | public setTemplatePath($templatePath) 28 | { 29 | $this->templatePath = $templatePath; 30 | } 31 | 32 | /** 33 | * @return string 34 | */ 35 | public function getTemplatePath() 36 | { 37 | if ($this->templatePath != null) { 38 | return $this->templatePath; 39 | } 40 | $path = str_replace('.php','.html',$this->getFileName()); 41 | if (file_exists($path)) { 42 | $this->templatePath = $path; 43 | return $path; 44 | } 45 | $path = str_replace('.php', '/'.$this->getShortName().'.html', $this->getFileName()); 46 | if (file_exists($path)) { 47 | $this->templatePath = $path; 48 | return $path; 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /lib/Ostric/Util/Inflector.php: -------------------------------------------------------------------------------- 1 | path.to.class_name 11 | */ 12 | public static function dotted($word) 13 | { 14 | return str_replace('\\','.',self::lower($word)); 15 | } 16 | 17 | 18 | /** 19 | * Convert doted, path, tableize to classify 20 | * - path.to.class_name 21 | * - path/to/class-name 22 | * - Path/To/ClassName 23 | * - class_name 24 | * - class-name 25 | * to: Path\To\ClassName 26 | * 27 | */ 28 | 29 | public static function classify($word) 30 | { 31 | $word = str_replace(" ", "\\", ucwords(strtr($word, "/.", " "))); 32 | $word = str_replace(" ", "", ucwords(strtr($word, "_-", " "))); 33 | return $word; 34 | } 35 | 36 | public static function lower($word) 37 | { 38 | return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); 39 | } 40 | /** 41 | * convert /home/:something/:id.html 42 | */ 43 | public static function simplepattern($word) 44 | { 45 | return '/' . str_replace('/','\/', 46 | preg_replace('/(:([a-z0-9_\-]+))/', 47 | '(?P<$2>[a-z0-9_\-]+)',$word)) .'/'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/Goal/GuestPage.php: -------------------------------------------------------------------------------- 1 | add(new InputText('name')); 25 | $this->add(new InputText('email')); 26 | $this->add(new TextArea('comment')); 27 | 28 | } 29 | 30 | public function onSubmit() 31 | { 32 | array_push(GuestPage::$guests,$this->guest); 33 | } 34 | } 35 | 36 | class GuestPage extends BasePage 37 | { 38 | public static $guests = array(); 39 | 40 | public function __construct() 41 | { 42 | $this->add(new GuestBookForm('form', new Guest())); 43 | 44 | $posts = new DataList('comments'); 45 | $this->add($posts); 46 | 47 | // entry data for list item 48 | foreach(self::$guests as $guest) 49 | { 50 | $posts->addItem(new Label('name',$guest->name)); 51 | $posts->addItem(new Label('comment',$guest->comment)); 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/Ostric/Util/InflectorTest.php: -------------------------------------------------------------------------------- 1 | assertEquals(Inflector::dotted('ClassName'),'class_name'); 42 | $this->assertEquals(Inflector::dotted('Path\To\ClassName'),'path.to.class_name'); 43 | 44 | } 45 | 46 | /** 47 | * @todo Implement testClassify(). 48 | */ 49 | public function testClassify() 50 | { 51 | $this->assertEquals(Inflector::classify('path.to.class_name'),'Path\To\ClassName'); 52 | $this->assertEquals(Inflector::classify('/path/to/class-name'),'\Path\To\ClassName'); 53 | $this->assertEquals(Inflector::classify('Path/To/ClassName'),'Path\To\ClassName'); 54 | $this->assertEquals(Inflector::classify('class_name'),'ClassName'); 55 | } 56 | } 57 | ?> 58 | -------------------------------------------------------------------------------- /lib/Ostric/Loader.php: -------------------------------------------------------------------------------- 1 | id = $id; 17 | $this->storage = Storage::getInstance(); 18 | $this->loadFromStorage(); 19 | 20 | } 21 | 22 | public function add(Component $component) 23 | { 24 | $this->components[] = $component; 25 | } 26 | 27 | public function getId() 28 | { 29 | return $this->id; 30 | } 31 | 32 | public function getClassId() 33 | { 34 | return Inflector::dotted(get_class($this)); 35 | } 36 | 37 | private function saveToStorage() 38 | { 39 | // save dynamic property 40 | $dynamic = get_object_vars($this); 41 | $static = $this->getClass()->getStaticProperties(); 42 | $this->storage->saveProperties($this->getClassId(),array_merge($dynamic,$static)); 43 | 44 | 45 | 46 | } 47 | 48 | private function loadFromStorage() 49 | { 50 | $properties = $this->storage->loadProperties($this->getClassId()); 51 | foreach ($properties as $name => $value) { 52 | if(property_exists($this,$name)){ 53 | $ref = new \ReflectionProperty(get_class($this),$name); 54 | if ($ref->isStatic()) { 55 | static::$$name = $value; 56 | } else { 57 | $this->$name = $value; 58 | } 59 | } else { 60 | $this->$name = $value; 61 | } 62 | 63 | } 64 | } 65 | 66 | public function __destruct() 67 | { 68 | $this->saveToStorage(); 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /example/Goal/BasePage.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Web Title </span> 7 | 8 | 9 | 10 | 11 |

12 | 15 |
16 | 17 |

Lorem ipsum dolor sit amet

18 | 19 |

Lorem ipsum dolor sit amet, consectetur adipisicing elit, 20 | sed do eiusmod tempor incididunt ut labore et dolore magna 21 | aliqua. Ut enim ad minim veniam, quis nostrud exercitation 22 | ullamco laboris nisi ut aliquip ex ea commodo consequat. 23 | Duis aute irure dolor in reprehenderit in voluptate velit esse 24 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat 25 | cupidatat non proident, sunt in culpa qui officia deserunt 26 | mollit anim id est laborum.

27 |
28 |
29 | 36 | 39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/Ostric/ActiveRecord.php: -------------------------------------------------------------------------------- 1 | setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); 24 | } 25 | 26 | public static function getConnection() 27 | { 28 | return self::$db; 29 | } 30 | 31 | public static function getTable() 32 | { 33 | if (!isset(static::$table)) { 34 | $short_class = static::getReflection()->getShortName(); 35 | return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $short_class)); 36 | } 37 | return static::$table; 38 | } 39 | 40 | public static function getReflection() 41 | { 42 | return new \ReflectionClass(get_called_class()); 43 | } 44 | 45 | public static function getPrimaryKey() 46 | { 47 | if (!isset(static::$primaryKey)) { 48 | return 'id'; 49 | } else { 50 | return static::$primaryKey; 51 | } 52 | } 53 | 54 | /** return array('id','name','email') 55 | */ 56 | public static function getColumns() 57 | { 58 | if(isset(self::$columns[get_called_class()])) { 59 | return self::$columns[get_called_class()]; 60 | } 61 | 62 | $table = static::getTable(); 63 | $sql = "SHOW COLUMNS FROM $table"; 64 | $statement = self::$db->prepare($sql); 65 | $statement->execute(); 66 | $dbcolumns = $statement->fetchAll(\PDO::FETCH_ASSOC); 67 | $columns = array(); 68 | foreach ($dbcolumns as $dc) { 69 | $columns[] = $dc['Field']; 70 | } 71 | return self::$columns[get_called_class()] = $columns; 72 | 73 | } 74 | 75 | 76 | public function __get($property) 77 | { 78 | $primaryKey = static::getPrimaryKey(); 79 | 80 | if(isset(static::$belongsTo) && array_key_exists($property,static::$belongsTo)) { 81 | $ref = static::$belongsTo[$property]; 82 | $associationClass = $ref['class']; 83 | $foreignKey = isset($ref['foreignKey'])?$ref['foreignKey']:$property . '_id'; 84 | return $this->$property = $associationClass::find($this->$foreignKey); 85 | } 86 | if(isset(static::$hasOne) && array_key_exists($property,static::$hasOne)) { 87 | $ref = static::$hasOne[$property]; 88 | $class = $ref['class']; 89 | $foreignKey = isset($ref['foreignKey'])?$ref['foreignKey']: static::getTable() . '_id'; 90 | $primaryKey = static::getPrimaryKey(); 91 | $table = $class::getTable(); 92 | $result = $class::query("SELECT * FROM $table WHERE $foreignKey = ? ",array($this->$primaryKey)); 93 | return $this->$propery = $result[0]; 94 | } 95 | 96 | if(isset(static::$hasMany) && array_key_exists($property,static::$hasMany)) { 97 | $ref = static::$hasMany[$property]; 98 | $class = $ref['class']; 99 | $foreignKey = isset($ref['foreignKey'])?$ref['foreignKey']: static::getTable() . '_id'; 100 | $associationTable = $class::getTable(); 101 | $primaryKey = static::getPrimaryKey(); 102 | 103 | if (isset($ref['joinTable'])) { 104 | $associationForeignKey = isset($ref['associationForeignKey'])?$ref['associationForeignKey']:$class::getTable() . '_id'; 105 | $associationPrimaryKey = $class::getPrimaryKey(); 106 | $joinTable = $ref['joinTable']; 107 | 108 | return $this->$property = $class::query("SELECT * FROM $associationTable 109 | WHERE $associationPrimaryKey IN ( 110 | SELECT $associationForeignKey 111 | FROM $joinTable 112 | WHERE $foreignKey = ? 113 | )",array($this->$primaryKey)); 114 | 115 | 116 | } else { 117 | return $this->$property = $class::query("SELECT * FROM $associationTable 118 | WHERE $foreignKey = ? ", 119 | array($this->$primaryKey)); 120 | } 121 | } 122 | 123 | } 124 | 125 | 126 | public function __set($property,$value) 127 | { 128 | if(isset(static::$belongsTo) && array_key_exists($property,static::$belongsTo)) { 129 | $ref = static::$belongsTo[$property]; 130 | $class = $ref['class']; 131 | $foreignKey = isset($ref['foreignKey'])?$ref['foreignKey']:$property . '_id'; 132 | $primaryKey = $class::getPrimaryKey(); 133 | //return $this->$property = $class::find($this->$foreignKey); 134 | $this->$foreignKey = $value->$primaryKey; 135 | 136 | } 137 | $this->$property = $value; 138 | } 139 | 140 | 141 | 142 | 143 | //======Retriving data method======== 144 | 145 | /** 146 | * return @type PDOStatement 147 | */ 148 | public static function query($query, $params = array()) 149 | { 150 | $class = get_called_class(); 151 | try { 152 | $statement = self::$db->prepare($query); 153 | $statement->setFetchMode(\PDO::FETCH_CLASS,$class); 154 | $statement->execute($params); 155 | return $statement->fetchAll(); 156 | 157 | 158 | } catch (PDOStatement $e) { 159 | die($e->getMessage()); 160 | } 161 | } 162 | /** 163 | * $options = array( 164 | * 'select' => 'name,message', 165 | * 'where' => '', 166 | * 'limit' => 167 | * 'offset' => 168 | * 'order' => '' 169 | * ); 170 | */ 171 | public static function all($options = array()) 172 | { 173 | $select = 'SELECT *'; 174 | $limit = ''; 175 | $offset = ''; 176 | $where = ''; 177 | $order = ''; 178 | 179 | if (isset($options['select'])) { 180 | $select = 'SELECT ' . $options['select']; 181 | if (count(array_keys(array_map(function($v){return trim($v);}, 182 | explode(',',$options['select'])),static::getPrimaryKey())) === 0) { 183 | 184 | $select .= ', ' . static::getPrimaryKey(); 185 | } 186 | } 187 | if (isset($options['where'])) { 188 | $where = 'where ' . $options['where']; 189 | } 190 | 191 | if (isset($options['order'])) { 192 | $offset = 'ORDER BY ' . $options['order']; 193 | } 194 | 195 | if (isset($options['limit'])) { 196 | $limit = 'LIMIT ' . $options['limit']; 197 | } 198 | 199 | if (isset($options['offset'])) { 200 | $offset = 'OFFSET ' . $options['offset']; 201 | } 202 | 203 | $table = static::getTable(); 204 | 205 | return static::query("$select from $table $where $order $limit $offset"); 206 | 207 | 208 | } 209 | 210 | /** 211 | * find(1) --> return single object with id = 1 212 | * find(1,2) --> return array of object with id = 1 and 2 213 | * find('name','Ata') --> return array objek with field 'name' is 'Ata' 214 | */ 215 | public static function find() 216 | { 217 | $class = get_called_class(); 218 | if (func_num_args() === 1) { 219 | return static::findByPrimaryKey(func_get_arg(0)); 220 | } 221 | if (property_exists($class,func_get_arg(0)) && func_num_args() > 1) { 222 | 223 | } else { 224 | return call_user_func_array(array($class,'findByPrimaryKeys'), 225 | func_get_args()); 226 | } 227 | 228 | } 229 | 230 | public static function findByPrimaryKey($id) 231 | { 232 | $table = static::getTable(); 233 | $primaryKey = static::getPrimaryKey(); 234 | $result = static::query("SELECT * FROM $table 235 | WHERE $primaryKey = :id", 236 | array('id' => $id)); 237 | return $result[0]; 238 | 239 | } 240 | 241 | public static function findByPrimaryKeys() 242 | { 243 | $ids = func_get_args(); 244 | $q1 = implode(',',array_map(function($v){return '?';},$ids)); 245 | 246 | $table = static::getTable(); 247 | $primaryKey = static::getPrimaryKey(); 248 | return static::query("SELECT * FROM $table 249 | WHERE $primaryKey in ($q1)",$ids); 250 | } 251 | 252 | 253 | /* ===== Saving data =========*/ 254 | public function save() 255 | { 256 | $primaryKey = static::getPrimaryKey(); 257 | $class = get_class($this); 258 | 259 | if(isset($this->$primaryKey)){ 260 | if($this->$primaryKey !== null) { 261 | return static::update($this); 262 | } else { 263 | return static::insert($this); 264 | } 265 | } else { 266 | return static::insert($this); 267 | } 268 | } 269 | 270 | public static function update($object) 271 | { 272 | $table = static::getTable(); 273 | $primaryKey = static::getPrimaryKey(); 274 | $sets = array(); 275 | $params = array(); 276 | foreach (static::getColumns() as $c) { 277 | if(property_exists($object,$c) && $object->$c !== null){ 278 | $sets[] = "$c = :$c "; 279 | $params[$c] = $object->$c; 280 | } 281 | } 282 | 283 | $params['primaryKey'] = $object->$primaryKey; 284 | $sets = join(',',$sets); 285 | $statement = self::$db->prepare("UPDATE $table SET $sets 286 | WHERE $primaryKey = :primaryKey"); 287 | return $statement->execute($params); 288 | } 289 | 290 | public static function insert($object) 291 | { 292 | $table = static::getTable(); 293 | $columns = array(); 294 | $values = array(); 295 | $params = array(); 296 | foreach (static::getColumns() as $c) { 297 | if(property_exists($object,$c) && $object->$c !== null){ 298 | $columns[] = $c; 299 | $values[] = ':'.$c; 300 | $params[$c] = $object->$c; 301 | } 302 | } 303 | 304 | $sql_columns = join(',',$columns); 305 | $sql_values = join(',',$values); 306 | $statement = self::$db->prepare("INSERT INTO $table($sql_columns) VALUES($sql_values)"); 307 | return $statement->execute($params); 308 | } 309 | 310 | 311 | //====== DESTROYING DATA ========== 312 | /** 313 | * destroy(1) -> destroy with primary key = 1 314 | * destroy(1,2,3) -> destroy with primary is 1,2 and 3 315 | */ 316 | public static function destroy($id) 317 | { 318 | $table = static::getTable(); 319 | $primaryKey = static::getPrimaryKey(); 320 | if(func_num_args() == 1){ 321 | $statement = self::$db->prepare("DELETE from $table WHERE $primaryKey = ?"); 322 | return $statement->execute(array($id)); 323 | } else { 324 | $ids = func_get_args(); 325 | $q1 = implode(',',array_map(function($v){return '?';},$ids)); 326 | 327 | $statement = self::$db->prepare("DELETE from $table WHERE $primaryKey IN ($q1)"); 328 | return $statement->execute($ids); 329 | } 330 | 331 | return false; 332 | } 333 | 334 | public function delete() 335 | { 336 | $primaryKey = static::getPrimaryKey(); 337 | $class = get_class($this); 338 | 339 | if (isset($this->$primaryKey) && $this->$primaryKey !== null) { 340 | return static::destroy($this->$primaryKey); 341 | } 342 | return false; 343 | } 344 | 345 | 346 | } 347 | -------------------------------------------------------------------------------- /example/static/js/mootools.js: -------------------------------------------------------------------------------- 1 | //MooTools, , My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, , MIT Style License. 2 | 3 | var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; 4 | var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; 5 | if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; 6 | }if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); 7 | }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); 8 | }return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); 9 | return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); 66 | },camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); 67 | });},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); 68 | },toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); 69 | return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; 70 | var c=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); 71 | }}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; 72 | });}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; 73 | },hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); 74 | },this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; 75 | },set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); 76 | return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); 77 | },this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; 78 | }}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; 79 | Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; 80 | Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; 81 | });d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); 82 | var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; 83 | var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; 84 | if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; 85 | var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; 86 | if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; 87 | break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; 88 | }}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); 89 | }});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); 90 | },stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); 91 | }else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; 92 | }this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); 93 | a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); 94 | }return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); 95 | break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; 96 | },wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); 97 | }var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); 98 | }});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); 99 | if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; 100 | if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; 101 | this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); 102 | }return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); 103 | },this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; 104 | },clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; 105 | this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); 106 | if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); 107 | if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); 108 | }return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); 109 | }}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); 110 | if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); 111 | delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); 112 | if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; 113 | if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); 123 | },getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; 124 | },element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); 125 | }return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; 126 | };})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); 127 | }var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; 130 | },this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; 131 | var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); 132 | n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; 133 | }}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); 134 | }if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); 135 | }q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; 136 | var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; 137 | b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); 138 | }},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); 139 | },top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); 140 | return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); 141 | }break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); 142 | return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); 143 | return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); 144 | return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); 145 | return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; 146 | (l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; 147 | },hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); 148 | }return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); 149 | },adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); 150 | },grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); 151 | l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); 152 | },getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); 153 | },getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); 154 | },getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); 155 | },getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; 156 | },getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; 157 | }}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; 158 | }var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; 159 | this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; 160 | }):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); 161 | }});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); 162 | v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; 163 | if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); 164 | },destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); 165 | });return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; 166 | }if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); 167 | },match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; 168 | n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); 169 | }return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; 170 | },retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; 171 | return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; 172 | },get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); 173 | }};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; 174 | a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; 175 | for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; 176 | }var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); 177 | }};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; 178 | }h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); 179 | }return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); 180 | if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; 181 | }var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); 182 | }c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; 183 | },removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; 184 | }if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; 185 | },fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); 186 | },this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); 187 | }}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; 188 | (function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); 189 | };Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); 190 | })();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; 191 | }}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; 192 | }this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); 193 | },getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; 194 | }b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; 195 | }).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); 196 | case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; 197 | }for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); 198 | if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; 199 | b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; 200 | }if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); 201 | }return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); 202 | Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; 203 | var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; 204 | f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); 205 | }else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; 206 | },getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); 207 | }return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; 208 | }return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; 209 | }}return null;},getOffsets:function(){if(this.getBoundingClientRect){var j=this.getBoundingClientRect(),m=document.id(this.getDocument().documentElement),p=m.getScroll(),k=this.getScrolls(),i=this.getScroll(),h=(d(this,"position")=="fixed"); 210 | return{x:j.left.toInt()+k.x-i.x+((h)?0:p.x)-m.clientLeft,y:j.top.toInt()+k.y-i.y+((h)?0:p.y)-m.clientTop};}var l=this,n={x:0,y:0};if(b(this)){return n; 211 | }while(l&&!b(l)){n.x+=l.offsetLeft;n.y+=l.offsetTop;if(Browser.Engine.gecko){if(!f(l)){n.x+=c(l);n.y+=g(l);}var o=l.parentNode;if(o&&d(o,"overflow")!="visible"){n.x+=c(o); 212 | n.y+=g(o);}}else{if(l!=this&&Browser.Engine.webkit){n.x+=c(l);n.y+=g(l);}}l=l.offsetParent;}if(Browser.Engine.gecko&&!f(this)){n.x-=c(this);n.y-=g(this); 213 | }return n;},getPosition:function(k){if(b(this)){return{x:0,y:0};}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0}; 214 | return{x:h.x-j.x,y:h.y-j.y};},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize(); 215 | var k={left:h.x,top:h.y,width:i.x,height:i.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; 216 | },setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); 217 | return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); 218 | return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; 219 | },getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; 220 | }});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); 221 | }function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; 222 | }})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; 223 | },getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; 224 | },getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; 225 | }});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; 227 | }var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); 228 | return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; 229 | Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; 230 | }var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; 231 | if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; 232 | break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; 233 | break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; 234 | }var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); 235 | }else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); 236 | }}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; 237 | }return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; 238 | },filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; 239 | d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; 240 | if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); 241 | return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); 242 | return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;ea){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); 260 | },odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); 261 | }});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; 262 | window.fireEvent("domready");document.fireEvent("domready");};window.addEvent("load",b);if(Browser.Engine.trident){var a=document.createElement("div"); 263 | (function(){($try(function(){a.doScroll();return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})(); 264 | }else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); 265 | })();}else{document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); 266 | },encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; 267 | case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); 268 | case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; 269 | }return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b; 270 | this.setOptions(a);},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; 271 | }if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; 272 | }this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); 273 | return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(b,c,a){return new Cookie(b,a).write(c); 274 | };Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; 275 | },initialize:function(l,m){this.instance="Swiff_"+$time();this.setOptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=document.id(m.container); 276 | Swiff.CallBacks[this.instance]={};var e=m.params,g=m.vars,f=m.callBacks;var h=$extend({height:m.height,width:m.width},m.properties);var k=this;for(var d in f){Swiff.CallBacks[this.instance][d]=(function(n){return function(){return n.apply(k.object,arguments); 277 | };})(f[d]);g[d]="Swiff.CallBacks."+this.instance+"."+d;}e.flashVars=Hash.toQueryString(g);if(Browser.Engine.trident){h.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; 278 | e.movie=l;}else{h.type="application/x-shockwave-flash";h.data=l;}var j=''; 279 | }}j+="";this.object=((a)?a.empty():new Element("div")).set("html",j).firstChild;},replaces:function(a){a=document.id(a,true);a.parentNode.replaceChild(this.toElement(),a); 280 | return this;},inject:function(a){document.id(a,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments)); 281 | }});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); 282 | return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; 283 | this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; 284 | }},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2); 325 | break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]); 326 | });});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); 327 | this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; 328 | }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; 329 | this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); 330 | },processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); 331 | },success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); 332 | },failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); 333 | return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; 334 | }switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; 335 | }this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=String(k.url),a=k.method.toLowerCase(); 336 | switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; 337 | g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; 338 | this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; 339 | }var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); 340 | this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); 341 | }},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; 342 | }this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; 343 | ["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); 344 | return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); 345 | }return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); 346 | }this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); 347 | b.send({data:this,url:a||b.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/]*>([\s\S]*?)<\/body>/i); 348 | c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d=""+c+"",g;if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM"); 349 | g.async=false;g.loadXML(d);}else{g=new DOMParser().parseFromString(d,"text/xml");}d=g.getElementsByTagName("root")[0];if(!d){return null;}for(var f=0,e=d.childNodes.length; 350 | f