	var deptcboname = ''; //variable to collect the control name for the department dropdown
	var facultycboname = ''; //variable to collect the control name for the faculty dropdown
	
	function LoadDepts(college, cbodept)
    {
		var cc=college.options[college.selectedIndex].value;
		deptcboname = cbodept;
		AJAXCollegeDept.GetDepts(cc,LoadDepts_CallBack);
    }
    
    function LoadDepts_CallBack(response)
    {
		var depts=response.value;
		var deptList=document.getElementById(deptcboname);
		    
		deptList.options.length=0; //reset the dept dropdown
	  
		for(var i=0;i<depts.length;++i)
		{
			deptList.options[deptList.options.length]=new Option(depts[i].Desc,depts[i].Code);
		}
    
    }
    
    //The function below is utilized in the searchmpage.aspx as we have to load the faculty
    //in this page. The faculty combobox is not required in the other pages
    
    // we are using the second parameter cbodept to pass the department combobox instead of
    //hard coding it with respect to the calling page
    function LoadDeptsSearch(college, cbodept,cbofac)
    {
 
		var cc=college.options[college.selectedIndex].value;
		deptcboname = cbodept;
		facultycboname=cbofac;
		AJAXCollegeDept.GetDepts(cc,LoadDeptsSearch_CallBack);
    }
    
    
    function LoadDeptsSearch_CallBack(response)
    {
    
		var depts=response.value;
		var deptList=document.getElementById(deptcboname);
		    
		deptList.options.length=0; //reset the dept dropdown
	   
		for(var i=0;i<depts.length;++i)
		{
			deptList.options[deptList.options.length]=new Option(depts[i].Desc,depts[i].Code);
		}
		
		LoadFaculties(); 
    
    }
    
    function LoadFaculties()
    {
                 
          //var dc=dept.options[dept.selectedIndex].value; 
          //facultycboname=  cbofac;
          var deptList=document.getElementById(deptcboname);     
          var dc=deptList.options[deptList.selectedIndex].value; 
          
         AJAXCollegeDept.GetFaculties(dc,LoadFaculties_CallBack);
        
    }
    
     function LoadFaculties_CallBack(res)
    {
       
         var count=0;
         var facs=res.value;
         var facList=document.getElementById(facultycboname);
         facList.options.length=0; //reset the faculty dropdown
         
         for(var i=0;i<facs.length;++i)
         {
           facList.options[facList.options.length]=new Option(facs[i].upName,facs[i].upId);
         }        
            
    }