// search textbox
function ValidateSearch()
{
	var frm = document.getElementById("frmSearch");
	
	if( isEmpty(frm.searchText.value) )
	{
		alert("Please enter a search word in the text box provided");
		frm.searchText.focus();
		return false;
	}
	else
	{
		frm.process.value = 1;
		frm.submit();
	}
}

/*
// emaillist.aspx
function EmailList()
{
	var frm = document.getElementById("frmEmailList");
	frm.process.value = 1;
	frm.func.value = 'EmailList';
	
	frm.submit();
}

// CircularItemList.aspx, CircularSearchList.aspx
function ILAddItem( item )
{
	var frm = document.getElementById("frmItemList");
	frm.process.value = 1;
	frm.itemToAdd.value = item;
	
	frm.submit();
}

// CircularItemList.aspx
function SubCatHandler( parentCatID, parentCatName, keyAppQSVars )
{
	var catID = document.frmSubCat.subCatMenu.options[document.frmSubCat.subCatMenu.selectedIndex].value;
	var link = 'CircularItemList.aspx?catID=' + catID + '&pos=0&pcid=' + parentCatID + '&pcn=' + parentCatName + '&' + keyAppQSVars;
	
	if( catID > 0 )
		window.document.location.replace(link);
	
	document.frmSubCat.subCatMenu.selectedIndex = 0 //Reset selection
}

// shoppinglist.aspx
function SLItems( action )
{
	var frm = document.getElementById("frmShopListPage");
	frm.process.value = 1;
	frm.func.value = action;
	
	if( action == "Add" )
	{
		if( isEmpty(frm.AdditionalItem.value) )
		{
			alert("Please enter an additional item in the text box provided");
			frm.AdditionalItem.focus();
			return;
		}
	}
	
	frm.submit();
}

// UC_Shoppinglist.ascx
function SLRemItem( item )
{
	var frm = document.getElementById("frmShopList");
	frm.process.value = 1;
	frm.itemToRemove.value = item;

	frm.submit();
}

// up arrow
function inc( sliid ) {

	var elem = document.getElementById("Q" + sliid);
	
	var qty = parseInt(elem.value) + 1;
	if (isNaN(qty)) {
		qty = 1;
	} else if (qty > 99) {
		qty = 99;
	}
	elem.value = qty;

	return;
}
// down arrow
function dec( sliid  ) {

	var elem = document.getElementById("Q" + sliid);
	
	var qty = parseInt(elem.value) - 1 ;

	if (isNaN(qty)) {
		qty = 1;
	} else if (qty <= 0) {
		qty = 0;
	}
	elem.value = qty;

	return;
}

// UC_CircularHeader.ascs
function CheckSearch(sform){
  if( sform.SearchText.value == "" )
	return false;
  else
	return true;
}

// SignIn.aspx
function SignIn( action )
{
	var frm = document.getElementById("frmSignIn");
	frm.process.value = 1;
	
	if( action == 'signin' )
		frm.func.value = 'signin';
	else
		frm.func.value = 'emailpassword';
	
	frm.submit();
}

// Register.aspx
function Register()
{
	var frm = document.getElementById("frmRegister");
	frm.process.value = 1;
	frm.func.value = 'Register';
	
	frm.submit();
}
*/
