$(document).ready(function(){
/* EXAMPLE SYNTAX
	 $("a").click(function(){
	   alert("Example");
	 });
*/
	function scrollRight()
	{
	  	var left = document.getElementById("scrollImg").offsetLeft;
		if (left == 0) {
			clearInterval(intervalID);
			
		} else {
		left = left+4;
		$("#scrollImg").css("left",left);
		}
	}

	function scrollLeft()
	{
	  	var left = document.getElementById("scrollImg").offsetLeft;
		if (left == -1468) { // Width of image minus viewing area width (800), always negative
			clearInterval(intervalIDleft);
			
		} else {
		left = left-4;
		$("#scrollImg").css("left",left);
		}
	}
	
	 $("#leftScroll").mouseover(function(){
		
		intervalID = setInterval(scrollRight, 10);
	 })
	 $("#leftScroll").mouseout(function(){
	
		clearInterval(intervalID);
	 });

	 $("#rightScroll").mouseover(function(){
		
		intervalIDleft = setInterval(scrollLeft, 10);
	 });
	 $("#rightScroll").mouseout(function(){
	
		clearInterval(intervalIDleft);
	 });
	
	
	$('#left li a').hover(function() {
	  $(this.parentNode).addClass('hover');
	}, function() {
	  $(this.parentNode).removeClass('hover');
	});



	 $("#salesForm").submit(function(){
		prod = $("#product").val();
		email = $("#email").val();
		phone = $("#phone").val();
		affil = $("#affiliation").val();
		$("#phone").val()
		if (prod == "" || email == "" ||  phone == "" || affil == "") {
			alert("Please enter all required fields.");
			return false;
		} else {
			return true;
		}
		return false;
	 });
	$("#supportForm").submit(function(){
		prod = $("#product").val();
		email = $("#email").val();
		phone = $("#phone").val();
		affil = $("#affiliation").val();
		concern = $("#concern").val();
		problem = $("#problem").val();
		$("#phone").val()
		if (prod == "" || email == "" ||  phone == "" || affil == "" || concern == "" || problem == "") {
			alert("Please enter all required fields.");
			return false;
		} else {
			return true;
		}
		return false;
	 });
	
});
