// JavaScript Document My Function Developed on JQuery.

// jquery function to validate form
function abc(callerpage){
//	alert(callerpage);
	/****************INDEX PAGE JS****************
	**********************************************/
 if (callerpage =='Index') {
	$(document).ready(function(){
								   
		function LoadUni(City) {
			$("#uniname").ajaxStart(function(){	
				$(this).html('<option>Loading...</option>')
			});			
			$.post("loadcombo.php", {combo:'City',city:City},
				function(data){
//				alert("Universities Loaded: " + data);
				$("#uniname").html(data);
//				$("#uniname").width =400;
				$("#uniname").css("width","450px");

				});	
			return 'one';			
		}
		/*
		ON CHANGE FUNCTION
		IT LOADS THE UNIVERSITIES DYNAMICALLY
		*/
	   $("#educity").change(function() {
			var city	= $("#educity").children("option:selected").val();
			var city2;
			city2 = city.split(':');
			city = city2[0];
//			alert(city2[1]);
			//Running the Functions
			LoadUni(city)
		});

	   $("#uniname").change(function() {
			var uni	= $("#uniname").children("option:selected").val();
			var uni2;		
			uni2 = uni.split(':');
			uni = uni2[1];
//			alert(uni);			
			//Running the Functions
			$("#uniname_selected").html(uni);
			uni2 = $("#uniname_selected").html();
//			alert("The Value in DIV :" + uni2);
		});
	   
	}); //document.ready end

 }
}
