/*普通页面用*/
function ShowHideDIV(divID, displayStatus) {
    document.getElementById(divID).style.display = displayStatus;
}



function addRows(val, curRows, controlName) {
    var currentRow = $(controlName).attr("Rows");
    var modifyRow = currentRow;
    if (val == 1)
        modifyRow = parseInt(currentRow) + 2;
    else {
        if (currentRow > curRows)
            modifyRow = modifyRow = parseInt(currentRow) - 2;
    }
    $(controlName).attr("Rows", modifyRow.toString());
}

$(function () {


    var originalFontSize = $('body').css('font-size');
    // Increase Font Size
    $(".increaseFont").click(function () {
        var currentFontSize = $('body').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var largestFontSize = 16;

        if (currentFontSizeNum < largestFontSize) {
            var newFontSize = Math.floor(currentFontSizeNum + 2);
            $('.text').css('font-size', newFontSize);
        }

        else {
            $('.text').css('font-size', largestFontSize);
        }
        return false;
    });
    // Decrease Font Size
    $(".decreaseFont").click(function () {
        var currentFontSize = $('body').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var smallFontSize = 12;

        if (currentFontSizeNum > smallFontSize) {
            var newFontSize = Math.floor(currentFontSizeNum - 2);
            $('.text').css('font-size', newFontSize);
        }

        else {
            $('.text').css('font-size', smallFontSize);
        }
        return false;
    });


    function onBefore() {
        $('#pic_news_text').html('<h2>' + $(this).children()[0].alt + '</h2>').hide().show();
    };

    $.fn.cycle.updateActivePagerLink = function (pager, currSlideIndex) {
        $(pager).find('li').removeClass('active_slide').filter('li:eq(' + currSlideIndex + ')').addClass('active_slide');
    };
    $('.pic_news_pics').cycle({
        fx: 'fade',
        delay: 2000,
        speed: 3000,
        before: onBefore,
        pager: '#pic_news_nav',
        pagerAnchorBuilder: function (idx, slide) {
            return '#pic_news_nav li:eq(' + idx + ') a';
        }
    });

    $(".icon_down").toggle(
			function () {
			    $(".listmore01").show('slow');
			    $(".list01").addClass('imgbg');
			    $(this).addClass('icon_top');
			},
			function () {
			    $(".listmore01").hide('slow');
			    $(".list01").removeClass('imgbg');
			    $(this).removeClass('icon_top');
			}
		);

    $(".close").click(
			function () {
			    $("#region").slideToggle("slow");
			});

    $(".choose_city").click(
			function () {
			    $("#region").slideToggle("slow");
			});

    $("#divKF").bind("mouseleave", (
            function () {
                if (!$("#divKF").is(":animated")) {
                    $("#divKF").animate({
                        left: "-200px"
                    }, 500);
                }
            }));
    $(".kfimg").mouseover(
            function () {
                $("#divKF").animate({
                    left: "0px"
                }, 500);

            });


    $("#imgPlus").click(function () {
        $("#region").slideToggle("slow");
        var rows = $("#InvestXMYQ").attr("Rows") + 2;
        $("#<%=InvestXMYQ.ClientID%>").attr("Rows", 10);
    });

    $("#imgMinus").click(function () {
        $("#region").slideToggle("slow");
        var rows = $("#<%=InvestXMYQ.ClientID%>").attr("Rows") - 2;
        if (rows > 3) {
            $("#<%=InvestXMYQ.ClientID%>").attr("Rows", rows);
        }
    });

////////    $('#home_tab01,#space,#home_tab02,#MyTabs,#SysLetterTabs').tabs();
    $('#space,#MyTabs,#SysLetterTabs').tabs();
    $(".list li:odd,.my_list li:odd,.Loan_list li:odd").addClass("yellow");
////////    $("#home_tab02 a,#home_tab01 a,#space a,#MyTabs a,#pic_news_nav a,#SysLetterTabs a").focus(function () { this.blur() });
    $("#space a,#MyTabs a,#pic_news_nav a,#SysLetterTabs a").focus(function () { this.blur() });
    $(".list li,.my_list li,.Loan_list li").hover(function () { $(this).addClass('gold'); }, function () { $(this).removeClass('gold'); });
    $(".features li").mouseover(function () { $(this).addClass('over'); });
    $(".features li").mouseout(function () { $(this).removeClass('over'); });
	$(".mt-nav>li:gt(0)").mouseover(function () { $(this).addClass('mh_over'); } );
	$(".mt-nav>li:gt(0)").mouseout(function () { $(this).removeClass('mh_over'); } );
    $(".experts_box").mouseover(function () { $(this).addClass('gold'); });
    $(".experts_box").mouseout(function () { $(this).removeClass('gold'); });
    $(".page a").mouseover(function () { $(this).addClass('over'); });
    $(".page a").mouseout(function () { $(this).removeClass('over'); });
    $(".release").mouseover(function () { this.className = 'release_over'; });
    $(".release").mouseout(function () { this.className = 'release'; });
    $(".freeAD").mouseover(function () { this.className = 'freeAD_over'; });
    $(".freeAD").mouseout(function () { this.className = 'freeAD'; });
    $(".search_btn").mouseover(function () { this.className = 'search_btn_over'; });
    $(".search_btn").mouseout(function () { this.className = 'search_btn'; });
    $(".search input").blur(function () { this.className = 'input_blur'; });
    $(".search input").focus(function () { this.className = 'input_focus'; });
    $(".input100,.input60,.input110,.input160,.input290,.input310,.input260,.textarea400,.textarea290,.textbox_187,.textbox_160,.input292_multi,.input500_multi,.input292_multi1,.input312_multi,.input280").blur(function () { $(this).removeClass('white'); });
    $(".input100,.input60,.input110,.input160,.input290,.input310,.input260,.textarea400,.textarea290,.textbox_187,.textbox_160,.input292_multi,.input500_multi,.input292_multi1,.input312_multi,.input280").focus(function () { $(this).addClass('white'); });


});

