<%@ page language="C#" autoeventwireup="true" enableeventvalidation="false" inherits="Masters_levels, App_Web_rbbxeul3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Organization Levels</title>
    <script type="text/javascript" language="javascript" src="../js/levelAjax.js"></script>    
    <script type="text/javascript" language="javascript">
        function closeWindow_Level()
        {
                var Id=document.getElementById('hdf_orgLevel').value;
                return LevelName_ID(Id);
        }
        var obj;
        function LevelName_ID(levelId)
        {
	        try
	        {
		        obj = new XmlHttpRequest();
	        }
	        catch(e)
	        {
		        try
		        {
			        obj = new ActiveXObject("Microsoft.XMLHTTP");
		        }
		        catch(e1)
		        {
			        obj = new ActiveXObject("Msxml2.XMLHTTP");
		        }
	        }
	        if(obj != null)
	        {
		        var link = "LevelName_Remote.aspx?";
		        link = link + "Level_Id=" + levelId ;
		        obj.onreadystatechange = ProcessTheResponse;		
		        obj.open("POST", link, false);
		        obj.send(null);
	        }
              opener.aspnetForm.ctl00_BodyContentPH_txt_OrgLevel.value = document.getElementById('hdf_LevelName').value;
              window.close();  
	        return false;
        }
        function ProcessTheResponse()
        {
	        if (obj.readyState == 4)
	        {
		        if(obj.status == 200)
		        { 
                  document.getElementById('hdf_LevelName').value=obj.responseText;
		        }
	        }
        }
    </script>
    <link href="../css/stylesheet.css" type="text/css" rel="Stylesheet" />
</head>
<body onload="return chckLevel1(0,0)" oncontextmenu="return false" >
    <form id="form1" runat="server">
        <div>
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td class="td" align="center">
                        <asp:DropDownList runat="server" CssClass="dlist" ID="ddlLevel0" onChange="getChild(1,this.value);">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span id="div_child"></span>
                    </td>
                </tr>
                <tr>
                    <td class="td">
                        <asp:Button Text="OK" runat="server" ID="btn_OK" CausesValidation="false" OnClientClick="closeWindow_Level();"  />                        
                    </td>
                </tr>
                <tr>
                    <td>
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="td" align="center">
                                    <asp:HiddenField ID="hdf_orgLevel" runat="server" EnableViewState="true" Visible="true" />
                                    <asp:HiddenField ID="hdf_LevelName" runat="server" EnableViewState="true" Visible="true" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
