function autoSlide(incoming){
	//for(s = 0; s <= 875; s=s+25){
	//	document.getElementById('homeFeaturedGalleryImages').scrollLeft = s;
	//}
	//document.getElementById('homeFeaturedGalleryImages').scrollLeft = 875;
	var outgoing = (incoming * 1) + 35;
	document.getElementById('homeFeaturedGalleryImages').scrollLeft = outgoing;
	
	/*if(outgoing >= 875){
		document.getElementById('homeFeaturedGalleryImages').scrollLeft = 875;
		return;
	}*/
	
	if(outgoing >= (slideInterval + startPosition) ){
		startPosition += slideInterval;
		document.getElementById('homeFeaturedGalleryImages').scrollLeft = startPosition;
		if(startPosition >= maxPosition){
			startPosition = 0;
			s = setTimeout('autoSlide(0)',2000);
		}else{
			s = setTimeout('autoSlide(' + startPosition.toString() + ')',2000);
		}
		// ADVANCE STEP
		if(document.getElementById('sliderStep'+stepCount.toString())){
			document.getElementById('sliderStep'+stepCount.toString()).className = '';
		}
		stepCount ++;
		if(document.getElementById('sliderStep'+stepCount.toString())){
			document.getElementById('sliderStep'+stepCount.toString()).className = 'selected';
		}else{
			stepCount = 1;
			if(document.getElementById('sliderStep'+stepCount.toString())){
				document.getElementById('sliderStep'+stepCount.toString()).className = 'selected';
			}
		}
	}else{
		if(navigator.userAgent.indexOf('MSIE') >= 0){
			s = setTimeout('autoSlide(' + outgoing.toString() + ')',5);
		}else{
			s = setTimeout('autoSlide(' + outgoing.toString() + ')',50);
		}
	}
}

function slideNav(incoming){
	// WHERE IS IT AT
	moveStartFrom = document.getElementById('homeFeaturedGalleryImages').scrollLeft;
	if(incoming == 'forth'){
		moveGoTo = document.getElementById('homeFeaturedGalleryImages').scrollLeft + slideInterval;
		newStepCount = (stepCount * 1) + 1;
		if(moveGoTo >= maxPosition){
			moveGoTo = 0;
			newStepCount = 1;
		}
	}else if(incoming == 'back'){
		moveGoTo = document.getElementById('homeFeaturedGalleryImages').scrollLeft - slideInterval;
		newStepCount = stepCount - 1;
		if(moveGoTo < 0){
			moveGoTo = 	maxPosition - slideInterval;
			newStepCount = maxPosition / slideInterval;
		}
	}else{
		clearTimeout(s);
		
		// WHERE IS IT GOING
		moveGoTo = slideInterval * (incoming - 1);
		newStepCount = incoming;
	}
	
	if(document.getElementById('sliderStep'+stepCount.toString())){
		document.getElementById('sliderStep'+stepCount.toString()).className = '';
	}
	stepCount = newStepCount;
	if(document.getElementById('sliderStep'+stepCount.toString())){
		document.getElementById('sliderStep'+stepCount.toString()).className = 'selected';
	}
	
	document.getElementById('homeFeaturedGalleryImages').scrollLeft = moveGoTo;
}

/*if(navigator.userAgent.indexOf('MSIE') >= 0){
	alert('IE');
}else{
	alert('Other');
}*/
// AUTO SCROLLER
//var s = setTimeout('autoSlide(0)',2000);

//alert(document.getElementById('homeFeaturedGalleryImages').scrollLeft = 100);
