<!--

function previewImages() {
	if (document.images) {
		for (var i=0; i<previewImages.arguments.length; i+=2) {
			document[previewImages.arguments[i]].src = previewImages.arguments[i+1];
		}
	}
}

function log_out() {
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Are you sure you want to log out?')) {
		return true;
	}
	else {
		ht[0].style.filter = "";
		return false;
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function convert( theurl ) { 
  window.open('' + theurl,'Convert','toolbar=0,width=570,height=480,resizable=yes,scrollbars=no');
} 
function ShowHelp( psFile ) { 
 window.open('' + psFile,'ShowHelp','toolbar=0,width=500,height=400,resizable=yes,scrollbars=yes');
}

function ValidateChangeEmail(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.OLDPASS.value == "") {
		alert("Please enter a value for the Password field.");
		theForm.OLDPASS.focus();
		return (false);
	}
	if (theForm.email.value == "") {
		alert("Please enter a value for the eMail Address field.");
		theForm.email.focus();
		return (false);
	}
	return (true);
}

function ValidateChangeName(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.password.value == "") {
		alert("Please enter a value for the Password field.");
		theForm.password.focus();
		return (false);
	}
	if (theForm.NEWNAME.value == "") {
		alert("Please enter a value for the NEW User Name field.");
		theForm.NEWNAME.focus();
		return (false);
	}
	if (theForm.NEWNAME.value.length > 30) {
		alert("Please enter at most 30 characters in the NEW User Name field.");
		theForm.NEWNAME.focus();
		return (false);
	}
	if (theForm.NEWNAME.value.length < 4) {
		alert("Please enter at least 4 characters in the NEW User Name field.");
		theForm.NEWNAME.focus();
		return (false);
	}
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	var checkStr = theForm.NEWNAME.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only alphanumeric characters in the NEW User Name field.");
		theForm.NEWNAME.focus();
		return (false);
	}
	return (true);
}

function ValidateChangeReg(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.OLDPASS.value == "") {
		alert("Please enter a value for the Password field.");
		theForm.OLDPASS.focus();
		return (false);
	}
	return (true);
}

function ValidateDisplayItem(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.password.value == "") {
		alert("Please enter a value for the Password field.");
		theForm.password.focus();
		return (false);
	}
	if (theForm.bid.value == "") {
		alert("Please enter a value for the Bid Price field.");
		theForm.bid.focus();
		return (false);
	}
	var checkOK = "0123456789.";
	var checkStr = theForm.bid.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
		if (ch != ".")
			allNum += ch;
	}
	if (!allValid) {
		alert("Please enter only numeric characters in the Bid Price field.");
		theForm.bid.focus();
		return (false);
	}
	return (true);
}

function ValidateJavaNew3(theForm) {
	if (theForm.title.value == "") {
		alert("Please enter a title.");
		theForm.title.focus();
		return (false);
	}
	if (theForm.title.value.length > 50) {
		alert("Please enter at most 50 characters in the Item Title field.");
		theForm.title.focus();
		return (false);
	}
	if (theForm.subtitle.value.length > 50) {
		alert("Please enter at most 50 characters in the Item Subtitle field.");
		theForm.subtitle.focus();
		return (false);
	}
	if (theForm.desc.value == "") {
		alert("Please enter a description.");
		theForm.desc.focus();
		return (false);
	}
	return (true);
}

function ValidateNewItem(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}

	if (theForm.location.value.length > 30) {
		alert("Please enter at most 30 characters in the Location field.");
		theForm.location.focus();
		return (false);
	}
	if (theForm.password.value == "") {
		alert("Please enter a value for the Password field.");
		theForm.password.focus();
		return (false);
	}
	if (theForm.title.value == "") {
		alert("Please enter a value for the Item Title field.");
		theForm.title.focus();
		return (false);
	}
	if (theForm.title.value.length > 50) {
		alert("Please enter at most 50 characters in the Item Title field.");
		theForm.title.focus();
		return (false);
	}
	if (theForm.days.selectedIndex < 0) {
		alert("Please select one of the days options.");
		theForm.days.focus();
		return (false);
	}
	if (theForm.days.selectedIndex == 0) {
		alert("The first days option is not a valid selection.  Please choose one of the other options.");
		theForm.days.focus();
		return (false);
	}
	if (theForm.hours.selectedIndex < 0) {
		alert("Please select one of the hours options.");
		theForm.hours.focus();
		return (false);
	}
	if (theForm.hours.selectedIndex == 0) {
		alert("The first hours option is not a valid selection.  Please choose one of the other options.");
		theForm.hours.focus();
		return (false);
	}
	if (theForm.minutes.selectedIndex < 0) {
		alert("Please select one of the minutes options.");
		theForm.minutes.focus();
		return (false);
	}
	if (theForm.minutes.selectedIndex == 0) {
		alert("The first minutes option is not a valid selection.  Please choose one of the other options.");
		theForm.minutes.focus();
		return (false);
	}
	if (theForm.location.value == "") {
		alert("Please enter a value for the Location field.");
		theForm.location.focus();
		return (false);
	}
	var checkOK = "0123456789-.";
	var checkStr = theForm.bid.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
		if (ch != ".")
			allNum += ch;
	}
	if (!allValid) {
		alert("Please enter only numeric characters in the Starting Price field.");
		theForm.bid.focus();
		return (false);
	}
}

