     /* Copyright 2009 Susan Corwin, all rights reserved  */
     /* to reuse this file, contact scorwin-intertwine@MochaExpress.com  */ 


/* refresh timer */
/* for web cams, refresh the page every 30 seconds  */

 
  var SlideTime=6;
  var SlideDistance = 1;
 
  var KeepSliding=0;
  var SlideRight=0;
 
 var showtimerId = "undefined"
  
  var BBObject = "undefined";
  var BBWidth=0;
  var BBLeft=0;
  var BBDivWidth=0;
  
function refreshTimer()
{
      if(KeepSliding == 0) {return 0; };
	  
      KeepSliding=MoveBillboard();
      
	  if (KeepSliding != 0)
	     {
      		timerID = setTimeout("refreshTimer()", SlideTime);
		 };
}

function StartRefreshTimer()
{
       timerID = setTimeout("refreshTimer()", SlideTime);
}

function MoveBillboard()
  {
	 var leftposition = parseInt(BBObject.style.left,10);
	 var position;
	 
	 if (SlideRight == 0)
	    {
		position = leftposition - SlideDistance;
		if (  leftposition + BBWidth - BBDivWidth <= 0){ return(0); };
		}
	 else
	    {
		position = leftposition + SlideDistance;
		if (  leftposition >= 0){ return(0); };
		};
		
	 BBObject.style.left = position + "px";
     return 1;
  }

function mouseOverBillboard(bbslider, bbdiv, direction)
  {
    var bbSliderObj = document.getElementById(bbslider);
	var divobj = document.getElementById(bbdiv);
	var position;
	var debugobject =  document.getElementById('debug');
	
	if(BBObject!=bbSliderObj)
	  {
		  BBObject = bbSliderObj;
		  BBDivWidth = 952; // divobj.style.width;
		  BBWidth = 4760; // bbSliderObj.style.width; 
		  BBLeft = 0;
		  BBObject.style.left = 0;
	  }; 
	 SlideRight = direction;
	 KeepSliding = 1;
     refreshTimer();

  }
  
  
function mouseOutBillboard( )
  {
	KeepSliding = 0;
	if (SlideRight != 0)
	   {SlideRight = 0; }
	 else
	    {SlideRight = 1;};

  }
  
function mouseClickBillboard( )
  {
	  location.href="http://www.TheIntertwine.org/TheIntertwine.php";
  }

function getPosition(ElementID, OffsetType)
 {
	 <!-- calculate where the Element is located in the window -->
		var el=document.getElementById(ElementID);
		var total=(OffsetType=="left")? el.offsetLeft : el.offsetTop;
		var parent=el.offsetParent;
		
		while (parent!=null)
		  {
			total=(OffsetType=="left")? total+parent.offsetLeft : total+parent.offsetTop;
			parent=parent.offsetParent;
		  }
		return total;
}
function SetUpBBDivs(ElementID1, ElementID2, topValue, leftValue, widthValue, heightValue, zindexVal)
  {
	  var el1=document.getElementById(ElementID2);
	  
	  el1.style.visibility='visible'; 
	  el1.style.zIndex = zindexVal;  
	  el1.style.position='absolute';
	  el1.style.top = topValue + "px"; /* getPosition(ElementID1, 'top') +  */
	  el1.style.width = widthValue + "px";
	  el1.style.height = heightValue + "px";
	  el1.style.left = leftValue + 'px'; /* getPosition(ElementID1, 'left') +  */
/*	  el1.style.border=' 1px solid #c0c0c0';  */
	  
  }	


