// JavaScript Document
jQuery(document).ready(function() { 
	$("li#research").css('margin-top', '-3px');
	$("li#research").children("a").css('height', '24px');
	$("li#research").children("a").unbind();
	//Scrolling Functionality
	$("div#researchWrap").css("overflow", "hidden");
	var currentTab = "contentOverview"; var currentNav = 'rdOverview';
	$("li#rdOverview").children("a").css("background-color", "#484848");
	//Left and Right Arrows
	$("div.arrowRight").children("a").removeClass("noShow");
	//Top Navigation Buttons
	$("div#researchNav").children("ul").children("li").children("a").attr("href", "javascript:void(0);");
	//Overview Button
	$("li#rdOverview").children("a").click(function() { 
		$("div#researchContent").animate({ left: "0px" }, 1000);
		$("div#researchNav").children("ul").children("li").children("a").each(function() {
			$(this).css("background-color", "#a6a6a6");
		});
		currentTab = "contentOverview"; currentNav = 'rdOverview';
		$("li#rdOverview").children("a").css("background-color", "#484848");
		$("div.arrowLeft").children("a").addClass("noShow");
		$("div.arrowRight").children("a").removeClass("noShow");
	});
	//Reverse Engineering Button
	$("li#rdReverse").children("a").click(function() {
		$("div#researchContent").animate({ left: "-712px" }, 1000);
		$("div#researchNav").children("ul").children("li").children("a").each(function() {
			$(this).css("background-color", "#a6a6a6");
		});
		currentTab = "contentReverse"; currentNav = 'rdReverse';
		$("li#rdReverse").children("a").css("background-color", "#484848");
		$("div.arrowLeft").children("a").removeClass("noShow");
		$("div.arrowRight").children("a").removeClass("noShow");
	});
	//Manufacturing Button
	$("li#rdManufacturing").children("a").click(function() {
		$("div#researchContent").animate({ left: "-1424px" }, 1000);
		$("div#researchNav").children("ul").children("li").children("a").each(function() {
			$(this).css("background-color", "#a6a6a6");
		});
		currentTab = "contentManufacturing"; currentNav = 'rdManufacturing';
		$("li#rdManufacturing").children("a").css("background-color", "#484848");
		$("div.arrowLeft").children("a").removeClass("noShow");
		$("div.arrowRight").children("a").addClass("noShow");
	});
	//Right Arrow
	$("div.arrowRight").children("a").click(function() {
		switch(currentTab) {
			case 'contentOverview' :
				$("div#researchContent").animate({ left: "-712px" }, 1000);
				$("div#researchNav").children("ul").children("li").children("a").each(function() {
					$(this).css("background-color", "#a6a6a6");
				});
				currentTab = "contentReverse"; currentNav = 'rdReverse';
				$("li#rdReverse").children("a").css("background-color", "#484848");
				$("div.arrowLeft").children("a").removeClass("noShow");
			break;
			case 'contentReverse' :
				$("div#researchContent").animate({ left: "-1424px" }, 1000);
				$("div#researchNav").children("ul").children("li").children("a").each(function() {
					$(this).css("background-color", "#a6a6a6");
				});
				currentTab = "contentManufacturing"; currentNav = 'rdManufacturing';
				$("li#rdManufacturing").children("a").css("background-color", "#484848");
				$("div.arrowRight").children("a").addClass("noShow");
			break;
		}
		return false;
	});
	//Left Arrow
	$("div.arrowLeft").children("a").click(function() {
		switch(currentTab) {
			case 'contentReverse' :
				$("div#researchContent").animate({ left: "0px" }, 1000);
				$("div#researchNav").children("ul").children("li").children("a").each(function() {
					$(this).css("background-color", "#a6a6a6");
					$("div.arrowLeft").children("a").addClass("noShow");
				});
				currentTab = "contentOverview"; currentNav = 'rdOverview';
				$("li#rdOverview").children("a").css("background-color", "#484848");
			break;
			case 'contentManufacturing' :
				$("div#researchContent").animate({ left: "-712px" }, 1000);
				$("div#researchNav").children("ul").children("li").children("a").each(function() {
					$(this).css("background-color", "#a6a6a6");
				});
				currentTab = "contentReverse"; currentNav = 'rdReverse';
				$("li#rdReverse").children("a").css("background-color", "#484848");
				$("div.arrowRight").children("a").removeClass("noShow");
			break;
		}
		return false;
	});
});