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);
                 }
        }
}


function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}



function addToFavoriate(title, url)
{
  if (window.sidebar)
  {
    window.sidebar.addPanel(title, url, '');
  }
  else if (window.external)
  {
    window.external.AddFavorite(url, title);
  }
  else
  {
    alert('sorry, can not add to bookmark.');
  }
}

function copy(inElement)
{
	alert('已经成功复制以下内容到剪贴板，你可以通过Ctrl+V粘贴到QQ/MSN/论坛签名档：\n\n'+inElement.innerHTML);
  if (inElement.createTextRange)
  {
    var range = inElement.createTextRange();
    if(range)
    {
    	range.execCommand('Copy');
    }
  }
  else
  {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier))
    {
	    var divholder = document.createElement('div');
	    divholder.id = flashcopier;
	    document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
  	var divinfo = '<embed src="/flashs/clipboard.swf" flashvars="clipboard='+inElement.value+'" width="0" height="0" type="application/x-shockwave-flash"/>';
  	document.getElementById(flashcopier).innerHTML = divinfo;
  }
}



	function chksearch() {
		var q = document.getElementById("q").value;	

		if(q == "") {
			alert('请填写搜索关键字');
			return false;

		}else{
			//alert(q);
			var url, bid;
			url = "/search-q-" + q ;
			bid = document.getElementById("bighy").value;		
			if (bid != 0) url = url + "-cid-" + bid;
			url = url + ".html"

			window.location.href = url;
		}
		return false;
	}





