function check_email(element){
var testresults;
var str=element.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
testresults=false
}
return (testresults)
}


function check_url(element){
var testresults;
var str=element.value
var filter = /([^www]+)(\.\w{2,4})+(\/[\S]*)?$/i;

if (filter.test(str))
testresults=true
else{
testresults=false
}
return (testresults)
}


function check_ss_url(element){
var testresults;
var str=element.value
var filter = /[^\w]+/i;

if (filter.test(str))
testresults=false
else{
testresults=true
}
return (testresults)
}



function check_form() { 

var style_color = "#c37a22";



if(document.forms[0].name=="login"){

//declare variables
      var acct_login = document.login.acct_login;
    	var acct_password = document.login.acct_password;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";



    if (acct_login.value == "")
    {
	window.alert("please enter a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please enter a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="password_reset"){


//declare variables
      var acct_email = document.password_reset.acct_email;
	var acct_login = document.password_reset.acct_login;

//reset form styles	
	document.getElementById('acct_email').style.color="";
	document.getElementById('acct_login').style.color="";



    if (acct_email.value == "")
    {
	window.alert("please enter an email address."); 
        acct_email.focus();
 	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_login.value == "")
    {
	window.alert("please enter your username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
}



if(document.forms[0].name=="photo_upload"){

//declare variables
      var uploaded = document.photo_upload.uploaded;

//reset form styles	
	document.getElementById('upload_text').style.color="";



    if (uploaded.value == "")
    {
	window.alert("please select an image file to upload."); 
        uploaded.focus();
 	  document.getElementById('upload_text').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="artist_signup"){

//declare variables
      var acct_login = document.artist_signup.acct_login;
    	var acct_password = document.artist_signup.acct_password;
	var acct_fname = document.artist_signup.acct_fname;
	var acct_lname = document.artist_signup.acct_lname;
	var acct_email = document.artist_signup.acct_email;
	var acct_newsletter_opt_in = document.artist_signup.acct_newsletter_opt_in;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_newsletter_opt_in').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!acct_newsletter_opt_in.checked)
    {
	window.alert("you must agree to the terms to continue."); 
        acct_newsletter_opt_in.focus();
 	  document.getElementById('acct_newsletter_opt_in').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="fan_signup"){

//declare variables
      var acct_login = document.fan_signup.acct_login;
    	var acct_password = document.fan_signup.acct_password;
	var acct_fname = document.fan_signup.acct_fname;
	var acct_lname = document.fan_signup.acct_lname;
	var acct_email = document.fan_signup.acct_email;
	var acct_gender = document.fan_signup.acct_gender;
	var acct_month = document.fan_signup.acct_month;
	var acct_day = document.fan_signup.acct_day;
	var acct_year = document.fan_signup.acct_year;
	var acct_city = document.fan_signup.acct_city;
	var acct_c_id = document.fan_signup.acct_c_id;
	var acct_s_id = document.fan_signup.acct_s_id;
	var acct_s_nonus = document.fan_signup.acct_s_nonus;
	var acct_zip = document.fan_signup.acct_zip;
	var acct_newsletter_opt_in = document.fan_signup.acct_newsletter_opt_in;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_gender').style.color="";
	document.getElementById('acct_month').style.color="";
      document.getElementById('acct_day').style.color="";
	document.getElementById('acct_year').style.color="";
	document.getElementById('acct_city').style.color="";
	document.getElementById('acct_country').style.color="";
	document.getElementById('acct_state').style.color="";
	document.getElementById('acct_zip').style.color="";
	document.getElementById('acct_newsletter_opt_in').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_gender.value == "")
    {
	  window.alert("Please enter your gender.");
        acct_gender.focus();
	  document.getElementById('acct_gender').style.color=style_color;
        return false;
    }
    if (acct_month.value == "")
    {
	  window.alert("Please enter your birthdate.");
        acct_month.focus();
	  document.getElementById('acct_date_of_birth').style.color=style_color;
        return false;
    }
    if (acct_day.value == "")
    {
	  window.alert("Please enter your birthdate.");
        acct_day.focus();
	  document.getElementById('acct_date_of_birth').style.color=style_color;
        return false;
    }
    if (acct_year.value == "")
    {
	  window.alert("Please enter your birthdate.");
        acct_year.focus();
	  document.getElementById('acct_date_of_birth').style.color=style_color;
        return false;
    }
    if (acct_city.value == "")
    {
	window.alert("please enter your city.");
        acct_city.focus();
	  document.getElementById('acct_city').style.color=style_color;
        return false;
    }
    if ((acct_c_id.value =="3")&&(acct_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        acct_s_id.focus();
	  document.getElementById('acct_country').style.color=style_color;
        return false;
    }
    if (acct_s_nonus.value == "")
    {
	window.alert("please enter your non-USA state.");
        acct_s_nonus.focus();
	  document.getElementById('acct_state').style.color=style_color;
        return false;
    }
    if (acct_zip.value == "")
    {
	window.alert("please enter your postal code.");
        acct_zip.focus();
	  document.getElementById('acct_zip').style.color=style_color;
        return false;
    }
    if (!acct_newsletter_opt_in.checked)
    {
	window.alert("you must agree to the terms to continue."); 
        acct_newsletter_opt_in.focus();
 	  document.getElementById('acct_newsletter_opt_in').style.color=style_color;
        return false;
    }

}




if(document.forms[0].name=="artist_profile_edit"){

//declare variables
      var p_name = document.artist_profile_edit.p_name;
	var p_ss_url = document.artist_profile_edit.p_ss_url;
      var p_city = document.artist_profile_edit.p_city;
      var p_s_id = document.artist_profile_edit.p_s_id;
      var p_s_nonus = document.artist_profile_edit.p_s_nonus;
      var p_c_id = document.artist_profile_edit.p_c_id;
	var p_bio = document.artist_profile_edit.p_bio;
	var p_tip_jar_email = document.artist_profile_edit.p_tip_jar_email;
	var p_web_url = document.artist_profile_edit.p_web_url;
	var p_distributor1 = document.artist_profile_edit.p_distributor1;
	var p_distributor2 = document.artist_profile_edit.p_distributor2;
	var p_distributor3 = document.artist_profile_edit.p_distributor3;


//reset form styles	
	document.getElementById('p_name').style.color="";
	document.getElementById('p_ss_url').style.color="";
	document.getElementById('p_city').style.color="";
	document.getElementById('p_USA_state').style.color="";
	document.getElementById('p_state').style.color="";
	document.getElementById('p_country').style.color="";
	document.getElementById('p_bio').style.color="";
	document.getElementById('p_tip_jar_email').style.color="";
	document.getElementById('p_web_url').style.color="";
	document.getElementById('p_distributor1').style.color="";
	document.getElementById('p_distributor2').style.color="";
	document.getElementById('p_distributor3').style.color="";

    if (p_name.value == "")
    {
	window.alert("please select a profile name."); 
        p_name.focus();
 	  document.getElementById('p_name').style.color=style_color;
        return false;
    }
    if (p_ss_url.value != "" && !check_ss_url(p_ss_url)){
	  window.alert("the SONGSPROUTS url you entered is invalid.\n It can only contain a-z or 0-9!");
        p_ss_url.focus();
	  document.getElementById('p_ss_url').style.color=style_color;
        return false;
    }
    if (p_city.value == "")
    {
	window.alert("please select a city.");
        p_city.focus();
	  document.getElementById('p_city').style.color=style_color;
        return false;
    }
    if ((p_c_id.value =="3")&&(p_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        p_s_id.focus();
	  document.getElementById('p_USA_state').style.color=style_color;
        return false;
    }

    if (p_tip_jar_email.value != "" && !check_email(p_tip_jar_email)){
	  window.alert("the email address you entered is invalid.");
        p_tip_jar_email.focus();
	  document.getElementById('p_tip_jar_email').style.color=style_color;
        return false;
    }
    if (p_web_url.value != "" && !check_url(p_web_url)){
	  window.alert("the web url you entered is invalid.");
        p_web_url.focus();
	  document.getElementById('p_web_url').style.color=style_color;
        return false;
    }
    if (p_distributor1.value != "" && !check_url(p_distributor1)){
	  window.alert("the distributor url you entered is invalid.");
        p_distributor1.focus();
	  document.getElementById('p_distributor1').style.color=style_color;
        return false;
    }
    if (p_distributor2.value != "" && !check_url(p_distributor2)){
	  window.alert("the distributor url you entered is invalid.");
        p_distributor2.focus();
	  document.getElementById('p_distributor2').style.color=style_color;
        return false;
    }
    if (p_distributor3.value != "" && !check_url(p_distributor3)){
	  window.alert("the distributor url you entered is invalid.");
        p_distributor3.focus();
	  document.getElementById('p_distributor3').style.color=style_color;
        return false;
    }
    if (p_city.value == "")
    {
	window.alert("please select a city.");
        p_city.focus();
	  document.getElementById('p_city').style.color=style_color;
        return false;
    }
    if (p_city.value == "")
    {
	window.alert("please select a city.");
        p_city.focus();
	  document.getElementById('p_city').style.color=style_color;
        return false;
    }
    if (p_city.value == "")
    {
	window.alert("please select a city.");
        p_city.focus();
	  document.getElementById('p_city').style.color=style_color;
        return false;
    }
    if (p_city.value == "")
    {
	window.alert("please select a city.");
        p_city.focus();
	  document.getElementById('p_city').style.color=style_color;
        return false;
    }
    if (p_bio.value == "")
    {
	window.alert("please enter your bio.");
        p_bio.focus();
	  document.getElementById('p_bio').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="artist_edit"){

//declare variables
      var acct_login = document.artist_edit.acct_login;
    	var acct_password = document.artist_edit.acct_password;
	var acct_fname = document.artist_edit.acct_fname;
	var acct_lname = document.artist_edit.acct_lname;
	var acct_email = document.artist_edit.acct_email;
	var acct_newsletter_opt_in = document.artist_edit.acct_newsletter_opt_in;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_newsletter_opt_in').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!acct_newsletter_opt_in.checked)
    {

    }

}



if(document.forms[0].name=="fan_edit"){

//declare variables
      var acct_login = document.fan_edit.acct_login;
    	var acct_password = document.fan_edit.acct_password;
	var acct_fname = document.fan_edit.acct_fname;
	var acct_lname = document.fan_edit.acct_lname;
	var acct_email = document.fan_edit.acct_email;
	var acct_newsletter_opt_in = document.fan_edit.acct_newsletter_opt_in;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_newsletter_opt_in').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!acct_newsletter_opt_in.checked)
    {

    }

}




if(document.forms[0].name=="song_upload"){

//declare variables
      var s_name = document.song_upload.s_name;
    	var s_writers = document.song_upload.s_writers;
	var s_genre_id = document.song_upload.s_genre_id;
    	var s_desc_short = document.song_upload.s_desc_short;
	var uploaded = document.song_upload.uploaded;

//reset form styles	
	document.getElementById('s_name').style.color="";
	document.getElementById('s_writers').style.color="";
	document.getElementById('s_genre_id').style.color="";
	document.getElementById('s_desc_short').style.color="";
	document.getElementById('upload_text').style.color="";

    if (s_name.value == "")
    {
	window.alert("please enter a song name."); 
        s_name.focus();
 	  document.getElementById('s_name').style.color=style_color;
        return false;
    }
    if (s_writers.value == "")
    {
	window.alert("please enter the songwriter's name.");
        s_writers.focus();
	  document.getElementById('s_writers').style.color=style_color;
        return false;
    }
    if (s_genre_id.value == "")
    {
	window.alert("please select a genre.");
        s_genre_id.focus();
	  document.getElementById('s_genre_id').style.color=style_color;
        return false;
    }
    if (s_desc_short.value == "")
    {
	window.alert("please enter a short description for the song.");
        s_desc_short.focus();
	  document.getElementById('s_desc_short').style.color=style_color;
        return false;
    }
    if (uploaded.value == "")
    {
	window.alert("please select an .mp3 file for upload.");
        uploaded.focus();
	  document.getElementById('upload_text').style.color=style_color;
        return false;
    }
    
}




if(document.forms[0].name=="song_edit"){

//declare variables
      var s_name = document.song_edit.s_name;
    	var s_writers = document.song_edit.s_writers;
	var s_genre_id = document.song_edit.s_genre_id;
    	var s_desc_short = document.song_edit.s_desc_short;

//reset form styles	
	document.getElementById('s_name').style.color="";
	document.getElementById('s_writers').style.color="";
	document.getElementById('s_genre_id').style.color="";
	document.getElementById('s_desc_short').style.color="";

    if (s_name.value == "")
    {
	window.alert("please enter a song name."); 
        s_name.focus();
 	  document.getElementById('s_name').style.color=style_color;
        return false;
    }
    if (s_writers.value == "")
    {
	window.alert("please enter the songwriter's name.");
        s_writers.focus();
	  document.getElementById('s_writers').style.color=style_color;
        return false;
    }
    if (s_genre_id.value == "")
    {
	window.alert("please select a genre.");
        s_genre_id.focus();
	  document.getElementById('s_genre_id').style.color=style_color;
        return false;
    }
    if (s_desc_short.value == "")
    {
	window.alert("please enter a short description for the song.");
        s_desc_short.focus();
	  document.getElementById('s_desc_short').style.color=style_color;
        return false;
    }
    
}



if(document.forms[0].name=="judges_signup"){

//declare variables
      var acct_login = document.judges_signup.acct_login;
    	var acct_password = document.judges_signup.acct_password;
	var acct_fname = document.judges_signup.acct_fname;
	var acct_lname = document.judges_signup.acct_lname;
	var acct_stage_name = document.judges_signup.acct_stage_name;
	var acct_title = document.judges_signup.acct_title;
	var acct_email = document.judges_signup.acct_email;
	var acct_web_url = document.judges_signup.acct_web_url;
	var acct_street = document.judges_signup.acct_street;
    	var acct_city = document.judges_signup.acct_city;
	var acct_c_id = document.judges_signup.acct_c_id;
	var acct_s_id = document.judges_signup.acct_s_id;
	var acct_s_nonus = document.judges_signup.acct_s_nonus;
	var acct_zip = document.judges_signup.acct_zip;
	var acct_phone = document.judges_signup.acct_phone;
	var acct_bio = document.judges_signup.acct_bio;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
	document.getElementById('acct_stage_name').style.color="";
	document.getElementById('acct_title').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_web_url').style.color="";
	document.getElementById('acct_street').style.color="";
	document.getElementById('acct_city').style.color="";
	document.getElementById('acct_country').style.color="";
	document.getElementById('acct_state').style.color="";
	document.getElementById('acct_zip').style.color="";
	document.getElementById('acct_phone').style.color="";
	document.getElementById('acct_bio').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_stage_name.value == "")
    {
	window.alert("please enter your 'stage' name.");
        acct_stage_name.focus();
	  document.getElementById('acct_stage_name').style.color=style_color;
        return false;
    }
    if (acct_title.value == "")
    {
	window.alert("please enter your title.");
        acct_title.focus();
	  document.getElementById('acct_title').style.color=style_color;
        return false;
    }
    if (acct_web_url.value == "")
    {
	window.alert("please enter your web address.");
        acct_web_url.focus();
	  document.getElementById('acct_web_url').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_street.value == "")
    {
	window.alert("please enter your street address.");
        acct_street.focus();
	  document.getElementById('acct_street').style.color=style_color;
        return false;
    }
    if (acct_city.value == "")
    {
	window.alert("please enter your city.");
        acct_city.focus();
	  document.getElementById('acct_city').style.color=style_color;
        return false;
    }
    if ((acct_c_id.value =="3")&&(acct_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        acct_s_id.focus();
	  document.getElementById('acct_country').style.color=style_color;
        return false;
    }
    if (acct_s_nonus.value == "")
    {
	window.alert("please enter your non-USA state.");
        acct_s_nonus.focus();
	  document.getElementById('acct_state').style.color=style_color;
        return false;
    }
    if (acct_zip.value == "")
    {
	window.alert("please enter your postal code.");
        acct_zip.focus();
	  document.getElementById('acct_zip').style.color=style_color;
        return false;
    }
    if (acct_phone.value == "")
    {
	window.alert("please enter your phone number.");
        acct_phone.focus();
	  document.getElementById('acct_phone').style.color=style_color;
        return false;
    }
    if (acct_bio.value == "")
    {
	window.alert("please enter your bio.");
        acct_bio.focus();
	  document.getElementById('acct_bio').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="judges_edit"){

//declare variables
      var acct_login = document.judges_edit.acct_login;
    	var acct_password = document.judges_edit.acct_password;
	var acct_fname = document.judges_edit.acct_fname;
	var acct_lname = document.judges_edit.acct_lname;
	var acct_stage_name = document.judges_edit.acct_stage_name;
	var acct_title = document.judges_edit.acct_title;
	var acct_email = document.judges_edit.acct_email;
	var acct_web_url = document.judges_edit.acct_web_url;
	var acct_street = document.judges_edit.acct_street;
    	var acct_city = document.judges_edit.acct_city;
	var acct_c_id = document.judges_edit.acct_c_id;
	var acct_s_id = document.judges_edit.acct_s_id;
	var acct_s_nonus = document.judges_edit.acct_s_nonus;
	var acct_zip = document.judges_edit.acct_zip;
	var acct_phone = document.judges_edit.acct_phone;
	var acct_bio = document.judges_edit.acct_bio;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
	document.getElementById('acct_stage_name').style.color="";
	document.getElementById('acct_title').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_web_url').style.color="";
	document.getElementById('acct_street').style.color="";
	document.getElementById('acct_city').style.color="";
	document.getElementById('acct_country').style.color="";
	document.getElementById('acct_state').style.color="";
	document.getElementById('acct_zip').style.color="";
	document.getElementById('acct_phone').style.color="";
	document.getElementById('acct_bio').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_stage_name.value == "")
    {
	window.alert("please enter your 'stage' name.");
        acct_stage_name.focus();
	  document.getElementById('acct_stage_name').style.color=style_color;
        return false;
    }
    if (acct_title.value == "")
    {
	window.alert("please enter your title.");
        acct_title.focus();
	  document.getElementById('acct_title').style.color=style_color;
        return false;
    }
    if (acct_web_url.value == "")
    {
	window.alert("please enter your web address.");
        acct_web_url.focus();
	  document.getElementById('acct_web_url').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_street.value == "")
    {
	window.alert("please enter your street address.");
        acct_street.focus();
	  document.getElementById('acct_street').style.color=style_color;
        return false;
    }
    if (acct_city.value == "")
    {
	window.alert("please enter your city.");
        acct_city.focus();
	  document.getElementById('acct_city').style.color=style_color;
        return false;
    }
    if ((acct_c_id.value =="3")&&(acct_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        acct_s_id.focus();
	  document.getElementById('acct_country').style.color=style_color;
        return false;
    }
    if (acct_s_nonus.value == "")
    {
	window.alert("please enter your non-USA state.");
        acct_s_nonus.focus();
	  document.getElementById('acct_state').style.color=style_color;
        return false;
    }
    if (acct_zip.value == "")
    {
	window.alert("please enter your postal code.");
        acct_zip.focus();
	  document.getElementById('acct_zip').style.color=style_color;
        return false;
    }
    if (acct_phone.value == "")
    {
	window.alert("please enter your phone number.");
        acct_phone.focus();
	  document.getElementById('acct_phone').style.color=style_color;
        return false;
    }
    if (acct_bio.value == "")
    {
	window.alert("please enter your bio.");
        acct_bio.focus();
	  document.getElementById('acct_bio').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="affiliate_signup"){

//declare variables
      var acct_login = document.affiliate_signup.acct_login;
    	var acct_password = document.affiliate_signup.acct_password;
	var acct_fname = document.affiliate_signup.acct_fname;
	var acct_lname = document.affiliate_signup.acct_lname;
	var acct_company = document.affiliate_signup.acct_company;
	var acct_email = document.affiliate_signup.acct_email;
	var acct_web_url = document.affiliate_signup.acct_web_url;
    	var acct_affiliate_id = document.affiliate_signup.acct_affiliate_id;
	var acct_payment_type = document.affiliate_signup.acct_payment_type;
	var acct_payments_to = document.affiliate_signup.acct_payments_to;
	var acct_pay_option = document.affiliate_signup.acct_pay_option;
	var acct_street = document.affiliate_signup.acct_street;
    	var acct_city = document.affiliate_signup.acct_city;
	var acct_c_id = document.affiliate_signup.acct_c_id;
	var acct_s_id = document.affiliate_signup.acct_s_id;
	var acct_s_nonus = document.affiliate_signup.acct_s_nonus;
	var acct_zip = document.affiliate_signup.acct_zip;
	var acct_phone = document.affiliate_signup.acct_phone;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
	document.getElementById('acct_company').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_web_url').style.color="";
	document.getElementById('acct_affiliate_id').style.color="";
      document.getElementById('acct_payment_type').style.color="";
	document.getElementById('payments_to').style.color="";
      document.getElementById('pay_option').style.color="";
	document.getElementById('acct_street').style.color="";
	document.getElementById('acct_city').style.color="";
	document.getElementById('acct_country').style.color="";
	document.getElementById('acct_USA_state').style.color="";
	document.getElementById('acct_state').style.color="";
	document.getElementById('acct_zip').style.color="";
	document.getElementById('acct_phone').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_company.value == "")
    {
	window.alert("please enter your company name."); 
        acct_company.focus();
 	  document.getElementById('acct_company').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_web_url.value == "")
    {
	window.alert("please enter your web address.");
        acct_web_url.focus();
	  document.getElementById('acct_web_url').style.color=style_color;
        return false;
    }
    if (acct_affiliate_id.value == "")
    {
	window.alert("please select an affiliate id.");
        acct_affiliate_id.focus();
	  document.getElementById('acct_affiliate_id').style.color=style_color;
        return false;
    }
    if (acct_payment_type.value == "")
    {
	window.alert("please enter an affiliate payment type.");
        acct_payment_type.focus();
	  document.getElementById('acct_payment_type').style.color=style_color;
        return false;
    }
    if ((acct_payment_type.value =="payout")&&(acct_payments_to.value == ""))
    {
	  window.alert("please enter who payments should be made to.");
        acct_payments_to.focus();
	  document.getElementById('payments_to').style.color=style_color;
        return false;
    }
    if ((acct_payment_type.value =="payout")&&(acct_pay_option.value == ""))
    {
	window.alert("please enter a payment option.");
        acct_pay_option.focus();
	  document.getElementById('pay_option').style.color=style_color;
        return false;
    }
    if (acct_street.value == "")
    {
	window.alert("please enter your street address.");
        acct_street.focus();
	  document.getElementById('acct_street').style.color=style_color;
        return false;
    }
    if (acct_city.value == "")
    {
	window.alert("please enter your city.");
        acct_city.focus();
	  document.getElementById('acct_city').style.color=style_color;
        return false;
    }
    if ((acct_c_id.value =="3")&&(acct_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        acct_s_id.focus();
	  document.getElementById('acct_USA_state').style.color=style_color;
        return false;
    }
    if (acct_s_nonus.value == "")
    {
	window.alert("please enter your non-USA state.");
        acct_s_nonus.focus();
	  document.getElementById('acct_state').style.color=style_color;
        return false;
    }
    if (acct_zip.value == "")
    {
	window.alert("please enter your postal code.");
        acct_zip.focus();
	  document.getElementById('acct_zip').style.color=style_color;
        return false;
    }
    if (acct_phone.value == "")
    {
	window.alert("please enter your phone number.");
        acct_phone.focus();
	  document.getElementById('acct_phone').style.color=style_color;
        return false;
    }

}



if(document.forms[0].name=="affiliate_edit"){

//declare variables
      var acct_login = document.affiliate_edit.acct_login;
    	var acct_password = document.affiliate_edit.acct_password;
	var acct_fname = document.affiliate_edit.acct_fname;
	var acct_lname = document.affiliate_edit.acct_lname;
	var acct_company = document.affiliate_edit.acct_company;
	var acct_email = document.affiliate_edit.acct_email;
	var acct_web_url = document.affiliate_edit.acct_web_url;
	var acct_payment_type = document.affiliate_edit.acct_payment_type;
	var acct_payments_to = document.affiliate_edit.acct_payments_to;
	var acct_pay_option = document.affiliate_edit.acct_pay_option;
	var acct_street = document.affiliate_edit.acct_street;
    	var acct_city = document.affiliate_edit.acct_city;
	var acct_c_id = document.affiliate_edit.acct_c_id;
	var acct_s_id = document.affiliate_edit.acct_s_id;
	var acct_s_nonus = document.affiliate_edit.acct_s_nonus;
	var acct_zip = document.affiliate_edit.acct_zip;
	var acct_phone = document.affiliate_edit.acct_phone;

//reset form styles	
	document.getElementById('acct_login').style.color="";
	document.getElementById('acct_password').style.color="";
	document.getElementById('acct_fname').style.color="";
	document.getElementById('acct_lname').style.color="";
	document.getElementById('acct_company').style.color="";
      document.getElementById('acct_email').style.color="";
	document.getElementById('acct_web_url').style.color="";
      document.getElementById('acct_payment_type').style.color="";
	document.getElementById('payments_to').style.color="";
      document.getElementById('pay_option').style.color="";
	document.getElementById('acct_street').style.color="";
	document.getElementById('acct_city').style.color="";
	document.getElementById('acct_country').style.color="";
	document.getElementById('acct_USA_state').style.color="";
	document.getElementById('acct_state').style.color="";
	document.getElementById('acct_zip').style.color="";
	document.getElementById('acct_phone').style.color="";

    if (acct_login.value == "")
    {
	window.alert("please select a username."); 
        acct_login.focus();
 	  document.getElementById('acct_login').style.color=style_color;
        return false;
    }
    if (acct_password.value == "")
    {
	window.alert("please select a password.");
        acct_password.focus();
	  document.getElementById('acct_password').style.color=style_color;
        return false;
    }
    if (acct_fname.value == "")
    {
	window.alert("please enter your first name.");
        acct_fname.focus();
	  document.getElementById('acct_fname').style.color=style_color;
        return false;
    }
    if (acct_lname.value == "")
    {
	window.alert("please enter your last name.");
        acct_lname.focus();
	  document.getElementById('acct_lname').style.color=style_color;
        return false;
    }
    if (acct_company.value == "")
    {
	window.alert("please enter your company name."); 
        acct_company.focus();
 	  document.getElementById('acct_company').style.color=style_color;
        return false;
    }
    if (acct_email.value == "")
    {
	window.alert("please enter your email address.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (!check_email(acct_email))
    {
	  window.alert("the email address you entered is invalid.");
        acct_email.focus();
	  document.getElementById('acct_email').style.color=style_color;
        return false;
    }
    if (acct_web_url.value == "")
    {
	window.alert("please enter your web address.");
        acct_web_url.focus();
	  document.getElementById('acct_web_url').style.color=style_color;
        return false;
    }
    if (acct_payment_type.value == "")
    {
	window.alert("please enter an affiliate payment type.");
        acct_payment_type.focus();
	  document.getElementById('acct_payment_type').style.color=style_color;
        return false;
    }
    if ((acct_payment_type.value =="payout")&&(acct_payments_to.value == ""))
    {
	  window.alert("please enter who payments should be made to.");
        acct_payments_to.focus();
	  document.getElementById('payments_to').style.color=style_color;
        return false;
    }
    if ((acct_payment_type.value =="payout")&&(acct_pay_option.value == ""))
    {
	window.alert("please enter a payment option.");
        acct_pay_option.focus();
	  document.getElementById('pay_option').style.color=style_color;
        return false;
    }
    if (acct_street.value == "")
    {
	window.alert("please enter your street address.");
        acct_street.focus();
	  document.getElementById('acct_street').style.color=style_color;
        return false;
    }
    if (acct_city.value == "")
    {
	window.alert("please enter your city.");
        acct_city.focus();
	  document.getElementById('acct_city').style.color=style_color;
        return false;
    }
    if ((acct_c_id.value =="3")&&(acct_s_id.value == "0"))
    {
	window.alert("please enter your USA state.");
        acct_s_id.focus();
	  document.getElementById('acct_USA_state').style.color=style_color;
        return false;
    }
    if (acct_s_nonus.value == "")
    {
	window.alert("please enter your non-USA state.");
        acct_s_nonus.focus();
	  document.getElementById('acct_state').style.color=style_color;
        return false;
    }
    if (acct_zip.value == "")
    {
	window.alert("please enter your postal code.");
        acct_zip.focus();
	  document.getElementById('acct_zip').style.color=style_color;
        return false;
    }
    if (acct_phone.value == "")
    {
	window.alert("please enter your phone number.");
        acct_phone.focus();
	  document.getElementById('acct_phone').style.color=style_color;
        return false;
    }

}




if(document.forms[0].name=="review"){

//declare variables
      var author = document.review.author;
    	var rating = document.review.rating;
	var review = document.review.review;

//reset form styles	
	document.getElementById('author').style.color="";
	document.getElementById('rating').style.color="";
	document.getElementById('review').style.color="";

    if (rating.value == "")
    {
	window.alert("please select a rating.");
        rating.focus();
	  document.getElementById('rating').style.color=style_color;
        return false;
    }
    if (author.value == "")
    {
	window.alert("please enter a reviewer's name."); 
        author.focus();
 	  document.getElementById('author').style.color=style_color;
        return false;
    }
    if (review.value == "")
    {
	window.alert("please enter your review.");
        review.focus();
	  document.getElementById('review').style.color=style_color;
        return false;
    }
    
}



}
