var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function show_promotions() {
 	if (xmlHttp.readyState == 4) {
	    var response = xmlHttp.responseText;
		document.getElementById('promotions').innerHTML = response;
	}
}

function event_company_populate_promotion(company_option){
	var company_id = company_option.options[company_option.selectedIndex].value;
	var url = "_get_promotions.php?company_id=" + escape(company_id);
	
	// Open a connection to the server
	xmlHttp.open("GET", url, true);
	
	// Setup a function for the server to run when it's done
	xmlHttp.onreadystatechange = show_promotions;
	
	// Send the request
	xmlHttp.send(null);
}
