
var favData; // GLOBAL VAR HOLDING THE IMPORTED DATA
var favurl;
var favAjax;
var favString;
var favStringAjax;

function ShowEmailtoFriend(){	
if (Element.visible('iconemailfriend'))
	{
		Element.hide('iconemailfriend');
	}
else
	{
	Element.show('iconemailfriend');
	}
}
function SendEmailtoFriend(pcode){	
// EMAILS THE ENQUIRY TO ADMIN (DATA NOT STORED IN DB)
	var seURL = "http://www.prd.com.au/Global/datasource/foxdata.asp?id=90001&sendHTML=1&subscribercode=" + subscriberCode ;
	seURL = seURL + "&EmailSubject=" + $F('yourname') + " has found a property you might be interested in!";
	seURL = seURL + "&EmailMessage=Hi " + $F('friendsname') + ",<br><br>" + $F('yourname') + " has found a property you might be interested in.<BR>" + "You can view this property online at <a target='_blank'  href='http://www.prd.com.au/display.asp?subscribercode=" +  subscriberCode + "&propertycode=" + pcode + "' >http://www.prd.com.au/display.asp?subscribercode=" +  subscriberCode + "&propertycode=" + pcode + "</a>";
	seURL = seURL + "<br><hr><br><b>" + $F('emailfriendcomments') + "</b><br><br><hr><br>";
	seURL = seURL + "&SenderName=" + $F('yourname');
	seURL = seURL + "&SenderEmail=" + "robina@prd.com.au";
	seURL = seURL + "&RecipientName=" + $F('friendsname');
	seURL = seURL + "&RecipientEmail=" + $F('friendsemail');
	seURL = seURL + "&AttachWebPage=http://www.prd.com.au/emailproperty.asp?subscribercode=" +  subscriberCode + "&propertycode=" + pcode;
	//alert(seURL);
	sendEnquiryAjax = new Ajax.Request(seURL,{method: 'GET', onComplete: emailEnquiryResponse});
}
//PROCESS THE RESPONSE
function emailEnquiryResponse(req){
	if (req.responseText.slice(0,5)=="Error") 
	{Element.update("emailfriendstatus","Send Error");}
	else 
	{Element.update("emailfriendstatus","Email Sent");}
}




