var xmlHttp

function sendEmail()
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="http://www.baroosoftware.com/contact-us/send-email.php"
url=url+"?name="+document.getElementById("fname").value
url=url+"&phone="+document.getElementById("phone").value
url=url+"&email="+document.getElementById("email").value
url=url+"&details="+document.getElementById("details").value
xmlHttp.onreadystatechange=stateChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
$("#pixel").html('<!-- Conversion Pixel – Baroo- DO NOT MODIFY --><img src="http://ib.adnxs.com/px?id=994&t=2" width="1" height="1" /><!-- End of Conversion Pixel --><!-- Burn Pixel – Baroo - DO NOT MODIFY --><img src="http://ib.adnxs.com/seg?remove=37511&t=2" width="1" height="1" /><!-- End of Burn Pixel -->');
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("contact-error").innerHTML=xmlHttp.responseText
 if(xmlHttp.responseText=="<p>Thank you for your interest in Baroo Software, your inquiry was submitted. We will get back to you before the close of the next business day.</p><p>We have one more question for you:</p>How did you hear about Baroo?<form action='how-did-you-hear-about-us.php' method='post'><textarea name='text' rows='20' cols='40' style='margin-bottom:10px;'></textarea><div class='clear'></div><input type='submit' value='Submit' class='button' /> <input type='button' class='button' value='No thanks' onclick='noThanks();' /></form>")
 document.getElementById("contact-information-form").innerHTML="" 
 } 
}

function noThanks(){
	document.getElementById("contact-error").innerHTML="Thanks again! We will get back to you before the close of the next business day.";
}


function callUs()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="http://www.baroosoftware.com/contact-us/callus.php"
url=url+"?pname="+document.getElementById("pname").value
url=url+"&company="+document.getElementById("company").value
url=url+"&phone="+document.getElementById("phone").value
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("have-us-call-you-error").innerHTML=xmlHttp.responseText
  if(xmlHttp.responseText=="<p>Thank you for your interest in Baroo Software, we will call you before the close of the next business day.</p><p class='small-button'><a href='javascript:hidePopup();' title='close'><strong><em>close</em></strong></a></p>")
  document.getElementById("have-us-call-you").innerHTML=""
 } 
}

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;
}
	function showPopup(){
		document.getElementById('hide-show').style.display = 'block';
		document.getElementById('have-us-call-you-error').innerHTML=""
		document.getElementById('have-us-call-you').innerHTML="<p>Please enter your information below...</p><form action='callus.php' method='post' id='sendphone'><input type='text' name='pname' id='pname' /><label for='pname'>Name</label><input type='text' name='company' id='company' /><label for='company'>Company</label><input type='text' name='phone' id='phone' /><label for='phone'>Phone</label><input type='button' onclick='callUs();' value='call me' class='button' /><input type='button' value='close' class='button' onclick='hidePopup();' /></form>"
		
	}
	function hidePopup(){
		document.getElementById('hide-show').style.display = 'none';
	}
