/*accordion scroll*/
	var direction;
	var scrolltimer;
	
	function verScroll(dir, spd) {
		scrolltimer = null;
		direction = dir;
		totalwidth = 2496;
		visiblewidth = 840;
		tilewidth = totalwidth //- visiblewidth;
		speed = parseInt(spd);
		var x_pos;
		x_pos = $("#divASContainer #contentLayer").position().left;
		if (direction == "right" && x_pos > -tilewidth) {
			$('#contentLayer').css('left', (x_pos - (speed)));
			} else if (direction == "right") {
			$('#contentLayer').css('left', 0);
			}
		if (direction == "left" && x_pos < 0) {
			$('#contentLayer').css('left', (x_pos + (speed)));
			} else if (direction == "left") {
			$('#contentLayer').css('left', -tilewidth);
			}
		scrolltimer = setTimeout("verScroll(direction,speed)", 24);
	}
	
	function scrollStart()
	{
		verScroll('right','1');
	}
	
	function stopScroll() {
		clearTimeout(scrolltimer);
	}

	function startAndStop(dir, spd) {
		clearTimeout(scrolltimer);
		verScroll(dir, spd);
	}
	
$(document).ready(function() {
	
	$("#scrollLeft").mouseover(function() {
		startAndStop('right','15');
		$("#scrollLeft").css('background-position','0px 0px');
	});
	$("#scrollLeft").mouseout(function() {
		startAndStop('right','1');
		$("#scrollLeft").css('background-position','0px -60px');
	});
	$("#scrollRight").mouseover(function() {
		startAndStop('left','15');
		$("#scrollRight").css('background-position','-29px 0px');
	});
	$("#scrollRight").mouseout(function() {
		startAndStop('left','1');
		$("#scrollRight").css('background-position','-29px -60px');
	});
	
	$('#contentLayer').mouseover(function() {
		stopScroll();
	})
	$('#contentLayer').mouseout(function() {
		startAndStop(direction,'1')
	})
	
	scrollStart();
	
});

$(document).ready(function() {

// Accordion Demo #1
	$('#accordion1').accordionza({
		autoPlay: true,
		autoRestartDelay: 400,
		pauseOnHover: true,
		navKey: true,
		slideDelay: 5000,
		slideTrigger: 'mouseover'
	});

});


$(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$(".menu_head").click(function()
    {
		$(this).css({backgroundImage:"url(images/leftarrow2.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	$(this).siblings().css({backgroundImage:"url(images/leftarrow1.png)"});
	});
	//slides the element with class "menu_body" when mouse is over the paragraph
});
