/***********************************************************************
 MyioCart  v1.5.0
 (C)2005 MyioSoft - http://www.myiosoft.com
 Email: support@myio.net
 -----------------------------------------------------------------------
 THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
 THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE. THIS FILE AND ALL OTHERS IN THE DOWNLOAD PACKAGE CANNOT BE
 REDISTRIBUTED!
************************************************************************/

/* Jump to products */
function viewProduct(){
	theForm = window.document.frmListProduct;
	catList = theForm.cboCategory;
	if (catList.selectedIndex == 0) {
      window.location.href = '';
	} else {
      window.location.href = '?9.' + catList.options[catList.selectedIndex].value;
	}
}
/* Strip whitespace from the beginning and end of a string Input : a string */
function trim(str){
	return str.replace(/^\s+|\s+$/g,'');
}
/* Make sure that textBox only contain number */
function checkNumber(textBox){
   while (textBox.value.length > 0 && isNaN(textBox.value) ) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
   textBox.value = trim(textBox.value);
}
/* Check if a form element is empty. If it is display an alert box and focus on the element */
function isEmpty(formElement, message) {
	formElement.value = trim(formElement.value);
	_isEmpty = false;
	if (formElement.value == '') {
		_isEmpty = true;
		alert(message);
		formElement.focus();
	}
	return _isEmpty;
}

