/*jslint browser: true, evil: true */
function consumeEVENT(event){if(!event){event=window.event;}
if(typeof event.preventDefault==='function'){event.preventDefault();}
if(typeof event.returnValue==='boolean'){event.returnValue=false;}
return false;}
if(!Array.prototype.push){Array.prototype.push=function push(){var currentIndex=this.length;for(var i=0;i<arguments.length;)
{this[currentIndex++]=arguments[i++];}
return this.length;};}
if(!Array.prototype.pop){Array.prototype.pop=function pop(){var length=this.length,lastElement=this[--length];if(length>=0){this.length=length;}
return lastElement;};}
if(!Array.prototype.unshift){Array.prototype.unshift=function unshift(){this.reverse();var currentIndex=this.length;for(var i=arguments.length;i>0;)
{this[currentIndex++]=arguments[--i];}
this.reverse();return this.length;};}
if(!Array.prototype.shift){Array.prototype.shift=function shift(){var firstElement=this[0];this.reverse();if(this.length>=1){this.length=this.length-1;}
this.reverse();return firstElement;};}
if(!Object.prototype.hasOwnProperty){Object.prototype.hasOwnProperty=function(property){try{var prototype=this.constructor.prototype;while(prototype){if(prototype[property]===this[property])
{return false;}
prototype=prototype.prototype;}}catch(e){}
return true;};}
if(!Function.prototype.apply){Function.prototype.apply=function(thisArg,argArray){if(typeof this!=='function'){throw new Error('apply called on incompatible object (not a function)');}
if(argArray!==null&&!(argArray instanceof Array)&&typeof argArray.callee!=='function'){throw new Error('The 2nd argument to apply must be an array or arguments object');}
thisArg=(thisArg===null)?window:thisArg;thisArg.__applyTemp__=this;var parameters=[],length=(argArray||'').length>>>0;for(var i=0;i<length;i++){parameters[i]='argArray['+i+']';}
var functionCall='thisArg.__applyTemp__('+parameters+')';try{return eval(functionCall);}finally{try{delete thisArg.__applyTemp__;}catch(e){}}};}
if(!Function.prototype.call){Function.prototype.call=function(thisArg){return this.apply(thisArg,Array.prototype.slice.apply(arguments,[1]));};}
var xb={evtHash:[],ieGetUniqueID:function(_elem)
{if(_elem===window){return'theWindow';}
else if(_elem===document){return'theDocument';}
else{return _elem.uniqueID;}},addEvent:function(_elem,_evtName,_fn,_useCapture)
{if(typeof _elem.addEventListener!=='undefined')
{_elem.addEventListener(_evtName,_fn,_useCapture);}
else if(typeof _elem.attachEvent!=='undefined')
{var key='{FNKEY::obj_'+xb.ieGetUniqueID(_elem)+'::evt_'+_evtName+'::fn_'+_fn+'}';var f=xb.evtHash[key];if(typeof f!=='undefined')
{return;}
f=function()
{_fn.call(_elem);};xb.evtHash[key]=f;_elem.attachEvent('on'+_evtName,f);window.attachEvent('onunload',function()
{_elem.detachEvent('on'+_evtName,f);});key=null;}
else
{_elem['on'+_evtName]=_fn;}},removeEvent:function(_elem,_evtName,_fn,_useCapture)
{if(typeof _elem.removeEventListener!=='undefined')
{_elem.removeEventListener(_evtName,_fn,_useCapture);}
else if(typeof _elem.detachEvent!=='undefined')
{var key='{FNKEY::obj_'+xb.ieGetUniqueID(_elem)+'::evt'+_evtName+'::fn_'+_fn+'}';var f=xb.evtHash[key];if(typeof f!=='undefined')
{_elem.detachEvent('on'+_evtName,f);delete xb.evtHash[key];}
key=null;}}};var _common_js_OK=true;
