﻿var lloc = "";

        $(document).ready(function() {

            var type = GetUrlParameter("type");

            if (type == "main.aspx" || type == null || type=="" || type==undefined) {
                document.getElementById("li-sy").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "news.aspx") {
                document.getElementById("top1").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "facilities.aspx") {
                document.getElementById("top2").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "products.aspx") {
                document.getElementById("top3").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "commonDown.aspx" || type == "downLogin.aspx" || type == "downl.aspx") {
                document.getElementById("top4").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "services.html") {
                document.getElementById("top5").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
            else if (type == "system.aspx") {
                document.getElementById("top6").style.backgroundImage = "url(../img/midbutton_over.png)";
            }
        });
	

        // initialise plugins
        jQuery(function() {
            jQuery('ul.sf-menu').superfish();
        });
		
		
		function setURL(type) {
        location.href = ("index.aspx?" + type);
        if (type == "") {
            location.href = ("index.aspx");
        }

    };

    function search() {

        var q = document.getElementById("sd").value;
        window.open("http://www.google.com/search?q=" + q + "&as_sitesearch=zhftc.com");
    };
    
    function GetUrlParameter(paramName)
        {
            var returnVal="";
            try{
                var paramUrl=window.location.search;
                //处理长度
                if(paramUrl.length>0){
                    paramUrl=paramUrl.substring(1,paramUrl.length);
                    var paramUrlArray=paramUrl.split("&");
                    for(var i=0;i<paramUrlArray.length;i++){
                        if(paramUrlArray[i].toLowerCase().indexOf(paramName.toLowerCase())!=-1){
                            var temp=paramUrlArray[i].split("=");
                            if(temp[0].toLowerCase()==paramName.toLowerCase()){
                                returnVal=temp[1];
                                break;
                            }
                        }
                    }
                }
            }
            catch(e){}
            return returnVal;
        };

        function setIF() {
            var type = GetUrlParameter("type");
            
            if (GetUrlParameter("id") != "") {
                document.getElementById("mainframe").src = type + "?id=" + GetUrlParameter("id");
            } else {
            document.getElementById("mainframe").src = type;
            }
            if (type == "") {
                document.getElementById("mainframe").src = "main.aspx";
            }
            

        };
