//DISJOINTED ROLLOVERS USING BUTTON NAVIGATION AND IMAGES FADING IN AND OUT


$(document).ready(function(){
startclass="stocks";

//disjointed rollover function starting point
$("div#button li").hover(function(){
	
	//make a variable and assign the hovered class to it
	var elclass = $(this).attr('class');
    		startclass=elclass;
	//hide the image currently there
		$("div#images div").hide();
	//fade in the image with the same id as the selected buttom
	$("div#images div#" + elclass + "").show();

	var y=["services","stocks","imprinting","phenotyping"];
	for (x in y)
	{
		
		if(y[x]==elclass)
		{

			$("." + y[x] + "").css("background","url(/img/" + y[x] + "_over.jpg) no-repeat");	
		}
		else
		{
			
			$("." + y[x] + "").css("background","url(/img/" + y[x] + "_up.jpg) no-repeat");
		}
	}
	


	},function(){
		

		
		
		
	}	);
	

function stocks()	{
	if(startclass=="phenotyping"){
$(".stocks").trigger('mouseover');
}
setTimeout (services, 7000 );	
}
function services()	{
		if(startclass=="stocks"){
$(".services").trigger('mouseover');
}
setTimeout (imprinting, 7000 );	
}
function imprinting()	{
		if(startclass=="services"){
$(".imprinting").trigger('mouseover');
}
setTimeout (phenotyping, 7000 );	
}
function phenotyping()	{
		if(startclass=="imprinting"){
$(".phenotyping").trigger('mouseover');
}
setTimeout (stocks, 7000 );	
}
setTimeout (services, 7000 );	
//setTimeout ("$(\".services\").trigger('mouseover')", 5000 );


		
		

});







