function SortSubmit()
{
	var conv = document.sort.Sortval.value;
	document.sort.Sortval.value=conv;
	document.sort.submit();
}
function giftSortSubmit()
{
	var conv = document.sort.giftSortval.value;
	document.sort.giftSortval.value=conv;
	document.sort.submit();
}
function checkRange(lowpriceval,high)
{
	var condCheck = false;
	if ((lowpriceval != null) && (lowpriceval != "") && (high != null) && (high != "" )){
		condCheck= (( parseFloat(document.getElementById("from-price").value)<= parseFloat(document.getElementById("to-price").value)))
	}
	return condCheck;
}
function setFieldOnEnterHitPrice(myfield,e)
{
var keycode;
if (window.event){ keycode = window.event.keyCode;}
else if (e) { keycode = e.which;}
else return true;
if (keycode == 13)
   {
	priceSubmit();
   return false;
   }
else
   return true;
}
/**
description: javascript function which allows only numbers to be entered in a 
* price range textbox
**/
function noAlphaPrice(e,myfield)
{
	var alpha=false;
	var charCode = (e.which) ? e.which : event.keyCode
    if (charCode >= 48 && charCode <= 57 || charCode == 8 )
		alpha= true;
		var enter=setFieldOnEnterHitPrice(myfield,e);
	 var keyPress=alpha && enter;
		return keyPress;
}
function priceSubmit()
{
		var conv = document.getElementById("from-price").value;
		var high =document.getElementById("to-price").value;
		var submitLow = document.price.Price_low;
		var submitHigh = document.price.Price_high;
		//var alphacheck=alphaRange(conv,high);
		var check = checkRange(conv,high);
		if(check)
		{
	    document.price.Price_low.value = conv;
		document.price.Price_high.value=high;
		document.getElementById("from-price").value="";
		document.getElementById("to-price").value="";
		document.price.submit();
		}
	}

