// Check that discount code box isn't emptyfunction checkDiscountBox() {	if (document.discount_code_form.discount_code.value=="") {		alert('Please enter a discount code.');		return false;	} else {		return true;	}}// Show searching message while search is being performedfunction showSearchingText() {	document.quote_search_form.product_search_button.disabled = true;	document.quote_search_form.product_search_button.value = "searching...";	//document.getElementById("product_search_content").innerHTML = "Your search is being performed...";}// Enable search button after a state is chosenfunction checkState() {	if (document.quote_search_form.state.value=="-") {		document.quote_search_form.product_search_button.disabled = true;		document.quote_search_form.state.style.color = "#FF0000";	} else {		document.quote_search_form.product_search_button.disabled = false;		document.quote_search_form.state.style.color = "#000000";	}}// Check tax checkbox statusfunction checkBox(name) {	document.paypal_form.action = 'index.php?page=view-quote#total';}// AJAX function to update quote with new quantity for specified productfunction updateQty(product_id) {	var quantity = document["add"+product_id].quantity.value;	var isNumber = parseFloat(quantity);	var notNumber = false;		if(isNaN(isNumber)) {		var notNumber = true;	}		if (quantity!="" && notNumber!=true) {		document.getElementById("status"+product_id).style.display = "block";		document.getElementById("status"+product_id).innerHTML = "adding...";							theURL = "processor.php?id=" + product_id + "&qty=" + quantity + "&key=2ef8ca536def553d035bf0c8578303f1";				if (window.XMLHttpRequest) {			var http_request = new XMLHttpRequest();		} else if (window.ActiveXObject) {			var http_request = new ActiveXObject("Microsoft.XMLHTTP");		}					http_request.onreadystatechange = function() {			if (http_request.readyState==4) {					if (http_request.responseText!="") {					document.getElementById("status"+product_id).style.display = "block";					document.getElementById("status"+product_id).innerHTML = http_request.responseText + " of these are in your eQuote";				}			}		}					http_request.open('GET',theURL,true);		http_request.send(null);	}}// Change status of product search form optionsfunction changeStatus(type) {	element_array = Array("grade_any","grade2","grade3","grade4","grade5","grade6","grade7","grade8","grade9","grade10","grade11","grade12","grade_teacher");	switch(type) {		case "any":			document.quote_search_form.grade_any.checked = true;			for (a=1; a<element_array.length; a++) {				current_element = element_array[a];				document.quote_search_form[current_element].checked = false;			}		break;		default:			if (document.quote_search_form.grade_any.checked) {				document.quote_search_form.grade_any.checked = false;				/*				for (a=1; a<element_array.length; a++) {					current_element = element_array[a];					document.quote_search_form[current_element].disabled = true;					document.quote_search_form[current_element].checked = false;				}				*/			} else {				for (a=1; a<element_array.length; a++) {					current_element = element_array[a];					document.quote_search_form[current_element].disabled = false;				}			}						counter = 0;			for (a=1; a<element_array.length; a++) {				current_element = element_array[a];				if (document.quote_search_form[current_element].checked) {										} else {					counter++;					}			}			if (counter==(element_array.length-1)) {				document.quote_search_form.grade_any.checked = true;				}		break;	}}// Navigation functionsfunction hideAllSubNav() {	for (a=0; a<all_ids_array.length; a++) {		current_id = all_ids_array[a];		document.getElementById(current_id).style.display = "none";	}}	function showSubNav(id_array) {	hideAllSubNav();	for (a=0; a<id_array.length; a++) {		current_id = id_array[a];		document.getElementById(current_id).style.display = "block";	}}