	//alert(sAppPath);
	function xmlError(e) 
	{//there was an error, show the user
		alert(e);
	}
	var request;
	var response;
	var pddlSeason = document.getElementById("ddlSeason");
	//var sPath="http://localhost/Applyajax/JSForApplyAjax/";
	function populateSeason()
	{	
		if (pddlSeason==null)
			pddlSeason = document.getElementById("ddlSeason");
		var ddlReportType = document.getElementById("ddlReportType");
		return SendRequestSeason(ddlReportType.options[ddlReportType.selectedIndex].value);
	}
	function InitializeRequestSeason()
	{
		try
		{
			request = new ActiveXObject("Microsoft.XMLHTTP");//Try creating an XMLHTTP Object
		}
		catch(Ex)
		{
			try
			{
				request = new ActiveXObject("Microsoft.XMLHTTP");//First failure, try again creating an XMLHTTP Object
			}
			catch(Ex)
			{
				request = null;//Else assign null to request
			}
		}
		if(!request&&typeof XMLHttpRequest != 'undefined')
		{
			request = new XMLHttpRequest();
		}
	}
	function SendRequestSeason(ID)
	{	
		//status.innerText = "Loading.....";//Set the status to "Loading....."
		InitializeRequestSeason();//Call InitializeRequest to set request object
		var url = sAppPath + "/ReportTypE.aspx?SRGCType=1&ReportType="+ID;//Create the url to send the request to
		//alert (url);
		request.onreadystatechange = ProcessRequestSeason;//Delegate ProcessRequest to onreadystatechange property so it gets called for every change in readyState value
		request.open("GET", url, true);//Open a GET request to the URL
		request.send(null);//Send the request with a null body.
	}
	function ProcessRequestSeason()
	{	
		if(request.readyState == 4)//If the readyState is in the "Ready" State
		{
			//alert(request.status);
			if(request.status == 200)//If the returned status code was 200. Everything was OK.
			{
				if(request.responseText != "")//If responseText is not blank
				{	
					//alert(request.responseText);
					populateListSeason(request.responseText);//Call the populateList fucntion
					//status.innerText = "Cities Loaded";//Set the status to "Territories Loaded"
				}
				else
				{
					//status.innerText = "None Found";//Set the status to "None Found"
					//clearSelect(pddlSeason);//Call clearSelect function
					pddlSeason.disabled=true;
					pddlSeason.options[0].text="No Season found";
					pddlSeason.options[0].value="0";
				}
			}
		}
		return true;//return
	}
		function populateListSeason(response)
		{	
			//alert("InPL");
			pddlSeason.disabled=false;
			var xmlDoc;
			if (navigator.appName.indexOf("Microsoft")>=0)  //Microsoft Case
				xmlDoc=new ActiveXObject("Microsoft.XMLDOM");//Create the XMLDOM object
			else											// Mozilla Case
				xmlDoc = new XMLHttpRequest();
			xmlDoc=new XMLDoc(response, xmlError);
			if(xmlDoc.docNode!=null)
			{	
				obRoot = xmlDoc.docNode;
				if(obRoot.getElements().length > 0)//If there are one or more TERRITORIES nodes
				{
					clearSelect(pddlSeason); // 18- Sept this will clear the ddlSeason before fill, every time
					pddlSeason.options.length=0;
					pddlSeason.remove(0);
					//if(pddlSeason.options[0].text=="No Season found")
					//{
					//	pddlSeason.options[0].text="Select";
					//}
					for (var i = 0; i < obRoot.getElements().length; i++)//Loop through the XML TERRITORIES nodes
					{
						var textNode = document.createTextNode(obRoot.getElements()[i].getText());//Create a TextNode
						appendToSelect(pddlSeason, obRoot.getElements()[i].getAttribute("season_id"), textNode);//Call appendToSelect to append the text elements to the PType dropdown	
					}
					//alert(obRoot.getElements().length);
					//if(obRoot.getElements().length>0)
					//	pddlSeason.selectedIndex=1;
				}
				else
				{
					pddlSeason.disabled=true;
					pddlSeason.options[0].text="No Season found";
				}	
			}
		}
	function appendToSelect(select, value, content)
	{
		var opt;
		opt = document.createElement("option");//Create an Element of type option
		opt.value = value;//Set the option's value
		opt.appendChild(content);//Attach the text content to the option
		select.appendChild(opt);//Append the option to the referenced [PType] select box
	}
	function clearSelect(select)
	{  select.options.length = 1;
		//select.options.length = 0;//Set the select box's length to 1 so only "--Select--" is availale in the selection on calling this function.
									//You may want to write your own clearSelect logic
		//select.remove(0);
	}
