function moveNext() {
  if (intBusy == 0) {
	  var the_style = getStyleObject("myDiv1");
	  if (the_style) {
	    intTargetLeft = parseInt(the_style.left) - intPanelWidth;
	  	if (intTargetLeft > intMinLeft) {
			intBusy = 1;
	    	the_timeout=setTimeout('moveDivNext();',50); return false;
		} else {
			alert('At the end already...' + intTargetLeft);
		}
	  }
  }
}
function movePrevious() {
  if (intBusy == 0) {
	  var the_style = getStyleObject("myDiv1");
	  if (the_style) {
	    intTargetLeft = parseInt(the_style.left) + intPanelWidth;
	  	if (intTargetLeft < intMaxLeft) {
			intBusy = 1;
	    	the_timeout=setTimeout('moveDivPrevious();',50); return false;
		} else {
			alert('At the beginning already...' + intTargetLeft);
		}
	  }
  }
}
function moveTo(intPanel) {
  if (intBusy == 0) {
	  var the_style = getStyleObject("myDiv1");
	  if (the_style) {
	    intTargetLeft = ((intPanel - 1) * intPanelWidth) * -1;
	  	if (intTargetLeft > parseInt(the_style.left)) {
			intBusy = 1;
	    	the_timeout=setTimeout('moveDivPrevious();',50); return false;
		} else {
			if (intTargetLeft < parseInt(the_style.left)) {
				intBusy = 1;
	    		the_timeout=setTimeout('moveDivNext();',50); return false;
			} else { 
				//alert('already there...');
			}
		}
	  }
  }
}
function moveDivNext() {
  var the_style = getStyleObject("myDiv1");
  if (the_style) {
    var current_left = parseInt(the_style.left);
    var new_left = current_left - intIncrement;
	if (new_left < (intTargetLeft + 10)) {
		new_left = current_left - 1;
	}
    if (document.layers) {
      the_style.left = new_left;
    } else {  
      the_style.left = new_left + "px";
    }
    if (new_left > intTargetLeft) {
   		the_timeout = setTimeout('moveDivNext();',1);
	} else {
		//alert(intTargetLeft + ":" + new_left); // test only
		if ((intTargetLeft - intPanelWidth) < intMinLeft) {
			the_style = getStyleObject("spanNext");
			the_style.visibility = 'hidden';
		}
		the_style = getStyleObject("spanPrevious");
		the_style.visibility = 'visible';
		fixClass();		
		intBusy = 0;
   	}
  }
}

function moveDivPrevious() {
  var the_style = getStyleObject("myDiv1");
  if (the_style) {
    var current_left = parseInt(the_style.left);
    var new_left = current_left + intIncrement;
	if (new_left > (intTargetLeft - 10)) {
		new_left = current_left + 1;
	}
    if (document.layers) {
      the_style.left = new_left;
    } else {  
      the_style.left = new_left + "px";
    }
    if (new_left < intTargetLeft) {
   		the_timeout = setTimeout('moveDivPrevious();',1);
	} else {
		if ((intTargetLeft + intPanelWidth) > intMaxLeft) {
			the_style = getStyleObject("spanPrevious");
			the_style.visibility = 'hidden';
		}
		the_style = getStyleObject("spanNext");
		the_style.visibility = 'visible';	
		fixClass();	
		intBusy = 0;
   	}
  }
}
function getStyleObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	return document.layers[objectId];
    } else {
	return false;
    }
}
function fixClass() {
}
