﻿function InitAssess(commentid,objectid,type,projectid,templateid,newsid)
{

     var zipCode=Math.random();

     var url = "/commentsolution/InitAssessInfo.aspx?projectid="+projectid + "&templateid=" + templateid +"&objectid="+newsid + "&type="+type+"&CommentID="+commentid+ "&zipcode="+zipCode ;    
      


     //$("#"+this.controlid).load(url); 
     
        var req;
		if((req = getHttpRequest()))
		{
		    req.open("GET",url,true);
			req.onreadystatechange = function()
			{
			    if (req.readyState == 4)
                {
                     if (req.status == 200) 
                     {
                        var result_text = req.responseText;
                        document.getElementById(objectid).innerHTML = result_text;
                     }                    
                }
            };
            req.send(null);
		}         
     
}



function DoAssess(commentid,objectid,type,projectid,templateid,newsid)
{  
      var total=parseInt(document.getElementById(objectid).innerHTML)+1
      document.getElementById(objectid).innerHTML = total;
      //$("#sp"+type).html(total);
      //$("#div"+type).html(total);
    
    
     var zipCode=Math.random();     
     
     var url = "/commentsolution/AssessHandle.aspx?projectid="+projectid + "&templateid=" + templateid +"&objectid="+newsid + "&type="+type +"&CommentID="+commentid+ "&zipcode="+zipCode ;   
   

             var req;
		if((req = getHttpRequest()))
		{
		    req.open("GET",url,true);
			req.onreadystatechange = function()
			{
			    if (req.readyState == 4)
                {
                     if (req.status == 200) 
                     {
                        //var result_text = req.responseText;
                        //document.getElementById(objectid).innerHTML = result_text;
                     }                    
                }
            };
            req.send(null);
		}    
}





//创建XmlHttpRequest对象
function getHttpRequest()
{
	var XmlHttp;

	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttp = new XMLHttpRequest();
	}
	return XmlHttp;
}

