/* 
   function: shownews 
*/

// Create the News message for the site
function shownews() {
    var strtdate = "20100501";
    var stopdate = "20100711";
    var tooday;
    with (new Date) { tooday = String((getFullYear() * 100 + getMonth() + 1) * 100 + getDate()); }

    if (tooday >= strtdate && tooday <= stopdate) {
       var msg =       "<p id=\"daily-msg\">";
       var msg = msg + "<em>Upcoming Events</em><br /><br />CAFY's National Day of Healing and Recognition ";
       var msg = msg + "is a movement of people committed to growing together within our families, communities ";
       var msg = msg + "and across the county, towards healing and reconciliation. At CAFY we are putting ";
       var msg = msg + "children first and we know healing happens.";
       var msg = msg + "<a href=\"ndhr-flier.php\"> Click here for information</a>";
//     var msg = msg + "<a href=\"news/candlelight2009espanol.pdf\">&nbsp;En Espanol</a></p>";
       document.open();
       document.write(msg);
       document.close();
    }
    return;
}

function checkBox1(email) {
    var str = email.value;
    if (str.length == 0) {
	alert("Please enter a valid email address (user@domain.com):");
	return false;
    }
    return true;
}

function checkBox2(name) {
    var str = name.value; 
    if(str.length == 0) {
	alert("Please fill in the required fields(*)"); 
	return false; 
    }
    return true; 
 }
 
function checkBox3(state) {
    var str = state.value; 
    if(str.length == 0) {
	alert("Please enter a valid state abbreviation");  
	return false; 
    }
    return true; 
}

    function checkForm(form) {
    if(checkBox1(form.email) && checkBox2(form.name) && checkBox3(form.state)) 
	return true; 
    return false;
}
