
function goToUrl(theUrl){
	document.location.href="/bass/" + theUrl;
	}
	
function altMsg(theDelay){
	setTimeout('blockUrl()',theDelay)
	}	

function blockUrl(){
	window.status='';
	return true;
	}
	
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function displayLayers() { //v1.0
  var i,p,v,obj,args=displayLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
    obj.display=v; }
}

function formatSwf(swfName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[swfName];
  }
  else {
    return window.document.getElementById(swfName);
  }
}

function showTuner() {
	displayLayers('tunerLayer','','block','subjectList','','none');
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    var mc = InternetExplorer ? window.bassLoader : window.document.bassLoader;
	mc.Play();
}

function hideTuner() {
	displayLayers('tunerLayer','','none','subjectList','','block');
}

/* FORM VALIDATION */

var numExp = /^[\d]*$/;
var alphaNumExp = /^[0-9a-z]*$/;
var emailExp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
var capNumExp = /^[0-9A-za-z]*$/;
var capNumSpDashExp = /^[ 0-9A-za-z\-]*$/;
var phoneExp = /^[\(\) 0-9\-]*$/;

function validateContact(theForm) {
	
	if (theForm.name.value=="") {
        alert ("\nPlease enter your name");
       	return false;
    }

	var strEmail = theForm.email.value;
	if (!emailExp.test(strEmail)) {
        alert ("\nPlease enter a valid email address");
       	return false;
    }
	
	if (theForm.message.value=="") {
        alert ("\nPlease enter a message");
       	return false;
    }

	return true;
}

function validateLogin(theForm) {

	var strUN = theForm.username.value;
	if ((strUN=="") || (!alphaNumExp.test(strUN))) {
        alert ("\nPlease enter a valid username");
       	return false;
	}

	var strPW = theForm.password.value;
	if ((strPW=="") || (!capNumExp.test(strPW))) {
        alert ("\nPlease enter a valid password");
       	return false;
	}

	return true;
}

function validateSked(theForm) {

	if (theForm.selDate.value=="") {
        alert ("\nPlease choose a date");
       	return false;
	}

	if (theForm.selTime.value=="") {
        alert ("\nPlease choose a time");
       	return false;
	}

	return true;
}

function validatePW(theForm) {

	var strPW = theForm.querytype.value;
	var strOldPW = theForm.oldPW.value;
	var strNewPW = theForm.newPW.value;
	var strConfirmPW = theForm.confirmPW.value;

	if (strPW!=strOldPW) {
        alert ("\nThe current password you have entered does not match the database");
       	return false;
	}

	if ((strOldPW=="") || (!capNumExp.test(strOldPW))) {
        alert ("\nPlease enter your current password");
       	return false;
	}

	if ((strNewPW=="") || (!capNumExp.test(strNewPW))) {
        alert ("\nPlease enter a valid new password");
       	return false;
	}

	if (strNewPW!=strConfirmPW) {
        alert ("\nThe new passwords you have entered do not match");
       	return false;
	}

	return true;
}

function validateProfile(theForm) {

	var strAddress1 = theForm.address1.value;
	var strAddress2 = theForm.address2.value;
	var strCity = theForm.city.value;
	var strState = theForm.state.value;
	var strZip = theForm.zip.value;
	var strEmail = theForm.email.value;
	var strPhone = theForm.phone.value;

	if ((strAddress1=="") || (!capNumSpDashExp.test(strAddress1))) {
        alert ("\nPlease enter your address");
       	return false;
	}

	if (!capNumSpDashExp.test(strAddress1)) {
        alert ("\nPlease enter a valid line for your second address line");
       	return false;
	}

	if ((strCity=="") || (!capNumSpDashExp.test(strCity))) {
        alert ("\nPlease enter your city");
       	return false;
	}

	if ((strState=="") || (!capNumExp.test(strState))) {
        alert ("\nPlease enter your state");
       	return false;
	}

	if ((strZip=="") || (!numExp.test(strZip))) {
        alert ("\nPlease enter your current password");
       	return false;
	}

	if ((strEmail=="") || (!emailExp.test(strEmail))) {
        alert ("\nPlease enter a valid email address");
       	return false;
	}

	if ((strPhone=="") || (!phoneExp.test(strPhone))) {
        alert ("\nPlease enter your phone number");
       	return false;
	}

	return true;
}

function clickIE4() {
	if (event.button==2){
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

//document.oncontextmenu=new Function("return false")
