var xmlhttp=false;
/*@cc_on @*/
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
 

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

function handler() {
	if(http.readyState == 4 && http.status == 200) {
		alert("Recruitment Updated");
	}
}

var http = xmlhttp;
var url = "index.php";

function postMethod(){	
	var post = document.recruitment;
	var data;
	var key;
	for(var i = 0; i < post.length; i++){
		if(post.elements[i].value == 'Submit'){
		}else{
			key = post.elements[i].name;
			data += '&'+key+'='+post.elements[i].value;
			if(post.elements[i].value > 0){
					//document.getElementById().innerHTML = '<img src="images/recruit/everquest/Berserker.gif" width="20" height="20">'+ key+": "+post.elements[i].value;
			}
		}
	}
	
	var params =  "do=recruit_update&classes=" + data;
	http.open("POST", url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");

	http.onreadystatechange = handler;
	http.send(params);

	
}