
var _c = _h = 0;
$(function(){
    $('#ibanner_btn .index_adv_btn').mouseover(function(){
        var i = $(this).attr('alt') - 1;
        _c = i;
        //play();
        change(i);
        clearInterval(_h);
    //alert(_h);
    })
    $('#ibanner_btn .index_adv_btn').mouseout(function(){
        play();
    })
    $("#ibanner_pic img").hover(function(){
        clearInterval(_h)
    }, function(){
        play()
    });
    play();
})
function play(){
    _h = setInterval("auto()", 3500);
}

function change(i){
    //alert($('#ibanner_btn li').eq(i).attr("alt"));
    $('#ibanner_btn .index_adv_btn').each(function(){
        $(this).children("span").eq(0).attr("class", "in_s1");
    });
    $('#ibanner_btn .index_adv_btn').eq(i).children("span").eq(0).attr('class', 'in_s1 in_fonts').blur();
    $("#ibanner_pic img").hide().eq(i).fadeIn('slow');
    $("#index_adv_word").html($('#ibanner_btn .index_adv_btn').eq(i).children("span").eq(0).attr("title"));
}

function auto(){
    _c = _c > 2 ? 0 : _c + 1;
    change(_c);
}

$("document").ready(function(){
    $('#expert_one').qtip({
        content: {
            url: '/expert_one.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    $('#expert_two').qtip({
        content: {
            url: '/expert_two.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    $('#expert_three').qtip({
        content: {
            url: '/expert_three.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    $('#expert_four').qtip({
        content: {
            url: '/expert_four.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    $('#expert_five').qtip({
        content: {
            url: '/expert_five.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    $('#expert_six').qtip({
        content: {
            url: '/expert_six.html'
        },
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            width: 400,
            border: {
                width: 1,
                radius: 2
            },
            tip: true,
            padding: 5,
            textAlign: 'left',
            name: 'light' // Style it according to the preset 'cream' style
        }
    });
    showNews();
    showFeed();
    showNewrelease();
    showNewupdate();
});

function showNewrelease(){
    $.post(
        "ajax/shownewrelease",
        {

        },
        function (flag){
            $("#NewRelease").next().hide();
            $("#NewRelease").html(flag);
            $("#NewRelease").show();
        },
        "html"
        );
}

function showNewupdate(){
    $.post(
        "ajax/shownewupdate",
        {

        },
        function (flag){
            $("#NewUpdate").next().hide();
            $("#NewUpdate").html(flag);
            $("#NewUpdate").show();
        },
        "html"
        );
}
