function EzknowScroller(objName,ScrollContentArray,BlockValue,TotalValue){this.ScrollStart=Ezknow_ScrollStart;this.ScrollStop=Ezknow_ScrollStop;this.ScrollInit=Ezknow_ScrollInit;this.Scrolling=Ezknow_Scrolling;this.InsertBlock=Ezknow_InsertBlock;this.Prev=Ezknow_ScrollPrev;this.Next=Ezknow_ScrollNext;this.scrollBlockID="IDEzknowScroller_"+objName;this.objName=objName;this.scrollBlockHeight=BlockValue;this.totalBlockHeight=TotalValue;this.scrollBlockWidth=BlockValue;this.totalBlockWdith=TotalValue;this.html="";this.contentCnt=0;this.bScrollWait=false;this.waitTime=3000;this.timerTime=this.waitTime;this.arrContent=ScrollContentArray;this.speedScroll=1;this.ScrollMode="TOP";this.TextAlign="LEFT";this.bStop=false;}function Ezknow_ScrollInit(){var i=0;document.write('<div id="'+this.scrollBlockID+'TotalBlock" style="width: 100%; height: '+this.totalBlockHeight+'px;  position: relative; overflow:hidden;z-index:5000;border:0 solid gray;"  onMouseover="'+this.objName+'.ScrollStop()" onMouseout="'+this.objName+'.ScrollStart()">');var htmlx="";for(var i=0;i<this.arrContent.length;i++){htmlx+=this.InsertBlock(this.contentCnt,this.contentCnt++);}document.write('</div>');if(this.ScrollMode.toUpperCase()=="TOP"){var cnt=Math.ceil(this.totalBlockHeight/this.scrollBlockHeight);if(this.contentCnt>1&&i>=cnt)window.setTimeout(this.objName+".Scrolling()",this.timerTime);}else{if(this.contentCnt>1)window.setTimeout(this.objName+".Scrolling()",this.timerTime);}}function Ezknow_ScrollStart(){this.bScrollWait=false;}function Ezknow_ScrollStop(){this.bScrollWait=true;}function Ezknow_Scrolling(){if(this.bStop){this.timerTime=this.waitTime;this.bStop=false;window.setTimeout(this.objName+".Scrolling()",this.timerTime);}else{if(!this.bScrollWait){this.timerTime=1;for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(this.ScrollMode.toUpperCase()=="TOP"){obj.top=parseInt(obj.top,10)-this.speedScroll;if(parseInt(obj.top,10)<=this.scrollBlockHeight*(-1))obj.top=this.scrollBlockHeight*(this.arrContent.length-1);if(parseInt(obj.top,10)==0)this.timerTime=this.waitTime;}else{obj.left=parseInt(obj.left,10)-this.speedScroll;if(parseInt(obj.left,10)<=this.scrollBlockWidth*(-1))obj.left=this.scrollBlockWidth*(this.arrContent.length-1);if(parseInt(obj.left,10)==0)this.timerTime=this.waitTime;}}}window.setTimeout(this.objName+".Scrolling()",this.timerTime);}}function Ezknow_InsertBlock(idx,n){var html='';if(this.ScrollMode.toUpperCase()=="TOP"){html='<div style="left: 0px;z-index:100000; width:100%; position: absolute; overflow:hidden; top: '+(this.scrollBlockHeight*n)+'px;" id="'+(this.scrollBlockID+n)+'" nowrap>\n';}else{html='<div style="z-index:100000; position: absolute; overflow:hidden; '+'left: '+(this.scrollBlockWidth*n)+'px; width: 100%; top:0px;  text-align: '+(this.TextAlign?this.TextAlign:"left")+'" id="'+(this.scrollBlockID+n)+'" nowrap>\n';}html+=this.arrContent[idx]+'\n';html+='</div>\n';document.write(html);return html;}function Ezknow_ScrollNext(){if(this.ScrollMode.toUpperCase()=="TOP"){if(!this.bScrollWait){this.timerTime=1;for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(this.ScrollMode.toUpperCase()=="TOP"){obj.top=parseInt(obj.top)-this.speedScroll;if(parseInt(obj.top,10)<=this.scrollBlockHeight*(-1))obj.top=this.scrollBlockHeight*(this.arrContent.length-1);if(parseInt(obj.top,10)==0)this.timerTime=this.waitTime;}else{obj.left=parseInt(obj.left,10)-this.speedScroll;if(parseInt(obj.left,10)<=this.scrollBlockWidth*(-1))obj.left=this.scrollBlockWidth*(this.arrContent.length-1);if(parseInt(obj.left,10)==0)this.timerTime=this.waitTime;}}}window.setTimeout(this.objName+".Scrolling()",this.timerTime);}else{this.bScrollWait=true;var width=0;for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(parseInt(obj.left,10)<1){width=this.scrollBlockWidth+parseInt(obj.left,10);break;}}for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(parseInt(obj.left,10)<1)obj.left=this.scrollBlockWidth*(this.contentCnt-1);else obj.left=parseInt(obj.left,10)-width;}this.bScrollWait=false;this.bStop=true;}}function Ezknow_ScrollPrev(){this.bScrollWait=true;if(this.ScrollMode.toUpperCase()=="TOP"){}else{var width=0;for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(parseInt(obj.left)<1){width=parseInt(obj.left,10)*(-1);break;}}if(width==0){var total_width=this.scrollBlockWidth*(this.contentCnt-1);for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(parseInt(obj.left,10)+1>total_width)obj.left=0;else obj.left=parseInt(obj.left,10)+this.scrollBlockWidth;}}else{for(i=0;i<this.contentCnt;i++){obj=document.getElementById(this.scrollBlockID+i).style;if(parseInt(obj.left,10)<1)obj.left=0;else obj.left=parseInt(obj.left,10)+width;}}}this.bScrollWait=false;this.bStop=true;}