  var img_width = 600;
  var do_slide = true;
  var num_slides = 7
  var currIndex = 0;
  var wait = 4000;
  var ssInt = 0;
  
  function doSlider (imgIndex) {  
  	if (do_slide) {
  		navOff();
  		navOn(imgIndex);
  		stopSlideShow();
  		do_slide = false;
  		newPos = imgIndex * img_width;
  		new Effect.Move('content_inner', { x: -newPos, y: 0, mode: 'absolute', duration: 2, afterFinish: function() { 
  			do_slide=true;
  			startSlideShow();
  			}.bind(this)
  		});
  		currIndex = imgIndex;
  	}
  }
  
  function navOff() {
  	for (i = 0; i < num_slides; i++) {
  		$('nav_slide' + i).removeClassName('on');
  	}
  }
  
  function navOn(imgIndex) {
  	$('nav_slide' + imgIndex).addClassName('on');
  }  
  
  function initImages() {
  	if ($('content_inner').childElements().length > 1) {
      $('content_inner').setStyle({width: ($('content_inner').childElements().length * img_width) + 'px'});
    }
    for(i = 0; i < $('content_inner').childElements().length; i++) {
    	$('slide'+i).setStyle({display: 'block'});
    }
    startSlideShow();	  
  }
  
  function smartCheck(frm) {
		output = true;
		if(frm.q.value == '') output = false;
		return output;
	}

	function checkValid() {
		check = true;
		if(document.frmComment.FirstName.value == "") {
			alert("Please enter your first name");
			check = false;
		} else if (document.frmComment.LastName.value == "") {
			alert("Please enter your last address");
			check = false;
		} else if (document.frmComment.Email.value == "") {
			alert("Please enter your email number");
			check = false;
		} else if (document.frmComment.Comments.value == "") {
			alert("Please enter comments / feedback");
			check = false;
		}
		return check;
	}
  
  function startSlideShow() {
		ssInt = setInterval("SlideShow()", wait);  // This is a javascript function which acts as a timer.
	}
	
	function stopSlideShow() {
		clearInterval(ssInt);
	}
	
	function SlideShow() {
		next_slide = (currIndex+1) % num_slides;
		doSlider(next_slide);
	}
	
	function goTo(url) {
		location.href=url;
	}