try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}
var $E={add:function(objRef,type,fn,useCapture)
{if(objRef.attachEvent)
{objRef['e'+type+fn]=fn;objRef[type+fn]=function(){objRef['e'+type+fn](window.event,objRef);}
objRef.attachEvent('on'+type,objRef[type+fn]);}
else
{objRef['e'+type+fn]=fn;objRef[type+fn]=function(e){objRef['e'+type+fn](e,this)};useCapture=useCapture||false;objRef.addEventListener(type,objRef[type+fn],useCapture);}},remove:function(objRef,type,fn)
{if(objRef.detachEvent)
{objRef.detachEvent('on'+type,objRef[type+fn]);objRef[type+fn]=null;}
else
objRef.removeEventListener(type,fn,false);},onload:function(func)
{var oldonload=window.onload;if(typeof window.onload!="function")
$E.add(window,"load",func)
else
$E.add(window,"load",function(){oldonload();func();})}}
var $D={$:function()
{var elements=new Array();for(var i=0;i<arguments.length;i++)
{var element=arguments[i];if(typeof element=="string")
element=document.getElementById(element);elements.push(element);}
if(elements.length==0)
return null;else if(elements.length==1)
return elements[0];else
return elements;},isClass:function(objRef,className)
{return((new RegExp("\\b"+className.trim()+"\\b","gi")).test(objRef.className));},setClass:function(objRef,className)
{$D.clearClass(objRef)
objRef.className=className.trim();},addClass:function(objRef,className)
{$D.removeClass(objRef,className);objRef.className=(objRef.className+" "+className).trim();},removeClass:function(objRef,className)
{objRef.className=objRef.className.replace(className,"").trim();},clearClass:function(objRef)
{objRef.className=""},getElementsByClassName:function(strClass,objContElm,strTag)
{strTag=strTag||"*";objContElm=objContElm||document;var objColl=objContElm.getElementsByTagName(strTag);if(!objColl.length&&strTag=="*"&&objContElm.all)objColl=objContElm.all;var resultArray=[];var delim=strClass.indexOf('|')!=-1?'|':' ';var arrClass=strClass.split(delim);for(var i=0,j=objColl.length;i<j;i++)
{var arrObjClass=objColl[i].className.split(' ');if(delim==' '&&arrClass.length>arrObjClass.length)continue;var c=0;comparisonLoop:for(var k=0,l=arrObjClass.length;k<l;k++)
{for(var m=0,n=arrClass.length;m<n;m++)
{if(arrClass[m]==arrObjClass[k])c++;if((delim=='|'&&c==1)||(delim==' '&&c==arrClass.length))
{resultArray.push(objColl[i]);break comparisonLoop;}}}}
return resultArray;},getElementsByTagNames:function(objRef)
{objRef=objRef||document;var resultArray=[];for(var i=1;i<arguments.length;i++)
{var tags=objRef.getElementsByTagName(arguments[i]);for(var j=0;j<tags.length;j++)
{resultArray.push(tags[j]);}}
var testNode=resultArray[0];if(!testNode)return[];if(testNode.sourceIndex)
{resultArray.sort(function(a,b)
{return a.sourceIndex-b.sourceIndex;});}
else if(testNode.compareDocumentPosition)
{resultArray.sort(function(a,b)
{return 3-(a.compareDocumentPosition(b)&6);});}
return resultArray;},getStyle:function(objRef,propName)
{if(objRef.currentStyle)
return objRef.currentStyle[propName];else if(window.getComputedStyle)
return window.getComputedStyle(objRef,null)[propName];},contains:function(parent,child)
{while(child&&child!=parent)
child=child.parentNode;return(child==parent);},getMousePosition:function(e)
{var x=0,y=0;if(!e)e=window.event;if(e.pageX||e.pageY)
{x=e.pageX;y=e.pageY;}
else if(e.clientX||e.clientY)
{x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
return{left:x,top:y};},documentwrite:function(str)
{document.write(str);}}
var $=$D.$;var $X=new function()
{this.toggleDisplay=function(objRef)
{if(objRef.nodeName=="TR")
$X.displayTR(objRef);else
objRef.style.display=objRef.style.display=="block"?"none":"block";}
this.close=function(objRef)
{objRef.style.display="none";}
this.open=function(objRef)
{if(objRef.nodeName=="TR")
$X.displayTR(objRef);else
objRef.style.display="block";}
this.displayTR=function(objRef)
{try{objRef.style.display="table-row";}
catch(eel){objRef.style.display="block";}}
this.slideOpen=function(objRef,duration,timeIncrement)
{clearInterval(objRef.$timer);objRef.style.display="block";objRef.$height=objRef.$height||parseInt(objRef.offsetHeight);timeIncrement=timeIncrement||10;var pixelIncrement=Math.ceil(objRef.$height/(duration/timeIncrement));objRef.style.overflow="hidden";objRef.style.height="1px";objRef.$timer=setInterval(function(){do_slideOpen(objRef,pixelIncrement)},timeIncrement);function do_slideOpen(objRef,pixelIncrement)
{if(objRef.offsetHeight>=objRef.$height)
{clearInterval(objRef.$timer);objRef.style.height="auto";}
else if(objRef.offsetHeight+pixelIncrement>0)
{objRef.style.height=Math.ceil(objRef.offsetHeight+pixelIncrement)+"px";}}}
this.slideClose=function(objRef,duration,timeIncrement)
{objRef.$height=objRef.$height||parseInt(objRef.offsetHeight);clearInterval(objRef.$timer);timeIncrement=timeIncrement||10;var pixelIncrement=Math.ceil(objRef.$height/(duration/timeIncrement));objRef.style.overflow="hidden";objRef.$timer=setInterval(function(){do_slideClose(objRef,pixelIncrement)},timeIncrement)
function do_slideClose(objRef,pixelIncrement)
{if((objRef.offsetHeight-pixelIncrement)<=0)
{objRef.style.display="none";clearInterval(objRef.$timer);}
else
{objRef.style.height=Math.ceil(objRef.offsetHeight-pixelIncrement)+"px"}}}
this.openWin=function(c)
{var config={width:500,height:500,scrollbars:"yes",resizable:"yes",name:"winName"+parseInt(Math.random()*10000000000000000)};for(var i in c)
config[i]=c[i];var newWin=window.open
(config.href,config.name,"resizable="+config.resizable+","
+"scrollbars="+config.scrollbars+","
+"width="+config.width+","
+"height="+config.height);if(!newWin)
alert("Popup blocked\n To use this function please disable popup blocker on this site.");return newWin;}
this.openPrint=function(str)
{var newWin=$X.openWin({href:"about:blank",width:600,height:800});newWin.document.open();newWin.document.write
('<html><head>\n'
+'<title>Temporary Printing Window</title>\n'
+'<script>\n'
+'function doprint(){window.print();window.close();}\n'
+'</scr'+'ipt>\n'
+'</head>\n'
+'<body onLoad="setTimeout(\'doprint()\', 10)">\n'
+str
+'</body></html>\n');newWin.document.close();}
this.Debug={debugDiv:null,lineNum:1,lineNumPadding:3,write:function(str)
{if(!$X.Debug.debugDiv)
$X.Debug.debugDiv=$X.Debug.buldWindow();var objRef=document.createElement("SPAN");objRef.innerHTML=str;$X.Debug.debugDiv.appendChild(objRef);$X.Debug.debugDiv.scrollTop=$X.Debug.debugDiv.scrollHeight;},writeLine:function(str)
{if(!$X.Debug.debugDiv)
$X.Debug.debugDiv=$X.Debug.buldWindow()
var objRef=document.createElement("SPAN");objRef.innerHTML=str+'<br><span style="background-color:#CFCFCF">'+'&nbsp;'.chars($X.Debug.lineNumPadding-($X.Debug.lineNum).toString().length)+($X.Debug.lineNum++)+' </span>&nbsp;';$X.Debug.debugDiv.appendChild(objRef);$X.Debug.debugDiv.scrollTop=$X.Debug.debugDiv.scrollHeight;},buldWindow:function()
{var objRef=document.createElement("DIV");objRef.id="$debugDiv";objRef.style.bottom="0px";objRef.style.right="0px";objRef.style.color="blue";objRef.style.width="300px";objRef.style.height="200px";objRef.style.border="2px solid red";objRef.style.overflow="auto";objRef.style.position="absolute";objRef.style.fontFamily="Fixedsys";objRef.style.whiteSpace="nowrap";objRef.style.backgroundColor="#E0E0E0";objRef=document.body.appendChild(objRef);objRef.innerHTML='<span style="background-color:#CFCFCF">'+"&nbsp;".chars($X.Debug.lineNumPadding-($X.Debug.lineNum).toString().length)+($X.Debug.lineNum++)+' </span>&nbsp;';return objRef},clear:function()
{$X.Debug.debugDiv.innerHTML="";}}
this.scroller=function(objId,dir,onMouseOverAction,firstDelay,speed)
{members={down:{coefficient:-1,scrollObject:"scrollTop",scrollSizeObject:"scrollHeight",offsetSizeObject:"offsetHeight",startFromEnd:true},up:{coefficient:1,scrollObject:"scrollTop",scrollSizeObject:"scrollHeight",offsetSizeObject:"offsetHeight",startFromEnd:false},right:{coefficient:-1,scrollObject:"scrollLeft",scrollSizeObject:"scrollWidth",offsetSizeObject:"offsetWidth",startFromEnd:true},left:{coefficient:1,scrollObject:"scrollLeft",scrollSizeObject:"scrollWidth",offsetSizeObject:"offsetWidth",startFromEnd:false}}
if($(objId)[members[dir].scrollSizeObject]>$(objId)[members[dir].offsetSizeObject])
init(objId,dir,onMouseOverAction,firstDelay,speed);function init(objId,dir,onMouseOverAction)
{var objRef=$(objId);objRef.innerHTML=objRef.innerHTML+objRef.innerHTML;objRef.$scrollDir=dir;objRef.$speed=speed;objRef.$onMouseOver=onMouseOverAction;if(onMouseOverAction)
{$E.add(objRef,"mousemove",stopScrollOn);$E.add(objRef,"mouseout",doScrollOn);}
setTimeout(function(){doScroll(objRef);},firstDelay);if(members[dir].startFromEnd)
{objRef[members[dir].scrollObject]=objRef[members[dir].scrollSizeObject];}}
function doScroll(objRef)
{var dir=objRef.$scrollDir||"down";if(objRef.$timer)
clearInterval(objRef.$timer);objRef.$timer=setInterval
(function()
{objRef[members[dir].scrollObject]=objRef[members[dir].scrollObject]+members[dir].coefficient;if(members[dir].coefficient>0&&objRef[members[dir].scrollObject]+objRef[members[dir].offsetSizeObject]==objRef[members[dir].scrollSizeObject])
{objRef[members[dir].scrollObject]=objRef[members[dir].scrollSizeObject]/2-objRef[members[dir].offsetSizeObject]}
else if(objRef[members[dir].scrollObject]<=0)
{objRef[members[dir].scrollObject]=objRef[members[dir].scrollSizeObject]/2;}}
,150/objRef.$speed);}
function doScrollOn(e,objRef)
{doScroll(objRef)
objRef.style.overflow="hidden"}
function stopScrollOn(e,objRef)
{stopScroll(objRef);if(objRef.$onMouseOver==2)
{objRef.style.overflow="auto";objRef.style[members[dir].hiddenOverflow]="hidden";objRef.style.overflowX="hidden";}}
function stopScroll(objRef)
{if(objRef.$timer)clearInterval(objRef.$timer);}}
this.scrollerold=function(objId,dir,onMouseOverAction,firstDelay,speed)
{init(objId,dir,onMouseOverAction,firstDelay,speed);function init(objId,dir,onMouseOverAction)
{var objRef=$(objId);h=objRef.offsetHeight;objRef.$scrollDir=dir;objRef.$speed=speed;objRef.$onMouseOver=onMouseOverAction;objRef.style.width=(parseInt($D.getStyle(objRef,"width"))||objRef.offsetWidth)+"px";objRef.style.height=(parseInt($D.getStyle(objRef,"hidth"))||h)+"px";objRef.style.overflow="hidden";objRef.innerHTML='<div style="clear:both;height:'+h+'px">&nbsp;</div>'+objRef.innerHTML+'<div style="clear:both;height:'+h+'px"></div>';if(objRef.$onMouseOver)
{$E.add(objRef,"mousemove",stopScrollOn);$E.add(objRef,"mouseout",doScrollOn);}
setTimeout(function(){doScroll(objRef);},firstDelay);}
function doScroll(objRef)
{var dir=parseInt(objRef.$scrollDir)||1;if(objRef.$timer)
clearInterval(objRef.$timer);objRef.$timer=setInterval
(function()
{objRef.scrollTop=objRef.scrollTop+1*dir;if(dir>0&&objRef.scrollTop+objRef.offsetHeight==objRef.scrollHeight)
{objRef.scrollTop=0;}
else if(objRef.scrollTop<=0)
{objRef.scrollTop=objRef.scrollHeight;}}
,150/objRef.$speed)}
function doScrollOn(e,objRef)
{doScroll(objRef)
objRef.style.overflow="hidden"}
function stopScrollOn(e,objRef)
{stopScroll(objRef);if(objRef.$onMouseOver==2)
{objRef.style.overflow="auto";objRef.style.overflowX="hidden";}}
function stopScroll(objRef)
{if(objRef.$timer)
clearInterval(objRef.$timer);}
function scrollToTop(objId)
{stopScroll(objRef);objRef.scrollTop=0;}
function scrollToBottom(objId)
{stopScroll(objRef);objRef.scrollTop=objRef.scrollHeight;}}
this.popupMenu=function(objId,highliteClass,activeClass,isVertical,isLtr)
{if(!$(objId)){return false}
var all_li=$(objId).getElementsByTagName("LI"),leftRight=isLtr?"left":"right";isVertical=!(!isVertical);for(var i=0,len=all_li.length;i<len;i++)
{var li=all_li[i],child_ul=li.getElementsByTagName("UL")
li.isVertical=isVertical;li.leftRight=leftRight;li.isFirstLevel=li.parentNode.parentNode.nodeName!="LI";li.isChildren=child_ul.length>=1;li.onmouseover=do_onmouseover;li.onmouseout=do_onmouseout;if(!isVertical&&li.isFirstLevel&&li.isChildren&&child_ul[0].offsetWidth<li.offsetWidth)
child_ul[0].style.width=li.offsetWidth+"px";}
var all_a=$(objId).getElementsByTagName("A");var currentParrent=null,maxWidth;for(var i=0,len=all_a.length;i<len;i++)
{if(all_a[i].href==location.href)
{if(all_a[i].parentNode.parentNode.parentNode.nodeName!="LI")
$D.setClass(all_a[i],activeClass);else
{var li=all_a[i].parentNode;while(li.parentNode.parentNode.nodeName=="LI")
li=li.parentNode.parentNode;$D.setClass(li.firstChild,activeClass);}
return true;}}
if(/(\?|&)(id=\d+)(&|$)/i.test(location.href))
{for(var i=0,len=all_a.length;i<len;i++)
{if(all_a[i].href.indexOf(RegExp.$2)!=-1)
{if(all_a[i].parentNode.parentNode.parentNode.nodeName!="LI")
$D.setClass(all_a[i],activeClass);else
{var li=all_a[i].parentNode;while(li.parentNode.parentNode.nodeName=="LI")
li=li.parentNode.parentNode;$D.setClass(li.firstChild,activeClass);}
return true;}}}
return true;function do_onmouseover()
{cascade_highlite(this,highliteClass,true);if(!this.isChildren){return false}
var ul=this.getElementsByTagName("UL");if(this.isFirstLevel)
{if(!this.isVertical)
{ul[0].style.top=this.offsetHeight+"px"}
else
{ul[0].style.top=this.offsetTop+5+"px"
ul[0].style[this.leftRight]=(this.offsetWidth-7)+"px"}}
else
{ul[0].style.top=this.offsetTop+5+"px";ul[0].style[this.leftRight]=(this.offsetWidth-7)+"px"}
ul[0].style.visibility="visible";return true;}
function do_onmouseout()
{cascade_highlite(this,highliteClass,false);if(!this.isChildren){return false}
var ul=this.getElementsByTagName("UL");ul[0].style.visibility="hidden";return true;}
function cascade_highlite(objRef,highliteClass,state)
{while(objRef.nodeName=="LI"||objRef.nodeName=="UL")
{if(objRef.nodeName=="LI")
if(state)
$D.addClass(objRef.firstChild,highliteClass);else
$D.removeClass(objRef.firstChild,highliteClass);objRef=objRef.parentNode;}}}
this.explorerMenu=function(objRef)
{if(!(objRef=$(objRef)))return;var root=objRef;var items=$D.getElementsByTagNames(objRef,"a","div");for(var i=0,len=items.length;i<len;i++)
{if(items[i].nodeName=="DIV")
$E.add(items[i],'click',function(){click(this);});}
function mouseover(objRef)
{$D.addClass(objRef,"over")}
function mouseout(objRef)
{$D.removeClass(objRef,"over")}
function click(objRef)
{var openedUls=[],allUls=root.getElementsByTagName("UL"),subUls=objRef.parentNode.getElementsByTagName("UL");for(var i=0,len=allUls.length;i<len;i++)
{if(allUls[i].offsetHeight>0)
{if(allUls[i]==subUls[0])return true;openedUls.push(allUls[i]);}}
if(subUls.length)
{$X.open(subUls[0]);$D.addClass(objRef,"active");}
for(var i=0,len=openedUls.length;i<len;i++)
{if(!$D.contains(openedUls[i],objRef))
{$X.close(openedUls[i]);$D.removeClass(objRef,"active")}}}}}
$F=new function()
{this.submit=function(objRef)
{if(objRef=findFormObj(objRef))
{if(objRef.onsubmit)
{if(objRef.onsubmit())
objRef.submit();}
else
objRef.submit();}}
this.reset=function(objRef)
{if(objRef=findFormObj(objRef))
objRef.reset();}
this.clear=function(objRef)
{if(objRef=findFormObj(objRef))
{for(var i=0,len=objRef.length;i<len;i++)
{switch(objRef[i].nodeName.toLowerCase())
{case"select":objRef[i].selectedIndex=-1;break;case"textarea":objRef[i].value="";break;case"input":switch(objRef[i].type.toLowerCase())
{case"text":case"password":objRef[i].value="";break;case"checkbox":case"radio":objRef[i].checked=false;break;}
break;}}}}
this.cancel=function()
{history.go(-1);}
function findFormObj(objRef)
{while(objRef&&objRef.nodeName!="FORM")
objRef=objRef.parentNode;return objRef;}
this.addInputs=function(contId,controls,appendRandom)
{var newInput=document.createElement("DIV"),rand=parseInt(Math.random()*10000000000000000),control="",str="";for(var i=0,len=controls.length;i<len;i++)
{control="";for(var a in controls[i])
control+=' '+a+'="'+controls[i][a]+'"';if(appendRandom)
control=control.replace(/name="([^"]+)"/gi,'name="$1_'+rand+'"')
str+='<input'+control+'>';}
newInput.innerHTML=str+' <img src="/admin/images/icons/del_small.gif" alt="Remove" onclick="$F.removeInput(this)">';var newTag=$(contId).appendChild(newInput);newInput=null;return{newTag:newTag,rand:rand};}
this.addInput=function(contId)
{var newInput=document.createElement("DIV"),str="";for(var i=1,len=arguments.length;i<len;i++)
str+='<input type="text" name="'+arguments[i]+'">';newInput.innerHTML=str+'<img src="/admin/images/icons/del_small.gif" alt="Remove" onclick="$F.removeInput(this)">';$(contId).appendChild(newInput);newInput=null;}
this.removeInput=function(objRef)
{objRef=objRef.parentNode;objRef.parentNode.removeChild(objRef);}
function resetInputs(contId,htmlName)
{document.getElementById(contId).innerHTML="<div class=\"dyncInputCont\"><input type=\"text\" name=\""+htmlName+"\"><img src=\"/admin/images/del.gif\" alt=\"הסר\" onclick=\"removeInput(this)\"></div>"}
this.orderControl=function(ids)
{var thisRef=this;this.objId=ids
this.moveOption=function(dir,end)
{var objRef=document.getElementById(thisRef.objId),selected=objRef.selectedIndex,options=objRef.options;if(selected==-1||(selected==0&&dir==-1)||(selected==options.length-1&&dir==1))
return;options[selected].swapNode(options[selected+dir]);if(end)
thisRef.moveOption(dir,end);}
this.selectAll=function()
{var options=document.getElementById(thisRef.objId).options;for(var i=0,len=options.length;i<len;i++)
{options[i].value=options[i].value+":"+(i+1);options[i].selected=true;}
return true}
this.setSelectSize=function()
{var objRef=$(thisRef.objId);if(objRef)
objRef.size=objRef.options.length;}}}
$AJAX=new function()
{var
reqObj=null,frmObj=null,objRef=this;this.isDebug=false;this.href=null;this.async=true;this.method="GET";this.isIframe=false;this.onResponse=null;this.responseText=null;this.callback=function(responseText)
{if(typeof objRef.onResponse=="function")
objRef.onResponse(responseText);}
this.execute=function(params)
{var queryString="";if(params)
{for(var p in params)
{queryString+=p+"="+params[p]+"&";}}
if(typeof objRef.onResponse!="function")
{if(objRef.isDebug)
alert("$AJAX error: onResponse does not contain function, unable to return data!");throw new Error("$AJAX error: onResponse does not contain function, unable to return data!");}
if(objRef.method!="POST")
{if(objRef.href.indexOf("?")==-1)
objRef.href+="?";else
objRef.href+="&";objRef.href+=queryString+"r="+Math.random();}
if(objRef.isIframe)
{reqObj.src=objRef.href;}
else
{reqObj.open(objRef.method,objRef.href,objRef.async)
if(objRef.method=="POST")
reqObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");reqObj.onreadystatechange=function()
{if(reqObj.readyState==4)
{if(reqObj.status==200)
{if(typeof objRef.onResponse=="function")
objRef.onResponse(reqObj.responseText);else
{if(objRef.isDebug)
alert("$AJAX error: onResponse does not contain function, unable to return data!");throw new Error("$AJAX error: onResponse does not contain function, unable to return data!");}}
else
{if(objRef.isDebug)
alert("$AJAX error: "+reqObj.statusText+"\nStatus: "+reqObj.status+"\nError:\n"+reqObj.responseText);throw new Error("$AJAX error: "+reqObj.statusText+"\nStatus: "+reqObj.status+"\nError:\n"+reqObj.responseText);}}}
if(objRef.method=="POST")
reqObj.send(queryString);else
reqObj.send(null);}}
this.init=function()
{if(reqObj)return true;try{reqObj=new XMLHttpRequest();}
catch(e)
{try{reqObj=new ActiveXObject("Msxml2.XMLHTTP.4.0");}
catch(e)
{try{reqObj=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try{reqObj=new ActiveXObject("microsoft.XMLHTTP");}
catch(e)
{try{if(objRef.method=="GET")
{frmObj=document.body.appendChild(document.createElement("IFRAME"));frmObj.width=0;frmObj.height=0;frmObj.style.width=0;frmObj.style.height=0;frmObj.style.display="none";objRef.isIframe=true;frmObj.onload=function(){objRef.callback("NOTIMPLAMENTED")};}
else
{if(objRef.isDebug)
alert("$AJAX error: iFrame can not be used - method is not set to GET");throw new Error("$AJAX error: iFrame can not be used - method is not set to GET");}}
catch(e)
{reqObj=null;}}}}}
if(!reqObj)
{if(objRef.isDebug)
alert("$AJAX error: Object was NOT created");return false;}
else
return true;}
this.updateBitField=function(tableName,fieldName,idFieldName,state,itemIds,objRef)
{if(tableName&&fieldName&&idFieldName&&itemIds&&objRef)
{if($AJAX.init())
{$AJAX.href="/admin/shared/set_bitField.asp";$AJAX.onResponse=function(response)
{if(response=="!DONE!")
{objRef.src="/admin/images/icons/"+(state?"checked":"disabled")+".gif";objRef.onclick=function(){$AJAX.updateBitField(tableName,fieldName,idFieldName,(state?0:1),itemIds,objRef)}
objRef.alt=state?"YES":"NO";objRef.title=(state?"YES":"NO")+" - click to change";}
else
{alert(response);}}
$AJAX.execute({tableName:tableName,fieldName:fieldName,idFieldName:idFieldName,state:state,itemIds:itemIds});}
else
alert("AJAX ERROR");}
else
alert(idFieldName)}}
Array.prototype.push=function()
{var n=this.length>>>0;for(var i=0;i<arguments.length;i++)
{this[n]=arguments[i];n=n+1>>>0;}
this.length=n;return n;}
String.prototype.trim=function()
{return this.replace(/^\s+|\s+$/,"");}
String.prototype.chars=function(num,mult)
{mult=mult||1;return new Array(num*mult+1).join(this);}
if(typeof Element!=="undefined")
{Element.prototype.swapNode=function(swapWith)
{var itemtmp=this.cloneNode(1),parent=this.parentNode;swapWith=parent.replaceChild(itemtmp,swapWith);parent.replaceChild(swapWith,this);parent.replaceChild(this,itemtmp);itemtmp=null;}}
