try{onLoadScriptFile();}catch(e){};function JCSuraViewer(){this.htmlAdded=false;this.startAya=1;this.endAya=4;this.totalAyat=VerseNoInSoura[this.suraNo];this.onclick=function(){event.cancelBubble=true;};this.toString=function(){this.nWidth=VerseNoInSoura[this.suraNo]*2;return "<div class=suraQViewer style='position:absolute;'>"+"<div style='cursor:hand;font-size:10px' NOWRAP>"+"<span style='width:8px' onclick='"+this.sID+".onClickPrev()'><img src=/images/prev.gif width=8 height=9></span>"+"<span onmousemove='"+this.sID+".onMouseMoveAya()' onclick='"+this.sID+".onClickAya()' style='width:"+this.nWidth+"px;background-image:url(/images/schart_bg.gif);background-repeat:repeat-x;'></span>"+"<span style='width:8px' onclick='"+this.sID+".onClickNext()'><img src=/images/next.gif width=8 height=9></span>"+"</div>"+"<div id='Slider_"+this.sID+"' style='font-size:8px;' NOWRAP xonmousemove='"+this.sID+".onClickSlider(1)' xonclick='"+this.sID+".onClickSlider()'>"+"<span style='width:0px;' id=StartAya_"+this.sID+"></span>"+"<span DHorz=1 mClass=JCDragDrop ondrop='"+this.sID+".onDropStart()'><img border=0 src='/images/start_aya.gif?v=2' width=8 height=16 style='cursor:E-resize'></span>"+"<span id='AyatCount_"+this.sID+"' style='width:8px'></span>"+"<span DHorz=1 mClass=JCDragDrop ondrop='"+this.sID+".onDropEnd()'><img border=0 src='/images/end_aya.gif?v=2' width=8 height=16 style='cursor:W-resize'></span>"+"</div>"+"</div>"+"<div style='height:35px;background:silver'></div>"+"<div class=suraQViewerText id=TextViewer_"+this.suraNo+"></div>"+"<div mClass=JCMenuItem bullet=open_book.gif onclick='ShowPages("+this.suraNo+")'>إفتح المصحف لقراءة السورة</div>";};this.validateRange=function(){if(this.startAya<1)this.startAya=1;if(this.startAya>this.totalAyat)this.startAya=this.totalAyat;if(this.endAya<1)this.endAya=1;if(this.endAya>this.totalAyat)this.endAya=this.totalAyat;if(this.startAya>this.endAya)this.endAya=this.startAya;};this.onDropStart=function(){this.startAya -=(document.dragGost.dragSource.shiftX/2);this.showCurrRange();};this.onDropEnd=function(){this.endAya -=(document.dragGost.dragSource.shiftX/2);this.showCurrRange();};this.onClickNext=function(){var nAyatCount=this.endAya - this.startAya;this.startAya=this.endAya+1;this.endAya=nAyatCount+this.startAya;this.showCurrRange();};this.onClickPrev=function(){var nAyatCount=this.endAya - this.startAya;this.startAya -=nAyatCount;if(this.startAya<1)this.startAya=1;this.endAya=nAyatCount+this.startAya;this.showCurrRange();};this.onMouseMoveAya=function(){var mouseX=parseInt((this.nWidth - event.offsetX)/2);event.srcElement.title="انقل المجال الى آية:"+mouseX;};this.onClickAya=function(){var nAyatCount=this.endAya - this.startAya;this.startAya=parseInt((this.nWidth - event.offsetX)/2);if(this.startAya<1){this.startAya=1;}this.endAya=this.startAya+nAyatCount;this.showCurrRange();};this.showCurrRange=function(){this.validateRange();this.showRange(this.startAya,this.endAya);if(!this.eStartAya){this.eStartAya=document.getElementById("StartAya_"+this.sID);}if(this.eStartAya){this.eStartAya.style.width=(this.startAya - 1)*2+"px";}if(!this.eAyatCount){this.eAyatCount=document.getElementById("AyatCount_"+this.sID);}if(this.eAyatCount){var nAyatCount=this.endAya - this.startAya;this.eAyatCount.style.width=(nAyatCount*2).toString(10)+"px";}};this.onAddToDocument=function(){this.showCurrRange();};this.showRange=function(start,end){this.showText("<div align=center><img src=/images/wait.gif width=32 height=32></div>");LoadData("http://cgi.muslim-web.com/cgi-bin/get_sura_text.pl?s="+(this.suraNo-1)+"&f="+start+"&t="+end+"&p=1",this.sID+".showText(gDataResponse)",true);};this.showText=function(sText){if(!this.textViewer){this.textViewer=document.getElementById("TextViewer_"+this.suraNo);}if(this.textViewer){this.textViewer.innerHTML=sText;}};}