// JavaScript Document

var $j = jQuery.noConflict();

$j(document).ready(function () {
	
	var archiveOpen = false;
	
	$j(".honda a[rel*='lightbox[newproducts]']").lightBox();
	$j(".honda a[rel*='lightbox[oldproducts]']").lightBox();
	
	$j("a.archiveBtn.2009").click(function () {
		$j("td.archive.2009").fadeIn();
		$j("tr td.archiveBtn.2009").css("paddingBottom", 20);
		$j("tr td.archiveBtn.2009").css("borderBottom", "#999 1px dashed");
		$j("a.hideArchive.2009").show();
		
		return false;
	});
	
	$j("a.hideArchive.2009").click(function () {
		$j("td.archive.2009").fadeOut(function () {
			$j("td.archiveBtn.2009").css("paddingBottom", 0);
			$j("td.archiveBtn.2009").css("borderBottom", "none");
		});
		$j(this).hide();
		
		return false;
	});
	
	$j("a.archiveImgBtn").click(function () {
		var year = $j(this).attr("id");
		var row = "tr.old."+year;
		
		if (!archiveOpen) {
			$j(row).fadeIn();
			archiveOpen = year;
			$j("div.closeImgArchive").fadeIn();
		} else if (archiveOpen == year) {
			row = "tr.old."+archiveOpen;
			$j(row).fadeOut();
			archiveOpen = false;
			$j("div.closeImgArchive").fadeOut();
		} else {
			row = "tr.old."+archiveOpen;
			$j(row).fadeOut();
			row = "tr.old."+year;
			$j(row).fadeIn();
			archiveOpen = year;
			$j("div.closeImgArchive").fadeIn();
		}
		
		return false;
	});
	
	$j("a.closeImgArchive").click(function () {
		var row = "tr.old."+archiveOpen;
		$j(row).fadeOut();
		archiveOpen = false;
		$j(this).parent("div").fadeOut();
		
		return false;
	});
	
	$j("td.archiveBtn").parent().prev("tr").children("td").css("paddingBottom", 20);
	
	$j("a[href='#']").click(function () {
		return false;
	});
});