// JavaScript Document

function checkform1() {
  for (i=0;i<fieldstocheck1.length;i++) {
    if (eval("document.subscribeform1.elements['"+fieldstocheck1[i]+"'].type") == "checkbox") {
      if (document.subscribeform1.elements[fieldstocheck1[i]].checked) {
      } else {
        alert("Please enter your "+fieldnames1[i]);
        eval("document.subscribeform.elements['"+fieldstocheck1[i]+"'].focus()");
        return false;
      }
    }
    else {
      if (eval("document.subscribeform1.elements['"+fieldstocheck1[i]+"'].value") == "") {
        alert("Please enter your "+fieldnames1[i]);
        eval("document.subscribeform1.elements['"+fieldstocheck1[i]+"'].focus()");
        return false;
      }
    }
  }
  for (i=0;i<groupstocheck1.length;i++) {
    if (!checkGroup1(groupstocheck1[i],groupnames1[i])) {
      return false;
    }
  }
  
  if(! compareEmail1())
  {
    alert("Email Addresses you entered do not match");
    return false;
  }
  return true;
}

var fieldstocheck1 = new Array();
var fieldnames1 = new Array();
function addFieldToCheck1(value,name) {
  fieldstocheck1[fieldstocheck1.length] = value;
  fieldnames1[fieldnames1.length] = name;
}
var groupstocheck1 = new Array();
var groupnames1 = new Array();
function addGroupToCheck1(value,name) {
  groupstocheck1[groupstocheck1.length] = value;
  groupnames1[groupnames1.length] = name;
}

function compareEmail1()
{
  return (document.subscribeform1.elements["email"].value == document.subscribeform1.elements["emailconfirm"].value);
}
function checkGroup1(name,value) {
  option = -1;
  for (i=0;i<document.subscribeform1.elements[name].length;i++) {
    if (document.subscribeform1.elements[name][i].checked) {
      option = i;
    }
  }
  if (option == -1) {
    alert ("Please enter your "+value);
    return false;
  }
  return true;
}

function SubmitForm1()
	{
		retval = checkform1();
		if (retval == true)
			document.subscribeform1.submit();
	}

document.write('<p class="bf_signupForm_p">Sign up for news\, resources & ideas*</p>');

document.write('<form method=post name="subscribeform1" action="http://m.biblefresh.com/?p=subscribe&id=3" target="mail_signup" id="subscribeform1"><table id="email_address" border=0>');

document.write('<tr><td class="attributeinput"><label for="emailAddress">Your Email Address</label><input type=text name=email id="emailAddress" value="Enter Your Email address" size="20" onfocus="this.value=this.value==\'Enter Your Email address\'?\'\':this.value;" onblur="this.value=this.value==\'\'?\'Enter Your Email address\':this.value;" /><script language="Javascript" type="text/javascript">addFieldToCheck1("email","Email");</script></td></tr>');

document.write('<tr><td class="attributeinput"><label for="confirmEmail">Confirm your Email Address Address</label><input type=text id="confirmEmail" name=emailconfirm value="Confirm your Email Address" size="20" onfocus="this.value=this.value==\'Confirm your Email Address\'?\'\':this.value;" onblur="this.value=this.value==\'\'?\'Confirm your Email Address\':this.value;" /><script language="Javascript" type="text/javascript">addFieldToCheck1("emailconfirm","Confirm your email address");</script></td></tr>');

document.write('<tr><td><input type=hidden name="htmlemail" value="1"><input type="hidden" name="list[11]" value="signup"><input type="hidden" name="listname[11]" value="BibleFresh News (General)"/><div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div><span class="art-button-wrapper"><span class="l"></span><span class="r"></span><a class="art-button" href="javascript:SubmitForm1();" title="Subscribe">Subscribe</a></span><input type=hidden name="subscribe" value="Subscribe"></td></tr></table></form>');

document.write('<p class="bf_signupForm_privacy">*<strong>Data Protection Act 1998:</strong> By providing your personal details you agree to allow the Evangelical Alliance to contact you by mail, email, telephone or SMS text message in connection with its charitable purposes. The Evangelical Alliance does not make personal data available to external individuals or organisations.</p>');
