﻿// JScript File


function one()
  {
// alert("hhhhh");
    document.getElementById("txthidden").value ="";
    var uid = document.getElementById("ddlUniversity").value;
//  alert(uid);
    CreateXmlHttp();
//    alert("fffsuccess");
    XmlHttp.onreadystatechange = HandleResponse;
//  alert("gi");
    XmlHttp.open("GET","ajaxsercodeforfillinstitute.aspx?uid=" + uid,true);
    
    XmlHttp.send(null);  
   
  }



 function CreateXmlHttp()
  {
   
	//Creating object of XMLHTTP in IE
	try
	{
	    XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		
	}
	catch(e)
	{
	   try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}

   }
    

 
 function HandleResponse()
{
    var s = "";
//alert(s);
	if(XmlHttp.readyState == 4)
	{
	  //alert("ji");
	 // alert(XmlHttp.status);
	 // alert(s);
		if(XmlHttp.status == 200)
		{	
		
			s=XmlHttp.responseText;
			// alert(s);
			populateList(s);
			
		}
		
		else
		{
			alert("There was a problem retrieving data from the server." );
		}
	}
}
  
  
   function populateList(uid)
  {
  var c = uid;
//alert(uid);
  var stateList = document.getElementById("ddlInstitute");
 //alert(stateList);
  for (var count = stateList.options.length-1; count >-1; count--)
	{
		stateList.options[count] = null;
	}
	
	if (c.length == 1)
	{
	var nulloption;
	nulloption = new Option("---Select---","---Select---",  false, false);
	stateList.options[stateList.length] = nulloption;
	}
	else
	{
	var seperate = uid.split('#');
	var statenames = seperate[0];
    var statevalues =seperate[1] ;
    var statename = statenames.split('*');
	var stateNodes = statevalues.split('*');
	var textValue,txtname; 
	var optionItem,optionValue;
	var firstitem;
	for (var count = 0; count < stateNodes.length; count++)
	{
	textValue = (stateNodes[count]);
	textname = (statename[count]);
	optionItem = new Option(textname,textValue,false, false);
	stateList.options[stateList.length]= optionItem;
//    alert(optionItem);
	}
 	}

  }


//fill other institute
function two()
  {
    document.getElementById("txthidden1").value ="";
    var uid1 = document.getElementById("ddlotheruniversity").value;
   //  alert(uid1);
    CreateXmlHttp1();
    XmlHttp.onreadystatechange = HandleResponse1;
    XmlHttp.open("GET","ajaxservercodefillotherinstitution.aspx?uid1=" + uid1,true);
    XmlHttp.send(null);  
   
  }



 function CreateXmlHttp1()
  {
   
	//Creating object of XMLHTTP in IE
	try
	{
	    XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		
	}
	catch(e)
	{
	   try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}

   }
    

 
 function HandleResponse1()
{
    var s = "";

	if(XmlHttp.readyState == 4)
	{
	   	if(XmlHttp.status == 200)
		{	
		   s=XmlHttp.responseText;
			populateListforotherinstitute(s);
		}
		else
		{
			alert("There was a problem retrieving data from the server." );
		}
	}
}
  
  
   function populateListforotherinstitute(uid1)
  {
  var c = uid1;
  var stateList = document.getElementById("ddlotherinstitute");
  for (var count = stateList.options.length-1; count >-1; count--)
	{
		stateList.options[count] = null;
	}
	
	if (c.length == 1)
	{
	var nulloption;
	nulloption = new Option("---Select---","---Select---",  false, false);
	stateList.options[stateList.length] = nulloption;
	}
	else
	{
	var seperate = uid1.split('#');
	var statenames = seperate[0];
    var statevalues =seperate[1] ;
    var statename = statenames.split('*');
	var stateNodes = statevalues.split('*');
	var textValue,txtname; 
	var optionItem,optionValue;
	var firstitem;
	for (var count = 0; count < stateNodes.length; count++)
	{
	textValue = (stateNodes[count]);
	textname = (statename[count]);
	optionItem = new Option(textname,textValue,false, false);
	stateList.options[stateList.length]= optionItem;
//    alert(optionItem);
	}
 	}

  }


//fill Spealization

