
/*---------------------------------------------------------------------------------------------
	Email to a friend function

	Call function as follows:  mailpage(displayName,siteName)

	Make sure that the following variables are defined somewhere else has specified bellow:
	var displayName = document.getElementById('storeDisplayName').innerHTML;
	var siteName = "<%=getCurrentAttribute('site','name')%>"; 
---------------------------------------------------------------------------------------------*/

function mailpage(displayName, siteName) {
	// uses displayName global variable defined and initialized previously
	mail_str  = "mailto:?subject=Check out the " + escape(displayName);
	mail_str += "&body=I saw this at the " + escape(siteName) + " site and thought you might be interested in it: ";
	mail_str += "%0D%0A" + "%0D%0A" + escape(displayName) + "." + "%0D%0A" + "%0D%0A";
	mail_str += "You can view it at: " + "%0D%0A" + escape(location.href); 
	location.href = mail_str;
}


