
var $,$$,$$$;(function(){var IPO_$$$=function(){};IPO_$$$.clone=function(obj){function F(){}
F.prototype=obj;return new F;};IPO_$$$.augment=function(rc,gc){if(arguments[2]){for(var i=2,len=arguments.length;i<len;i++){rc.prototype[arguments[i]]=gc.prototype[arguments[i]];}}
else{for(methodName in gc.prototype){if(!rc.prototype[methodName]){rc.prototype[methodName]=gc.prototype[methodName];}}}};IPO_$$$.extend=function(sub,sup){var F=function(){};F.prototype=sup.prototype;sub.prototype=new F();sub.prototype.constructor=sub;sub.superclass=sup.prototype;if(sup.prototype.constructor==Object.prototype.constructor){sup.prototype.constructor=sup;}};IPO_$$$.serialize=function(obj){var output=[];for(var k in obj){output.push(k+': '+obj[k]);}
return output.join(', ');};var IPO_$=function(thing){if(thing instanceof Array){return false;}
else if(typeof thing==='undefined'||!thing){return false;}
var obj=null;if(typeof thing==='string'){obj=IPO_$.get(thing);}
else{obj=thing;}
obj.IPO_$=true;obj.prev=function(skip){skip=skip?skip:1;var n=0;var elem=this;while(n<skip){do{elem=elem.previousSibling;}while(elem&&elem.nodeType!==1);n++;}
return IPO_$(elem);};obj.next=function(skip){skip=skip?skip:1;var n=0;var elem=this;while(n<skip){do{elem=elem.nextSibling;}while(elem&&elem.nodeType!==1);n++;}
return IPO_$(elem);};obj.first=function(){var elem=IPO_$(this.firstChild);return elem&&elem.nodeType!=1?elem.next():elem;};obj.last=function(){var elem=IPO_$(this.lastChild);return elem&&elem.nodeType!=1?elem.prev():elem;};var storage=[];obj.store=function(thing){var elem=IPO_$.checkElem(thing);try{if(elem){try{storage.push(elem);}
catch(e){alert(e.toString());}}
else{throw TypeError('Storage failed!');}}
catch(ee){alert(ee.toString());}};obj.pull=function(){return storage;};obj.clean=function(){storage=[];return this;};obj.flush=function(){for(var i=0,len=storage.length;i<len;i++){this.append(storage[i]);}
return this.clean();};obj.empty=function(){this.innerHTML='';return this;};obj.fill=function(stuff){if(typeof stuff==='string'){this.innerHTML=stuff;}
else{this.empty();this.append(stuff);}
return this;};obj.append=function(elem){if(typeof elem=='string'){this.innerHTML+=elem;}
else{this.appendChild(IPO_$.checkElem(elem));}
return this;};obj.before=function(before,elem){if(elem===null){elem=before;before=this;var parent=before.parentNode;}
this.insertBefore(IPO_$.checkElem(elem),before);return this;};obj.del=function(){var parent=this.parentNode;parent.removeChild(this);return IPO_$(parent);};obj.tag=function(tag){var elem=this;var arrayObj=IPO_$.tag(tag,elem);arrayObj.first=function(){return IPO_$(arrayObj[0]);};arrayObj.last=function(){return IPO_$(arrayObj[arrayObj.length-1]);};return arrayObj;};obj.$$=IPO_$$$.clone(IPO_$$);return obj;};IPO_$.get=function(id){var elem=document.getElementById(id);return IPO_$(elem);};IPO_$.tag=function(tag,elem){if(tag==null){tag='*';}
var elems=(elem||document).getElementsByTagName(tag);var newelems=[];for(var i=0,len=elems.length;i<len;i++){newelems.push(IPO_$(elems[i]));}
return newelems;};IPO_$.checkElem=function(elem,copy){return elem&&elem.constructor==String?document.createTextNode(elem):copy?IPO_$.copy(elem):elem;};IPO_$.create=function(elem,atty){var newelem=document.createElement(elem);if(atty){for(var a in atty){if(typeof atty[a]==='string'){newelem[a]=atty[a];}}}
return IPO_$(newelem);};IPO_$.copy=function(elem){var newelem=elem.cloneElement(true);if(newelem.hasAttribute('id')){newelem.id=newelem.id+'_1';}
return IPO_$(newelem);};var IPO_$$=function(elem){this.elem=elem||null;return this;};IPO_$$.all=function(cls,node,tag){if(typeof node==='string'){tag=node;node=null;}
if(typeof this.elem!=='undefined'&&arguments.length===1){tag=node;node=this.elem;}
var elems=[];if(node==null){node=document;}
if(tag==null){tag='*';}
var els=IPO_$.tag(tag,node);for(var i=0,j=0,len=els.length,ele;i<len;i++){ele=els[i];if($$.has(ele,cls)){elems[j]=IPO_$(ele);j++;}}
return elems;};IPO_$$.has=function(ele,cls){if(typeof this.elem!=='undefined'&&typeof cls==='undefined'){cls=ele;ele=this.elem;}
if(typeof ele!=='undefined'){return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));}
return false;};IPO_$$.add=function(ele,cls){if(typeof this.elem!=='undefined'&&!cls){cls=ele;ele=this.elem;}
if(typeof ele!=='undefined'){if(!IPO_$$.has(ele,cls)){ele.className+=' '+cls;}}
return ele;};IPO_$$.remove=function(ele,cls){if(arguments.length===1){cls=ele;ele=this.elem;}
if(typeof ele!=='undefined'){if(IPO_$$.has(ele,cls)){var reg=new RegExp('(\\s|^)'+cls+'(\\s|$)');ele.className=ele.className.replace(reg,' ');}}
return ele;};$=IPO_$;$$=IPO_$$;})();