// JavaScript Document
function copyToQQ(){
	is_opera = /opera/i.test(navigator.userAgent);  
	var is_ie = (/msie/i.test(navigator.userAgent) && !is_opera) 
	if(is_ie){
    var clipBoardContent=this.location.href; 
    window.clipboardData.setData("Text",clipBoardContent); 
    alert("复制成功，请粘贴到你的QQ/MSN上与你的好友共同分享美食！"); 
	}else
	{
		alert("对不起你所使用的浏览器，不支持该功能，请手动复制地址并与你的好友分享美食！");
	}
}

function showQQ()
{
    str = "<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=032451cb04e44e2f8ec8f2b025381c4a9d48cc6088b531334c891bb768f70b4e\"; target=_blank; ";
    str += "onclick=\"var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=032451cb04e44e2f8ec8f2b025381c4a9d48cc6088b531334c891bb768f70b4e';";
    str += "var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);";
    str += "if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://wpa.qq.com/pa?p=1:893906411:1' alt=\"点击这里给我发消息\"></a>";
    document.write(str);
}
function showUserQQ(q)
{    
    str = "";
    if(q != "" && !isNaN(q))
    {
        str = "<a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin="+q+"&Exe=QQ&Site=im.qq.com&Menu=No>";
        str += "<img SRC=http://wpa.qq.com/pa?p=4:"+q+":4 alt=\"给网友留言\"></a>";
    }
    document.write(str);    
}
function addfavorite()
{
	var name1=$(".h1").text();
	var url1=this.location.href;
	if (document.all)
	{
		window.external.addFavorite(url1,'好吃嘴-' + name1);
	}
	else if (window.sidebar)
	{
		window.sidebar.addPanel(name1, url1, "");
	}
} 

function addhczui()
{
	if (document.all)
	{
		window.external.addFavorite('http://www.hczui.com','好吃嘴 http://www.hczui.com');
	}
	else if (window.sidebar)
	{
		window.sidebar.addPanel('好吃嘴 http://www.hczui.com', 'http://www.hczui.com', "");
	}
}

function setindex()
{
	try{
           document.body.style.behavior='url(#default#homepage)';
       		document.body.setHomePage('http://www.hczui.com');
        }
        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','http://www.hczui.com');
                 }
        }
}
function killErrors() {
return true;
}
window.onerror =killErrors;