function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}

function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}



//Validates the Seach Form
function Validate(theForm)
{
	var initialPrice 
	var finalPrice

	initialPrice = parseFloat(theForm.sInitialPrice.value)
	finalPrice = parseFloat(theForm.sFinalPrice.value)

  if (initialPrice < 0)
  {
	alert("Please enter a valid value for the \"From Price Range\" field.");
	theForm.sInitialPrice.focus();
	return (false);
  }
  if (finalPrice < 0)
  {
	alert("Please enter a valid value for the \"To Price Range\" field.");
	theForm.sFinalPrice.focus();
	return (false);
  }
  if (finalPrice < initialPrice)
  {
	alert(" \"To Price Range\" field has to be larger than \"From Price Range\" field.");
	theForm.sFinalPrice.focus();
	return (false);
  }

 return (true);
}
   
function popitup(url) {
	newwindow=window.open(url,'product_review','resizable=no,location=no,menubar=no,scrollbars=auto,status=yes,toolbar=no,fullscreen=no,dependent=no,width=450,height=760,status');
	if (window.focus) {newwindow.focus()}
	return false;
}

function equalHeight(group) 
{
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}

// Add 1 to the helpFul counting
function addToHelpFul(reviewID) {
	var URL = "/_includes/site/templates/update_helpful.asp?reviewID=" + reviewID;
	ajaxCall(URL,showNumber);	
}

function howManyHelpFul(reviewID) {
	ajaxCall("/_includes/site/templates/howmanyHelpful.asp?reviewID=" + reviewID, showNumber);
}

function showNumber(xml) {
//	var qtyHelpFul	= $(xml).find("total").text();
//	$("#helpFul").text(qtyHelpFul);
}
