/*
 * Bazillyo's Spiffy DHTML Popup Calendar v. 1.0 © 2000 S. Ousta
 *   - freeware with this comment
 *   - for download size, you can strip all spaces & comments except the © notices
 *   - Thanks to Chris for the domlay() function
 *   - this requires calendarcode.js, calendar.css, and calendarTest.htm
 *   - works in IE4.x, IE5.x, NS4.75 possibly 4.x, NS6 (with slight cosmetic issues)
 *   - Netscape does display some controls overtop of the layer so layout is important
 *
 */
 
// initialiZe variables... 
var http = createRequestObject(); 
function oncheckclick(obj)
{
	 alert(obj);
}
function createRequestObject()
{
var request_o; //declare the variable to hold the object.
var browser = navigator.appName; //find the browser name
if(browser == "Microsoft Internet Explorer"){
/* Create the object using MSIE's method */
request_o = new ActiveXObject("Microsoft.XMLHTTP");
}else{
/* Create the object using other browser's method */
request_o = new XMLHttpRequest();
}
return request_o; //return the object
}

		function handleresponse_secondlevelovercity()
		{
		
			if(http.readyState == 4)
			{ 
				var response = http.responseText;
				//alert(response);
				document.getElementById('second_categoriescity').options.length=0;
				document.getElementById('second_categoriescity').options[0]=new Option('Select City','none');
				results=response.split("--");
				names = results[1].split(":");
				ids = results[0].split(":");
				for(i=0;i<names.length;i++)
				{
					j=i+1;
					document.getElementById('second_categoriescity').options[j] = new Option(names[i],names[i]);
				} 
			
			}
		}
  			function secondLevelcatcity() {
				   	var parent_idcitynew=document.getElementById("first_categoriescity").value;
					//alert(parent_id);
					http.open('get','fetch_nextlevelcategory4.php?parent_idcitynew='+ parent_idcitynew);
					http.onreadystatechange = handleresponse_secondlevelovercity; 
					http.send(null);
			} 
			
			
			function handleresponse_thirdlevel() {
			
			if(http.readyState == 4)
				{ 
						var response = http.responseText;
						document.getElementById('third_categories').options.length=0;			
						document.getElementById('third_categories').options[0]=new Option('--Select Course--','none');
						results=response.split("--");
						names = results[1].split(":");					
						ids = results[0].split(":");
						for(i=0;i<names.length;i++)
						{
								j=i+1;
								document.getElementById('third_categories').options[j] = new Option(names[i],names[i]);
						} 
				
				}
			}			
			function get_thirdLevelcat(parent_id) {
					// alert(parent_id);
					http.open('get','fetch_nextlevelcategory4.php?parent_id='+ parent_id);
					http.onreadystatechange = handleresponse_thirdlevel; 
					http.send(null);
			} 
			
			function handleresponse_secondlevel1() {			
				if(http.readyState == 4){ 
				var response = http.responseText;
				//alert(response);
				document.getElementById('second_categoriescity1').options.length=0;
				document.getElementById('second_categoriescity1').options[0]=new Option('--Select Course--','none');
				results=response.split("--");
				names = results[1].split(":");
				ids = results[0].split(":");

				for(i=0;i<names.length;i++)	{
					j=i+1;
					document.getElementById('second_categoriescity1').options[j] = new Option(names[i],ids[i]);
				} 
				
				}
			}	
			
			function handleresponse_thirdlevel1() {			
			if(http.readyState == 4)
				{ 
						var response = http.responseText;
						document.getElementById('third_categories1').options.length=0;			
						document.getElementById('third_categories1').options[0]=new Option('--Select Course--','none');
						results=response.split("--");
						names = results[1].split(":");
						ids = results[0].split(":");
						for(i=0;i<names.length;i++)
						{
								j=i+1;
								document.getElementById('third_categories1').options[j] = new Option(names[i],ids[i]);
						} 
				
				}
			}
               
