function validatebook() {

var message='';


if (document.form.sub.value)
{
document.getElementById('subtitle').style.color="#333333"
}
else
{
document.getElementById('subtitle').style.color="#FF0000";
if (message)
	{message=message + ", subject";}
	else
	{var message="I still need to know your textbook's subject";}
}

if (document.form.tit.value)
{
document.getElementById('tittitle').style.color="#333333"
}
else
{
document.getElementById('tittitle').style.color="#FF0000";
if (message)
	{message=message + " and title";}
	else
	{var message="I still need to know your textbook's title";}
}

if (message)
{
message=message + ". <br />Besides, the more information you give me, the better your textbook will show up in a search.";
document.getElementById('sendarea').innerHTML=message;
document.getElementById('sendarea').style.color="#FF0000";
}
else
{
document.getElementById('sendarea').innerHTML="<input type='submit' value='Send' />";
}
}


function validateaccount() {

var message='';
if (document.form.password.value != document.form.password2.value)
	{
document.getElementById('npw').style.color="#FF0000";
document.getElementById('rnpw').style.color="#FF0000";

var message='Plese make sure that your "New Password" field matches the "Repeat New Password" field.';
	}
	else
	{
document.getElementById('npw').style.color="#33333";
document.getElementById('rnpw').style.color="333333";
	}

if (document.form.oldpassword.value)
	{
document.getElementById('currentpassword').style.color="#333333";
document.getElementById('sendarea').style.color="#333333";
document.getElementById('sendarea').innerHTML="<input type='submit' value='Send' />";
	}
	else
	{
	document.getElementById('currentpassword').style.color="#FF0000";
if (message) 
		{
message=message + ' <br />I need your current password before you can submit these changes!';
		}
		else
		{
var message="I need your current password before you can submit these changes!";
		}
	}
	
if (message)
	{
document.getElementById('sendarea').style.color="#FF0000";
document.getElementById('sendarea').innerHTML=message;
	}
	else
	{
document.getElementById('sendarea').style.color="#333333";
document.getElementById('sendarea').innerHTML='<input type="submit" value="Send" />';
	}
}


function validatesignup() {

var firstName='';
var lastName='';
var email='';
var password='';
var password2='';

if (document.form.firstName.value)
{
document.getElementById('firstName').style.color="#333333"
}
else
{
document.getElementById('firstName').style.color="#FF0000";
firstName=1;
}

if (document.form.lastName.value)
{
document.getElementById('lastName').style.color="#333333"
}
else
{
document.getElementById('lastName').style.color="#FF0000";
lastName=1;
}

if (document.form.email.value)
{
document.getElementById('email').style.color="#333333"
}
else
{
document.getElementById('email').style.color="#FF0000";
email=1;
}

if (document.form.password.value)
{
document.getElementById('password').style.color="#333333"
}
else
{
document.getElementById('password').style.color="#FF0000";
password=1;
}

if (document.form.password2.value)
{
document.getElementById('password2').style.color="#333333"
}
else
{
document.getElementById('password2').style.color="#FF0000";
password2=1;
}



if (firstName || lastName || email || password || password2)
{
message = "One or more fields still need to be filled out before you can submit this form.";
document.getElementById('sendarea').innerHTML=message;
document.getElementById('sendarea').style.color="#FF0000";
}
else if (document.form.password.value != document.form.password2.value)
{
document.getElementById('password').style.color="#FF0000";
document.getElementById('password2').style.color="#FF0000";
message = "Please make sure that your password matches your repeated password.";
document.getElementById('sendarea').innerHTML=message;
document.getElementById('sendarea').style.color="#FF0000";
}
else
{
document.getElementById('sendarea').innerHTML="<input type='submit' value='Send' />";
}
}

