function forward(msg){
//Use AJAX to send mail

var xmlReq = null 

if (typeof window.ActiveXObject != 'undefined' ) 
{ 
	xmlReq = new ActiveXObject("Microsoft.XMLHTTP"); 
	//doc.onreadystatechange = displayState; 
} 
else 
{ 
   	xmlReq = new XMLHttpRequest(); 
 	//doc.onload = displayState; 
}

var str = msg;


var url = "";

url = "/forwardComic.cgi";

xmlReq.open("POST",url,true); 

xmlReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 

xmlReq.send(str);

// Send a confirm message if necessary

alert('Your e-mail has been successfully sent!');

}


function printEmailForm(id){
	var emailForm = '';
	emailForm = emailForm + '<form name="f">';
	emailForm = emailForm + '<table cellpadding=8 width=100% style="border-style:solid;border-width:0px;border-color:#003399;margin-left:20px;margin-right:4px;">';
	emailForm = emailForm + '<tr><td valign=top></td><td>';
	emailForm = emailForm + '<table cellpadding=5 border=0 cellspacing=0><tr><td class=small><font color="#003399"><b>Email this page to a friend:</b></font></td></tr><tr>';
	emailForm = emailForm + '<td class=small>To: <input type=text name=to> &nbsp; From: <input type=text name=from> &nbsp; ';
	emailForm = emailForm + '<input type="button" value="Send E-mail" onClick="forward(\'r=\' + document.f.to.value + \'&s=\' + document.f.subject.value + \'&f=\' + document.f.from.value + \'&id=' + id + '\'); document.getElementById(\'e5\').className=\'Collapse\';">';
	emailForm = emailForm + '</td></tr><tr><td>&nbsp; &nbsp; <input type=text name=subject size=55 value="Your message">';
	emailForm = emailForm + '</td></tr></table></td></tr></table>';
	emailForm = emailForm + '</form>';
	return emailForm;
}