function ValidateRegister(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length < 4) {
		alert("Please enter at least 4 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	var checkStr = theForm.username.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only alphanumeric characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.email.value == "") {
		alert("Please enter a value for the eMail Address field.");
		theForm.email.focus();
		return (false);
	}
	if (theForm.confirmemail.value == "") {
		alert("Please enter a value for the Confirm eMail Address field.");
		theForm.email.focus();
		return (false);
	}
	if (theForm.realname.value == "") {
		alert("Please enter a value for the Full Name field.");
		theForm.realname.focus();
		return (false);
	}
	if (theForm.address.value == "") {
		alert("Please enter a value for the Street Address field.");
		theForm.address.focus();
		return (false);
	}
	if (theForm.city.value == "") {
		alert("Please enter a value for the City field.");
		theForm.city.focus();
		return (false);
	}
	if (theForm.state.value == "") {
		alert("Please enter a value for the State field.");
		theForm.state.focus();
		return (false);
	}
	if (theForm.country.value == "") {
		alert("Please enter a value for the Country field.");
		theForm.country.focus();
		return (false);
	}
	if (theForm.postal.value == "") {
		alert("Please enter a value for the Postal field.");
		theForm.postal.focus();
		return (false);
	}
	if (theForm.birthdate.value == "") {
		alert("Please enter a value for the Birthdate field.");
		theForm.birthdate.focus();
		return (false);
	}
	if (theForm.phone.value == "") {
		alert("Please enter a value for the Phone field.");
		theForm.phone.focus();
		return (false);
	}
	var checkOK = "0123456789--() ";
	var checkStr = theForm.phone.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only numeric, whitespace and -() characters in the Phone field.");
		theForm.phone.focus();
		return (false);
	}
	return (true);
}

function mod10( cc_num ) {
	var ar = new Array( cc_num.length );
	var i = 0,sum = 0;
	for( i = 0; i < cc_num.length; ++i ) {
		ar[i] = parseInt(cc_num.charAt(i));
	}
	for( i = ar.length -2; i >= 0; i-=2 ) {
		ar[i] *= 2;
		if( ar[i] > 9 ) ar[i]-=9;
	}
	for( i = 0; i < ar.length; ++i ) {
		sum += ar[i];
	}
	return (((sum%10)==0)?true:false);	 	
}
function expired( month, year ) {
	var now = new Date();
	var expiresIn = new Date(year,month,0,0,0);
	expiresIn.setMonth(expiresIn.getMonth()+1);
	if( now.getTime() < expiresIn.getTime() ) return false;
	return true;
}

