function checkQuantity(StockQty,txtbox,ItemMFGDesc, blnHideProductStock)
{
	var value2=txtbox.value;
			
	if(blnHideProductStock == "1")
	{
		if (value2 > StockQty && StockQty != -1)
		{
			if(StockQty != 0) {
				alert('The available quantity in stock for "' + ItemMFGDesc +'" is ' + StockQty + '. Please reduce the order quantity in order to proceed');
			} else {
				alert(ItemMFGDesc +' is not in stock at this time. Please check back later.');
			}	
			return false;
		}
	}	
	return true;
}
		
function ShowCommonWordsDetails()
{
	window.open("CommonWordsDetails.asp","CommonWordsDetails","menubar=no,scrollbars=no,width=400,height=300")
}

function fnSearch(blnDisplayPrice, blnUserLoggedIn)
{
	var frm = document.frmAdvancedSearch;
	if(blnDisplayPrice != "1" || blnUserLoggedIn == "True")
	{
		if(frm.txtMinPrice.value != '' || frm.txtMaxPrice.value != '')
		{			
			if(!validate_CURRENCY(frm.txtMinPrice,"minimum price")){return false;}
			if(!validate_CURRENCY(frm.txtMaxPrice,"maximum price")){return false;}
			if(frm.txtMaxPrice.value == "")
			{
				alert("The maximum price should be entered.")
				frm.txtMaxPrice.focus();
				return false;
			}
			if(frm.txtMinPrice.value == "")
			{
				alert("The minimum price should be entered.");
				frm.txtMinPrice.focus();
				return false;
			}
			if(parseFloat(frm.txtMaxPrice.value) < parseFloat(frm.txtMinPrice.value))
			{
				alert("The maximum price cannot be less than the minimum price.")
				frm.txtMaxPrice.focus();
				return false;
			}
		}
	}
}
