function refreshadminArtist()
{
   document.form1.action.value="changed";
   document.form1.feature.value="";
   document.form1.Venue.value="0";
   document.form1.DJ.value="0";
   document.form1.submit();
}
function refreshadminDJ()
{
   document.form1.action.value="changed";
   document.form1.feature.value="";
   document.form1.Artist.value="0";
   document.form1.Venue.value="0";
   document.form1.submit();
}

//newWindow = null
 
function openWindowLink() {
	newWindow = window.open("blog.php", "newWin", "toolbar=no,location=yes,scrollbars=yes,width=800,height=650")
}
function openWindowMail() {
	newWindow = window.open("join-maillist.php", "newWin", "toolbar=no,location=yes,scrollbars=yes,width=350,height=300")
}
function openWindowBand() {
	newWindow = window.open("bandordj.php", "newWin", "toolbar=no,location=yes,scrollbars=no,width=500,height=670")
}
function openWindowPartner() {
	newWindow = window.open("becomeapartner.php", "newWin", "toolbar=yes,location=yes,scrollbars=no,width=400,height=350")
}
function openWindowMember() {
	newWindow = window.open("member.php", "newWin", "toolbar=yes,location=yes,scrollbars=no,width=400,height=550")
}

function closeWindow() {

	if (newWindow && !newWindow.closed) {
		newWindow.close()
		}
	}

function validateMember(form) {
//alert( "In validate form - " );
    if (isNotEmpty(form.company)) {
        if (isNotEmpty(form.address)) {
            if (isNotEmpty(form.email)) {
                if (isEMailAddr(form.email)) {
		   if (isNotEmpty(form.last)) {
		      if (isNotEmpty(form.first)) {
			if (isChosen(form.Type)) {
			  if (isNotEmpty(form.password) && isNotEmpty(form.password2) ){
			   return true;
			  }
			}
		      }
		   }
                }
            }
        }
    }
    return false;
}

function validateBooking(form) {
//alert( "In validate form - " );
    if (isNotEmpty(form.Name)) {
            if (isNotEmpty(form.email)) {
                if (isEMailAddr(form.email)) {
		   if (isNotEmpty(form.EventDate)) {
		      if (isNotEmpty(form.DayPhone)) {
			return true;
		      }
		   }
                }
            }
        }
    return false;
}


// validates that the field value string has one or more characters in it
function isNotEmpty(elem) {
	var str = elem.value;
    var re = /.+/;
    if(!str.match(re)) {
        alert("Please fill in the required field.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    } else {
        return true;
    }
}
//validates that the entry is a positive or negative number
function isNumber(elem) {
	var str = elem.value;
    var re = /^[-]?\d*\.?\d*$/;
    str = str.toString();
    if (!str.match(re)) {
        alert("Enter only numbers into the field.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    }
    return true;
}
// validates that the entry is 16 characters long
function isLen16(elem) {
	var str = elem.value;
    var re = /\b.{16}\b/;
    if (!str.match(re)) {
        alert("Entry does not contain the required 16 characters.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    } else {
        return true;
    }
}
// validates that the entry is formatted as an e-mail address
function isEMailAddr(elem) {
    var str = elem.value;
    var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
    if (!str.match(re)) {
        alert("Verify the e-mail address format.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    } else {
        return true;
    }
}
// validate that the user made a selection other than default
function isChosen(select) {
    if (select.selectedIndex == 0) {
        alert("Please make a choice from the list.");
        return false;
    } else {
        return true;
    }
}

// validate that the user has checked one of the radio buttons
function isValidRadio(radio) {
    var valid = false;
    for (var i = 0; i < radio.length; i++) {
        if (radio[i].checked) {
            return true;
        }
    }
    alert("Make a choice from the radio buttons.");
    return false;
}

function focusElement(formName, elemName) {
    var elem = document.forms[formName].elements[elemName];
    elem.focus();
    elem.select();
}

// open popup windows

function openWindowp1() {
	newWindow = window.open("package1.php", "newWin", "toolbars=no,location=no,scrollbars=yes,width=550,height=300")
}
function openWindowp2() {
	newWindow = window.open("package2.php", "newWin", "toolbars=no,location=no,scrollbars=yes,width=550,height=300")
}
function openWindowp3() {
	newWindow = window.open("package3.php", "newWin", "toolbars=no,location=no,scrollbars=yes,width=550,height=300")
}
function openWindowp4() {
	newWindow = window.open("package4.php", "newWin", "toolbars=no,location=no,scrollbars=yes,width=550,height=300")
}
function isEMailAddr(elem) {
    var str = elem.value;
    var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
    if (!str.match(re)) {
        alert("Verify the e-mail address format.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    } else {
        return true;
    }
}
function isNotEmpty(elem) {
	var str = elem.value;
    var re = /.+/;
    if(!str.match(re)) {
        alert("Please fill in the required information.");
        setTimeout("focusElement('" + elem.form.name + "', '" + elem.name + "')", 0);
        return false;
    } else {
        return true;
    }
}
function validateInfo(form) {
//alert( "In validate form - " );
    if (isNotEmpty(form.first)) {
            if (isNotEmpty(form.email)) {
                if (isEMailAddr(form.email)) {
		   if (isNotEmpty(form.last)) {
			return true;
		   }
                }
            }
        }
    return false;
}
//Barry
newWindow = null
-->



