if (GetCookie("show_survey") == null) {
	if(document.URL.match(/np=1/i) != null) {
		SetCookie("show_survey","0",null,"/", c_domain,false);
	} else {
		SetCookie("show_survey","1",null,"/", c_domain,false);	
	}
}

if (GetCookie("show_survey") == 1 ) {
	Poll();
}

function validateform() {
 with (document.nlform) {
	if(!newsletter[0].checked && !newsletter[1].checked ) {
		alert("Please select at least one Newsletter");
		return false;
	}	

 	if (email.value == "" || email.value == "your email") {
		alert("Please enter your email"); 
		return false;
	}
	if (!chk_email(email)) {
			email.focus();
			email.select();
			return false;
	}
		
 }
 
}

function chk_email(obj) {
 var bad_email_chars = "`/ (){}|<>/,&+=*'%?!~#^:;";
 if (!chk_badchar(obj.value, bad_email_chars)) {
  alert("Please remove all special characters from email address.")
  return false;
 }
  // Check @ 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 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 loop
  	}
 }
 if (found > -1) 
 	 return false;
 else 
 	 return true;
}