//-------------------------------------------------------------------------
// http://htmldog.com/articles/suckerfish/dropdowns/example/bones1.html
//-------------------------------------------------------------------------

		sfHover = function()
		{
				var sfEls = document.getElementById("nav").getElementsByTagName("LI");
				for (var i=0; i<sfEls.length; i++) 
				{
						sfEls[i].onmouseover = function()
						{
							this.className += " sfhover";
						}

						sfEls[i].onmouseout = function()
						{
							this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
						}
				}
		}

		if (window.attachEvent) window.attachEvent("onload", sfHover);
		

//-------------------------------------------------------------------------
// TR_Coloreaza
//-------------------------------------------------------------------------
		
		function rgbConvert(str)
		{
			   str = str.replace(/rgb\(|\)/g, "").split(",");
			   str[0] = parseInt(str[0], 10).toString(16).toLowerCase();
			   str[1] = parseInt(str[1], 10).toString(16).toLowerCase();
			   str[2] = parseInt(str[2], 10).toString(16).toLowerCase();
			   str[0] = (str[0].length == 1) ? '0' + str[0] : str[0];
			   str[1] = (str[1].length == 1) ? '0' + str[1] : str[1];
			   str[2] = (str[2].length == 1) ? '0' + str[2] : str[2];
			   return ('#' + str.join(""));
		}


		function TR_Coloreaza(operatie, rand_curent)
		{
				culoare = rand_curent.style.backgroundColor;
				if(culoare)
				{
						switch(culoare)
						{
							case '#f1f2ee': //initial
							case '#90ee90': //over
							case '#fed9af': //click
								break;
							
							default:
								culoare = rgbConvert(culoare);
								break;
						}
				}
				//alert(culoare);

				switch(operatie)
				{
					case 'over':
						switch(culoare)
						{
							case "undefined": //la inceput
							case "":
							case "#f1f2ee":
								rand_curent.style.backgroundColor = '#90ee90';
								break;
						}
						break;
					
					case 'out':
						switch(culoare)
						{
							case "#90ee90":
								rand_curent.style.backgroundColor = '#f1f2ee';
								break;
						}
						break;

					case 'click':
						switch(culoare)
						{
							case "#f1f2ee":
							case "#90ee90":
								rand_curent.style.backgroundColor = '#fed9af';
								break;

							case "#fed9af":
								rand_curent.style.backgroundColor = '#f1f2ee';
								break;
						}
						break;
				}

				return true;	
		}

