function fLoadRating()
{
	if (document.images)
	{
		oImageOn = new Image();
		oImageOff = new Image();
		
		oImageOff.src = "http://www.hihenry.com/web-icon-star.gif";
		oImageOn.src = "http://www.hihenry.com/web-icon-star-on.gif";

		oImageCashOn = new Image();
		oImageCashOff = new Image();
		
		oImageCashOff.src = "http://www.hihenry.com/web-icon-cash.gif";
		oImageCashOn.src = "http://www.hihenry.com/web-icon-cash-on.gif";
	}
}

function fMenuRegularOn(oImage, sType)
{
	oImage.src = oImage.src.replace("." + sType,"-on." + sType);
}

function fMenuRegularOff(oImage, sType)
{
	oImage.src = oImage.src.replace("-on." + sType,"." + sType);
}

function fChangeRating(oImage, oName, iStart, iEnd)
{
	if (document.writereviews.rating_allow.value == 1)
	{
		var iCounterA = iEnd;
		for (iCounterA; iCounterA <= 5; iCounterA++)
			 document.getElementById(oName + iCounterA).src = oImageOff.src;
		iCounterA = iStart;
		for (iCounterA; iCounterA <= iEnd; iCounterA++)
			 document.getElementById(oName + iCounterA).src = oImageOn.src;
		
		/*
		if (oName == "overall")
			document.writereviews.rating_overall.value = iEnd;	 
		if (oName == "food")
			document.writereviews.rating_food.value = iEnd;	 
		if (oName == "value")
			document.writereviews.rating_value.value = iEnd;	 
		if (oName == "service")
			document.writereviews.rating_service.value = iEnd;	 
		if (oName == "atmosphere")
			document.writereviews.rating_atmosphere.value = iEnd;	 
		*/
	}
	//oImage.src = oImage.src.replace("-on." + sType,"." + sType);
}

function fChangeRatingMouseOut(oImage, oName, iStart, iEnd)
{
	var iCounterA;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("food" + iCounterA).src = oImageOff.src;
	for (iCounterA=1; iCounterA <= document.writereviews.rating_food.value; iCounterA++)
		 document.getElementById("food" + iCounterA).src = oImageOn.src;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("value" + iCounterA).src = oImageOff.src;
	for (iCounterA=1; iCounterA <= document.writereviews.rating_value.value; iCounterA++)
		 document.getElementById("value" + iCounterA).src = oImageOn.src;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("service" + iCounterA).src = oImageOff.src;
	for (iCounterA=1; iCounterA <= document.writereviews.rating_service.value; iCounterA++)
		 document.getElementById("service" + iCounterA).src = oImageOn.src;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("atmosphere" + iCounterA).src = oImageOff.src;
	for (iCounterA=1; iCounterA <= document.writereviews.rating_atmosphere.value; iCounterA++)
		 document.getElementById("atmosphere" + iCounterA).src = oImageOn.src;
}

function fGiveRating(sType, iNumber)
{
	if (sType == "food")
		document.writereviews.rating_food.value = iNumber;	 
	if (sType == "value")
		document.writereviews.rating_value.value = iNumber;	 
	if (sType == "service")
		document.writereviews.rating_service.value = iNumber;	 
	if (sType == "atmosphere")
		document.writereviews.rating_atmosphere.value = iNumber;	 

	var iCounterA = 1;
	for (iCounterA; iCounterA <= iNumber; iCounterA++)
		 document.getElementById(sType + iCounterA).src = oImageOn.src;
	
}

function fChangeSearchRating(oImage, oName, iStart, iEnd)
{
	var iCounterA = iEnd;
	for (iCounterA; iCounterA <= 5; iCounterA++)
		 document.getElementById(oName + iCounterA).src = oImageOff.src;
	iCounterA = iStart;
	for (iCounterA; iCounterA <= iEnd; iCounterA++)
		 document.getElementById(oName + iCounterA).src = oImageOn.src;
	//oImage.src = oImage.src.replace("-on." + sType,"." + sType);
}

function fChangeSearchRatingMouseOut(oImage, oName, iStart, iEnd)
{
	var iCounterA;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("overall" + iCounterA).src = oImageOff.src;
	for (iCounterA=1; iCounterA <= document.step123.user_restaurant_rating.value; iCounterA++)
		 document.getElementById("overall" + iCounterA).src = oImageOn.src;
}

function fGiveSearchRating(sType, iNumber)
{
	var iCounterA = 1;
	for (iCounterA; iCounterA <= iNumber; iCounterA++)
		 document.getElementById(sType + iCounterA).src = oImageOn.src;

	document.step123.user_restaurant_rating.value = iNumber;
	document.step123.user_restaurant_rating_select.selectedIndex = iNumber;
	fSubmitSearch('Yes');
}

function fGiveSearchRatingDefault(sType, iNumber)
{
	var iCounterA = 1;
	for (iCounterA; iCounterA <= iNumber; iCounterA++)
		 document.getElementById(sType + iCounterA).src = oImageOn.src;

	document.step123.user_restaurant_rating.value = iNumber;
	document.step123.user_restaurant_rating_select.selectedIndex = iNumber;
}



function fChangeSearchPricing(oImage, oName, iStart, iEnd)
{
	var iCounterA = iEnd;
	for (iCounterA; iCounterA <= 5; iCounterA++)
		 document.getElementById(oName + iCounterA).src = oImageCashOff.src;
	iCounterA = iStart;
	for (iCounterA; iCounterA <= iEnd; iCounterA++)
		 document.getElementById(oName + iCounterA).src = oImageCashOn.src;
	//oImage.src = oImage.src.replace("-on." + sType,"." + sType);
}

function fChangeSearchPricingMouseOut(oImage, oName, iStart, iEnd)
{
	var iCounterA;
	for (iCounterA=1; iCounterA <= 5; iCounterA++)
		 document.getElementById("cash" + iCounterA).src = oImageCashOff.src;
	for (iCounterA=1; iCounterA <= document.step123.user_restaurant_price.value; iCounterA++)
		 document.getElementById("cash" + iCounterA).src = oImageCashOn.src;
}

function fGiveSearchPricing(sType, iNumber)
{
	var iCounterA = 1;
	for (iCounterA; iCounterA <= iNumber; iCounterA++)
		 document.getElementById(sType + iCounterA).src = oImageCashOn.src;

	document.step123.user_restaurant_price.value = iNumber;
	document.step123.user_restaurant_price_select.selectedIndex = iNumber;
	fSubmitSearch('Yes');
}

function fGiveSearchPricingDefault(sType, iNumber)
{
	var iCounterA = 1;
	for (iCounterA; iCounterA <= iNumber; iCounterA++)
		 document.getElementById(sType + iCounterA).src = oImageCashOn.src;

	document.step123.user_restaurant_price.value = iNumber;
	document.step123.user_restaurant_price_select.selectedIndex = iNumber;
}

fLoadRating();