/*

	Frank Marion, software@frankmarion.com
	http://www.frankmarion.com

	Date Created:	Thursday, January 15, 2004 9:50:40 PM
	Last Modified:	Thursday, January 15, 2004 9:50:44 PM
	Revision:		1.0

	Function: Various functions used to support the commerce engine

*/

// Change the class of a table to a "roll over" state
function roll_over_class(obj,img,img_alt,css_class)
{
	obj = document.getElementById(obj);
	img = document.getElementById(img);
	img.src = img_alt;
	obj.className = css_class;
	
}

// Change the class of a table to a "roll off" state
function roll_off_class(obj,img,img_alt,css_class)
{
	obj = document.getElementById(obj);
	img = document.getElementById(img);
	img.src = img_alt;
	obj.className = css_class;
	//alert(obj +'\n'+ img +'\n'+ img_alt +'\n'+ css_class);
}


// Validate search form input, and reset when field is selected
function input_reset() {
	var product_name = document.getElementById('search_product_form_input');
	product_name.style.backgroundColor = 'white';
	if (product_name.value == 'Enter keyword') {
		product_name.value = '';
	}
}
function val_search_input() {
	var product_name = document.getElementById('search_product_form_input');
	if(product_name.value =='Enter keyword' || product_name.value =='') {
		product_name.style.backgroundColor = 'salmon';
		alert('Please enter a search term');
		return false;
	} else {
		return true;
	}
}