//NewsPaper Slide Show
<!--
//variable that will increment through the images
var step=1;
var currentPos=1;
var url = location.href;
var urlId=(url.charAt(url.length-1));
var contentLoaded=0;


	
function alertMessage()
{
	alert("message");
};

function startNewsHeadlines(){
	
if (step<25)
step++
else
step=1

$("#newsSlider").attr("src", "images/newsPaperHeadlines/headline"+step+".jpg");

//call function "slideit()" every 7 seconds
var paperTimer=setTimeout("startNewsHeadlines()",5000);
};

$("#newsSlider").click(function(){
	startNewsHeadlines();	
	});
//-->

function loadOtherContent()
{	
 $("#sliderContentOne").load("aboutUs.html");	
 $("#sliderContentThree").load("products.html");
 $("#sliderContentFour").load("contact.html");	
 clearTimeout(loadingContentTimer);
 loadingContentTimer=null;
};

function loadOtherContentTimer(){var loadingContentTimer=setTimeout("loadOtherContent()",300);};



$(document).ready(function(){//*****************************************

loadOtherContentTimer();	

startNewsHeadlines();

// ALERT

//function(){ alert("all done");


	
//Causes content to Load on click. ajax

/*
$("#DivThatYouClick").click(function(){  
  $("#DivToLoadInTo").load("FileToLoad.html")
 });
*/
	
$("#sendFeedback").click(function(){  
  $("#body").load("feedback.php")
 });	


  
//****** Start slides the main contents**********************************
   	$("#posZero").click(function()
{
  $( "#slider" ).animate({"left": "900px"}, "slow", 
  function(){$("#homeContent").show().animate({"opacity": "1"}, "slow"); });
 
});
	
	
//one	
	$("#posOne").click(function()
{
	currentPos=1;
	if (($("#homeContent").css("opacity")) > 0)
	{
		$("#homeContent").animate({"opacity": "0"}, "fast",
		
		function()
		{ 	
			$('#homeContent').hide()
  			$("#slider").animate({"left": "0px"}, "slow") 
		}
	)}
	else
	{
		$("#slider").animate({"left": "0px"}, "slow");
    	//Ajax for AGProducts.html
	}
});


if(urlId==1)
{
	currentPos=1;
$("#homeContent").hide()
$("#slider").animate({"left": "0px"},(0));
};
		

//two	
$("#posTwo").click(function(){
		currentPos=2;
		if (($("#homeContent").css("opacity")) > 0){
	$("#homeContent").animate({"opacity": "0"}, "fast",
	 function(){  $('#homeContent').hide()
  	$("#slider").animate({"left": "-900px"}, "slow")  })
	}
	else{
		$("#slider").animate({"left": "-900px"}, "slow");
    //Ajax for AGProducts.html
	}
});
	
if(urlId==2)
{
	currentPos=2;
$("#homeContent").hide()
$("#slider").animate({"left": "-900px"},(0));
};
	
//three	
$("#posThree").click(function(){
		currentPos=3;	
	if (($("#homeContent").css("opacity")) > 0){
	$("#homeContent").animate({"opacity": "0"}, "fast", 
	function(){  $('#homeContent').hide()
  	$("#slider").animate({"left": "-1800px"}, "slow")  })
	}
	else{
		$("#slider").animate({"left": "-1800px"}, "slow");
    }
});
	
if(urlId==3)
{
	currentPos=3;
$("#homeContent").hide()
$("#slider").animate({"left": "-1800px"},(0));
};

//four	
$("#posFour").click(function(){
		currentPos=4;
	if (($("#homeContent").css("opacity")) > 0){
	$("#homeContent").animate({"opacity": "0"}, "fast",
	 function(){  $('#homeContent').hide()
  	$("#slider").animate({"left": "-2700px"}, "slow")  })
	}
	else{
		$("#slider").animate({"left": "-2700px"}, "slow");
    }
});
	
if(urlId==4)
{
	currentPos=4;
$("#homeContent").hide()
$("#slider").animate({"left": "-2700px"},(0));
};

//five	
	function redirectStore(){
		
	//$("#posFive").click(function(){
	if (($("#homeContent").css("opacity")) > 0)
	{
	$("#homeContent").animate({"opacity": "0"}, "fast",
	 function(){  $('#homeContent').hide()
  	$("#slider").animate({"left": "-3600px"}, "slow")  })
	}
	else
	{
		$("#slider").animate({"left": "-3600px"}, "slow");
    }
	
	$("#sliderContentFive").hide();
	//});

	window.location = this;
	return false;	
};
//****** end slides the main contents*************************************	
	
	
//**slides button selector to the currently selected button***************
	$("#posZero").click(function(){
  	$("#buttonSlider").animate({"left": "0px"}, "slow");
	});
	if(urlId==0){$("#buttonSlider").animate({"left": "0px"}, (0));};
	
	$("#posOne").click(function(){
  	$("#buttonSlider").animate({"left": "180px"}, "slow");
	});
	if(urlId==1){$("#buttonSlider").animate({"left": "180px"}, (0));};
	
	/*$("#posTwo").click(function(){
  	$("#buttonSlider").animate({"left": "300px"},"slow")
	});
	if(urlId==2){$("#buttonSlider").animate({"left": "300px"}, (0));};*/
	
	$("#posThree").click(function(){
  	$("#buttonSlider").animate({"left": "360px"}, "slow");
	});
	if(urlId==3){$("#buttonSlider").animate({"left": "360px"}, (0));};
	
	$("#posFour").click(function(){
  	$("#buttonSlider").animate({"left": "540px"}, "slow");
	});
	if(urlId==4){$("#buttonSlider").animate({"left": "540px"}, (0));};
	
	$("#posFive").click(function(){
  	$("#buttonSlider").animate({"left": "720px"}, "slow");
	});
	if(urlId==5){$("#buttonSlider").animate({"left": "720px"}, (0));};
	
});//end of document.ready*************************************************	

