function getPopup_SendToFriend() {
	var strURL = "/inc/sendToFriend_ajax.asp";
	strURL += "?itemid="+encodeURI(document.getElementById("gstrItemId").value);
	strURL += "&page="+encodeURI(document.getElementById("gstrPage").value);
	strURL += "&r="+Math.random();
	ajax = InitAjax();
	ajax.onreadystatechange = renderPopup_SendToFriend;
	ajax.open("GET",strURL,true);
	ajax.send(null);
	return false;
}

function submitForm_SendToFriend() {
	var strPostData = "";
	strPostData += buildQS_Value("itemid");
	strPostData += "&" + buildQS_Value("page");
	strPostData += "&" + buildQS_Value("from_name");
	strPostData += "&" + buildQS_Value("from_email");
	strPostData += "&" + buildQS_Value("to_email");
	strPostData += "&" + buildQS_Value("comments");
	strPostData += "&" + buildQS_Value("submitted");
	strPostData += "&r="+Math.random();
	postAjax(strPostData,"/inc/sendToFriend_ajax.asp",renderPopup_SendToFriend);
	return false;
}

function renderPopup_SendToFriend() {
	if ( ajax.readyState==4 || ajax.readyState=="complete" ) {
		var div = document.getElementById("divPopup");
		div.innerHTML = ajax.responseText;
	}
}

