// JScript File
var objLPView = null;
    function ajaxLeavePolicyView(EmpID,NoDetailsfoundinEmpLeavePolicyView,Errorinretrivingdetails)
    {
        if(window.ActiveXObject)
        {    
	        try
	        {
		        objLPView = new ActiveXObject("Msxml2.XMLHTTP");
	        }
	        catch(e)
	        {
		        try
		        {
			        objLPView = new ActiveXObject("Microsoft.XMLHTTP");
		        }
		        catch(e1)
		        {
			        objLPView = null;
		        }
	        }
        }  
         else if(window.XMLHttpRequest)
         {
	        try
	        {
		        objLPView = new XMLHttpRequest("Msxml2.XMLHTTP");
	        }
	        catch(e)
	        {
		        try
		        {
			        objLPView = new XMLHttpRequest("Microsoft.XMLHTTP");
		        }
		        catch(e1)
		        {
			        objLPView = null;
		        }
	        }
        }
        if(objLPView!=null)
        {
            var k=Math.floor(Math.random()*111);
            if(window.ActiveXObject)
            {
                objLPView.onreadystatechange=Process_Response_LeavePolicy_View;
                objLPView.open("GET","LeavePolicy_RemoteView.aspx?EmpID=" + EmpID+"&Random="+k,true);
                objLPView.send(null);
            }
            else if(window.XMLHttpRequest)
            {
                objLPView.open("GET","LeavePolicy_RemoteView.aspx?EmpID=" + EmpID+"&Random="+k,false);
                objLPView.send(null);
                objLPView.onreadystatechange=Process_Response_LeavePolicy_View();
            }
        }
        return false;
    }
    function Process_Response_LeavePolicy_View()
	{
		if(objLPView.readyState == 4)
		{
			if(objLPView.status == 200)
			{
				var retval=objLPView.responseText;
				if (retval.length > 0)
				{
				   document.getElementById('tbl_policy').innerHTML+=retval;
				}
				else
				{
				    //alert("No Details found in Emp Leave Policy View!");
				    alert(NoDetailsfoundinEmpLeavePolicyView);
				}
			}
			else
			{
				//alert("Error in retriving details");
				alert(Errorinretrivingdetails);
			}
		}
	}
