<!-- Display random ad -->

function displayAd()
{
	var ad0 = "<a href=\"http://www.amazon.com/Open-Letters-America-Essays-Powell/dp/1593762143\" target=\"_blank\"><img src=\"images/ad_openletters.jpg\" width=\"160\" height=\"600\" border=\"0\" class=\"ad\" /></a>";
	
	var mess = new Array(ad0);
	var max = mess.length;
	var num = Math.floor((Math.random() * max));
	document.write(mess[num]);
}

function displayAd2()
{
	var ad0 = "<a href=\"http://www.amazon.com/Open-Letters-America-Essays-Powell/dp/1593762143\" target=\"_blank\"><img src=\"../images/ad_openletters.jpg\" width=\"160\" height=\"600\" border=\"0\" class=\"ad\" /></a>";
	
	var ad1 = "<a href=\"http://www.brotherhood-sistersol.org?=kevinpowell\" target=\"_blank\"><img src=\"../images/ad_bhss.jpg\" width=\"160\" height=\"600\" border=\"0\" class=\"ad\" /></a>";
	
	var ad2 = "<a href=\"http://www.ohmyimfly.com?=kevinpowell\" target=\"_blank\"><img src=\"../images/ad_ohmyimfly.jpg\" width=\"160\" height=\"600\" border=\"0\" class=\"ad\" /></a>";
	
	var ad3 = "<a href=\"http://www.rockthevote.com?=kevinpowell\" target=\"_blank\"><img src=\"../images/ad_rockthevote.jpg\" width=\"160\" height=\"600\" border=\"0\" class=\"ad\" /></a>";
	
	var mess = new Array(ad0,ad1,ad2,ad3);
	var max = mess.length;
	var num = Math.floor((Math.random() * max));
	document.write(mess[num]);
}



function checkFields() {
missinginfo = "";
if (document.form2.name.value == "") {
missinginfo += "\n     -  Name";
}
if (document.form2.address1.value == "") {
missinginfo += "\n     -  Address 1";
}
if (document.form2.city.value == "") {
missinginfo += "\n     -  City";
}
if (document.form2.state.value == "") {
missinginfo += "\n     -  State";
}
if (document.form2.zip.value == "") {
missinginfo += "\n     -  Zip";
}
if ((document.form2.email.value == "") || 
(document.form2.email.value.indexOf('@') == -1) || 
(document.form2.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  Valid Email Address";
}
if (document.form2.organization.value == "") {
missinginfo += "\n     -  Organization";
}
if (document.form2.date.value == "") {
missinginfo += "\n     -  Requested Speaking Date";
}
if (document.form2.purpose.value == "") {
missinginfo += "\n     -  Purpose/Type of Program";
}
if (missinginfo != "") {
missinginfo ="You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________________________________" +
"\n\nPlease make sure you complete all required items and submit again.";
alert(missinginfo);
return false;
}
else return true;
}


function checkFieldsJoin() {
missinginfo = "";
if (document.network.name.value == "") {
missinginfo += "\n     -  Name";
}
if ((document.network.email.value == "") || 
(document.network.email.value.indexOf('@') == -1) || 
(document.network.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  Valid Email Address";
}
if (missinginfo != "") {
missinginfo ="You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________________________________" +
"\n\nPlease make sure you complete all required items and submit again.";
alert(missinginfo);
return false;
}
else return true;
}




