/* 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();
}

if (document.cookie.length>0) {
	c_start=document.cookie.indexOf("banner=");
	if (c_start!=-1) {
		c_start=c_start+7;
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		var promocode = unescape(document.cookie.substring(c_start,c_end));
	}
}

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 = "mail/subscribe.php";
	var parameters = "FormValue_Email=" + encodeURI(eml) + "&FormValue_CustomField1="+encodeURI(promocode)+"&FormValue_MailListIDs[]=1&Subscribe=Submit&FormValue_SuccessScreenID=MQ%3D%3D&FormValue_FailureScreenID=Mg%3D%3D&FormValue_CustomFieldIDs=MQ%3D%3D";
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", parameters.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = scripreturn;
	xmlHttp.send(parameters);
}
function scripreturn() {
	if (xmlHttp.readyState == 2) {
	}

	if (xmlHttp.readyState == 4) {
		var retur = xmlHttp.responseText;
		if (retur.indexOf("Thank")>0) {
			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:90px;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>");