function get_category(level)
{
	if(level!='Select Level' && level!='')
	{
		
		$.ajax({
				type: "POST",
				url: appurl+"ajax_process.php",
				data: "mode=fetch_category&level="+level,
				//beforeSend: function(){$("#loadingIcon_"+CampusID).show("slow");}, //show loading just when link is clicked
				//complete: function(){ $("#loadingIcon_"+CampusID).slideUp("slow");}, 
				async: false,
				success: function(html)
				{ //so, if data is retrieved, store it in html
					//alert(html);
					$("#dfn_category").html(html);
					
				}
			});
			return false;
	}
	else{
		var div_html = '<select name="Category" id="online_category"><option>Select Category</option></select>';
		$("#dfn_category").html(div_html);
		
		var div_html2 = '<select name="Subject" id="online_subject"><option>Select Subject</option></select>';
		$("#dfn_subject").html(div_html2);
	}
}


function get_subject(category)
{
	//alert(category);
	var level = $("#online_level").val();
	if(category!='')
	{
		$.ajax({
				type: "POST",
				url: appurl+"ajax_process.php",
				data: "mode=fetch_subject&category="+category+"&level="+level,
				//beforeSend: function(){$("#loadingIcon_"+CampusID).show("slow");}, //show loading just when link is clicked
				//complete: function(){ $("#loadingIcon_"+CampusID).slideUp("slow");}, 
				async: false,
				success: function(html)
				{ //so, if data is retrieved, store it in html
					//alert(html);
					$("#dfn_subject").html(html);
					
				}
			});
			return false;
	}
	
}

function onlineCourse(){
	
	var error =0;
	
	if($("#online_level").val()==''){
		alert("Please choose a level");
		error =1;
		return false;
	}
	if($("#online_category").val()==''){
		alert("Please choose a category");
		error =1;
		return false;
	}
	if($("#online_subject").val()==''){
		alert("Please choose a subject");
		error =1;
		return false;
	}
	return true;
}
		//window.location.href= appurl+"SearchProcess.php?LSID="+subject_id+"&Level_ID="+id+"&Course_ID="+cid+"&location="+loc+"&zip="+zip_c;
	