﻿function  addFav() {   //加入收藏夹   
           try
    {
        window.external.addFavorite("'http://www.fzlsdz.com'", "佛子岭水库管理处");
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel("佛子岭水库管理处", "http://www.fzlsdz.com", "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
        }   
function SetHome(obj){   //设置首页
    try{   
        obj.style.behavior='url(#default#homepage)';   
        obj.setHomePage('http://www.fzlsdz.com');   
    }catch(e){   
        if(window.netscape){   
            try{   
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
            }catch(e){   
                alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");   
            };   
        }else{   
            alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'http://www.fzlsdz.com'设置为首页。");   
        };   
    };   
};   

                  
                //切换菜单
		function change(container,eventSource)
		{
		    	var menu=container;
			for(i = 0;i<menu.childNodes.length;i++)
			{
			        var childNode=menu.childNodes[i];
				if(eventSource.getAttribute("id")!=childNode.getAttribute("id"))
				{
					childNode.className="nonChecked";
				};
				else
				{
					eventSource.className="checked";
				};


                          			 
			};
                        copyTitle(eventSource,"title");
                        showSiteMap(eventSource,"mySiteMap");
                        window.parent.frames['main'].location.href=eventSource.getAttribute("remark");
                        

			
		};



//获取类型
		function getQueryString()
		{
		    queryString = window.document.URL;
		    var reStr = "no";
			if(queryString.indexOf("?")>0)
			{
				var qTemp=queryString.split("?");
				var qTemp_1=qTemp[1].split("&");
				var qTemp_2 = qTemp_1[0].split("=");
				reStr = qTemp_2[1];
			}
			return reStr;
		}

		//界面初始化
		function ini(container) {
		   
		    var type = getQueryString();
		    if (type != "no") {
		        change(container, document.getElementById(type));
		    };
		    else {
                                                 change(container, container.childNodes[0]);
		    };
		};

              function copyTitle(eventSource,target)
		{ 
                      document.getElementById("title").innerText=eventSource.innerText;
		}


//富文本编辑器脚本

