$(document).ready(function() {
						   
	//homepage graphics fade					   
	
	var cont1 = 1;
	var cont2 = 2;
		
	function automat() {
		$('#v-fade-' + cont1).fadeOut("slow");
		$('#v-fade-' + cont2).fadeIn("slow");
		cont1++;
		cont2++;
		if(cont1==6) cont1 = 1;
		if(cont2==6) cont2 = 1;
	}
		

	var id = setInterval(automat, 10000);
	
	$('#home-comp').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-2, #v-fade-3, #v-fade-4, #v-fade-5').fadeOut("slow");
			$('#v-fade-1').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-bus, #home-ecomm, #home-enter, #home-down').removeClass('this-seg');
		}
	});
	
	$('#home-bus').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-3, #v-fade-4, #v-fade-5').fadeOut("slow");
			$('#v-fade-2').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-comp, #home-ecomm, #home-enter, #home-down').removeClass('this-seg');
		}
	});
		
	$('#home-ecomm').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-2, #v-fade-4, #v-fade-5').fadeOut("slow");
			$('#v-fade-3').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-comp, #home-bus, #home-enter, #home-down').removeClass('this-seg');
		}
	});
		
	$('#home-enter').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-2, #v-fade-3, #v-fade-5').fadeOut("slow");
			$('#v-fade-4').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-comp, #home-bus, #home-ecomm, #home-down').removeClass('this-seg');
		}
	});
	
	$('#home-down').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-2, #v-fade-3, #v-fade-4').fadeOut("slow");
			$('#v-fade-5').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-comp, #home-bus, #home-ecomm, #home-enter').removeClass('this-seg');
		}
	});
		
});

function checksearchForm() {
	if($("#search input[name='sp_q']").val() == "" || $("#search input[name='sp_q']").val() == "Search our website")
	{
		alert("Please enter a search term!");
	  	return false;
	}
	return true;
}
