
function hideShow(el)
{

	if(document.getElementById(el).style.display!="block")
		document.getElementById(el).style.display="block";
	else
		document.getElementById(el).style.display="none";
	closeBut(el);

}

function closeBut(el)
{
	if(el!='pop')
		document.getElementById('pop').style.display="none";
	if(el!='pop2')
		document.getElementById('pop2').style.display="none";
}

var currentShowCaseNum = 1;
function showCaseProp(num)
{
		
	var ccc = props.length;
	for(var i=1;i<ccc;i++)
		document.getElementById('showCaseTab'+i).className = "showCaseNavLight";
	document.getElementById('showCaseTab'+num).className = "showCaseNav";
	
	//alert( props[num]['address'] );
	e = document.getElementById('showcaseHouse');
	e.innerHTML = props[num]['image'];
}

function sendFriend(id)
{
	document.getElementById("send"+id).style.display = "block";	
	
}

function hideSent(id)
{
	document.getElementById("send"+id).style.display = "none";	
	
}

function toggle(id)
{
	
	var tog = document.getElementById('toggle'+id);

	if(tog.style.display!='block')
	{
			tog.style.display="block";
			return;
	}
	
	tog.style.display="none";
	
	
}

function submitFeedback()
{

	
	
	AJAX('/feedback.php','feedback='+document.getElementById('feedIn').value,false,false);
	
	document.getElementById('feedBack').innerHTML = '<div style="text-align:center; font-size: 30px; padding-top: 40px;">Thank you!<br /> [<a href="javascript:void(0)" onclick="hideShow(\'feedBack\')">Close</a>]</div>';
	
	
}


function AJAX(url,params,div,OW)
{ 
	var xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null){return;} 
	xmlHttp.onreadystatechange=	function()
	{
		if (xmlHttp.readyState==4)
		{
			if(xmlHttp.responseText=="")
				return;			
				
			if(div==false)
				return;
			if(OW)
				document.getElementById(div).innerHTML=xmlHttp.responseText;
			else 
				document.getElementById(div).innerHTML = document.getElementById(div).innerHTML + xmlHttp.responseText;

		}
	};
	
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.send(params);
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{ 
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
		}
		catch(e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

