function show_large(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=330');");
}
// ========================================================
// VERIFICATION FUNCTIONS

function validate_email(field,alerttxt) {
	with (field) {
		// THERE IS A VALUE NOW CHECK IF IT IS VALID
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
			
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);
			return false;
		} else {
			return true;
		}
	}
}

function validate_field(field,alerttxt) {
	with (field) {
  		if (value==null||value=="") {
  			alert(alerttxt);
			return false;
  		} else {
  			return true;
  		}
	}
}

function validate_dropdown(field,alerttxt) {
	with (field) {
		// MAKE SURE THE USER SELECTED A VALUE
  		if (options[selectedIndex] == options[0]) {
  			alert(alerttxt);
			return false;
  		} else {
  			return true;
  		}
	}
}

function validate_number(field,alerttxt){
	with(field) {
		// CHECK IF THERE IS A VALUE
		if (value==null||value=="") {
  			alert(alerttxt);
			return false;
  		} else {
			// THERE IS A VALUE NOW CHECK IF ITS VALID
			valid_chars = "0123456789.-";
			
			var char_status = "valid";
			// LOOP THROUGH STRING TO FIND VALID CHARACTERS
			for(i=0;i<value.length;i++){
				if(valid_chars.indexOf(value.charAt(i)) < 0){
					// DETECT THE INVALID CHARACTER VALUE TO REMOVE IT
					var invalid_character = value.charAt(value.length - 1);
				
					// AN INVALID CHARACTER WAS FOUND, ALERT USER
					char_status = "invalid";
			
				}
			}
			if(char_status == "invalid") {
				alert(alerttxt);
				return false;
			} 
		}
	}
}
// ============= CALL ALL VALIDATION FUNCTIONS ===================


function validate_form(thisform) {
	with (thisform) {
		
		if (validate_field(name,"Please Enter Your Name!")==false) {
			name.focus();
			return false;
		}
		
		if (validate_field(address,"Please Enter a Street Address!")==false) {
			address.focus();
			return false;
		}
		
		if (validate_field(city,"Please Enter a City!")==false) {
			city.focus();
			return false;
		}
		
		if (validate_dropdown(state,"Please Select a State!")==false) {
			state.focus();
			return false;
		}
		
		if (validate_number(zip,"Please Enter a Valid Zip Code!")==false) {
			zip.focus();
			return false;
		}
		
		
		if (validate_email(email,"Please Enter a Valid Email!")==false) {
			email.focus();
			return false;
		}
		
		if (validate_field(phone,"Please Enter a Phone Number!")==false) {
			phone.focus();
			return false;
		}
		
		if (validate_number(cardnumber,"Please Enter a Credit Card Number!")==false) {
			cardnumber.focus();
			return false;
		}
		
		if (validate_number(cvmvalue,"Please Enter Your CVV Code!")==false) {
			cvmvalue.focus();
			return false;
		}
	}
}