
var xmlHttp;


function getContactInfo()
{ 
var dept = document.getElementById("dept").value;
var email = document.getElementById("email").value;
var message = document.getElementById("message").value;
xmlHttpContact=GetXmlHttpObject();
if (xmlHttpContact==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/sendcontact.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/sendcontact.php";}
if (host=="pipelinei.com"){var url="http://pipelinei.com/technology/sendcontact.php";}
if (host=="www.pipelinei.com"){var url="http://www.pipelinei.com/technology/sendcontact.php";}
//var url="http://favoriteagent.com/newsite/sendcontact.php";
url=url+"?name="+name;
url=url+"&dept="+dept;
url=url+"&email="+email;
url=url+"&message="+message;
url=url+"&sid="+Math.random();
xmlHttpContact.onreadystatechange=stateChangedContact;
xmlHttpContact.open("GET",url,true);
xmlHttpContact.send(null);
}

function stateChangedContact() 
{ 
if (xmlHttpContact.readyState==4 || xmlHttpContact.readyState=="complete")
 { 
  document.getElementById("contact_result").innerHTML=xmlHttpContact.responseText;
 } 
}

function getCities()
{ 
xmlHttpCities=GetXmlHttpObject();
if (xmlHttpCities==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/getcities.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/getcities.php";}
url=url+"?sid="+Math.random();
url=url+"&states="+document.getElementById("states").value;
xmlHttpCities.onreadystatechange=stateChangedCities;
xmlHttpCities.open("GET",url,true);
xmlHttpCities.send(null);
}

function stateChangedCities() 
{ 
if (xmlHttpCities.readyState==4 || xmlHttpCities.readyState=="complete")
 { 
  document.getElementById("citydata").innerHTML=xmlHttpCities.responseText;
 } 
}

function getLCMForm()
{
xmlHttpLCMForm=GetXmlHttpObject();
if (xmlHttpLCMForm==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }

var url="http://favoriteagent.com/newsite/findagent_form.php";
url=url+"?sid="+Math.random();
url=url+"&country="+document.getElementById("country").value;
url=url+"&state="+document.getElementById("states").value;
url=url+"&city="+document.getElementById("cities").value;
xmlHttpLCMForm.onreadystatechange=stateChangedLCMForm;
xmlHttpLCMForm.open("GET",url,true);
xmlHttpLCMForm.send(null);
}

function stateChangedLCMForm() 
{ 
if (xmlHttpLCMForm.readyState==4 || xmlHttpLCMForm.readyState=="complete")
 { 
  document.getElementById("main_text").innerHTML=xmlHttpLCMForm.responseText;
 } 
}

function processLCM()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/findagent_process.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/findagent_process.php";}
var params = "f_loan_type="+document.getElementById("f_loan_type").value;
params+="&f_home_type="+document.getElementById("f_home_type").value;
params+="&AgentR="+document.getElementById("AgentR").value;
params+="&Type="+document.getElementById("Buying or Selling field").value;
params+="&FirstName="+document.getElementById("First Name").value;
params+="&LastName="+document.getElementById("Last Name").value;
params+="&Email="+document.getElementById("Email Address").value;
params+="&f_home_phone="+document.getElementById("f_home_phone").value;
params+="&f_other_phone="+document.getElementById("f_other_phone").value;
params+="&f_city="+document.getElementById("f_city").value;
params+="&f_state="+document.getElementById("f_state").value;
params+="&f_credit_rating="+document.getElementById("f_credit_rating").value;
params+="&f_price_range="+document.getElementById("Price Range").value;
params+="&f_ltv="+document.getElementById("Down Payment").value;
params+="&MM_insert="+document.getElementById("MM_insert").value;
xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessLCM;
xmlHttpProcess.send(params);
}

function stateChangedProcessLCM() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  document.getElementById("main_text").innerHTML=xmlHttpProcess.responseText;
 } 
}

function processBrokerage()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/process_brokerage.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/process_brokerage.php";}
var params = "fname="+document.getElementById("fname").value;
params+="&lname="+document.getElementById("lname").value;
params+="&mobile_phone="+document.getElementById("mobile_phone").value;
params+="&alt_phone="+document.getElementById("alt_phone").value;
params+="&email="+document.getElementById("email").value;
params+="&company_name="+document.getElementById("company_name").value;
params+="&sell_reason="+document.getElementById("sell_reason").value;
params+="&address="+document.getElementById("address").value;
params+="&city="+document.getElementById("city").value;
params+="&state="+document.getElementById("state").value;
params+="&zip="+document.getElementById("zip").value;
params+="&value="+document.getElementById("value").value;
params+="&agents="+document.getElementById("agents").value;
params+="&brokers="+document.getElementById("brokers").value;
params+="&split_arrangement="+document.getElementById("split_arrangement").value;
params+="&staff="+document.getElementById("staff").value;
params+="&transactions="+document.getElementById("transactions").value;
params+="&avg_sale_price="+document.getElementById("avg_sale_price").value;
params+="&properties_managed="+document.getElementById("properties_managed").value;
params+="&rents="+document.getElementById("rents").value;
params+="&net_income="+document.getElementById("net_income").value;
params+="&assets="+document.getElementById("assets").value;

xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessBrokerage;
xmlHttpProcess.send(params);
}

function stateChangedProcessBrokerage() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  document.getElementById("form_area").style.backgroundColor='#FFFFFF';
  document.getElementById("form_area").style.border='';
  document.getElementById("form_area").innerHTML=xmlHttpProcess.responseText;
 } 
}

function processRecruitmentForm()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/recruitment_process.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/recruitment_process.php";}
if (host=="rvpinfo.favoriteagent.com"){var url="http://rvpinfo.favoriteagent.com/recruitment_process.php";}
var params = "AgentR="+document.getElementById("AgentR").value;
params+="&FirstName="+document.getElementById("First Name").value;
params+="&LastName="+document.getElementById("Last Name").value;
params+="&Email="+document.getElementById("Email Address").value;
params+="&f_home_phone="+document.getElementById("f_home_phone").value;
params+="&interest="+document.getElementById("interest").value;
params+="&f_city="+document.getElementById("f_city").value;
params+="&source_id="+document.getElementById("source_id").value;
params+="&agent_id="+document.getElementById("agent_id").value;
params+="&f_state="+document.getElementById("f_state").value;
params+="&company="+document.getElementById("company").value;
params+="&license="+document.getElementById("license").value;
params+="&yrs_exp="+document.getElementById("yrs_exp").value;
params+="&broker_exp="+document.getElementById("broker_exp").value;
params+="&transactions="+document.getElementById("transactions").value;
params+="&tech_exp="+document.getElementById("tech_exp").value;
params+="&numb_agents="+document.getElementById("numb_agents").value;
params+="&considerations="+document.getElementById("considerations").value;


xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessRecruitment;
xmlHttpProcess.send(params);
}

function stateChangedProcessRecruitment() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  scroll(0,0);
  document.getElementById("main_text").innerHTML=xmlHttpProcess.responseText;
 } 
}

function processRecruitmentFormBlack()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/recruitment_process_black.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/recruitment_process_black.php";}
var params = "AgentR="+document.getElementById("AgentR").value;
params+="&FirstName="+document.getElementById("First Name").value;
params+="&LastName="+document.getElementById("Last Name").value;
params+="&Email="+document.getElementById("Email Address").value;
params+="&f_home_phone="+document.getElementById("f_home_phone").value;
params+="&interest="+document.getElementById("interest").value;
params+="&f_city="+document.getElementById("f_city").value;
//params+="&f_state="+document.getElementById("f_state").value;
params+="&company="+document.getElementById("company").value;
params+="&license="+document.getElementById("license").value;
params+="&yrs_exp="+document.getElementById("yrs_exp").value;
params+="&broker_exp="+document.getElementById("broker_exp").value;
params+="&transactions="+document.getElementById("transactions").value;
params+="&tech_exp="+document.getElementById("tech_exp").value;
params+="&numb_agents="+document.getElementById("numb_agents").value;
params+="&considerations="+document.getElementById("considerations").value;

xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessRecruitmentBlack;
xmlHttpProcess.send(params);
}

function stateChangedProcessRecruitmentBlack() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  parent.document.getElementById("iframe1").style.height = "100px";
  document.getElementById("content").innerHTML=xmlHttpProcess.responseText;
  
 } 
}


function processPreinterviewForm()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/preinterview_process.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/preinterview_process.php";}
var params = "id="+document.getElementById("id").value;
params+="&ld_id="+document.getElementById("ld_id").value;
params+="&email="+document.getElementById("email").value;
params+="&cust_name="+document.getElementById("cust_name").value;
params+="&yrs_real_estate="+document.getElementById("years_real_estate").value;
params+="&yrs_broker="+document.getElementById("years_broker").value;
params+="&production_last_yr="+document.getElementById("production_last_yr").value;
params+="&production_this_yr="+document.getElementById("production_this_yr").value;
params+="&hrs_per_week="+document.getElementById("hrs_per_week").value;
params+="&full_time="+document.getElementById("full_time").value;
params+="&states="+document.getElementById("states").value;
params+="&agents_recruited="+document.getElementById("agents_recruited").value;
params+="&production="+document.getElementById("production").value;
params+="&numb_agents="+document.getElementById("numb_agents").value;
params+="&dom="+document.getElementById("dom").value;
params+="&absorption="+document.getElementById("absorption").value;
params+="&list_to_sale="+document.getElementById("list_to_sale").value;
params+="&avg_list_price_new="+document.getElementById("avg_list_price_new").value;
params+="&avg_list_price_pre="+document.getElementById("avg_list_price_pre").value;
params+="&numb_pre_sold="+document.getElementById("numb_pre_sold").value;
params+="&numb_new_sold="+document.getElementById("numb_new_sold").value;
params+="&numb_pre_onmarket="+document.getElementById("numb_pre_onmarket").value;
params+="&numb_new_onmarket="+document.getElementById("numb_new_onmarket").value;
params+="&ten_largest="+document.getElementById("ten_largest").value;
params+="&one_trans="+document.getElementById("one_trans").value;
params+="&six_trans="+document.getElementById("six_trans").value;
params+="&twelve_trans="+document.getElementById("twelve_trans").value;
params+="&twentyfive_trans="+document.getElementById("twentyfive_trans").value;
params+="&fifty_trans="+document.getElementById("fifty_trans").value;
params+="&indy_comps="+document.getElementById("indy_comps").value;
params+="&essay1="+document.getElementById("essay1").value;
params+="&essay2="+document.getElementById("essay2").value;
params+="&essay3="+document.getElementById("essay3").value;
params+="&goals1="+document.getElementById("goals1").value;
params+="&goals2="+document.getElementById("goals2").value;
params+="&goals3="+document.getElementById("goals3").value;
params+="&assessment1="+document.getElementById("assessment1").value;
params+="&assessment2="+document.getElementById("assessment2").value;
params+="&assessment3="+document.getElementById("assessment3").value;


xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessPreinterview;
xmlHttpProcess.send(params);
}

function stateChangedProcessPreinterview() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  scroll(0,0);
  document.getElementById("main_text").innerHTML=xmlHttpProcess.responseText;
 } 
}

function processPreinterviewFormBlack()
{ 
xmlHttpProcess=GetXmlHttpObject();
if (xmlHttpProcess==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var host = document.location.host;
if (host=="favoriteagent.com"){var url="http://favoriteagent.com/newsite/preinterview_process_black.php";}
if (host=="www.favoriteagent.com"){var url="http://www.favoriteagent.com/newsite/preinterview_process_black.php";}
var params = "id="+document.getElementById("id").value;
params+="&ld_id="+document.getElementById("ld_id").value;
params+="&email="+document.getElementById("email").value;
params+="&cust_name="+document.getElementById("cust_name").value;
params+="&yrs_real_estate="+document.getElementById("years_real_estate").value;
params+="&yrs_broker="+document.getElementById("years_broker").value;
params+="&production_last_yr="+document.getElementById("production_last_yr").value;
params+="&production_this_yr="+document.getElementById("production_this_yr").value;
params+="&hrs_per_week="+document.getElementById("hrs_per_week").value;
params+="&full_time="+document.getElementById("full_time").value;
params+="&states="+document.getElementById("states").value;
params+="&agents_recruited="+document.getElementById("agents_recruited").value;
params+="&production="+document.getElementById("production").value;
params+="&numb_agents="+document.getElementById("numb_agents").value;
params+="&dom="+document.getElementById("dom").value;
params+="&absorption="+document.getElementById("absorption").value;
params+="&list_to_sale="+document.getElementById("list_to_sale").value;
params+="&avg_list_price_new="+document.getElementById("avg_list_price_new").value;
params+="&avg_list_price_pre="+document.getElementById("avg_list_price_pre").value;
params+="&numb_pre_sold="+document.getElementById("numb_pre_sold").value;
params+="&numb_new_sold="+document.getElementById("numb_new_sold").value;
params+="&numb_pre_onmarket="+document.getElementById("numb_pre_onmarket").value;
params+="&numb_new_onmarket="+document.getElementById("numb_new_onmarket").value;
params+="&ten_largest="+document.getElementById("ten_largest").value;
params+="&one_trans="+document.getElementById("one_trans").value;
params+="&six_trans="+document.getElementById("six_trans").value;
params+="&twelve_trans="+document.getElementById("twelve_trans").value;
params+="&twentyfive_trans="+document.getElementById("twentyfive_trans").value;
params+="&fifty_trans="+document.getElementById("fifty_trans").value;
params+="&essay1="+document.getElementById("essay1").value;
params+="&essay2="+document.getElementById("essay2").value;
params+="&essay3="+document.getElementById("essay3").value;
params+="&goals1="+document.getElementById("goals1").value;
params+="&goals2="+document.getElementById("goals2").value;
params+="&goals3="+document.getElementById("goals3").value;
params+="&assessment1="+document.getElementById("assessment1").value;
params+="&assessment2="+document.getElementById("assessment2").value;
params+="&assessment3="+document.getElementById("assessment3").value;

xmlHttpProcess.open("POST",url,true);
xmlHttpProcess.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpProcess.setRequestHeader("Content-length", params.length);
xmlHttpProcess.setRequestHeader("Connection", "close");
xmlHttpProcess.onreadystatechange=stateChangedProcessPreinterviewBlack;
xmlHttpProcess.send(params);
}

function stateChangedProcessPreinterviewBlack() 
{ 
if (xmlHttpProcess.readyState==4 || xmlHttpProcess.readyState=="complete")
 { 
  scroll(0,0);
  document.getElementById("content").innerHTML=xmlHttpProcess.responseText;
 } 
}

function homePage()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/homepage.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function findAgent()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/findagent.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function ourStory()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/ourstory.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function pressRoom()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/pressroom.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function opportunity()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/opportunity.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function contactUs()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="http://favoriteagent.com/newsite/contactus.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
    document.getElementById("main_text").innerHTML=xmlHttp.responseText;
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}