function quoteChk1()
{
	event.keyCode=quoteDisallow(event.keyCode)	
}

function quoteDisallow(keyPressed)
{
	if (keyPressed==39 || keyPressed==34)
	{
		keyPressed = 0
	}
	else
	{		
	}
		return keyPressed	
}

function pricechk1()
{
	event.keyCode=priceDisallow(event.keyCode)	
}
function keyval1()
{
	if(eval(document.frm1.txtPriceFrom1.value) <= 0)
	{
		alert("Enter Price greater than Zero.");
		eval("document.frm1.txtPriceFrom1.value=''");
		eval("document.frm1.txtPriceFrom1.focus()");
	}	
	if(isNaN(eval("document.frm1.txtPriceFrom1.value")))
	{
		alert("Enter Numeric values for From Price.");
		eval("document.frm1.txtPriceFrom1.value=''");
		eval("document.frm1.txtPriceFrom1.focus()");
	}
	if(eval(document.frm1.txtPriceTo1.value) <= 0)
	{
		alert("Enter Price greater than Zero");
		eval("document.frm1.txtPriceTo1.value=''");
		eval("document.frm1.txtPriceTo1.focus()");
	}
	if(isNaN(eval("document.frm1.txtPriceTo1.value")))
	{
		alert("Enter Numeric values for To Price");
		eval("document.frm1.txtPriceTo1.value=''");
		eval("document.frm1.txtPriceTo1.focus()");
	}	
	
}
function priceDisallow1(keyPressed)
{
	if ((keyPressed >= 48 && keyPressed <= 57) || keyPressed == 46)
	{		
	}
	else
	{
		keyPressed = 0
	}
		return keyPressed	
}

function submitForm1()
{
	
	var strSearchTxt = document.frm1.txtKeyText.value;
	while(''+strSearchTxt.charAt(0)==' ')
		strSearchTxt=strSearchTxt.substring(1,strSearchTxt.length);
	document.frm1.txtKeyText.value=strSearchTxt;
	if (document.frm1.txtKeyText.value=="" && document.frm1.txtPriceFrom1.value=="" && document.frm1.txtPriceTo1.value=="" && document.frm1.cboSelCategory.value=="NS")
	{
		alert("Please specify the Search Criteria.");
		document.frm1.txtKeyText.focus();
		return false;
		
	}
	if (document.frm1.txtPriceFrom1.value!="" && document.frm1.txtPriceTo1.value!="")
	{
		if (parseFloat(document.frm1.txtPriceFrom1.value)>parseFloat(document.frm1.txtPriceTo1.value))
		{
			alert("The Price To Value should be greater than the Price From Value.");
			document.frm1.txtPriceTo1.focus();
			return false;
			
		}
	}
	if (document.frm1.txtPriceFrom1.value!="")
	{
		var pricefrom1 = document.frm1.txtPriceFrom1.value;
		if (parseInt(pricefrom1.split(".").length)>2)
		{
			alert("Please enter a valid value for the Price From field.");
			document.frm1.txtPriceFrom1.select();
			return false;
		
		}
	}
	if (document.frm1.txtPriceTo1.value!="")
	{
		var priceto1 = document.frm1.txtPriceTo1.value;
		if (parseInt(priceto1.split(".").length)>2)
		{
			alert("Please enter a valid value for the Price To field.");
			document.frm1.txtPriceTo1.select();
			return false;
			
		}
		
	}
	else
	{	
		return true;
			
	}
	
}


	function HeaderSearch()
	{
		var SearchCriteria = ""
		if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value == "" && document.frm1.pricech[document.frm1.pricech.selectedIndex].value == "")
		{
			SearchCriteria="IncludeAll";
		}
		if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value == "" && document.frm1.pricech[document.frm1.pricech.selectedIndex].value != "")
		{
			SearchCriteria="price";
		}
		if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value != "" && document.frm1.pricech[document.frm1.pricech.selectedIndex].value == "")
		{
			SearchCriteria="Category";
		}
		if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value != "" && document.frm1.pricech[document.frm1.pricech.selectedIndex].value != "")
		{
			SearchCriteria="PriceCategory";
		}

		var strCriteria = "";
		var strCategory = "";
		var strSearch = "";
		var ctn = 0;
		var strPrice="";
		if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value != "")
		{
			ctn=ctn+1;
		}
		if (document.frm1.pricech[document.frm1.pricech.selectedIndex].value != "")
		{
			ctn=ctn+1;
		}
		
		if (ctn == 1)
		{
			if (document.frm1.categorych[document.frm1.categorych.selectedIndex].value != "")
			{
				strSearch = "category"
				strCriteria = document.frm1.categorych[document.frm1.categorych.selectedIndex].value;
				strCategory = document.frm1.categorych[document.frm1.categorych.selectedIndex].value;
			//	alert(strCategory);
			}
			else if (document.frm1.pricech[document.frm1.pricech.selectedIndex].value != "")
			{
				strSearch = "advanced"
				strPrice = "pricecombo"
				strCriteria = document.frm1.pricech[document.frm1.pricech.selectedIndex].value;
			//	strPrice = document.frm1.price1[document.frm1.price1.selectedIndex].value;
			//	alert(strPrice);

			}
			document.frm1.action = "ClientProductListing.asp?strSearch="+strSearch+"&strPageNo=0&strCriteria="+strCriteria+"&strPrice="+strPrice+"&SearchCriteria="+SearchCriteria+"&strCategory="+strCategory;	
		}
		else
		{
			if (document.frm1.pricech[document.frm1.pricech.selectedIndex].value != "" && document.frm1.categorych[document.frm1.categorych.selectedIndex].value != "" )
			{
				strSearch = "advanced";
				strCriteria = "PC";
				var strCategory = document.frm1.categorych[document.frm1.categorych.selectedIndex].text;
				var strPrice =document.frm1.pricech[document.frm1.pricech.selectedIndex].value
				document.frm1.action = "ClientProductListing.asp?strSearch="+strSearch+"&strPageNo=0&strCriteria="+strCriteria+"&strPrice="+strPrice+"&strCategory="+strCategory+"&SearchCriteria="+SearchCriteria;		

			}
			if (ctn==0)
			{
				strSearch = "";
				document.frm1.action = "ClientProductListing.asp?strSearch="+strSearch+"&strPageNo=0&SearchCriteria="+SearchCriteria+"&strCategory="+strCategory;	
			}

		}


//alert(document.frm1.action);



		document.frm1.eflyerschstring1.value = document.frm1.action;
		document.frm1.method = "post";
		document.frm1.submit();		
	}
