﻿function g(o){return document.getElementById(o);}
                String.prototype.trim = function() {
                 return this.replace(/(^\s*)|(\s*$)/g, "");
                 return this.replace(/[ ]/g,""); 
                }
                function search(){
                    var txtKeyword = g("searchkey");
                    var txtKeywordValue = g("searchkey").value.trim()+"-";
                    if(txtKeywordValue.length==0||txtKeywordValue=="請輸入您要搜尋的關鍵字"){
                        alert("請輸入關鍵字！");
                        txtKeyword.focus();
                        return false;
                    }
                    
                    var searchUrl= g("hiSearchUrl").value;
                    searchUrl= searchUrl.replace("{id1}",txtKeywordValue);
                    searchUrl = encodeURI(encodeURI(searchUrl))
                    location.href=searchUrl;
                    return false;
                }
                function clickLisk(nameLisk){
                    var txtKeyWordTitle=nameLisk.title.trim()+"-";
                    var searchUrl=g("hiSearchUrl").value;
                    searchUrl=searchUrl.replace("{id1}",txtKeyWordTitle);
                    searchUrl=encodeURI(encodeURI(searchUrl));
                    location.href=searchUrl;
                    
                }
