/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function scripsh() {
	var scrip = document.getElementById("scrip");
	if (scrip.style.display == "none") {
		scrip.style.display = "";
	} else {
		scrip.style.display = "none";
	}
}
function scripclr() {
	var eml = document.getElementById("ema");
	if (eml.value=="Your e-mail") {
		eml.value = "";
	}
}
function scripkeys(e) {
	if(window.event) {
		key = window.event.keyCode;
	} else {
		key = e.which;
	}
	if(key == 13) {
		scripsend();
	}
}
function scripsend() {
	var eml = document.getElementById("ema").value;
	var url = "/newsletter.asp?eml=" + encodeURI(eml) + "&aff=" + encodeURI(21117);
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange = scripreturn;
	xmlHttp.send(null);
}
function scripreturn() {
	if (xmlHttp.readyState == 2) {
	}
	
	if (xmlHttp.readyState == 4) {
		var retur = xmlHttp.responseText;
		if (retur == "Y") {
			document.getElementById("retur").style.display = "block";
			document.getElementById("retur").innerHTML = "<span style=\"font-weight:bold;\">Thank you for joining.</span>"
			var t = setTimeout("document.getElementById(\"scrip\").style.display=\"none\"",3000);
		} else {
			document.getElementById("retur").style.display = "block";
			document.getElementById("retur").innerHTML = "<span style=\"font-weight:bold;color:#c33;\">There has been a problem adding you. Please correct your address and try again.</span>"
		}
	}
}
	
	document.write("<tr><td><img src=\"/images/200604/smallarrow.gif\" width=\"7\" height=\"8\" alt=\"\" /></td>")
	document.write("<td align=\"left\"><a href=\"#\" class=\"sidelink\" onclick=\"scripsh();return false;\">Get Our Newsletter</a></td></tr>")
	document.write("<tr id=\"scrip\" style=\"display:none;\"><td colspan=\"2\"><div style=\"margin:0 4px;padding:6px 7px;font-size:12px;font-family:arial,helvetica,sans-serif;text-align:justify;background-color:#ffc;border:1px solid #ccc;\">")
	document.write("Periodically, we send out newsletters with <span style=\"font-weight:bold;\">helpful tutorials</span> and <span style=\"font-weight:bold;\">simple explanations</span> of technical concepts.  You can unsubscribe at any time.<br />")
	document.write("<input type=\"text\" name=\"Email\" id=\"ema\" style=\"width:100px;margin-top:4px;\" value=\"Your e-mail\" onfocus=\"scripclr();\" onkeypress=\"scripkeys(event);\"  />&nbsp;<div style=\"display:inline;width:36px;padding:3px;border:1px solid #000;margin-top:4px;cursor:pointer;cursor:hand;background-color:#E6E6E6;\" onclick=\"scripsend();\">Get it</div><br />")
	document.write("<div id=\"retur\" style=\"display:none;margin-top:4px;text-align:left;\"></div>")
	document.write("</div></td></tr>")
