﻿//window.onerror = function(){return true}
//搜索
function Go_Search()
{
    var key = document.getElementById("key");
    if(key.value=="快速搜索..." || key.value=="")
    {
        alert("请输入关键字！");
        key.focus();
        return false;
    }
    
    return true;
}
//加入收藏
function addFavorite(url,title)
{
    if (document.all)
    {
       window.external.addFavorite(url,title);
    }
    else if (window.sidebar)
    {
       window.sidebar.addPanel(title, url, "");
    }
}
//设为首页
function setHomepage(url)
{
  if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(url); 
    }
    else if (window.sidebar)
    {
        if(window.netscape)
        {
            try
            { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }  
            catch (e)  
            { alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); }
        } 
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',url);
    }
}

//静态类开始
var Menu={}

Menu.elem  = null;
Menu.leng  = 0;
Menu.wuca  = [0,5,13,23,29]; //偏移
Menu.left  = 10;
Menu.index = 0;
Menu.delay = null;
Menu.link  = ['|<a href="/who-we-are/">关于我们</a>|<a href="/who-we-are/cultule.html">企业文化</a>|<a href="/who-we-are/team.html">精品团队</a>|<a href="/who-we-are/join-us.html">加入我们</a>','|<a href="/what-we-do/" class="td_top_other">网站全程策划、设计、制作</a>|<a href="/what-we-do/internet-marketing.html">网络营销推广</a>|<a href="/what-we-do/web-site-hosting-and-maintenance-of-the-whole.html">网站整体托管及维护</a>|<a href="/what-we-do/health-care-consulting-and-training.html">医疗咨询培训</a>|<a href="/what-we-do/network-consulting-platform.html">商务通网络咨询平台</a>','','|<a href="/what-we-have-done/">案例展示</a>|<a href="/what-we-have-done/case.html">参考网站</a>','|<a href="/our-advantages/#a">专注医疗行业</a>|<a href="/our-advantages/#b">成果展示</a>|<a href="/our-advantages/#c">网站建设和托管</a>|<a href="/our-advantages/#d">网络营销策略与技巧</a>|<a href="/our-advantages/#e">咨询医疗团队组建和培训</a>'];

Menu.Init = function(i){
    Menu.elem  = $("#menu li");
    Menu.leng  = Menu.elem.size();
    Menu.index = i;
    Menu.doover(); 
    Menu.elem.hover(function(){
        if(null!=Menu.delay) clearTimeout(Menu.delay);
        Menu.index = Menu.leng - $(this).nextAll().size() - 1;
        Menu.doover();
    },function(){
        $("#top_nav").hover(function(){},function(){ Menu.index = i;Menu.delay = setTimeout("Menu.doover()",2000);});
    });
};

Menu.doover = function(){
    for(var i=0;i<Menu.leng;i++)
    {
        if(i==Menu.index)
        {
            var offsie = Menu.wuca[i] + 131*i;
            $("#img").animate({left: (Menu.left + offsie) + "px"}, "fast");
            Menu.elem.eq(i).children().addClass("h_nav_tab");
            $("#top_nav").html(Menu.link[i]);
        }
        else
        {
            Menu.elem.eq(i).children().removeClass("h_nav_tab");
        }
    }
};
//静态类结束

document.write('<div style="width:1003px;margin:0 auto;position:relative;z-index:999;"><div id="floatChat" style="width:24px;height:113px;position:absolute;top:186px;right:0px;"><a href="http://lr.zoosnet.net/LR/Chatpre.aspx?id=LEF64432974" target="_blank"><img src="/images/online/online.png" alt="向我咨询"/></a></div></div>');

lastScrollYChat=0;
function floatDiv(){
	var diffY;
	if (document.documentElement && document.documentElement.scrollTop)
		diffY = document.documentElement.scrollTop;
	else if (document.body)
		diffY = document.body.scrollTop
	else{/*Netscape stuff*/}
		
	percent=.1*(diffY-lastScrollYChat); 
	if(percent>0)percent=Math.ceil(percent); 
	else percent=Math.floor(percent);
	document.getElementById("floatChat").style.top=parseInt(document.getElementById("floatChat").style.top)+percent+"px";
	lastScrollYChat+=percent;
}
setTimeout(function(){window.setInterval("floatDiv()",1);}, 1000);