function pausecomp(Amount) { 

d = new Date() //today's date
while (1)
{
mill=new Date() // Date Now
diff = mill-d //difference in milliseconds
if( diff > Amount ) {break;}
}
}

function slidedata(strdirection) {

  prevbutton.style.visibility = 'hidden';
  nextbutton.style.visibility = 'hidden';

  var currentpos = cellsdiv.scrollLeft

	/* how long to pause between each movement try 10 for starters */ 
	var pausefor = 10

	/* width of each cell MUST MATCH setting in style */
	var scrollsize = 740

  /* trigger point is 
	var triggerpoint = 0 */
	
	/* how many scrooling steps for the ean to slow down the scroll */
	var landing = 1
	
	/* size of each scrolling step */
	var step = scrollsize/20
	
	/* number of pages IMPORTANT MUST MATCH number of cells in table, also determines the hiding of the navigation buttons */
	var numberofpages = 10
	
  if (strdirection == "left") {
	  for(i=currentpos; i>=currentpos-scrollsize; i=i - step) {
		
		triggerpoint = eval(currentpos-scrollsize+(step*landing))

		if (i < triggerpoint) {
		  
			for(x=cellsdiv.scrollLeft; x>=currentpos-scrollsize; x=x - 1) {
    			pausefor = pausefor + 1
					if(pausefor>20) { pausefor = 20 }
					pausecomp(pausefor);
			    cellsdiv.scrollLeft = x;
			}		
		}
		
		delaytime.value = pausefor
			
	  pausecomp(pausefor);
    cellsdiv.scrollLeft = i;
		showval.value = cellsdiv.scrollLeft
    }
		nextbutton.style.visibility = 'visible';
		if (cellsdiv.scrollLeft != 0) {prevbutton.style.visibility = 'visible';}

	}

  if (strdirection == "right") {
		for(i=currentpos; i<=currentpos+scrollsize; i=i + step) {
		
		triggerpoint = eval((currentpos+scrollsize)-(step*landing))
		
		if (i > triggerpoint) {

		  for(x=cellsdiv.scrollLeft; x<=currentpos+scrollsize; x=x + 1) {
    			pausefor = pausefor + 1
					if(pausefor>20) { pausefor = 2 }
					pausecomp(pausefor);
			    cellsdiv.scrollLeft = x;
			}		
		}

		delaytime.value = pausefor
	  pausecomp(pausefor);
    cellsdiv.scrollLeft = i;
		showval.value = cellsdiv.scrollLeft
    }
		prevbutton.style.visibility = 'visible';
	  if (cellsdiv.scrollLeft != numberofpages*scrollsize) {nextbutton.style.visibility = 'visible';}
	}
}
