﻿
                      var votingIsEnabled = true
                        
                        function DHF(what)
                        {
                            if (!votingIsEnabled) {return;}
                            
                            for(i=1; i<6; i++)
		                    {
                    			 
			                    var who = document.getElementById( "ratingcell_" + i)
			                    who.style.backgroundColor=""; // unset
		                    }
                        }

                        function DHN(what)
                        {
                            if (!votingIsEnabled) {return;}
                            
		                    var elementNumber = what.id.split("_")[1]
	                            for(i=elementNumber; i>0; i--)
		                    {
			                    var who = document.getElementById( "ratingcell_" + i)
			                    who.style.backgroundColor = GetBackgroundColour(i)
                    			 
		                    }
                        }

	                function GetBackgroundColour(elemId)
	                { 	// I used a SWITCH at first but that didn't work.  It kept hitting the default case 
                        if (elemId == 1) 
		                {return "red";}
		                if (elemId == 2) 
		                {return "orange";}
		                if (elemId == 3) 
		                {return "yellow";}
		                if (elemId == 4) 
		                {return "green";}
		                if (elemId == 5) 
		                {return "lime";} 
	                }
