function makerequestsimplefp(serverPage, objID, type)
{
	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;
			}
    		}
  	}
	var obj = document.getElementById(objID);
	
	xmlHttp.onreadystatechange=function()
    	{
		if(xmlHttp.readyState==4)
	      	{
			if(xmlHttp.status == 200)
			{
	        			obj.innerHTML = xmlHttp.responseText;
				tb_init('a.thickbox, area.thickbox, input.thickbox');
			}
      		}
		else
		{
			obj.innerHTML = '<div class="Box_2Column"><center><img src="/build/ajax_loader.gif" border="0"></center></div>';
		}
    	}
	
	//type is either POST or GET
	xmlHttp.open(type, serverPage,true);
	xmlHttp.send(null);

}
function makerequestsimple(serverPage, objID, type)
{
	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;
			}
    		}
  	}
	var obj = document.getElementById(objID);
	
	xmlHttp.onreadystatechange=function()
    	{
		if(xmlHttp.readyState==4)
	      	{
			if(xmlHttp.status == 200)
			{
	        		obj.innerHTML = xmlHttp.responseText;
			}
			else
			{

			}
      		}
    	}
	
	//type is either POST or GET
	xmlHttp.open(type, serverPage,true);
	xmlHttp.send(null);

}
function makerequestsimpleTracking(serverPage, objID, type, pName)
{
	var xmlHttp;
	var pageName;
	pageName = pName;
	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;
			}
    		}
  	}
	var obj = document.getElementById(objID);
	
	xmlHttp.onreadystatechange=function()
    	{
		if(xmlHttp.readyState==4)
	      	{
			if(xmlHttp.status == 200)
			{
	        		obj.innerHTML = xmlHttp.responseText;
				//pageTracker._trackPageview(pageName);
			}
			else
			{

			}
      		}
    	}
	
	//type is either POST or GET
	xmlHttp.open(type, serverPage,true);
	xmlHttp.send(null);

}
function makerequest(serverPage, objID, parameters)
{
	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;
			}
    		}
  	}
	var obj = document.getElementById(objID);
	
	xmlHttp.onreadystatechange=function()
    	{
		if(xmlHttp.readyState==4)
	      	{
			if(xmlHttp.status == 200)
			{
				var mtext = xmlHttp.responseText;
	        			if (mtext == 1)
				{
					obj.innerHTML = '<span style="color:#FF0000">Thanks someone will contact you shortly</span>';
					setTimeout('$(".ContactForm").fadeOut("2000")', 1000);
				}
				else 
				{
					obj.innerHTML = xmlHttp.responseText;
				}

			}
			else
			{

			}
      		}
    	}

	xmlHttp.open("POST", serverPage,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", parameters.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(parameters);
}


function contactA(checker) 
{
	var selectBox = document.forminfonew.contactmeth;
	var contactm = selectBox.options[selectBox.selectedIndex].value;
	var statusval;
	for (var p=0; p < document.formselect.currentstatus.length; p++)
	{
   		if (document.formselect.currentstatus[p].checked)
      		{
		      statusval = document.formselect.currentstatus[p].value;
      		}
   	}
	var poststr = "submit" + encodeURI( document.getElementById("submit").value ) + "&email=" + encodeURI( document.getElementById("email").value ) +
                    "&fname=" + encodeURI( document.getElementById("fname").value ) + 
                    "&lname=" + encodeURI( document.getElementById("lname").value ) + "&phone=" + encodeURI( document.getElementById("phone").value ) +
                    "&apthome=" + encodeURI( document.getElementById("apthome").value ) + "&comments=" + encodeURI( document.getElementById("comments").value ) + "&contactmeth=" + encodeURI(contactm)
			+ "&complexname=" + encodeURI(checker) + "&cstatus=" + encodeURI(statusval);

       makerequest('/build/contactprocess.php', 'contactform_message', poststr);
}


function contactB(checker) 
{
	var selectBox = document.forminfonewB.aptsize;
	var flrplan = selectBox.options[selectBox.selectedIndex].value;

	var selectBox1 = document.forminfonewB.FlrPre;
	var flrpre = selectBox1.options[selectBox1.selectedIndex].value;

	var selectBox2 = document.forminfonewB.WithPets;
	var withpets = selectBox2.options[selectBox2.selectedIndex].value;

	var statusval;
	for (var p=0; p < document.formselect.currentstatus.length; p++)
	{
   		if (document.formselect.currentstatus[p].checked)
      		{
		      statusval = document.formselect.currentstatus[p].value;
      		}
   	}
	var poststr = "submit" + encodeURI( document.forminfonewB.submit.value ) +
			 "&email=" + encodeURI( document.forminfonewB.email.value ) +
                    "&fname=" + encodeURI( document.forminfonewB.fname.value ) + 
                    "&lname=" + encodeURI( document.forminfonewB.lname.value ) + 
			"&phone=" + encodeURI( document.forminfonewB.phone.value ) +
			"&addy=" + encodeURI( document.forminfonewB.addy.value ) +
			"&city=" + encodeURI( document.forminfonewB.city.value ) +
			"&state=" + encodeURI( document.forminfonewB.state.value ) +
			"&zip=" + encodeURI( document.forminfonewB.zip.value ) +
			"&movedate=" + encodeURI( document.forminfonewB.MoveInDate.value ) +
			"&datefield=" + encodeURI( document.forminfonewB.DateField.value ) +
			"&ziptime=" + encodeURI( document.forminfonewB.TimeField.value ) +
			"&comments=" + encodeURI( document.forminfonewB.comments.value ) + 
			"&complexname=" + encodeURI(checker) + 
			"&aptsize=" + encodeURI(flrplan) +
			"&fplanpref=" + encodeURI(flrpre) +
			"&pets=" + encodeURI(withpets) +
			"&cstatus=" + encodeURI(statusval);

       makerequest('/build/contactprocessB.php', 'contactform_message', poststr);
}

function contactAB(objShow)
{
	document.getElementById('contactformB').style.display = 'none';
	document.getElementById('contactform').style.display = 'none';
	//document.getElementById('contactformB_message').innerHTML = '';
	//document.getElementById('contactform_message').innerHTML = '';
	var divObj = document.getElementById(objShow);
	divObj.style.display = 'block';
}










