function loadPrice(txtPrice)
{
 $(document).ready(function(){
    var selPriceRangeBig;
    	
	    $("#priceRangeBig a").hover(function() {
		    $(this).siblings().removeClass("act");
		    $(this).prevAll("a").addClass("hover");
	    }, function() {
		    $(this).prevAll("a").removeClass("hover");
		    restoreRangeBig();
	    });
    	
	    $("#priceRangeBig a").click(function() {
		    $("#"+txtPrice).attr("value", $(this).next("em").children().html());
		    $(this).addClass("act");
		    $(this).prevAll("a").addClass("act");
		    selPriceRangeBig = $(this);
	    });
    	
	    function restoreRangeBig() {
		    $(selPriceRangeBig).addClass("act");
		    $(selPriceRangeBig).prevAll("a").addClass("act");
	    }
	 });
}

function loadReviewOptions(txtRate,txtPrice)
    {
    $(document).ready(function(){
	    /* --- Big Rating --- */
	    var selBigRating;
    	
	    $(".ratingBig .good a[class!=minus]").hover(function() {
	     
		    $(this).siblings().removeClass("act");
		    $(this).prevAll("a").addClass("hover");
	    }, function() {
		    $(this).prevAll("a").removeClass("hover");
		    restoreRating(true);
	    });
    	
	    $(".ratingBig .good a[class!=minus]").click(function() {
	    
		   // $("#"+txtRate).attr("value", $(this).next("em").children().html().slice(-2));
		   // alert($("#"+txtRate).val());
		    $(this).addClass("act");
		    $(this).prevAll("a").addClass("act");
		    selBigRating = $(this);
		   
		    $(".ratingBig .bad a").removeClass("act");
		    
	    });
    	
	    $(".ratingBig .bad a[class!=plus]").hover(function() {
		    $(this).siblings().removeClass("act");
		    $(this).nextAll("a").addClass("hover");
	    }, function() {
		    $(this).nextAll("a").removeClass("hover");
		    restoreRating(false);
	    });
    	
//	    $(".ratingBig .bad a[class!=plus]").click(function() {
//		    $("#"+txtRate).attr("value", $(this).next("em").children().html().slice(-2));
//		    $(this).nextAll("a").addClass("act");
//		    selBigRating = $(this);
//		    $(".ratingBig .good a").removeClass("act");
//	    });
//    	
	    function restoreRating(r) {
		    if (r) {
			    $(selBigRating).addClass("act");
			    $(selBigRating).prevAll("a").addClass("act");
		    } else {
			    $(selBigRating).addClass("act");
			    $(selBigRating).nextAll("a").addClass("act");
		    }
	    }
    	
	    $(".ratingBig .minus").click(function() {	
		    $(this).next("em").hide();
		    $(".ratingBig .good").animate({ paddingLeft: "167", width: "0", opacity: "hide" }, 500, function() {
			    $(".ratingBig .good").css("padding-left", "0");
    			
			    $(".ratingBig .bad").css("width", "0px");
			    $(".ratingBig .bad").animate({width: "169"}, 500);
		    });
	    });
    	
	    $(".ratingBig .plus").click(function() {
		    $(this).next("em").hide();
		    $(".ratingBig .bad").animate({ paddingRight: "169", width: "0", opacity: "hide" }, 500, function() {
			    $(".ratingBig .bad").css("padding-right", "0");
    			
			    $(".ratingBig .good").css({'width' : '0', 'marging-left' : '167px'});
			    $(".ratingBig .good").animate({width: "167", margingLeft: "0"}, 500);
		    });
	    });

    	
	    /* --- Big Price Range --- */
	    var selPriceRangeBig;
    	
	    $("#priceRangeBig a").hover(function() {
		    $(this).siblings().removeClass("act");
		    $(this).prevAll("a").addClass("hover");
	    }, function() {
		    $(this).prevAll("a").removeClass("hover");
		    restoreRangeBig();
	    });
    	
	    $("#priceRangeBig a").click(function() {
		    $("#"+txtPrice).attr("value", $(this).next("em").children().html());
		    $(this).addClass("act");
		    $(this).prevAll("a").addClass("act");
		    selPriceRangeBig = $(this);
	    });
    	
	    function restoreRangeBig() {
		    $(selPriceRangeBig).addClass("act");
		    $(selPriceRangeBig).prevAll("a").addClass("act");
	    }
    	

    });

}

