//+++++++++++++++++++++++++++++++++++++++++++++
//   AJAX
//   JAVASCRIPT CALLS FOR AJAX
//+++++++++++++++++++++++++++++++++++++++++++++
function getCaptcha(){
var postValues 	= "" ;
var div_id				= "randomCaptcha";  
var processFile 	= "lead_gen/ajax/random_captcha.inc.php"	;
pkl_AjaxCall_POST(processFile, postValues, div_id)	;
}

 
function processReqInfo(targetDiv){
// for processing Prospect's request for more info
var nameFirst 			= document.getElementById("prospNameFirst").value;
var nameLast 			= document.getElementById("prospNameLast").value;
if(document.getElementById("prospCompany")){
var company			= document.getElementById("prospCompany").value; }else{ company ="none" }
if(document.getElementById("prospPhone")){
	var phone				= document.getElementById("prospPhone").value;}else{ phone ="none" }
var email 					= document.getElementById("prospEmail").value;
if(document.getElementById("prospIndustry")){
			var industry				= document.getElementById("prospIndustry").value; }else{ industry ="none" }
if(document.getElementById("textcomments") ){
			var textcomments	= document.getElementById("textcomments").value; }else{ textcomments ="none" }
if(document.getElementById("companytitle") ){
			var companytitle	= document.getElementById("companytitle").value; }else{ companytitle ="none" }			
var captchaImg		= document.getElementById("captchaImg").src;
var captchaChar		= document.getElementById("captchaChar").value;
var prospId				= document.getElementById("prospId").value;
var assocPg				= document.getElementById("assocPg").value;
var form				    = document.getElementById("form").value;
if(document.getElementById("manuf-info")){
		var checkbox	= document.getElementById("manuf-info").checked;
		}
//checkbox for the marketing drip campaign 
if(document.getElementById("drip-signup")){
		var dripSignup	= document.getElementById("drip-signup").checked;
		}



var postValues 	= "nameFirst="+nameFirst+"&nameLast="+nameLast+"&company="+company+"&phone="+phone+"&email="+email+"&industry="+industry+"&textcomments="+textcomments+"&companytitle="+companytitle+"&captcha-img="+captchaImg+"&captcha-char="+captchaChar+"&prosp_id="+prospId+"&assocPg="+assocPg+"&form="+form+"&checkbox="+checkbox+"&drip_signup="+dripSignup;
var processFile 	= "lead_gen/ajax/processInfoRequest.php"	;
var div_id				= targetDiv ;

pkl_AjaxCall_POST(processFile, postValues, div_id)	;
}//function processReqInfo()

//+++++++++++++++++++++++++++++++++++++++++++++
//      ZEMELRECK FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++
 
function pkl_AjaxCall_POST(processFile, postValues, div_id){
 	var XMLHttpRequestObject = false;
  	if (window.XMLHttpRequest) {
				XMLHttpRequestObject = new XMLHttpRequest();
  			} else if (window.ActiveXObject) {
				XMLHttpRequestObject = new 
				ActiveXObject("Microsoft.XMLHTTP");
  			}//if-else
  	if(XMLHttpRequestObject) {
			XMLHttpRequestObject.open("POST", processFile); 
    		XMLHttpRequestObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');  
			XMLHttpRequestObject.onreadystatechange = function() { 
								document.getElementById(div_id).innerHTML = "<img src='lead_gen/images/loading.gif' /> Requesting content..." ;
	  							if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { 
		  							document.getElementById(div_id).innerHTML = XMLHttpRequestObject.responseText;
	  							} //if
						} //function
			XMLHttpRequestObject.send(postValues); 
  		}// if(XMLHttpRequestObject)
  }//function pkl_AjaxCall(processFile, div )