
function closeCost(what)
{
	document.getElementById(what).style.display = "none";
	//document.getElementById('shareBox').style.display = "none";
	if(what!='showPop'){
	refreshWin(what);
	}
	//alert(document.getElementById('showWin').style.display);
	
}




function openWin(){
	document.getElementById('showWin').style.display = "block";
	//document.getElementById('showPop').style.display = "none";
}
function openCont(kint){
	document.getElementById(kint).style.display = "block";
}

function getClaimResponse(cont_name, cont_email, cont_date, cont_comm, cont_agree, cont_phone, moving_from_link, came)
{

if(came=='claimFormBox'){
	var shareBoxV = 'claimFormBox';
	var responseV = 'claimResponse';
}else if(came=='claimFormBox2'){
	var shareBoxV = 'claimFormBox2';
	var responseV = 'claimResponse2';
}

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		  
		  if(cont_name!='' && cont_email !='' && cont_date !='' && cont_phone !=''){
			if(isValidEmail(cont_email)){
			 
				  document.getElementById(responseV).innerHTML="";
				  document.getElementById(shareBoxV).innerHTML=xmlHttp.responseText;
			 
			}else{
				document.getElementById(responseV).innerHTML="<p>A valid e-mail address is required!</p>";
			}
		  }else{
			  document.getElementById(responseV).innerHTML="<p>Please fill out all fields marked with *!</p>";
		  }
		 
		  //document.myform.message.value = '';
	  }
	}
	
	
   var url="/forms/claimResponse.php";
   url=url+"?cont_name="+cont_name;
   url=url+"&cont_email="+cont_email;
   url=url+"&cont_date="+cont_date;
   url=url+"&cont_agree="+cont_agree;
   url=url+"&cont_phone="+cont_phone;
   url=url+"&cont_comm="+cont_comm;
   url=url+"&from_link="+moving_from_link;
   url=url+"&came="+came;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  }

function getTestimonialResponse(cont_name, cont_email, cont_date, cont_comm, cont_agree, moving_from_link, came)
{

if(came=='testFormBox'){
	var shareBoxV = 'testFormBox';
	var responseV = 'testResponse';
}else if(came=='testFormBox2'){
	var shareBoxV = 'testFormBox2';
	var responseV = 'testResponse2';
}

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		  
		  if(cont_name!='' && cont_email !='' && cont_date !='' && cont_comm !=''){
			if(isValidEmail(cont_email)){
				
				  document.getElementById(responseV).innerHTML="";
				  document.getElementById(shareBoxV).innerHTML=xmlHttp.responseText;
			 
			}else{
				document.getElementById(responseV).innerHTML="<p>A valid e-mail address is required!</p>";
			}
		  }else{
			  document.getElementById(responseV).innerHTML="<p>Please fill out all fields marked with *!</p>";
		  }
		 
		  //document.myform.message.value = '';
	  }
	}
	
	
   var url="/forms/testimonialResponse.php";
   url=url+"?cont_name="+cont_name;
   url=url+"&cont_email="+cont_email;
   url=url+"&cont_date="+cont_date;
   url=url+"&cont_agree="+cont_agree;
   url=url+"&cont_comm="+cont_comm;
   url=url+"&from_link="+moving_from_link;
   url=url+"&came="+came;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  }
				
				
				
				
				
function getFriendResponse(cont_name, cont_email, friend_email, cont_comm, moving_from_link, came)
{


if(came=='friendBox'){
	var shareBoxV = 'friendBox';
	var responseV = 'friendResponse';
}else if(came=='friendBox2'){
	var shareBoxV = 'friendBox2';
	var responseV = 'friendResponse2';
}

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		  
		  if(cont_name!='' && cont_email !='' && friend_email !=''){
			if(isValidEmail(cont_email) && isValidEmail(friend_email)){
			 
				  document.getElementById(responseV).innerHTML="";
				  document.getElementById(shareBoxV).innerHTML=xmlHttp.responseText;
			 
			}else{
				document.getElementById(responseV).innerHTML="<p>A valid e-mail address is required!</p>";
			}
		  }else{
			  document.getElementById(responseV).innerHTML="<p>Please fill out all fields marked with *!</p>";
		  }
		 
		  //document.myform.message.value = '';
	  }
	}
	
	
   var url="/forms/friendResponse.php";
   url=url+"?cont_name="+cont_name;
   url=url+"&cont_email="+cont_email;
   url=url+"&friend_email="+friend_email;
   url=url+"&cont_comm="+cont_comm;
   url=url+"&from_link="+moving_from_link;
   url=url+"&came="+came;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  }










