// JScript File

var objLPView = null;

    function ajaxLeavePolicyView(EmpID)
    {
        try
        {
             objLPView = new XMLHttpRequest();
        }
        catch(ex)
        {
            try
            {
                objLPView=new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e)
            {
                try
                {
                    objLPView=new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch(e1)
                {
                    objLPView=null;
                }
            }
        }
        
        if(objLPView!=null)
        {
        var k=Math.floor(Math.random()*111);
        
            objLPView.onreadystatechange=Process_Response_LeavePolicy_View;
            objLPView.open("GET","LeavePolicy_RemoteView.aspx?EmpID=" + EmpID+"&Random="+k,true);
            objLPView.send(null);
         
        }
        
        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('ctl00_BodyContentPH_div_policy').innerHTML+=retval;
				}
				
				else
				{
				    alert("No Details found in Emp Leave Policy View!");
				}
			}
			
			else
			{
				alert("Error in retriving details");
			}
			
		}
	}


