﻿/// <reference path="../js/jq/jquery-1.2.6-vsdoc-cn.js"/>
$(document).ready(function() {
    var isajax = false; ;
    $('#home_member a').hover(function() {
        $('#home_member a').removeClass("current");
        $(this).addClass("current");
        var c = $(this).attr("c");
        var div = $('#' + c);
        var isload = false;
        if (div.text() == "") {
            div.html('<img src="images/ajax/ajax-loader.gif" />正在加载');
            isload = true;
        }
        $('#divMemberWrap div.content').stop().css("height", "110px").css("opacity", "0%").css('display', 'none');
        div.css("opacity", "10%").css("display", "block").css('height', '110px');
        div.animate({ height: "194px", opacity: "100%" }, 300, function() { });
        //加载内容
        if (!isload) return;
        isajax = true;
        if (c == "myaccount") {
            div.load("/Customer/AjaxHandler/HomeAccountInfo.aspx", { "ddd": "aaa" }, function() { });
        }
        if (c == "myorders") {
            div.load("/Customer/AjaxHandler/HomeMyOrders.aspx", { "ddd": "aaa" }, function() { });
        }
        if (c == "myservice") { }
        isajax = false;

    }, function() { });
    //$('#divMemberWrap div.content').css("display", "none").css("height", "110px").fadeOut(0);
    //$('#home_member').ajaxStart(function() { if (isajax) { $('#home_member_loading').css('display', 'block'); } });
    //$('#home_member').ajaxComplete(function() { $('#home_member_loading').css('display', 'none'); });
    $('#home_member').ajaxError(function(event, request, settings) { if (isajax) { isajax = false; alert('加载用户信息出错'); $(this).hide(); } });

    //hide Menu
    $('#divMemberWrap').hover(
    function() {
    },
    function() {
        $('#divMemberWrap div.content').stop().css("height", "110px").animate({ 'opacity': '0%' }, 300, function() { $(this).css('display', 'none'); }); ; //.css("opacity", "0%");
        $('#home_member a').removeClass("current");

    });
});
function AutoScroll(obj) {
    $(obj).find("ul:first").animate({
        marginTop: "-25px"
    }, 500, function() {
        $(this).css({ marginTop: "0px" }).find("li:first").appendTo(this);
    });
}
$(document).ready(function() {
    setInterval('AutoScroll("#scrollDiv")', 2000)
});


$(document).ready(function() {
    var alist = $('#smallpiclist a');
    $('#smallpiclist a').hover(function() {
        $('#smallpiclist a').removeClass('current');
        $(this).addClass('current');
        var index = alist.index($(this)); //index指向当前
        for (var i = 0; i <= 4; i++) {
            $('#sale_content_' + i).hide();
        }
        $('#sale_content_' + index).show();

    }, function() { });
});


$(function() {
    var marrylist = $('#marrynav a');
    $('#marrynav a').hover(function() {
        $('#marrynav a').removeClass('current');
        $(this).addClass('current');
        var index = marrylist.index($(this)); //index指向当前
        for (var i = 0; i <= 3; i++) {
            $('#marry_content_' + i).hide();
        }
        $('#marry_content_' + index).show();

    }, function() { });
});
$(function() {
    var silverlist = $('#silver a');
    $('#silver a').hover(function() {
        $('#silver a').removeClass();

        var index = silverlist.index($(this)); //index指向当前
        if (index == 0) {
            $(this).addClass('left');
        }
        else if (index == 3) {
            $(this).addClass('right');
        }
        else {
            $(this).addClass('current');
        }
        for (var i = 0; i <= 3; i++) {
            $('#silver_content_' + i).hide();
        }
        $('#silver_content_' + index).show();

    }, function() { });
});

function linkkind(i) {
    var count = 4;
    for (var n = 0; n < count; n++) {
        if (n == i) {
            document.getElementById("bd_tit" + n).className = "li-2";
            document.getElementById("bd_txt" + n).style.display = "";
        }
        else {
            document.getElementById("bd_tit" + n).className = "li-1";
            document.getElementById("bd_txt" + n).style.display = "none";
        }
    }
}