﻿$(document).ready(function() {
    $('.mouseover .body>ul>li:first-child').addClass("current");
    $('.mouseover li').mouseover(function() {
        $(this).parent().find('.current').removeClass("current");
        //$('.mouseover .current').removeClass("current");
        $(this).addClass("current");
    });
    eTime = new Date($('#info #timer').attr('title'));
    if (!isNaN(eTime)) {
        interval = window.setInterval('Timer(eTime)', 1000);
    }
    $.get('/ProductProcess.ashx?id='+$('#hdnProductId').val()+'&referrer='+$('#referrer').val());
    $('#popLogin').jqm({modal: true,trigger:'a.review',ajax:'/PostReview.aspx?t='+Math.random(),onLoad: function(h){$('#imgVCode').attr('src', '/v.aspx?t='+Math.random());},onHide: function(h) {
        if(h.w) h.w.hide();
        if(h.o) h.o.remove();        
        if(typeof(isLogin) != 'undefined' && isLogin){
            $('#popLogin').jqmShow();
        }
    }});
});
function Timer(eTime) {
    var time = TimeSpan(eTime);
    if (time.t > 0) {
        $('#info #timer').html('促销结束时间：' + time.d + ' <span style="color:#404040">天</span> ' + time.h + ' <span style="color:#404040">小时</span> ' + time.m + ' <span style="color:#404040">分</span> ' + time.s + ' <span style="color:#404040">秒</span>');
    }
    else {
        $('#info #timer').html('促销结束时间：0 <span style="color:#404040">天</span> 0 <span style="color:#404040">小时</span> 0 <span style="color:#404040">分</span> 0 <span style="color:#404040">秒</span>');
        clearInterval(interval);
    }
}
