/*------------------------------------------------------------------------------
    Title: Pro-Teams-Script.js.asp
    Version: 1.0
    Date: 11/01/2006

    Author:    James Stuart Johnson
    Email:     jjohnson@NationalDodgeball.com
    Website:   WWW.NationalDodgeball.COM

    Description: Utility Javascripts
------------------------------------------------------------------------------*/

/* About, Just a simple test function or bug hunting.
------------------------------------------------------------------------------*/
function about() {
alert("Utility Scripts Ver: 1.0\n Site: www.NationalDodgeball.com\n Date: 11-06-2006")
}


/* rollover, Back image swaping
------------------------------------------------------------------------------*/
function rollover(imgName, imgFile)  {
    if (document.images) {
        imgName.src = imgFile;
    }
  return;
  }

/* closewindow
------------------------------------------------------------------------------*/
function closewindow () {
	if (self.close && !self.closed) {
		self.close();
	}
}

/* openwindow
------------------------------------------------------------------------------*/
function openwindow (currPage, currWindowName, pageWidth, pageHeight) {
	var winWidth, winHeight;
	var wPopWindow;

	winWidth = 800;
	if (pageWidth > 0) {
		winWidth = pageWidth;
	}

	winHeight = screen.height;
	if (pageHeight > 0) {
		winHeight = pageHeight;
	} else if (pageHeight == 0) {
		winHeight = screen.height;
	}

	if (currPage != "") {
		wPopWindow = window.open(currPage, currWindowName, "resizable=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,width=" + winWidth + ",height=" + winHeight + "");
		wPopWindow.focus();
	}
}


/* openfixedwindow
------------------------------------------------------------------------------*/
function openfixedwindow (currPage, currWindowName, pageWidth, pageHeight) {
	var winWidth, winHeight;
	var wPopWindow;

	winWidth = 800;
	if (pageWidth > 0) {
		winWidth = pageWidth;
	}

	winHeight = 600;
	if (pageHeight > 0) {
		winHeight = pageHeight;
	}

	if (currPage != "") {
		wPopWindow = window.open(currPage, currWindowName, "resizable=no,location=no,menubar=no,scrollbars=no,status=no,width=" + winWidth + ",height=" + winHeight + "");
		if (wPopWindow) {
			wPopWindow.focus();
		}
	}
}

function bio_popup(url_add,sPlayerName)
   {
   window.open(url_add, sPlayerName, "width=460, height=600,menubar=yes,status=yes, location=yes,toolbar=yes,scrollbars=yes" );
   }

function validate(currForm) {
	var retValue = true;

	if (currForm.firstname.value == "" || currForm.lastname.value == "" || currForm.address1.value == "" || currForm.city.value == ""
	|| currForm.state.value == ""|| currForm.zip.value == ""|| currForm.country.value == "" || currForm.email.value == "" || currForm.age.value == ""|| currForm.gender.value == ""|| currForm.phone.value == "") {
		alert("Please enter all fields.");
		retValue = false;
	}

	return retValue;
}

function isEmail(fieldObject) {
	fldValue = fieldObject.value;
	currPos1 = fldValue.indexOf(" ");
	currPos2 = fldValue.indexOf("@");
	nl = fldValue.length;

	fldTest = isNaN(fldValue);
	if (fldValue == "") {
		fieldObject.value = "";
	} else if (currPos1 != -1 || currPos2 == -1) {
		alert("Please enter a valid e-mail address.  An email must not have spaces, and must have an @ symbol.");
		fieldObject.value = "";
		fieldObject.select();
		fieldObject.focus();
	}

}
