function getCommentUrl(URL)
{
	URL = trim(URL);
	//alert(URL);
	if(URL == "" || URL == undefined)
	{
		document.write("");
		return false;
	}
	var urlArray = new Array(), htmlArray = new Array();
		urlArray = URL.split('/');
		htmlArray = urlArray[urlArray.length - 1].split('.');
	var aid = htmlArray[0];
		if(isNum(aid))
		{

			document.write("<a href='http://comment.hunantv.com/comment/?type=ent&sid="+aid+"' target='_blank'>发表评论</a>");
		}else{
			document.write("<a href='"+URL+"' target='_blank'>发表评论</a>");
		}
}
function isNum(v)
{
	var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/   
	if (!re.test(v))
	{
		return false;
	}
	return true;
}
/**
 * 去除前后空格
 */
function trim(str)
{
	return str.replace(/^\s*(.*?)[\s\n]*$/g, '$1');
}

function setCommentLogin()
{
	var ref = window.location.href;
	document.getElementById("comment-login").innerHTML = '<a href="http://passport.hunantv.com/login/?ref='+ref+'" title="登录">登录</a> <a href="http://passport.hunantv.com" title="注册" target="_blank">注册</a>';
}