Index: branches/RC/themes/default2009/platform/inc/script.js =================================================================== diff -u -r11337 -r11427 --- branches/RC/themes/default2009/platform/inc/script.js (.../script.js) (revision 11337) +++ branches/RC/themes/default2009/platform/inc/script.js (.../script.js) (revision 11427) @@ -28,6 +28,19 @@ } } +function addEvent(el, evname, func, traditional) { + if (traditional) { + eval('el.on'+evname+'='+func); + return; + } + + if (document.all) { + el.attachEvent("on" + evname, func); + } else { + el.addEventListener(evname, func, true); + } +}; + // ItemCategories class function ItemCategories($table_id, $field_id, $primary_category, $phrases) { this.CategoryTable = document.getElementById($table_id); @@ -51,11 +64,11 @@ var $category_name = this.CategorySelector.options[this.CategorySelector.selectedIndex].innerHTML.trim(); if ((this.SearchCategory($category_id) !== false) || ($category_id == this.PrimaryCategory) || ($category_id == 0)) { - // don't add same category twice & don't allow to add item's primary category + // don't add same category twice & don't allow to add item's primary category alert(this.Phrases[1]); return ; } - + if ((this.MoreCategories.length + 2) > $max_categories) { // don't add more category - $max_categories limit @@ -114,4 +127,8 @@ ItemCategories.prototype.updateMoreCategoriesField = function() { this.MoreCategoriesField.value = this.MoreCategories.length ? '|' + this.MoreCategories.join('|') + '|' : ''; -} \ No newline at end of file +} + +function jq(myid) { + return '#'+myid.replace(/:/g,"\\:").replace(/\./g,"\\."); +}