//New Big Pricing and rating
///////////////Pricing//////////////
var selecPrice = null;
function loadPriceRange(txtPrice) {
    var isSelected = false;
    $(document).ready(function () {
        var selPriceRangeBig;

        $("#priceRangeBigIcons a").hover(function () {
            $(this).siblings().removeClass("act");
            $(this).prevAll("a").addClass("hover");
        }, function () {
            $(this).prevAll("a").removeClass("hover");
            restoreRangeBig();
        });
        $(".price_rating a").hover(
		function () {
		    tmp = $(this).attr('title');
		    $(this).parent().children('span').hide().addClass('blue').text(tmp).fadeIn('fast');
		},
		function () {
		    if (isSelected == false)
		        $(this).parent().children('span').hide().removeClass('blue').text('Roll over, then click to rate').fadeIn('fast');
                else if (selecPrice!=null)
                    $(this).parent().children('span').hide().text($("#" + txtPrice).attr("value")).fadeIn('fast');
		}
    	);
        $(".price_rating a").click(
		function () {
		    tmp = $(this).attr('title');
		    $(this).parent().children('span').hide().addClass('blue').text(tmp).fadeIn('fast');
		    isSelected = true;
		    selecPrice = $(this);
		}
    	);
        $("#priceRangeBigIcons a").click(function () {
            $("#" + txtPrice).attr("value", $(this).next("em").children().html());
            $(this).addClass("act");
            $(this).prevAll("a").addClass("act");
            selPriceRangeBig = $(this);
        });

        function restoreRangeBig() {
            $(selPriceRangeBig).addClass("act");
            $(selPriceRangeBig).prevAll("a").addClass("act");

        }

    });
}
function addPriceError() {
    $(document).ready(function () {
        
        $("#priceRangeBigIcons").addClass("input_err");

    });
}
function removePriceError() {
    $(document).ready(function () {

        $("#priceRangeBigIcons").removeClass("input_err");

    });
}
function loadPriceRangeAtLoad(txtPrice) {
    //alert(document.getElementById(txtPrice).value);
    $(document).ready(function () {
        $("#priceRangeBigIcons a[title='" + $("#" + txtPrice).val() + "']").click();
    });
}



//////////////////////Rating/////////////////////////
var selecRate = null;
function loadRateRange(txtRate) {
    var isSelected = false;
    $(document).ready(function () {
        var selRateRangeBig;

        $("#ratingBigIcons a").hover(function () {
            $(this).siblings().removeClass("act");
            $(this).prevAll("a").addClass("hover");
        }, function () {
            $(this).prevAll("a").removeClass("hover");
            restoreRateBig();
        });
        $(".rating a").hover(
		function () {
		    tmp = $(this).attr('title');
		    $(this).parent().children('span').hide().addClass('blue').text(tmp).fadeIn('fast');
		},
		function () {
		    if (isSelected == false)
		        $(this).parent().children('span').hide().removeClass('blue').text('Roll over, then click to rate').fadeIn('fast');
		    else if (selecRate != null)
		        $(this).parent().children('span').hide().text($("#" + txtRate).attr("value")).fadeIn('fast');
		}
    	);
        $(".rating a").click(
		function () {
		    tmp = $(this).attr('title');
		    $(this).parent().children('span').hide().addClass('blue').text(tmp).fadeIn('fast');
		    isSelected = true;
		    selecRate = $(this);
		}
    	);
		$("#ratingBigIcons a").click(function () {
            $("#" + txtRate).attr("value", $(this).next("em").children().html());
            $(this).addClass("act");
            $(this).prevAll("a").addClass("act");
            selRateRangeBig = $(this);
        });

        function restoreRateBig() {
            $(selRateRangeBig).addClass("act");
            $(selRateRangeBig).prevAll("a").addClass("act");

        }

    });
}
function addRateError() {
    $(document).ready(function () {

        $("#ratingBigIcons").addClass("input_err");

    });
}
function removeRateError() {
    $(document).ready(function () {

        $("#ratingBigIcons").removeClass("input_err");

    });
}
function loadRateRangeAtLoad(txtRate) {
    //alert(document.getElementById(txtPrice).value);
    $(document).ready(function () {
        $("#ratingBigIcons a[title='" + $("#" + txtRate).val() + "']").click();
    });
}
