
			var strErrDateInvalid = "Please enter a valid date";
			var strErrAcceptTerms = "You must agree to DateClub\'s Terms and Conditions to continue.";



function PrintThisPage() {
	window.print();
}

function BookmarkThisPage() {
	var url = self.location.href;
	var title = window.document.title;

	if (document.all && window.external) window.external.AddFavorite(url, title);
}

function checkProfileSelection(selectFieldName, setFocus) {
   var selectField = document.getElementById(selectFieldName);
   var otherField = document.getElementById(selectFieldName + "Other");

   if (selectField.value == 'other') {
      otherField.disabled = false;
      otherField.style.visibility = 'visible';
      if (setFocus) otherField.focus();
   }
   else {
      otherField.value = '';
      otherField.style.visibility = 'hidden';
      otherField.disabled = true;
   }
}

function checkTermsAccepted(checkBoxId) {
	if (document.getElementById(checkBoxId).checked) return true;
	alert(strErrAcceptTerms);
	return false;
}

function checkDate(fieldBaseName) {
	// retrieve complete field names
	var fieldNameDay	= fieldBaseName + 'Day';
	var fieldNameMonth	= fieldBaseName + 'Month';
	var fieldNameYear	= fieldBaseName + 'Year';

	// retrieve date values from input form
	var inputDay	= parseInt(document.getElementById(fieldNameDay).value, 10);
	var inputMonth	= parseInt(document.getElementById(fieldNameMonth).value, 10);
	var inputYear	= parseInt(document.getElementById(fieldNameYear).value, 10);

	// generate a valid date with the input parameters
	var chkDate		= new Date(inputYear, inputMonth - 1, inputDay);
	var chkDay		= parseInt(chkDate.getDate(), 10);
	var chkMonth	= parseInt(chkDate.getMonth()+1, 10);
	var chkYear		= parseInt(chkDate.getYear(), 10);

	// workaround for older mozilla/netscape implementation
	if (chkYear < 2000) chkYear += 1900;

	// verify that the generate date is = to the input data (e.g. it is valid)
	if ((inputDay != chkDay) || (inputMonth != chkMonth) || (inputYear != chkYear)) {
		alert(strErrDateInvalid);
		document.getElementById(fieldNameDay).focus();
		return false;
	}

	// date ok
	return true;
}
