// JavaScript Document
//menu drop down

	$(".mainMenuItem").children(".subMenu").css({

		'display' : 'none',

		'opacity' : 0

	});

	

	$(".mainMenuItem").hover(

		

		function() {

						

			var image = $(this).find("a img")[0];

			image.src = image.src.replace("_off", "_hover");

			image.src = image.src.replace("_on", "_hover");





			var $subMenu = $(this).children(".subMenu");

			$subMenu.css('display', 'block');





			if ($(this).data("isPlaying")) {

				$subMenu.stop();

			}

			else {

				$(this).data("isPlaying", true);

			}			

					

			$subMenu.animate(

				{opacity: 1}, 

				{queue:false,

				 duration:300}

			);

	



		},

		

		function() {



			var image = $(this).find("a img")[0];

			if ($(image).hasClass("activeMenu")) {

				

				image.src = image.src.replace('_hover', '_on');

			}

				image.src = image.src.replace("_hover", "_off");



			

			var $subMenu = $(this).children(".subMenu");

			

			$subMenu.stop();

			$subMenu.animate(

				{opacity: 0}, 

				{queue:false, 

				 duration:300,

				 complete: function(){

				 	$(this).css('display', 'none');

				 }

				}

			);



		}

	);

