// MailURL.action v1.7.1 - March, 2004
// Copyright © 2000 by Walter Blady
// All rights reserved
var MUisIE4 = navigator.appVersion.indexOf("MSIE 4") >= 0;
var MUmyWindow = null, MUAction;
function WBMailURL(action) {
	if (MUVersion()) {
		MUAction = action;
		var MUisIE = window.navigator.userAgent.indexOf("MSIE") != -1;
		var MUW3C = document.getElementById ? true : false;
		var url = action[8] != "" && action[9] != "#" ? action[8] : unescape(window.location);
		var s = url.indexOf("?");
		url = !(s > -1) ? url : url.substr(0, s) + escape(url.substr(s, url.length));
		url = action[7] + url;
		if (action[1] == 0) {
			var content = "mailto:Recipient@emailAddress?subject=" + action[17] + "&body=" + url;
			window.location = content;
			if (action[9] != "" && action[9] != "#") {
				var t = setTimeout("MURedirect()", 3000);
			}
			return true;
		}
		var w = parseInt(action[5]), h = parseInt(action[6]);
		MUParams = "width=" + w + ",height=" + h + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,favorites=no,resizable=yes";
		var screenWidth = screen.width;
		var screenHeight = screen.height;
		if (action[2] == 0) {
			var left = Math.round((screenWidth - (w+20))/2);
			var top = Math.round((screenHeight - (h+55))/2);
		}
		else if (action[2] == 1) {
			var left = 10;
			var top = 10;
		}
		else if (action[2] == 2) {
			var left = 10;
			var top = (screenHeight - (h+55));
		}
		else if (action[2] == 3) {
			var left = (screenWidth - (w+20));
			var top = 3;
		}
		else if (action[2] == 4) {
			var left = (screenWidth - (w+20));
			var top = (screenHeight - (h+55));
		}
		else if (action[2] == 5) {
			var left = parseInt(action[3]);
			var top = parseInt(action[4]);
		}
		MUParams += (MUisIE || MUW3C) ? ",top=" + top + ",left=" + left : ",screenY=" + top + ",screenX=" + left;
		var MUMess = '<html><head><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">\n';
		MUMess += '<title>Richard N. Best Associates E-mail a URL</title>\n';
		MUMess += '<style media="screen" type="text\/css"><!-- body, form { font-size: 12px; font-family: Verdana, Geneva, Helvetica, Arial } --><\/style>\n';
		MUMess += '<script language="Javascript"> function MUCloseWindow() { self.window.close(); return; }\n';
		MUMess += 'function MURedirect() { opener.location.href = "' + MUAction[9] + '"; MUCloseWindow(); return;}\n';
		MUMess += 'function MUSendForm() { var url ="' + url + '", myForm = window.document.emailForm;\n';
		MUMess += 'if (myForm.email.value == "") myForm.email.value = "Recipient@emailAddress";\n';
		MUMess += 'var c = myForm.cc.value == "" ? "?cc=" : "?cc=" + myForm.cc.value;\n';
		MUMess += 'var s = myForm.subject.value == "" ? "&Subject=" :"&Subject=" + myForm.subject.value;\n';
		MUMess += 'var content = "mailto:" + myForm.email.value + c + s + "&body=" + ';
		MUMess += 'myForm.body.value;\n';
		MUMess += 'window.location = content;\n';
		if (action[9] != "" && action[9] != "#") {
			MUMess += 'var t = setTimeout("MURedirect()", 3000);\n';
		}
		MUMess +=  'return true; } </' + 'script>\n';
		MUMess += '</head><body bgcolor="#ffffff">\n';
		MUMess += '<div align="center"><b>' + action[10] + '</b>\n';
		MUMess += '<form name="emailForm" action="" method="post" enctype="text/plain">\n';
		MUMess += action[11] + '<br><input type="text" name="email" size="40"><br>\n';
		MUMess += action[12] + '<br><input type="text" name="cc" size="40"><br>\n';
		MUMess += action[13] + '<br><input type="text" name="subject" value="' + action[17] + '" size="50"><br>\n';
		MUMess += action[14] + '<br><textarea name="body" cols="49" rows="6">' + url + '</textarea>\n';
		if (action[1] == 1) {
			MUMess += '<input type="button" name="mailURL" value="' + action[15] + '" onclick="Javascript:void(MUSendForm())">\n';
		}
		MUMess += '<input type="button" name="closeWindow" value="' + action[16] + '" onclick="Javascript:void(MUCloseWindow())">\n';
		MUMess += '</form>\n';
		MUMess += '</div></body></html>\n';
		MUmyWindow = window.open("", "MUmyWind", MUParams);
		MUmyWindow.moveTo(left, top);
		MUmyWindow.document.write(MUMess);
		MUmyWindow.document.close();
		MUmyWindow.focus();
		return;
	}
}
function MURedirect() {
	window.location.href = MUAction[9];
	return;
}
function MUVersion() {
	return true;
}
//
