

var pauseScrolling = 0;

var scrollerwidth=155;
var scrollerheight=96;
var pausebetweenimages=3000;
var idx;


//for (index = 1; index <= 3; index++)
{
//hSlideContent[5] = "<%=scrban(0)%>"
//hSlideContent[0]='<p>Horizontal Scrolling Layers</p><p>By David Miles<br><a href="http://www.z3roadster.net/dreamweaver" target="_blank">www.z3roadster.net/dreamweaver</a></p><p>Damn, this is snazzy.</p>'
//hSlideContent[1]='<p>It sure is a good thing you decided to add more shock to your site, by visiting <a href="http://www.dhtmlshock.com" target="_blank">DHTMLShock.com</a>. We have the highest quality DHTML and JavaScripts around.</p><p>(Please pardon our advertising propaganda.)</p>'
//hSlideContent[2]='<a href="http://www.xdimen.com"><img src="mod/scrollImage/5.gif" width="155" height="96" border="0"></a>'
//hSlideContent[3]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="155" height="96"><param name="movie" value="mod/scrollImage/chop_tree2[1].swf"><param name="quality" value="high"><PARAM NAME="bgcolor" VALUE="#000000"><embed src="mod/scrollImage/chop_tree2[1].swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="155" height="96"></embed></object>'
//hSlideContent[4]='<img src="/download/ScrBanner/<%=SBanID%>/<%= SBanFile%>" width="155" height="96" border="0"></a>'
//hSlideContent[5]='<%=scrban(0)%>'
}

if (hSlideContent.length>1)
	idx=2
else
	idx=0

//Edit by Wayne
function locateObject(n, d) { //v3.0\\
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)  {
	    d=parent.frames[n.substring(p+1)].document;
	    n=n.substring(0,p);
    }
  if(!(x=d[n])&&d.all) x=d.all[n];
  
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document);
  
  
  return x;
}

function moveHTextFirstBlock(whichdiv){

	if (document.all){
		tdiv=eval(whichdiv)
	//	alert (tdiv);
		if (tdiv.style.pixelLeft>0&&tdiv.style.pixelLeft<=5)	{
			tdiv.style.pixelLeft=0
			setTimeout("moveHTextFirstBlock(tdiv)",pausebetweenimages)
			setTimeout("moveHTextSecondBlock('hTextSecond')",pausebetweenimages)

			return
		}
		if (tdiv.style.pixelLeft>=tdiv.offsetWidth*-1)	{
			if (pauseScrolling == 0) {
			tdiv.style.pixelLeft-=5
			}
			setTimeout("moveHTextFirstBlock(tdiv)",10)			
		}else{
			tdiv.style.pixelLeft=scrollerwidth+5
			tdiv.innerHTML=hSlideContent[idx]

			if (idx==hSlideContent.length-1) {			
				idx=0

			} else {
				idx++

			}
		}
	} 
	
	else {

		tlayer=eval(whichdiv)
		if (tlayer.left>0&&tlayer.left<=5)	{
			tlayer.left=0
			setTimeout("moveHTextFirstBlock(tlayer)",pausebetweenimages)
			setTimeout("moveHTextSecondBlock(locateObject('hTextSecond'))",pausebetweenimages)
			return
		}
		if (tlayer.left>=tlayer.document.width*-1)	{
			tlayer.left-=5
			setTimeout("moveHTextFirstBlock(tlayer)",10)
		}else{
			tlayer.left=scrollerwidth+5
			tlayer.document.write(hSlideContent[idx])
			tlayer.document.close()
			if (idx==hSlideContent.length-1)
				idx=0
			else
				idx++
		}
	}
	
}

function moveHTextSecondBlock(whichdiv){

	if (document.all){
		tdiv2=eval(whichdiv)

		if (tdiv2.style.pixelLeft>0&&tdiv2.style.pixelLeft<=5){
			tdiv2.style.pixelLeft=0
			setTimeout("moveHTextSecondBlock(tdiv2)",pausebetweenimages)
			setTimeout("moveHTextFirstBlock('hTextFirst')",pausebetweenimages)

			return			
		}
		
		if (tdiv.style.pixelLeft>=tdiv.offsetWidth*-1)	{
			if (pauseScrolling == 0) {
			tdiv.style.pixelLeft-=5
			}
			setTimeout("moveHTextFirstBlock(tdiv)",10)			
		}else{
			tdiv.style.pixelLeft=scrollerwidth+5
			tdiv.innerHTML=hSlideContent[idx]

			if (idx==hSlideContent.length-1) {			
				idx=0

			} else {
				idx++

			}
		}	} 
	else if (document.layers) {
		tlayer2=eval(whichdiv)

		if (tlayer2.left>0&&tlayer2.left<=5){
			tlayer2.left=0
			setTimeout("moveHTextSecondBlock(tlayer2)",pausebetweenimages)
			setTimeout("moveHTextFirstBlock(locateObject('hTextMain').document.layers['hTextFirst'])",pausebetweenimages)
			return
		}
		if (tlayer2.left>=tlayer2.document.width*-1){
			tlayer2.left-=5
			setTimeout("moveHTextSecondBlock(tlayer2)",10)
		}else{
			tlayer2.left=scrollerwidth+5
			tlayer2.document.write(hSlideContent[idx])
			tlayer2.document.close()
				
			if (idx==hSlideContent.length-1)
			idx=0
			else
			idx++
		}
	}
	
}

function startHScroll(){
	if (document.all){
		locateObject('hTextSecond').style.left=scrollerwidth+5
		locateObject('hTextSecond').visibility='visible'
		moveHTextFirstBlock(locateObject("hTextFirst"))

	}	
	/*
	else if (document.layers){
		locateObject('hTextMain').visibility='show'
		locateObject('hTextFirst').visibility='show'
		locateObject('hTextSecond').left=scrollerwidth+5
		locateObject('hTextSecond').visibility='show'
		moveHTextFirstBlock(locateObject('hTextMain').document.layers['hTextFirst'])
	}
	*/
}

function pauseHScroll() {
	pauseScrolling = 1;
}

function resumeHScroll() {
	pauseScrolling = 0;
}
