// guitar-websites.php
function categoryChange(){
	window.document.location.replace("guitar-websites.php?categoryID="+document.changer.category.value);
}

// addlink.php
function validate(){
	if (document.frmAdd.categoryID.value==0){
		alert ("You must select a category."); return false;
		}
	if (document.frmAdd.title.value.length==0){
		alert ("You must enter a title."); return false;
		}
	if (document.frmAdd.description.value.length==0){
		alert ("You must enter a description."); return false;
		}
	if (document.frmAdd.description.value.length>250){
		alert ("The maximum length for the description is 250 characters. You have entered " + document.frmAdd.description.value.length + "."); return false;
		}
	if (document.frmAdd.url.value.length==0){
		alert ("You must enter a URL to link to."); return false;
		}
	if (document.frmAdd.name.value.length==0){
		alert ("You must enter your name."); return false;
		}

	// check for valid email address
	var email = document.frmAdd.email.value;
	if ((email.length==0)||(email.indexOf("@")==-1)||(email.indexOf(".", email.indexOf("@"))==-1)){
		alert ("You must enter a valid email address."); return false;
		}
	return true;
}



