$(function(){
	$('#motorHome').flash({
		src: 'flashs/home.swf?v=0.5',
		width: 1000,
		height: 567,
		wmode: "transparent"
	}, { version: 9 });

	// Menu productos
	$("#products .menu a").click(function(){
		$("#products .item.hide").hide();
		$("#products .menu a").removeClass("alt");
		$($(this).attr("href")).show();
		$(this).addClass("alt");
		return false
	});
	$(".item ul li a").click(function(){
		$(".item ul li ul").hide();
		$(".item ul li a").removeClass("alt");
		$(".item ul li .contact").remove();
		$(this).next().show();
		$(this).addClass("alt");
		$(this).after('<a href="./contact.php?t='+ $(this).parent().parent().prev().text() +'&m='+ $(this).text() +'" title="Contact" class="contact">Contact</a>');
		return false;
	})
	// Cebreado
	$(".item ul > li:even").not(".item li li").addClass("alt");
	// Anchor-based navigation
	var func = {
		carga: function() {
			var anchor = document.location.toString();
			if (anchor.match('#')) {
				var myAnchor = '#' + anchor.split('#')[1];
				$("#products " + myAnchor).show();
			}
			else {
				$("#products #description").show();
			}
		}
	}
	func.carga();
});