
var x = 0;
var p=0; //array pos of slideShow img

function menuShow(){
	menuHide();
	x = $(this).find("#drop").show();
}
function menuHide(){
	if(x) $('#nav').find('#drop').hide();
}

function changeSlide(){ //used onLoad f or rotating main image instead of randomly displaying one non-rotating image
	img = ["images/homepage.jpg","images/sl_piping.jpg","images/sl_fmcbio.jpg","images/sl_seating.jpg"];
	show = document.getElementById('slideShow');
	$(show).fadeOut('4000',function(){
		show.src=img[p];
	});
	$(show).fadeIn('4000');
	p=p+1;
	if(p<img.length)
		timer=setTimeout("changeSlide()",7000);	
	else{
		p=0;
		timer=setTimeout("changeSlide()",7000);
		}
		
}


$(document).ready(function (){
	$('#nav').find('#drop').hide();
	$('#nav').find('.menuItem').bind('mouseover',menuShow);
	$('.menuItem').bind('mouseout',menuHide);
	$('#p-sec').bind('mouseup',menuHide);
});





