function addevent(obj,evttype,func,cap){cap=cap||false;if(obj.addeventlistener){obj.addeventlistener(evttype,func,cap);return true;}else if(obj.attachevent){if(cap){obj.setcapture();return true;}else{return obj.attachevent("on"+ evttype,func);}}else{return false;}} function getpagescroll(){var xscroll,yscroll;if(self.pagexoffset){xscroll=self.pagexoffset;}else if(document.documentelement&&document.documentelement.scrollleft){xscroll=document.documentelement.scrollleft;}else if(document.body){xscroll=document.body.scrollleft;} if(self.pageyoffset){yscroll=self.pageyoffset;}else if(document.documentelement&&document.documentelement.scrolltop){yscroll=document.documentelement.scrolltop;}else if(document.body){yscroll=document.body.scrolltop;} arraypagescroll=new array(xscroll,yscroll);return arraypagescroll;} function getpagesize(){var xscroll,yscroll;if(window.innerheight&&window.scrollmaxy){xscroll=document.body.scrollwidth;yscroll=window.innerheight+ window.scrollmaxy;}else if(document.body.scrollheight>document.body.offsetheight){xscroll=document.body.scrollwidth;yscroll=document.body.scrollheight;}else{xscroll=document.body.offsetwidth;yscroll=document.body.offsetheight;} var windowwidth,windowheight;if(self.innerheight){windowwidth=self.innerwidth;windowheight=self.innerheight;}else if(document.documentelement&&document.documentelement.clientheight){windowwidth=document.documentelement.clientwidth;windowheight=document.documentelement.clientheight;}else if(document.body){windowwidth=document.body.clientwidth;windowheight=document.body.clientheight;} if(yscrollw){dirx=-1;x=w;kx=math.sin(rad);ky=math.cos(rad);} y=y+ step*ky*diry;if(y<0){diry=1;y=0;kx=math.sin(rad);ky=math.cos(rad);} if(y>h){diry=-1;y=h;kx=math.sin(rad);ky=math.cos(rad);}} this.run=function(){var delay=20;interval=setinterval(obj.custommethod,delay);obj.onmouseover=function(){clearinterval(interval);} obj.onmouseout=function(){interval=setinterval(obj.custommethod,delay);}}}