// JavaScript Document
	var searchReq=createAjaxObj();
	function createAjaxObj()
	 {
		var httprequest=false;
		if(window.XMLHttpRequest)
		{
			httprequest=new XMLHttpRequest();
			if(httprequest.overrideMimeType)
			{
				httprequest.overrideMimeType('text/xml');
			}
		}
		else if (window.ActiveXObject)
		{
			try
			{httprequest=new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e)
			{
				try{httprequest=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){}
			}
		}
		return httprequest
	 }      
	function ding(newid)
	{
		if(newid!="")
		{
			url="medo.aspx?action=ding&newId="+newid;
			searchReq.open("post",url);
			searchReq.onreadystatechange=handleSearchSuggest;
			searchReq.send(null);			
		}
		else
		{
			alert('新闻编号错误');
		}	
	}	
	function handleSearchSuggest()
	{
		if(searchReq.readyState==4)
		{
			var res=searchReq.responseText;
		  	if(res.indexOf('成功')>0)
			{
				var num = parseInt(document.getElementById("ding_num").innerHTML.replace("(","").replace(")",""));
				num=num+1;
				document.getElementById("ding_num").innerHTML="("+num+")";
			}
			alert(res);
		}
	}
	function cai(newid)
	{
		if(newid!="")
		{
			url="medo.aspx?action=cai&newId="+newid;
			searchReq.open("post",url);
			searchReq.onreadystatechange=handleSearchSuggest1;
			searchReq.send(null);			
		}
		else
		{
			alert('新闻编号错误');
		}	
	}
	function handleSearchSuggest1()
	{
		if(searchReq.readyState==4)
		{
			var res=searchReq.responseText;
		  	if(res.indexOf('成功')>0)
			{
				var num = parseInt(document.getElementById("cai_num").innerHTML.replace("(","").replace(")",""));
				num=num+1;
				document.getElementById("cai_num").innerHTML="("+num+")";
			}
			alert(res);
		}
	}
	function check_submit()
	{
		var com=document.form_dis.content;
		var value=com.value;
		if(value=="")
		{
			alert("评论内容不能为空！");
			com.focus();
			return false;
		}
		if(value.length>600)
		{
			alert("评论内容不得超过500字！");
			com.focus();
			return false;
		}
		com=document.form_dis.yzm;
		value=com.value;
		if(value=="")
		{
			alert("验证码不能为空！");
			com.focus();
			return false;
		}
		if(value.length!=5)
		{
			alert("验证码为五位数字和字母组合！");
			com.focus();
			return false;
		}
	}
	
	function ju(newid)
	{
		if(newid!="")
		{
			var url='jubao.aspx?random='+Math.random()+'&newid='+newid;
			window.showModalDialog(url,'ss','resizable:no;scroll:yes;status:no;dialogWidth=600px;dialogHeight=450px;center=yes;help=no;');
		}
	}
	
	function chao(newid)
	{
		if(newid!="")
		{
			var url='chaosong.aspx?random='+Math.random()+'&newid='+newid;
			window.showModalDialog(url,'ss','resizable:no;scroll:yes;status:no;dialogWidth=609px;dialogHeight=450px;center=yes;help=no');
		}
	}
	function disucc()
	{ 
		document.documentElement.scrollTop=document.getElementById("yzm_y").offsetTop;
	}
