// JavaScript Document
	var scrollerStatus = 1;
	var numImages = 3;
	var htmlStr;
	var fadeTimer;
	var imageFolder = "";
		
	$(document).ready(function(){		
		window.onload = function(){
			//alert("hmm");
			//scrollRight();
			fadeOut();
			if(ContactPage==1){
				document.contactForm.Name.value='NAME: ';
				document.contactForm.Email.value='E-MAIL: ';
				document.contactForm.Tel.value='TEL: ';
				document.contactForm.Message.value='MESSAGE: ';
			}
		}
						
     });
			
	function scrollRight(){
		scrollerStatus += 1;
		if(scrollerStatus > numImages){ scrollerStatus = 1; }
		fadeTimer=setTimeout("fadeOut();",10);
		//updateScroller();
	}
	
	function fadeOut(){
		$('.imageScroller').animate({
    			opacity: '0.0'
  			}, 500, function() {
    			// Animation complete.
				updateScroller();			
				fadeTimer=setTimeout("fadeIn();",10);
  		});
	}
	
	function fadeMid(){
		$('.imageScroller').animate({
    			opacity: '0.0'
  			}, 1, function() {
    			// Animation complete.
  		});
	}
	
	function fadeIn(){
		$('.imageScroller').animate({
    			opacity: '1.0'
  			}, 500, function() {
				fadeTimer=setTimeout("scrollRight();",5000);
    			// Animation complete.
  		});
	}
	
	function updateScroller(){
		if(innerPage==1){
			imageFolder="../";
		}
		else{
			imageFolder="";
		}
		
		if(scrollerStatus==1){
			htmlStr = "<div class=\"imageScroller\"><img src=\""+imageFolder+"images/header"+(bannerWordSet+0)+".jpg\" /></div>"
		}
		if(scrollerStatus==2){
			htmlStr = "<div class=\"imageScroller\"><img src=\""+imageFolder+"images/header"+(bannerWordSet+1)+".jpg\" /></div>"
		}
		if(scrollerStatus==3){
			htmlStr = "<div class=\"imageScroller\"><img src=\""+imageFolder+"images/header"+(bannerWordSet+2)+".jpg\" /></div>"
		}
		// if(innerPage==1){ carImagePath = "../" + carImagePath; }
		$('.imageScroller').replaceWith(htmlStr);
	}
	
	
	function validateForm(){
		var validate = 1;
		if(document.contactForm.Name.value=="NAME: "){ validate = 0; }
		if(document.contactForm.Name.value==""){ validate = 0; }
		if(document.contactForm.Email.value=="E-MAIL: "){ validate = 0; }
		if(document.contactForm.Email.value==""){ validate = 0; }
		if(document.contactForm.Tel.value=="TEL: "){ validate = 0; }
		if(document.contactForm.Tel.value==""){ validate = 0; }
		if(document.contactForm.Message.value=="MESSAGE: "){ validate = 0; }
		if(document.contactForm.Message.value==""){ validate = 0; }
		
		if(validate==1){
			return true;
		}
		else{
			alert("Please fill in all fields");
			return false;
		}
	}
	function clearAll() {
		document.contactForm.Name.value='NAME: ';
		document.contactForm.Email.value='E-MAIL: ';
		document.contactForm.Tel.value='TEL: ';
		document.contactForm.Message.value='MESSAGE: ';
	}
	
	function clearName() {
		if(document.contactForm.Name.value=="NAME: "){
			document.contactForm.Name.value='';
		}
	}
	
	function resetName() {
		if(document.contactForm.Name.value==""){
			document.contactForm.Name.value='NAME: ';
		}
	}
	
	function clearEmail() {
		if(document.contactForm.Email.value=="E-MAIL: "){
			document.contactForm.Email.value='';
		}
	}
	
	function resetEmail() {
		if(document.contactForm.Email.value==""){
			document.contactForm.Email.value='E-MAIL: ';
		}
	}
	
	function clearMessage() {
		if(document.contactForm.Message.value=="MESSAGE: "){
			document.contactForm.Message.value='';
		}
	}
	
	function resetMessage() {
		if(document.contactForm.Message.value==""){
			document.contactForm.Message.value='MESSAGE: ';
		}
	}
	
	function clearTel() {
		if(document.contactForm.Tel.value=="TEL: "){
			document.contactForm.Tel.value='';
		}
	}
	
	function resetTel() {
		if(document.contactForm.Tel.value==""){
			document.contactForm.Tel.value='TEL: ';
		}
	}
