function hits(id)
{
for (var i = 1; i <5; i++)
{
if(i==id)
{
document.getElementById("a"+i).className="topcurrenttarges";
document.getElementById("bottoma"+i).className="currentUnderline";
document.getElementById('searchImg1').style.display='none';
var htmlid=document.getElementById('hrefurl');
htmlid.innerHTML='<img src="../images/search_btn.jpg" alt="去搜索" onclick="openurl('+i+')" />';
}
 else
{
document.getElementById("a"+i).className="toptarges";
document.getElementById("bottoma"+i).className="targesUnderline";
}       
}
}
function Clearinfo(divid)
{
document.getElementById(divid).value='';
}
function openurl(num)
{
  var content1=document.getElementById("searchcontent").value;
  if(content1.length>0&&content1.length<8)
  {
      var content=escape(content1);
      switch(num)
      {
        case 1:
        window.open("../Searchcard.aspx?content="+content,"card");
        break;
        case 2:
        window.open("../SearchProduct.aspx?content="+content,"Product");
        break;
        case 3:
        window.open("../SearchInformation.aspx?content="+content,"Information");
        break;
        case 4:
        window.open("../SearchMember.aspx?content="+content,"Member");
        break;
        default:
        window.open("Error.html","error");
        break;  
      }
  }
  else
  {
      window.alert('Sorry,Error.......');
  }
}
function jsopen(url)
{
  window.open(url,"opencard");
}

//导航按钮背景颜色
function menucurrent(menunum) {
    for (var i = 0; i < 11; i++) {
        if (i == menunum) {
            //alert('topmenu' + menunum);
            var topid = 'topmenu' + menunum;
            document.getElementById(topid).className= 'currentmenu';
        }
    }
}
/**   
 *    
 * @param {} sURL 收藏链接地址   
 * @param {} sTitle 收藏标题 
 */   
function AddFavorite(sURL, sTitle) {   
    try {   
        window.external.addFavorite(sURL, sTitle);   
    } catch (e) {   
        try {   
            window.sidebar.addPanel(sTitle, sURL, "");   
        } catch (e) {   
            alert("加入收藏失败，请使用Ctrl+D进行添加");   
        }   
    }   
}   
/**   
 *    
 * @param {} obj 当前对象，一般是使用this引用。   
 * @param {} vrl 主页URL   
 */   
function SetHome(obj, vrl) {   
    try {   
        obj.style.behavior = 'url(#default#homepage)';   
        obj.setHomePage(vrl);   
    } catch (e) {   
        if (window.netscape) {   
            try {   
                netscape.security.PrivilegeManager   
                        .enablePrivilege("UniversalXPConnect");   
            } catch (e) {   
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入about:config并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");   
            }   
            var prefs = Components.classes['@mozilla.org/preferences-service;1']   
                    .getService(Components.interfaces.nsIPrefBranch);   
            prefs.setCharPref('browser.startup.homepage', vrl);   
        }   
    }   
}   
