function slide(){
	
	$(".highlighted").animate({ opacity: "0.5",border: "0px", padding: "0" }, 400 );

	$(".holder").animate({ left: "-=180px" }, 800, function(){
		var item = $(".holder a:first").clone()
		$(".holder a:first").remove()
		$(".holder").css("left", "0")
		$(".holder").append(item)
	});

	$("#holder").animate({ left: "-=891px" }, 800, function(){
		var item2 = $("#holder a:first").clone()
		$("#holder a:first").remove()
		$("#holder").css("left", "0")
		$("#holder").append(item2)
	});

	var n = $(".highlighted").next()
	$(".highlighted").removeClass("highlighted")
	n.addClass("highlighted")
	
	$(".highlighted").animate({ opacity: "1", padding: "1px" }, 400, function(){ });

}
function isValidEmail(str) { return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);}
var timeIt;
$(document).ready(function() {
	$(".holder a:not(.highlighted)").animate({opacity: "0.5" }, 400);
	
	$(".nav_product").mouseover(function(){
		$("#products_drop").show()
		clearTimeout(timeIt);
	});
	$("#products_drop").mouseover(function(){
		clearTimeout(timeIt);
	});
	$(".nav_product").mouseout(function(){
		timeIt = setTimeout("hideNav()",500)
	});
	$("#products_drop").mouseout(function(){
		timeIt = setTimeout("hideNav()",500)
	});		
	if(typeof sIFR == "function"){
			sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"/fafers.swf", sWmode: 'transparent', sColor:"#C45723", sLinkColor:"#C45723", sBgColor:"#000000", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"wmode=transparent&textalign=left&offsetTop=0"}));
		};
	
	
	setInterval("slide()",5000)

	$("#email").focus(function(){ 
		if (!$("#email").hasClass("focus")){
			$("#email").addClass("focus");
			$("#email").attr("value","");
		}
	});
	$("#email").blur(function() { 
		if ($("#email").val()==""){
			$("#email").removeClass('focus');
			$("#email").attr("value","Updates Invites & Free Stuff");
		}
	});
	
	$("#submit").click(function(){ 
			if (!isValidEmail($("#email").val())){
				alert("Please enter a valid email address.");
				$("#email").focus()
			}else{
				var email = $("#email").val();
				$("#submit").fadeOut("fast")
				$("#email").readOnly = true;
				$("#email").attr("value","REGISTERING");
							
				$.ajax({
				   type: "GET",
				   url: "email.php?email="+ email,
				success: function(msg){
				     	$("#mailing").html('<span class="thanks">SIT TIGHT, YOU\'RE ON THE LIST!</SPAN>')
				   }
				 });

			}
		});
	
});
function hideNav(){
	$("#products_drop").hide()
}
