document.writeln('<style>');
document.writeln('<!--');
document.writeln('.topnav-link { font-weight:bold; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#ffffff; text-decoration:none;}');
document.writeln('.right-nav { font-weight:normal; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#666666; text-decoration:none;}');
document.writeln('.rightb-nav { font-weight:bold; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#000000; text-decoration:none;}');
document.writeln('.status-chart { font-weight:bold; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#666666; text-decoration:none;}');
document.writeln('.content { font-weight:normal; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#666633; text-decoration:none;}');
document.writeln('.title { font-weight:bold; font-size:10px; font-family: Verdana,Arial,Helvetica,sans-serif; color:#666633; text-decoration:none;}');
document.writeln('.title A:link {text-decoration:none;}');
document.writeln('-->');
document.writeln('</style>');

function validateform() {
 with (document.nwsletterform) {
 	var chk_service;
	var chk_status;
	if (email.value == "" || email.value == "your email") {
		alert("please enter your email"); 
		return false;
	}
	if (!chk_email(email)) {
			email.focus();
			email.select();
			return false;
	}	
	if (service_code.selectedIndex <= 1) {
		alert("Please select Service");
		return false;
	}
	if (status_code.selectedIndex == 1 || status_code.selectedIndex < 0) {
		alert("Please select your Status");
		return false;
	}
	document.nwsletterform.formsource.value = "nosource";	
	window.open("http://www.military.com/Newsletter/SaveNewsLetterSubscription", "newsletter", "height=155, width=350, status=no, toolbar=no, menubar=no, location=no");
	return true;		
 }
}
function chk_email(obj) {
 var bad_email_chars = "`/ (){}|<>/,&+=*'%?!~#^:;";
 // check if user type in the email
 /* if (obj.value=="your email") {
  alert("Please type in your email address.")
  return false;
 } */
 // check for spl characters that are invalid
 if (!chk_badchar(obj.value, bad_email_chars)) {
  alert("Please remove all special characters from email address.")
  return false;
 }
 
 // Check for an @ sign
 var at_sign = obj.value.indexOf("@");
 if (at_sign < 0) {
  var msg = "Oops!  You forgot an '@' sign in your e-mail address.  Please enter an address such as ";
  msg = msg + obj.value + "@Military.com";
  alert(msg);
  return false;
 }
 // Check for a domain
 var dot = obj.value.substring(at_sign, obj.value.length + 1).indexOf(".");
 if (dot < 0) {
  var msg = "Oops, you forgot a '.' following the @ sign in your e-mail address.  Please enter an address such as ";
  msg = msg + obj.value + ".com";
  alert(msg);
  return false;
 }
 return true;
}

function chk_badchar(word, badchars) {
 var found = -1; // bad char not found 
 for (var i = 0; i < badchars.length; i++) {
  	found = word.indexOf(badchars.charAt(i));
  	if (found > -1) {
   		break;  // exit from for loop
  	}
 }
 if (found > -1) 
 	 return false;
 else 
 	 return true;
}


document.writeln('<table width=144 cellpadding=0 cellspacing=0 border=0 background=http://images.military.com/fd_pics/Hybrid_Blue.gif>');
document.writeln('<tr background=http://images.military.com/fd_pics/Hybrid_Blue.gif>');
document.writeln('<td valign=top align=center>');
document.writeln('<img src=http://www.military.com/images/NL_Header_animated.gif width=144 height=43><br>');
document.writeln('<form name = "nwsletterform" method = "post" action = "http://www.military.com/Newsletter/SaveNewsLetterSubscription" onsubmit = "return validateform();" target="newsletter">');
document.writeln('<input type="hidden" name="formsource" value="">');
document.writeln('<table bgcolor=#ffffff width=126 cellpadding=2 cellspacing=0 border=0 align=center>');
document.writeln('<tr><td><table width=126 cellpadding=0 cellspacing=0 border=0 align=center>');
document.writeln('<tr><td bgcolor=#9c0000 colspan=3><img src=http://images.military.com/pics/spacer.gif width=126 height=1><br></td></tr>');
document.writeln('<tr><td bgcolor=#9c0000><img src=http://images.military.com/pics/spacer.gif width=1 height=1 border=0></td>');
document.writeln('<td width=124 valign=top bgcolor=#D0E0EA class=right-nav>');
document.writeln('<input type=checkbox name=ck_weekly_news value=1 checked>Service News<br>');
document.writeln('<input type=checkbox name=newsletter value=4>Daily Military News<br>');
document.writeln('<input type=checkbox name=newsletter value=9>Education Benefits<br>');
document.writeln('<input type=checkbox name=newsletter value=8>Veteran Careers<br>');
document.writeln('<input type=checkbox name=newsletter value=10>Money Matters<br>');
document.writeln('<input type=checkbox name=newsletter value=12>Joining the Military<br>');
document.writeln("<div align=right style='padding-bottom:3;'><a href=http://www.military.com/Content/MoreContent?file=privacy TARGET='_blank'>Privacy</a>&nbsp;</div>");
document.writeln("</td><td bgcolor=#9c0000><img src=http://images.military.com/pics/spacer.gif width=1 height=1 border=0></td></tr>");
document.writeln("<tr><td bgcolor=#9c0000 colspan=3><img src=http://images.military.com/pics/spacer.gif width=126 height=1><br></td></tr>");
	
