   // global variable for the XMLHttpRequest object
   var httpRequest;
   
   /**
    * process ...
    */
	
	function skills_handler(target,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_skills_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_skills.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_skills(); } ;
        httpRequest.send(null);
   	}
	
	function skills_handler_form(target,id)
    {	   
	
	   var target = target;
	   var id = id;

	   var poststr = "&skill=" 	+ encodeURI( document.getElementById("skill").value ) 	+
					 "&years=" 	+ encodeURI( document.getElementById("years").value )	;

		document.getElementById('section_main_skills_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_skills.php?function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_skills(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    function skills_handler_form2(target,skill,years,id)
    {	   
	
	   var target 	= target;
	   var id 		= id;
	   var skill 	= skill;
	   var years 	= years;

	   var poststr = "&skill=" 	+ encodeURI( document.getElementById(skill).value ) +
					 "&years=" 	+ encodeURI( document.getElementById(years).value )	;

		document.getElementById('section_main_skills_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_skills.php?function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_skills(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
	function preference_handler(target,form,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_preference_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_preference.php?function=' + escape(target) + "&form=" + escape(form) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_preference(); } ;
        httpRequest.send(null);
   	}
	
	function preference_handler_form(target,id)
    {	   
	
	   var target = target;
	   var id = id;
	
	   if( document.getElementById("emp_type_1").checked ){
	   		var emp1="1";
	   } else {
	   		var emp1="2";
	   }
	   if( document.getElementById("emp_type_2").checked ){
	   		var emp2="1";
	   } else {
	   		var emp2="2";
	   }
	   if( document.getElementById("emp_type_3").checked ){
	   		var emp3="1";
	   } else {
	   		var emp3="2";
	   }

	   var poststr = "emp_type_1=" 			+ emp1 																+
                     "&emp_type_2=" 		+ emp2																+
					 "&emp_type_3=" 		+ emp3 																+
					 "&salary=" 			+ encodeURI( document.getElementById("salary").value ) 				+
					 "&work_region=" 		+ encodeURI( document.getElementById("work_region").value ) 		+
					 "&travel=" 			+ encodeURI( document.getElementById("travel").value ) 															+
					 "&work_hours=" 		+ encodeURI( document.getElementById("work_hours").value ) 			+
					 "&company_size=" 		+ encodeURI( document.getElementById("company_size").value ) 		+
					 "&dress_code=" 		+ encodeURI( document.getElementById("dress_code").value ) 			+
					 "&notes_preferences=" 	+ encodeURI( document.getElementById("notes_preferences").value )	;

	   
		//document.getElementById('infoHolder').style.display = 'block';
        //document.getElementById('infoHolder').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_preference_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_preference.php?form=preferences&function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_preference(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
	
	function education_handler(target,form,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_education_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_education.php?function=' + escape(target) + "&form=" + escape(form) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_education(); } ;
        httpRequest.send(null);
   	}
	
	function education_handler_form(target,id)
    {	   
	
	   var target = target;
	   var id = id;
	
	   var poststr = "degree=" 				+ encodeURI( document.getElementById("degree").value ) 			+
                     "&field=" 				+ encodeURI( document.getElementById("field").value ) 			+
					 "&school=" 			+ encodeURI( document.getElementById("school").value ) 			+
					 "&school_pending=" 	+ encodeURI( document.getElementById("school_pending").value ) 	+
					 "&year_from=" 			+ encodeURI( document.getElementById("year_from").value ) 		+
					 "&year_to=" 			+ encodeURI( document.getElementById("year_to").value ) 		+
					 "&full_degree=" 		+ encodeURI( document.getElementById("full_degree").value ) 	+
					 "&organizations=" 		+ encodeURI( document.getElementById("organizations").value ) 	+
					 "&notes_education=" 	+ encodeURI( document.getElementById("notes_education").value ) +
					 "&form_profile=" 		+ encodeURI( document.getElementById("form_profile").value ) ;
					 //"&id=" 				+ encodeURI( document.getElementById("id").value )				;

	   
		//document.getElementById('infoHolder').style.display = 'block';
        //document.getElementById('infoHolder').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_education_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_education.php?form=education&function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_education(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
	
	
	
	function work_handler(target,form,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_work_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_work.php?function=' + escape(target) + "&form=" + escape(form) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_work(); } ;
        httpRequest.send(null);
   	}
	
	function work_handler_form(target,id)
    {	   

	   var target = target;
	   var id = id;
	
	   if( document.getElementById("specialization").value == "Accounting / Finance / Banking" ){
		   	var specializationArea = document.getElementById("specialization_accounting").value;
	   }
	   if( document.getElementById("specialization").value == "Admin / HR" ){
		   	var specializationArea = document.getElementById("specialization_hr").value;
	   }
	   if( document.getElementById("specialization").value == "Arts / Media / Comm" ){
		   	var specializationArea = document.getElementById("specialization_comm").value;
	   }
	   if( document.getElementById("specialization").value == "Building / Construction" ){
		   	var specializationArea = document.getElementById("specialization_construction").value;
	   }
	   if( document.getElementById("specialization").value == "Call Centers / Customer Service" ){
		   	var specializationArea = document.getElementById("specialization_call").value;
	   }
	   if( document.getElementById("specialization").value == "Computer / IT" ){
		   	var specializationArea = document.getElementById("specialization_computer").value;
	   }
	   if( document.getElementById("specialization").value == "Education / Training" ){
		   	var specializationArea = document.getElementById("specialization_education").value;
	   }
	   if( document.getElementById("specialization").value == "Engineering" ){
		   	var specializationArea = document.getElementById("specialization_engineering").value;
	   }
	   if( document.getElementById("specialization").value == "Healthcare / Medical" ){
		   	var specializationArea = document.getElementById("specialization_healthcare").value;
	   }
	   if( document.getElementById("specialization").value == "Hotel / Restaurant" ){
		   	var specializationArea = document.getElementById("specialization_hotel").value;
	   }
	   if( document.getElementById("specialization").value == "Legal" ){
		   	var specializationArea = document.getElementById("specialization_legal").value;
	   }
	   if( document.getElementById("specialization").value == "Manufacturing" ){
		   	var specializationArea = document.getElementById("specialization_manufacturing").value;
	   }
	   if( document.getElementById("specialization").value == "Sales / Marketing" ){
		   	var specializationArea = document.getElementById("specialization_sales").value;
	   }
	   if( document.getElementById("specialization").value == "Sciences" ){
		   	var specializationArea = document.getElementById("specialization_sciences").value;
	   }
	   if( document.getElementById("specialization").value == "Services" ){
		   	var specializationArea = document.getElementById("specialization_services").value;
	   }
	   if( document.getElementById("specialization").value == "Other" ){
		   	var specializationArea = document.getElementById("specialization_other").value;
	   }
	 
	   if( document.getElementById("tenure_end_present").checked ){
	   	var present="checked";
	   } else {
	   	var present="";
	   }
	   
	   var poststr = "company=" 			+ encodeURI( document.getElementById("company").value ) 			+
	   				 "&company_pending=" 	+ encodeURI( document.getElementById("company_pending").value ) 	+
                     "&specialization=" 	+ encodeURI( document.getElementById("specialization").value ) 		+
					 "&specialization_area="+ encodeURI( specializationArea ) 									+
					 "&title=" 				+ encodeURI( document.getElementById("title").value ) 				+
					 "&position_level=" 	+ encodeURI( document.getElementById("position_level").value ) 		+
					 "&tenure_start_month=" + encodeURI( document.getElementById("tenure_start_month").value ) 	+
					 "&tenure_start_year=" 	+ encodeURI( document.getElementById("tenure_start_year").value ) 	+
					 "&tenure_end_month=" 	+ encodeURI( document.getElementById("tenure_end_month").value ) 	+
					 "&tenure_end_year=" 	+ encodeURI( document.getElementById("tenure_end_year").value ) 	+
					 "&tenure_end_present=" + present															+
					 "&overview=" 			+ encodeURI( document.getElementById("overview").value )			;

		document.getElementById('section_main_work_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_work.php?form=work&function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_work(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
	
	/**
    * Event handler for the XMLhttprequest
    * when the content is back (State 4 and status 200)
    * take the content of the request and copy it into the HTML page
    */
	
   function process_education()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_education_overlay').style.display = "none";
          document.getElementById('section_main_education').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_education').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {

          //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		  document.getElementById('section_main_education_overlay').style.display = "block";
      }

   }
   
   
   function process_work()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_work_overlay').style.display = "none";
          document.getElementById('section_main_work').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_work').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {

          //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		  document.getElementById('section_main_work_overlay').style.display = "block";
      }

   }
   
   
   function process_preference()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_preference_overlay').style.display = "none";
          document.getElementById('section_main_preference').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_preference').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {

          //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		  document.getElementById('section_main_preference_overlay').style.display = "block";
      }

   }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function employer_job_posting_handler(target,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'employer_jobs.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_employer_job_posting(); } ;
        httpRequest.send(null);
   	}
   	
   	function employer_profile_handler(target,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'employer_profile.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_employer_job_posting(); } ;
        httpRequest.send(null);
   	}
   	
   	
   	function employer_job_posting_handler_form(target,id)
    {	   

	   var target = target;
	   var id = id;
	
	   if( document.getElementById("specialization").value == "Accounting / Finance / Banking" ){
		   	var specializationArea = document.getElementById("specialization_accounting").value;
	   }
	   if( document.getElementById("specialization").value == "Admin / HR" ){
		   	var specializationArea = document.getElementById("specialization_hr").value;
	   }
	   if( document.getElementById("specialization").value == "Arts / Media / Comm" ){
		   	var specializationArea = document.getElementById("specialization_comm").value;
	   }
	   if( document.getElementById("specialization").value == "Building / Construction" ){
		   	var specializationArea = document.getElementById("specialization_construction").value;
	   }
	   if( document.getElementById("specialization").value == "Call Centers / Customer Service" ){
		   	var specializationArea = document.getElementById("specialization_call").value;
	   }
	   if( document.getElementById("specialization").value == "Computer / IT" ){
		   	var specializationArea = document.getElementById("specialization_computer").value;
	   }
	   if( document.getElementById("specialization").value == "Education / Training" ){
		   	var specializationArea = document.getElementById("specialization_education").value;
	   }
	   if( document.getElementById("specialization").value == "Engineering" ){
		   	var specializationArea = document.getElementById("specialization_engineering").value;
	   }
	   if( document.getElementById("specialization").value == "Healthcare / Medical" ){
		   	var specializationArea = document.getElementById("specialization_healthcare").value;
	   }
	   if( document.getElementById("specialization").value == "Hotel / Restaurant" ){
		   	var specializationArea = document.getElementById("specialization_hotel").value;
	   }
	   if( document.getElementById("specialization").value == "Legal" ){
		   	var specializationArea = document.getElementById("specialization_legal").value;
	   }
	   if( document.getElementById("specialization").value == "Manufacturing" ){
		   	var specializationArea = document.getElementById("specialization_manufacturing").value;
	   }
	   if( document.getElementById("specialization").value == "Sales / Marketing" ){
		   	var specializationArea = document.getElementById("specialization_sales").value;
	   }
	   if( document.getElementById("specialization").value == "Sciences" ){
		   	var specializationArea = document.getElementById("specialization_sciences").value;
	   }
	   if( document.getElementById("specialization").value == "Services" ){
		   	var specializationArea = document.getElementById("specialization_services").value;
	   }
	   if( document.getElementById("specialization").value == "Other" ){
		   	var specializationArea = document.getElementById("specialization_other").value;
	   }
	   
	   var poststr = "title=" 				+ encodeURI( document.getElementById("title").value ) 			+
                     "&specialization=" 	+ encodeURI( document.getElementById("specialization").value ) 	+
					 "&specialization_area="+ encodeURI( specializationArea ) 								+
					 "&position_level=" 	+ encodeURI( document.getElementById("position_level").value ) 	+
					 "&salary=" 			+ encodeURI( document.getElementById("salary").value ) 			+
					 "&work_region=" 		+ encodeURI( document.getElementById("work_region").value ) 	+
					 "&travel=" 			+ encodeURI( document.getElementById("travel").value ) 			+
					 "&work_hours=" 		+ encodeURI( document.getElementById("work_hours").value ) 		+
					 "&school=" 			+ encodeURI( document.getElementById("school").value ) 			+
					 "&field=" 				+ encodeURI( document.getElementById("field").value ) 			+
					 "&skill_1=" 			+ encodeURI( document.getElementById("skill_1").value ) 		+
					 "&years_1=" 			+ encodeURI( document.getElementById("years_1").value ) 		+
					 "&skill_2=" 			+ encodeURI( document.getElementById("skill_2").value ) 		+
					 "&years_2=" 			+ encodeURI( document.getElementById("years_2").value ) 		+
					 "&skill_3=" 			+ encodeURI( document.getElementById("skill_3").value ) 		+
					 "&years_3=" 			+ encodeURI( document.getElementById("years_3").value ) 		+
					 "&skill_4=" 			+ encodeURI( document.getElementById("skill_4").value ) 		+
					 "&years_4=" 			+ encodeURI( document.getElementById("years_4").value ) 		+
					 "&skill_5=" 			+ encodeURI( document.getElementById("skill_5").value ) 		+
					 "&years_5=" 			+ encodeURI( document.getElementById("years_5").value ) 		+
					 "&overview=" 			+ encodeURI( document.getElementById("overview").value ) 		;

		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'employer_jobs.php?function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_employer_job_posting(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    
    function employer_profile_handler_form(target,id)
    {	   

	   var target = target;
	   var id = id;
	   
	   var poststr = "website=" 		+ encodeURI( document.getElementById("website").value ) 			+
                     "&numberEmployees=" 	+ encodeURI( document.getElementById("numberEmployees").value ) +
					 "&industry="		+ encodeURI( document.getElementById("industry").value ) 			+
					 "&address=" 		+ encodeURI( document.getElementById("address").value ) 			+
					 "&work_region=" 		+ encodeURI( document.getElementById("work_region").value ) 	+
					 "&overview=" 		+ encodeURI( document.getElementById("overview").value ) 			;

		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'employer_profile.php?function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_employer_job_posting(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
	
	function job_skills_handler_form(target,id)
    {	   
	
	   var target = target;
	   var id = id;

	   var poststr = "&skill=" 	+ encodeURI( document.getElementById("skill").value ) 	+
					 "&years=" 	+ encodeURI( document.getElementById("years").value )	;

		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'employer_jobs.php?function=' + escape(target) + "&id=" + escape(id), true);
          httpRequest.onreadystatechange= function () { process_employer_job_posting(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    
    
    function member_job_matching_handler(target,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'match_jobs.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_employer_job_posting(); } ;
        httpRequest.send(null);
   	}
    
    
    function message_handler(target,id)
   	{
        var target = target;
		var form = form;
		var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_messages.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_employer_job_posting(); } ;
        httpRequest.send(null);
   	}
    
	function message_handler_form(target,id)
   	{
       var target = target;
	   var id = id;
	   
	   var poststr = "&messageId=" 	+ encodeURI( document.getElementById("messageId").value ) 	+
					 "&to=" 		+ encodeURI( document.getElementById("to").value )			+
					 "&subject=" 	+ encodeURI( document.getElementById("subject").value )		+
					 "&job_title=" 	+ encodeURI( document.getElementById("job_title").value )	+
					 "&message=" 	+ encodeURI( document.getElementById("message").value )		;

		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_messages.php?function=' + escape(target) + '&id=' + escape(id), true);
          httpRequest.onreadystatechange= function () { process_employer_job_posting(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
   	}
	
	function process_employer_job_posting()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_job_overlay').style.display = "none";
          document.getElementById('section_main_job').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_job').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {

          //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		  document.getElementById('section_main_job_overlay').style.display = "block";
      }

   }
   function process_skills()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_skills_overlay').style.display = "none";
          document.getElementById('section_main_skills').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_skills').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {
		  document.getElementById('section_main_skills_overlay').style.display = "block";
      }

   }

	
	
	
	function send_invites(target)
    {	   
	
	   var target = target;

	   var poststr = "&email_1=" 	+ encodeURI( document.getElementById("email_1").value ) 	+
					 "&email_2=" 	+ encodeURI( document.getElementById("email_2").value ) 	+
					 "&email_3=" 	+ encodeURI( document.getElementById("email_3").value ) 	+
					 "&email_4=" 	+ encodeURI( document.getElementById("email_4").value ) 	+
					 "&email_5=" 	+ encodeURI( document.getElementById("email_5").value ) 	;

		document.getElementById('small_ajax_box').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_contacts.php?function=' + escape(target), true);
          httpRequest.onreadystatechange= function () { process_send_invites(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    function process_send_invites()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('small_ajax_box').style.display = "block";
          document.getElementById('small_ajax_box').innerHTML = "Emails Sent";
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('small_ajax_box').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {
		  document.getElementById('small_ajax_box').style.display = "block";
      }

   }

   
   
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////

	function send_notification_preview()
    {	   
	
		document.getElementById('message_preview').style.display = "block";
     	var message = "You have been invited by " 
 					+ document.getElementById("company_name").value 
 					+ " for a " + document.getElementById("schedule").value 
 					+ " on " + document.getElementById("date").value + " at " 
 					+ document.getElementById("time").value + " for the position of "
 					+ document.getElementById("job_title").value + ". "
 					+ document.getElementById("details").value;
     	
     	document.getElementById('message_preview').innerHTML = message;
    }

    
    function send_notification(target)
    {	   
	
	   var target = target;

	   var poststr = "&schedule=" 		+ encodeURI( document.getElementById("schedule").value ) 		+
					 "&date=" 			+ encodeURI( document.getElementById("date").value ) 			+
					 "&time=" 			+ encodeURI( document.getElementById("time").value ) 			+
					 "&details=" 		+ encodeURI( document.getElementById("details").value ) 		+
					 "&company_name=" 	+ encodeURI( document.getElementById("company_name").value ) 	+
					 "&applicant=" 		+ encodeURI( document.getElementById("applicant").value ) 		+
					 "&applicant_name=" + encodeURI( document.getElementById("applicant_name").value ) 	+
					 "&match=" 			+ encodeURI( document.getElementById("match").value ) 			+
					 "&job_title=" 		+ encodeURI( document.getElementById("job_title").value ) 		;
	
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'employer_contact.php?function=' + escape(target), true);
          httpRequest.onreadystatechange= function () { process_send_notification(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    function process_send_notification()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById('section_main_job_overlay').style.display = "block";
          document.getElementById('section_main_job').innerHTML = httpRequest.responseText;
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_job').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {
		  document.getElementById('section_main_job_overlay').style.display = "block";
      }

   }
   
   
   
   function member_contacts_handler(target,id)
   	{
        var target = target;
        var id = id;
	    
        //document.getElementById('section_main_education').innerHTML = "<div class='loading'>Loading....</div>";
		document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }

		httpRequest.open('GET', 'member_contacts.php?function=' + escape(target) + "&id=" + escape(id), true);

        httpRequest.onreadystatechange = function () { process_send_notification(); } ;
        httpRequest.send(null);
   	}
   	
   	
   	function employer_shortlist_handler(target,id)
   	{
   		var target = target;
        var id = id;
   		var members;
   		
		 for (i=0;i<document.checkbox_form.length;i++)
		 {
			if (document.checkbox_form[i].type=="checkbox" && document.checkbox_form[i].checked)
			{
				members = members +  " " + document.checkbox_form[i].value;
			}
		 }
		 var poststr = "&members=" + encodeURI(members);
		 
		 document.getElementById('section_main_job_overlay').style.display = "block";
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'employer_jobs.php?function=' + escape(target) + '&id=' + escape(id), true);
          httpRequest.onreadystatechange= function () { process_send_notification(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
   	}	
   	
   	
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/



	function send_member_message(target,div,member_id)
    {	   
	
	   var target = target;

	   var poststr = "&message=" + encodeURI( document.getElementById(div + '_message').value );

		document.getElementById(div + '_overlay').style.display = "block";
     
    	//alert(poststr);
    	
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'member_messages.php?function=' + escape(target) + '&id=' + escape(member_id), true);
          httpRequest.onreadystatechange= function () { process_send_member_messages(div); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }

	
	function process_send_member_messages(div)
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  document.getElementById(div + '_overlay').style.display = "none";
		  document.getElementById(div + '_message').value = "";
          document.getElementById(div + '_confirm').innerHTML = "<img src=\"../images/objects_007.gif\" /> Your message has been sent.";
		}
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById(div + '_overlay').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        }
      }
      else
      {
		  document.getElementById(div + '_overlay').style.display = "block";
      }

   }


   	
   	
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/
/*************************************************************************************************************************/
   	

   	
   	function employer_job_system_test()
    {	   
	
	   if( document.getElementById("specialization").value == "Accounting / Finance / Banking" ){
		   	var specializationArea = document.getElementById("specialization_accounting").value;
	   }
	   if( document.getElementById("specialization").value == "Admin / HR" ){
		   	var specializationArea = document.getElementById("specialization_hr").value;
	   }
	   if( document.getElementById("specialization").value == "Arts / Media / Comm" ){
		   	var specializationArea = document.getElementById("specialization_comm").value;
	   }
	   if( document.getElementById("specialization").value == "Building / Construction" ){
		   	var specializationArea = document.getElementById("specialization_construction").value;
	   }
	   if( document.getElementById("specialization").value == "Call Centers / Customer Service" ){
		   	var specializationArea = document.getElementById("specialization_call").value;
	   }
	   if( document.getElementById("specialization").value == "Computer / IT" ){
		   	var specializationArea = document.getElementById("specialization_computer").value;
	   }
	   if( document.getElementById("specialization").value == "Education / Training" ){
		   	var specializationArea = document.getElementById("specialization_education").value;
	   }
	   if( document.getElementById("specialization").value == "Engineering" ){
		   	var specializationArea = document.getElementById("specialization_engineering").value;
	   }
	   if( document.getElementById("specialization").value == "Healthcare / Medical" ){
		   	var specializationArea = document.getElementById("specialization_healthcare").value;
	   }
	   if( document.getElementById("specialization").value == "Hotel / Restaurant" ){
		   	var specializationArea = document.getElementById("specialization_hotel").value;
	   }
	   if( document.getElementById("specialization").value == "Legal" ){
		   	var specializationArea = document.getElementById("specialization_legal").value;
	   }
	   if( document.getElementById("specialization").value == "Manufacturing" ){
		   	var specializationArea = document.getElementById("specialization_manufacturing").value;
	   }
	   if( document.getElementById("specialization").value == "Sales / Marketing" ){
		   	var specializationArea = document.getElementById("specialization_sales").value;
	   }
	   if( document.getElementById("specialization").value == "Sciences" ){
		   	var specializationArea = document.getElementById("specialization_sciences").value;
	   }
	   if( document.getElementById("specialization").value == "Services" ){
		   	var specializationArea = document.getElementById("specialization_services").value;
	   }
	   if( document.getElementById("specialization").value == "Other" ){
		   	var specializationArea = document.getElementById("specialization_other").value;
	   }
	   
	   var poststr = "&specialization=" 	+ encodeURI( document.getElementById("specialization").value ) 	+
					 "&specialization_area="+ encodeURI( specializationArea ) 								+
					 "&salary=" 			+ encodeURI( document.getElementById("salary").value ) 			+
					 "&work_hours=" 		+ encodeURI( document.getElementById("work_hours").value ) 		+
					 "&skill_1=" 			+ encodeURI( document.getElementById("skill_1").value ) 		+
					 "&years_1=" 			+ encodeURI( document.getElementById("years_1").value ) 		+
					 "&skill_2=" 			+ encodeURI( document.getElementById("skill_2").value ) 		+
					 "&years_2=" 			+ encodeURI( document.getElementById("years_2").value ) 		+
					 "&skill_3=" 			+ encodeURI( document.getElementById("skill_3").value ) 		+
					 "&years_3=" 			+ encodeURI( document.getElementById("years_3").value ) 		;
     
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }		
	      httpRequest.open('POST', 'system_results.php', true);
          httpRequest.onreadystatechange= function () { process_employer_job_system_test(); } ;
		  httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");		
          httpRequest.send(poststr);
    }
    
    function process_employer_job_system_test()
   {
      if (httpRequest.readyState == 4)
      {
        if(httpRequest.status == 200)
        {
		  //document.getElementById('section_main_job_overlay').style.display = "none";
          document.getElementById('section_main_job').innerHTML = httpRequest.responseText;
          //document.getElementById('section_main_job').innerHTML = "<div class='loading'><img src=\"../images/ajax-loader-small-green.gif\" /> Loading....</div>";
        }
        else
        {
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

            document.getElementById('section_main_job').innerHTML = "Error: can not get the content ("+ httpRequest.statusText +")";
        //	document.getElementById('section_main_job').innerHTML = "<div class='loading'><img src=\"../images/ajax-loader-small-green.gif\" /> Loading....</div>";
		}
      }
      else
      {

          document.getElementById('section_main_job').innerHTML = "<div class='loading'><img src=\"../images/ajax-loader-small-green.gif\" /> Calculating Matches.... (This will take a few seconds)</div>";
		  //document.getElementById('section_main_job_overlay').style.display = "block";
      }

   }