function spealization()
  {
// alert("hhhhh");
    document.getElementById("txthiddenspe").value ="";
    var uid = document.getElementById("ddlQualification").value;
 // alert(uid);
    CreateXmlHttpspe();
  //  alert("fffsuccess");
    XmlHttp.onreadystatechange = HandleResponsespe;
 // alert("gi");
    XmlHttp.open("GET","ajaxserfillspecialization.aspx?uid=" + uid,true);
    
    XmlHttp.send(null);  
   
  }



 function CreateXmlHttpspe()
  {
   
	//Creating object of XMLHTTP in IE
	try
	{
	    XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		
	}
	catch(e)
	{
	   try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}

   }
    

 
 function HandleResponsespe()
{
    var s = "";
//alert(s);
	if(XmlHttp.readyState == 4)
	{
	  //alert("ji");
	 // alert(XmlHttp.status);
	 // alert(s);
		if(XmlHttp.status == 200)
		{	
		
			s=XmlHttp.responseText;
			// alert(s);
			populateListspe(s);
			
		}
			else
		{
			alert("There was a problem retrieving data from the server." );
		}
	}
}
  
  
   function populateListspe(uid)
  {
  var c = uid;
//alert(uid);
  var stateList = document.getElementById("ddlSpecialization");
// alert(stateList);
  for (var count = stateList.options.length-1; count >-1; count--)
	{
		stateList.options[count] = null;
	}
	
	if (c.length == 1)
	{
	var nulloption;
	nulloption = new Option("---Select---","---Select---",  false, false);
	stateList.options[stateList.length] = nulloption;
	}
	else
	{
	var seperate = uid.split('#');
	var statenames = seperate[0];
    var statevalues =seperate[1] ;
    var statename = statenames.split('*');
	var stateNodes = statevalues.split('*');
	var textValue,txtname; 
	var optionItem,optionValue;
	var firstitem;
	for (var count = 0; count < stateNodes.length; count++)
	{
	textValue = (stateNodes[count]);
	textname = (statename[count]);
	optionItem = new Option(textname,textValue,false, false);
	stateList.options[stateList.length]= optionItem;
//    alert(optionItem);
	}
 	}

  }
  
  
  
  
  
  //fill Other Spealization

function Othspealization()
  {
// alert("hhhhh");
    document.getElementById("txthiddenothspe").value ="";
    var uid = document.getElementById("ddlotherqualification").value;
 // alert(uid);
    CreateXmlHttpothspe();
  //  alert("fffsuccess");
    XmlHttp.onreadystatechange = HandleResponseothspe;
 // alert("gi");
    XmlHttp.open("GET","ajaxserfillotherspecialization.aspx?uid=" + uid,true);
    
    XmlHttp.send(null);  
   
  }



 function CreateXmlHttpothspe()
  {
   
	//Creating object of XMLHTTP in IE
	try
	{
	    XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		
	}
	catch(e)
	{
	   try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}

   }
    

 
 function HandleResponseothspe()
{
    var s = "";
//alert(s);
	if(XmlHttp.readyState == 4)
	{
	  //alert("ji");
	 // alert(XmlHttp.status);
	 // alert(s);
		if(XmlHttp.status == 200)
		{	
		
			s=XmlHttp.responseText;
			// alert(s);
			populateListothspe(s);
			
		}
			else
		{
			alert("There was a problem retrieving data from the server." );
		}
	}
}
  
  
   function populateListothspe(uid)
  {
  var c = uid;
//alert(uid);
  var stateList = document.getElementById("ddlotherspecialization");
// alert(stateList);
  for (var count = stateList.options.length-1; count >-1; count--)
	{
		stateList.options[count] = null;
	}
	
	if (c.length == 1)
	{
	var nulloption;
	nulloption = new Option("---Select---","---Select---",  false, false);
	stateList.options[stateList.length] = nulloption;
	}
	else
	{
	var seperate = uid.split('#');
	var statenames = seperate[0];
    var statevalues =seperate[1] ;
    var statename = statenames.split('*');
	var stateNodes = statevalues.split('*');
	var textValue,txtname; 
	var optionItem,optionValue;
	var firstitem;
	for (var count = 0; count < stateNodes.length; count++)
	{
	textValue = (stateNodes[count]);
	textname = (statename[count]);
	optionItem = new Option(textname,textValue,false, false);
	stateList.options[stateList.length]= optionItem;
//    alert(optionItem);
	}
 	}

  }
