
//Time Remaining - count down
var countdown = 1800;
var time_remain_speed = 1000;
var featured_product_speed = 10000;
var cycleFlag = false;
//time_remaining_interval_object = setInterval(function(){_update_time_remaining(countdown);}, time_remain_speed);
//featured_product_interval_object = setInterval(function(){_check_featured_product_interval_object();}, featured_product_speed);

function _update_time_remaining(seconds){
    if(countdown > 1 || cycleFlag == 1){
        var display = $("#time-remaining");
        display.text(seconds);
        countdown = countdown - 1;   
    }else{
        clearInterval(time_remaining_interval_object);
    }
}

function _check_featured_product_interval_object(){
    if(countdown > 1 || cycleFlag == 1){
        var display = $("#featured-product-check");
        display.append("featured product check @ "+countdown+"<br />");
    }else{
        clearInterval(featured_product_interval_object);
    }
}

$(document).ready(function() {
	var parrowmargin = 8;
	$(".product-thumbs li").hover(
	     function () {
			var newmargin;
			newmargin = (($(this).prevAll().length)*117);
			var speed = Math.abs(newmargin - parrowmargin); 
			$("#pbottom-arrow").animate({ 
		        marginLeft: newmargin,
		        }, speed);
			parrowmargin = newmargin;
	     }
	   );
	$(".pt").click(function() {
		var newsrc =  $(this).attr("src").replace(/T/,"F");
		$("#main-product-pic").attr("src",newsrc) ;
		
	});
	$(".user-input").focus(function(){
			$(".input-info").hide();
			$(this).parents("tr").find(".input-info").show();
		} );
});



