function winClose(id)
{
	document.getElementById(id).style.display='none';
}

//Add to favourite
function show_fav(prpid,type)
{  
	document.getElementById("div12").style.display='block';
	add_to_fav_ajax(prpid,type);
}      
function add_to_fav_ajax(prpid,type)
{	
	var params="prop_id="+escape(prpid)+"&type="+escape(type);
	//alert(params);
	var url="add_to_fav.php";
	//	alert(url);
	 http.open("POST", url, true);
	 http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	 http.onreadystatechange = handleHttpResponse_add_to_fav;
	 http.send(params);
}
function handleHttpResponse_add_to_fav()
{
	if (http.readyState == 4)
	{
		// results = http.responseText;
		// Split the comma delimited response into an array
		results = http.responseText.split("|||");
		document.getElementById("div12").style.display="block";
		document.getElementById("div12").innerHTML =results[0];
	}
}
//Send To Friend
function disp_send_to_friend()
{
	document.getElementById("send_to_frnd").style.display='block';
}

function valid_send_to_frnd()
{				
	if((document.contact.name_test.value).length < 1)
	{
		alert('Please Enter Your Name');
		document.contact.name_test.focus();
		return false;
	}
	if((document.contact.recip.value).length < 1)
	{
		alert("Please Enter Recipient's Name ");
		document.contact.recip.focus();
		return false;
	}
	if((document.contact.mail.value).length < 1)
	{
		alert('Please Enter your Email');
		document.contact.mail.focus();
		return false;
	}		
	var email_str=document.contact.mail.value;
	var email_arr=email_str.split(",");
	
	var email_flag="1";
	for(var i=0;i<email_arr.length;i++)
	{		
		if (echeck(email_arr[i])==false)
		{
			email_flag="0";
  		}		
	}
	if(email_flag=="0")
	{
		document.contact.mail.value="";
        document.contact.mail.focus();        
        return false;
	}
	
	if((document.contact.message.value).length < 1)
	{
		alert('Please Enter Message');
		document.contact.message.focus();
		return false;
	}			
	if((document.contact.msubject.value).length < 1)
	{
		alert('Please Enter Subject');
		document.contact.msubject.focus();
		return false;
	}		
	
	//document.contact.submit();
	sendto_frnd_ajax();
}
function sendto_frnd_ajax() 
{
	var name_test=document.contact.name_test.value;
	
	var recip=document.contact.recip.value;
	//alert(rmail);
	var rmail=document.contact.mail.value;
	var message=document.contact.message.value;
	var msubject=document.contact.msubject.value;
	var from1=document.contact.from.value;
	
	
	var url_site=document.contact.site_url.value;
	
	var params="yrname="+escape(name_test)+"&recip="+escape(recip)+"&rmail="+escape(rmail)+"&message="+escape(message)+"&msubject="+escape(msubject)+"&from1="+escape(from1)+"&url="+escape(url_site);
	//alert(params);
	var url="send_to_friend_ajax_prop_detail.php";
	
	//alert(url_site);
	
	 http.open("POST", url, true);
	 http.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	 http.onreadystatechange = handleHttpResponse_send_to_fr;
	 http.send(params);	
}

function handleHttpResponse_send_to_fr() 
{
	if (http.readyState == 4) {
		// results = http.responseText;
		// Split the comma delimited response into an array		
		results = http.responseText.split("|||");
		document.getElementById("msg_area1").style.display="block";
		document.getElementById("msg_area1").innerHTML =results[1];
  }
}
function getHTTPObject() 
{
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object


