//显示时间
function showLocale(objD) 
{
	var dn, str;
	var hh = objD.getHours();
	var mm = objD.getMinutes();
	var ss = objD.getSeconds();
	str = (objD.getMonth() + 1) + "月" + objD.getDate() +"日";
	
	if(hh<10) hh = '0' + hh;
	if(mm<10) mm = '0' + mm;
	if(ss<10) ss = '0' + ss;
	str += " " + hh + ":" + mm + ":" + ss;
	return(str);
}
function tick() 
{
	var today;
	today = new Date();
	document.getElementById("localtime").innerHTML = showLocale(today);
	window.setTimeout("tick()", 1000);
}

// 添加到收藏夹
function JSAddFavorite(text,url)
{
	if(!text) text = document.title;
	if(!url) url = document.location.href;
	if ( window.sidebar && "object" == typeof( window.sidebar ) && "function" == typeof( window.sidebar.addPanel) )
		window.sidebar.addPanel(text, url, "");
	else if ( document.all && "object" == typeof( window.external ) )
		window.external.addFavorite(url,text);
}

//复制url
function copyUrl(url){
var content='';
window.clipboardData.setData("Text",url);
alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友");
}

function preview(fo,strImg)
{
    var oImg = document.getElementById(strImg);
    oImg.style.display = "block";
    oImg.src = fo;
    oImg.onerror = function () { 
	    oImg.style.display = "none";
	    if (fo!="" && fo !=null ) { alert('获取图片预览失败，请上传图片文件！'); } 
    }
    oImg.onload = function() { var iWidth = parseInt(oImg.width); if (iWidth>120) {oImg.width=120;}}
}

function upload()
{
upshow.innerHTML="<img src='http://www.izhuti.com/iztimg/img/loader.gif' border='0' align='absmiddle'> <span class='red'>上传中...</span>";
return true;
}

function addcomment()
{
cre.innerHTML="<span class='font-red'>提交中...</span>";
//setTimeout("xajax_addcomment()",1000);
return true;
}

function setsmiley(what) 
{ 
document.form1.comment.value = document.form1.comment.value+" "+what; 
document.form1.comment.focus(); 
} 