$(function () {
    // 幫 #menu li 加上 hover 事件
    $('#topmenu>li').hover(function () {
        //			alert('abc');
        // 先找到 li 中的子選單
        var _this = $(this),
				_subnav = _this.children('ul');

        // 變更目前母選項的背景顏色
        // 同時顯示子選單(如果有的話)
        //_this.css('backgroundColor', '#06c');
        _subnav.css('display', 'inline');
    }, function () {
        // 變更目前母選項的背景顏色
        // 同時隱藏子選單(如果有的話)
        // 也可以把整句拆成上面的寫法
        $(this).css('backgroundColor', '').children('ul').css('display', 'none');
    });

    // 取消超連結的虛線框
    $('a').focus(function () {
        this.blur();
    });

    var $news = $('.BOX ul'),
			scrollHeight = $news.find('li').outerHeight(true),
			scrollSpeed = 600, fadeInSpeed = 600,
			timer, speed = 3000;

    // 用來控制輪播用
    function newsScroll() {
        // 先把 .BOX ul 往下移
        $news.animate({
            top: scrollHeight + 'px'
        }, scrollSpeed, function () {
            // 當 .BOX ul 移動到定點後
            // 先找出最後一個 li
            var $last = $news.find('li:last');
            // 複製一份並先隱藏起來
            // 接著把它加到 .BOX ul 中的第一個項目
            // 最後用淡入的方式顯示, 當顯示完後繼續輪播
            $last.clone().hide().prependTo($news).fadeIn(fadeInSpeed, function () {
                timer = setTimeout(newsScroll, speed);
            });
            // 馬上把 .BOX ul 移到 top 等於 0 的位置
            $news.css('top', 0);
            // 把 $last 移除掉
            $last.remove();
        });
    }

    // 啟動輪播計時器
    timer = setTimeout(newsScroll, speed);

    //變更字型大小
    $('#fontA').click(function () {
        var size = $('#fontA').val();
        //$('#container').css('font-size', size + '%');
        $('#container').css('font-size', '80%');
        //alert("A");
        return false;


    });
    $('#fontAA').click(function () {
        var size = $('#fontA').val();
        //$('#container').css('font-size', size + '%');
        $('#container').css('font-size', '100%');
        //alert("A");
        return false;


    });
    $('#fontAAA').click(function () {
        var size = $('#fontA').val();
        //$('#container').css('font-size', size + '%');
        $('#container').css('font-size', '120%');
        //alert("A");
        return false;


    });

    //醫療團隊	
    $('#doctor').hide();
    $('#d1').click(function () {
        $('#doctor').toggle();
        //if($('#doctor').show()){$('#d4').hide();}
    });
    $('#d3').click(function () {
        $('#d2').toggle();
    });

    //search
    $('#ToSearch').click(function () {
        location.href = 'search.html'
    })
    



});
	// 右上選單連結
	function bor_jyue001() {
	    location.href = 'sitemap.aspx';
	}
	function bor_jyue002() {
	    location.href = 'traffic.aspx';
	}
	function bor_jyue003() {
	    location.href = 'list.aspx?menuID=S0020';
	}
	function bor_jyue004() {
	    location.href = 'index.aspx';
	}
	document.oncontextmenu = function () { return false;}
	document.onselectstart = function () { return false;}
	document.oncontextmenu = function () { return false;}
	