function getMessageResponse(name, phone, email, date, size, from, to, from_link, came)
{

if(name=='Name'){
	name = '';
}
if(phone=='Phone'){
	phone = '';
}
if(email=='Email'){
	email = '';
}
if(from=='Moving From (Zip or City/State)'){
	from = '';
}
if(to=='Moving To (Zip or City/State)'){
	to = '';
}



if(came=='shareBox'){
	var shareBoxV = 'shareBox';
	var responseV = 'response';
}else if(came=='shareBox2'){
	var shareBoxV = 'shareBox2';
	var responseV = 'response2';
}

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		  
		  if(name!='' && phone !='' && email !='' && date !='' && size !='' && from !='' && to !=''){
			if(isValidEmail(email)){
			 
				  document.getElementById(responseV).innerHTML="";
				  document.getElementById(shareBoxV).innerHTML=xmlHttp.responseText;
			 
			}else{
				document.getElementById(responseV).innerHTML="<p>A valid e-mail address is required!</p>";
			}
		  }else{
			
			  document.getElementById(responseV).innerHTML="<p>Please fill out all fields marked with *!</p>";
		  }
		 
		  //document.myform.message.value = '';
	  }
	}
   var url="/forms/quoteResponse.php";
   url=url+"?name="+name;
   url=url+"&phone="+phone;
   url=url+"&email="+email;
   url=url+"&date="+date;
   url=url+"&to="+to;
   url=url+"&from="+from;
   url=url+"&size="+size;
   url=url+"&from_link="+from_link;
   url=url+"&came="+came;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  }

  
  
 

function getSpecialsResponse(name, phone, email, date, from_link, came)
{

if(name=='Name'){
	name = '';
}
if(phone=='Phone'){
	phone = '';
}
if(email=='Email'){
	email = '';
}


if(came=='shareBoxSp1'){
	var shareBoxV = 'shareBoxSp1';
	var responseV = 'responseSp1';
}else if(came=='shareBoxSp2'){
	var shareBoxV = 'shareBoxSp2';
	var responseV = 'responseSp2';
}else if(came=='shareBoxSp3'){
	var shareBoxV = 'shareBoxSp3';
	var responseV = 'responseSp3';
}

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		  
		  if(name!='' && phone !='' && email !='' && date !=''){
			if(isValidEmail(email)){
			 
				  document.getElementById(responseV).innerHTML="";
				  document.getElementById(shareBoxV).innerHTML=xmlHttp.responseText;
			 
			}else{
				document.getElementById(responseV).innerHTML="<p>A valid e-mail address is required!</p>";
			}
		  }else{
			
			  document.getElementById(responseV).innerHTML="<p>Please fill out all fields marked with *!</p>";
		  }
		 
		  //document.myform.message.value = '';
	  }
	}
   var url="/forms/specialsResponse.php";
   url=url+"?name="+name;
   url=url+"&phone="+phone;
   url=url+"&email="+email;
   url=url+"&date="+date;
   url=url+"&from_link="+from_link;
   url=url+"&came="+came;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  } 
  
  
  


/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  //strEmail = document.forms[0].email.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      //alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    } 
    return true; 
}



  
function refreshWin(kint)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
	{
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
  catch (e)
	{
	try
	  {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	catch (e)
	  {
	  alert("Your browser does not support AJAX!");
	  return false;
	  }
	}
  }
  xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
		document.getElementById(kint).innerHTML=xmlHttp.responseText;
	  }
	  
	  //document.myform.message.value = '';
	  }
   var url="/refreshResponse.php";
   url=url+"?kint="+kint;
   url=url+"&sid="+Math.random();
	 xmlHttp.open("GET",url,true);
	 xmlHttp.send(null);
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