function ValidateRegisterCC(theForm) {
	if (theForm.username.value == "") {
		alert("Please enter a value for the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length > 30) {
		alert("Please enter at most 30 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.username.value.length < 4) {
		alert("Please enter at least 4 characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
	var checkStr = theForm.username.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only alphanumeric characters in the User Name field.");
		theForm.username.focus();
		return (false);
	}
	if (theForm.email.value == "") {
		alert("Please enter a value for the eMail Address field.");
		theForm.email.focus();
		return (false);
	}
	if (theForm.confirmemail.value == "") {
		alert("Please enter a value for the Confirm eMail Address field.");
		theForm.email.focus();
		return (false);
	}
	if( theForm.cc_num.value.length == 0 ) {
		alert("Please enter a credit card number.");
		theForm.cc_num.focus();
		return false;				
	}
	for( var i = 0; i < theForm.cc_num.length; ++i ) {
		var c = theForm.cc_num.value.charAt(i);
		if( c < '0' || c > '9' ) {
			alert("Please enter a valid card number. Use only digits. Do not use spaces or hyphens.");
			theForm.cc_num.focus();
			return false;
		}
	}
	var length = theForm.cc_num.value.length;
	if( theForm.cc_type[0].checked ) {
			if( length != 16 && length != 13 ) {
				alert("Please enter a valid Visa Card number.");
				theForm.cc_num.focus();
				return false;
			}
			var prefix = parseInt( theForm.cc_num.value.substring(0,1));
			if( prefix != 4 ) {
				alert("Please enter a valid Visa Card number.");
				theForm.cc_num.focus();
				return false;
			}
	}
	else if( theForm.cc_type[1].checked ) {
			if( length != 16 ) {
				alert("Please enter a valid MasterCard number.");
				theForm.cc_num.focus();
				return false;
			}
			var prefix = parseInt( theForm.cc_num.value.substring(0,2));
			if( prefix < 51 || prefix > 55) {
				alert("Please enter a valid MasterCard number.");
				theForm.cc_num.focus();
				return false;
			}
	}
	else if( theForm.cc_type[2].checked ) {
			if( length != 16 ) {
				alert("Please enter a valid Discover Card number.");
				theForm.cc_num.focus();
				return false;
			}
			var prefix = parseInt( theForm.cc_num.value.substring(0,4));
			if( prefix != 6011 ) {
				alert("Please enter a valid Discover Card number.");
				theForm.cc_num.focus();
				return false;
			}
	}
	else if( theForm.cc_type[3].checked ) {
			if( length != 15 ) {
				alert("Please enter a valid American Express Card number.");
				theForm.cc_num.focus();
				return false;
			}
			var prefix = parseInt( theForm.cc_num.value.substring(0,2));
			if( prefix != 34 && prefix != 37 ) {
				alert("Please enter a valid American Express Card number.");
				theForm.cc_num.focus();
				return false;
			}
	}
	else if( theForm.cc_type[4].checked ) {
			var firstdig = theForm.cc_num.value.substring(0,1);
			var seconddig = theForm.cc_num.value.substring(1,2);
			var validNums = "068";
			if (validNums.indexOf(seconddig)>=0) {
				if( length != 14 && firstdig != 3) {
					alert("Please enter a valid Diners Club Card number.");
					theForm.cc_num.focus();
					return false;
				}
			}
			else {
				alert("Please enter a valid Diners Club Card number.");
				theForm.cc_num.focus();
				return false;
			}
	}
	else {
		alert("Please select a credit card type.");
		theForm.cc_num.focus();
		return false;
	}
	if( !mod10( theForm.cc_num.value ) ) {
		alert("You did not enter a valid credit card number.");
		theForm.cc_num.focus();
		return false;
	}
	if( expired( theForm.cc_month.value, theForm.cc_year.value ) ) {
		alert("You did not enter a valid credit card expiration date.");
		theForm.cc_month.focus();
		return false;
	}
	if (theForm.cc_ver.value == "") {
		alert("Please enter the credit card verification number.");
		theForm.cc_ver.focus();
		return (false);
	}
	if (theForm.realname.value == "") {
		alert("Please enter a value for the Full Name field.");
		theForm.realname.focus();
		return (false);
	}
	if (theForm.address.value == "") {
		alert("Please enter a value for the Street Address field.");
		theForm.address.focus();
		return (false);
	}
	if (theForm.city.value == "") {
		alert("Please enter a value for the City field.");
		theForm.city.focus();
		return (false);
	}
	if (theForm.state.value == "") {
		alert("Please enter a value for the State field.");
		theForm.state.focus();
		return (false);
	}
	if (theForm.country.value == "") {
		alert("Please enter a value for the Country field.");
		theForm.country.focus();
		return (false);
	}
	if (theForm.postal.value == "") {
		alert("Please enter a value for the Postal field.");
		theForm.postal.focus();
		return (false);
	}
	if (theForm.birthdate.value == "") {
		alert("Please enter a value for the Birthdate field.");
		theForm.birthdate.focus();
		return (false);
	}
	if (theForm.phone.value == "") {
		alert("Please enter a value for the Phone field.");
		theForm.phone.focus();
		return (false);
	}
	var checkOK = "0123456789--() ";
	var checkStr = theForm.phone.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only numeric, whitespace and -() characters in the Phone field.");
		theForm.phone.focus();
		return (false);
	}
	return (true);
}

function ValidateRetractBid(theForm) {
	if (theForm.item.value == "") {
		alert("Please enter a value for the Item field.");
		theForm.item.focus();
		return (false);
	}
	if (theForm.reason.value == "") {
		alert("Please enter a value for the Reason field.");
		theForm.reason.focus();
		return (false);
	}
	if (theForm.reason.value.length < 20) {
		alert("Please enter at least 20 characters in the Reason field.");
		theForm.reason.focus();
		return (false);
	}
	var checkOK = "0123456789";
	var checkStr = theForm.item.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert("Please enter only numeric characters in the Item field.");
		theForm.item.focus();
		return (false);
	}
	return (true);
}
-->