// JavaScript Document
function validate(form) 
{
		bid 	= form.bid.value;
		list 	= form.list.value;
		
		// FILTER OUT ANY CRAP
		re 		= /^\$|,/g;
		bid 	= bid.replace(re, "");
		list 	= list.replace(re, "");
		
		// CREATE INTEGERS
		bid 	= parseInt(bid);
		list	= parseInt(list);
		
		// FIND THE MININUM BID
		test_value = (list * .5);
		test_value = Math.round(test_value);
		
		if (bid >= test_value) {
			valid = true;
		} else {
			alert("In order to better service our customers and our consigners Pedigree Comics has instituted a mininum bid for all comic books and magazines.\n\nYour bid has not reached the mininum for this item.");
			valid = false;
		}
		return valid;
}
	
function confirmBuy() 
{
	if (confirm("You have clicked the Buy It Now button. Please click 'OK' to confirm your purchase of this item at the price listed.")) {
		return true;
	} else {
		return false;	
	}
}

function validate_auction(form) 
{
		bid 	= form.bid.value;
		min_bid	= form.min_bid.value;
		
		// FILTER OUT ANY CRAP
		re 			= /^\$|,/g;
		bid 		= bid.replace(re, "");
		min_bid 	= min_bid.replace(re, "");
		
		// CREATE INTEGERS
		bid 	= parseInt(bid);
		min_bid	= parseInt(min_bid);
		
		if (bid >= min_bid) {
			
			if (confirm("You are about to place a bid of $" + bid + ". Click OK to confirm")) {
				valid = true;
			} else {
				valid = false;
			}
		
		} else {
			alert("Your bid has not reached the mininum for this item.\n\nYour Max Bid must be equal or greater than the opening bid, or the next bid.");
			valid = false;
		}
		return valid;
}