document.writeln("</table></td></tr>");
document.writeln("<!--add--><tr><td colspan=3 align=center style='padding-top: 2px;'>");
document.writeln('<INPUT TYPE="text" class=standard style="color:#9c0000;" name="email" value="your email" size="18" onFocus="this.value=\'\'"><br>');
document.writeln('<select name=service_code class=standard style="color:#9c0000;">');
document.writeln("<option value=''>your service</option>");
document.writeln('<Script Language="JavaScript">');
document.writeln('<!--');
document.writeln('browsername = navigator.userAgent.toLowerCase()');
document.writeln('if (browsername.indexOf("safari")!=-1) {');
document.writeln('document.write(\'<option value=" ">------------</option>\')');
document.writeln('} else {');
document.writeln('document.write(\'<option value=" ">-------------------</option>\')')
document.writeln('}');
document.writeln('// -->');
document.writeln('</script>');
document.writeln("<option value ='ARMY'>Army</option>");
document.writeln("<option value ='NAVY'>Navy</option>");
document.writeln("<option value ='AIRFRC'>Air Force</option>");
document.writeln("<option value ='MARINE'>Marine Corps</option>");
document.writeln("<option value ='COASTG'>Coast Guard</option>");
document.writeln("<option value ='DOD'>DoD</option>");
document.writeln("<option value ='GOVERN'>Gov't</option>");
document.writeln("<option value ='NONE'>Other/None</option>");
document.writeln("</select><br>");
document.writeln('<select name=status_code class=standard style="color:#9c0000;">');
document.writeln("<option value ='A'>active duty</option>");
document.writeln('<Script Language="JavaScript">');
document.writeln("<!--");
document.writeln("browsername = navigator.userAgent.toLowerCase();");
document.writeln('if (browsername.indexOf("safari")!=-1) {');
document.writeln('document.write(\'<option value=" ">------------</option>\')');
document.writeln('} else {');
document.writeln('document.write(\'<option value=" ">-------------------</option>\')');
document.writeln("}");
document.writeln("// -->");
document.writeln("</script>");
document.writeln("<option value = 'V20PLU'>retired military</option>");
document.writeln("<option value = 'V20MIN'>prior service</option>");
document.writeln("<option value = 'ACTRES'>reservist-drilling</option>");
document.writeln("<option value = 'NATGRD'>national guard</option>");
document.writeln("<option value = 'INTRES'>inactive res/grd</option>");
document.writeln("<option value = 'ACDMEM'>service academy </option>");
document.writeln("<option value = 'RESTRA'>ROTC</option>");
document.writeln("<option value = 'GOVEMP'>gov't employee</option>");
document.writeln("<option value = 'DEFCON'>defense worker</option>");
document.writeln("<option value = 'OTHMIL'>other military</option>");
document.writeln("<option value = 'CONJON'>consider joining</option>");
document.writeln("<option value = 'SPOUSE'>spouse: active</option>");
document.writeln("<option value = 'SPOUSE'>spouse: ret</option>");
document.writeln("<option value = 'SPOVET'>spouse: veteran</option>");
document.writeln("<option value = 'ENTHUS'>enthusiast</option>");
document.writeln("<option value = 'F'>other family</option>");
document.writeln("<option value = 'MILOTH'>other</option>");
document.writeln("</select><br>");
document.writeln('<input type=image src=http://www.military.com/images/Subscribe_BlueBtn.gif width=130 height=24 border=0 align=center vspace=2 >');
document.writeln("</td></tr><!--add-->");
document.writeln("</table></form></td></tr></table>");

