﻿
// XML http object for Ajax
function GetXmlHttpObject()
{  
	//alert("Using AJAX!"); 
	//xmlHttp=GetXmlHttpObject()
	var xmlHttp=null;
	try
	{ 
		// Firefox, Opera 8.0+, Safari 
		xmlHttp=new XMLHttpRequest();  
	}
	catch (e)
	{  //	alert("Using AJAX on IE!");  
		// Internet Explorer  
		try
		{    
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");   
		}
		catch (e)
		{  	
			//alert("Using AJAX! on IE-5"); 
			try
			{  
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			}
			catch (e)
			{  
				alert("Your browser does not support AJAX!"); 
				return false;      
			}  
		}
	}
		return xmlHttp;
}


function fnIncrementAbuseCount(strMyVal)
{
     //alert("strMyVal" + strMyVal);
 
 

  var answer = confirm ("Do you want to report this as abusive..");
  if(answer)
   {
        xmlHttp=GetXmlHttpObject()
	    if (xmlHttp==null)
	    {
		    alert ("Your browser does not support AJAX!");
		    return;
	    } 
	    xmlHttp.onreadystatechange = handleCommentStateChange;
        var  mydate = new Date();
	    var url="AjaxIncrementAbuseCount.aspx";
	    url=url+"?strValue="+strMyVal +"&mydate=" +mydate.getTime();

	    //xmlHttp.open("post","ajaxresponsepage.aspx",true);
	    xmlHttp.open("GET",url,true);
	    xmlHttp.send(null);
	}
	
}

// This method will be called after the method has been executed
// and the result has been sent to the client.

function handleCommentStateChange() 
{

    if(xmlHttp.readyState == 4) 
    {
        if(xmlHttp.status == 200) 
        {

             alert('This comment Recorded as Abuse , Thanks for your response')
        }
    }
}


