		//procentul de vocale necesar pentru validarea unui cuvant
		var procentVocaleNecesar = 20;
		//declara replaceAll pentru stringuri
		String.prototype.replaceAll=function(s1, s2) {return this.split(s1).join(s2)}
		//si trim, ca javascript nu s-a obosit sa aiba
		function trim(stringToTrim) 
		{
			return stringToTrim.replace(/^\s+|\s+$/g,"");
		}

		function cleanString (stringToClean) 
		{
			return stringToClean.replace(/[^\A-Za-z]/g, "");
		}
		
		function procentVocale(stringVocale)
		{
			var vocale = 0;
			var procent = 0;
			for (pos = 0; pos < stringVocale.length; pos++)
			{
				chr = stringVocale.charAt(pos)
				if (chr == "a" || chr == "e" || chr == "i" || chr == "o" || chr == "u" || chr == "A" || chr == "E" || chr == "I" || chr == "O" || chr == "U")
				{
					vocale++;
				}
				procent = vocale * 100 / stringVocale.length;
			}
			return procent;

		}
		
		
		function callRima() 
		{
			var zip = document.getElementById('rima');
			var theString = zip.value;
			
			theString = replaceCharacters(theString,259,97);
			theString = replaceCharacters(theString,226,97);
			theString = replaceCharacters(theString,227,97);
			theString = replaceCharacters(theString,238,105);
			theString = replaceCharacters(theString,351,115);
			theString = replaceCharacters(theString,355,116);
			//litere mari
			theString = replaceCharacters(theString,258,65);
			theString = replaceCharacters(theString,194,65);
			theString = replaceCharacters(theString,195,65);
			theString = replaceCharacters(theString,350,83);
			theString = replaceCharacters(theString,354,84);
			theString = replaceCharacters(theString,206,73);
			//porcarii
			theString = removeFromString(theString,34);
			theString = removeFromString(theString,38);
			theString = removeFromString(theString,39);
			theString = removeFromString(theString,44);
			theString = removeFromString(theString,46);
			theString = removeFromString(theString,47);
			theString = removeFromString(theString,60);
			theString = removeFromString(theString,61);
			theString = removeFromString(theString,62);
			theString = removeFromString(theString,63);
			theString = removeFromString(theString,92);
								
			theString = cleanString(theString);
			theString = trim(theString);
			
			if (theString == '')
			{
				document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus este eronat';
				FadeColor('tip','#FF0000','#418FA5','5000');
			}
			else if (theString.length < 3)
			{
				document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus este prea scurt';
				FadeColor('tip','#FF0000','#418FA5','5000');
			} /* verifica vocalele */
			else if (procentVocale(theString)<procentVocaleNecesar)
			{
				document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus pare a fi o cretinitate';
				FadeColor('tip','#FF0000','#418FA5','5000');
			}
			else
			{
				var loc = 'rime-' + theString + '.html';
				document.location.href = loc;
			}

		}
	
	
		function callRimaEnter(e)
		{
			var keynum;
			if(window.event) // IE
			{
				keynum = e.keyCode;
			}
			else if(e.which) // Netscape/Firefox/Opera
			{
				keynum = e.which;
			}
			
			
			//alert (keynum);
			
			if (keynum == 13)
			{
					zip = document.getElementById('rima');

					var theString = zip.value;

					theString = replaceCharacters(theString,259,97);
					theString = replaceCharacters(theString,226,97);
					theString = replaceCharacters(theString,227,97);
					theString = replaceCharacters(theString,238,105);
					theString = replaceCharacters(theString,351,115);
					theString = replaceCharacters(theString,355,116);
					//litere mari
					theString = replaceCharacters(theString,258,65);
					theString = replaceCharacters(theString,194,65);
					theString = replaceCharacters(theString,195,65);
					theString = replaceCharacters(theString,350,83);
					theString = replaceCharacters(theString,354,84);
					theString = replaceCharacters(theString,206,73);
					//porcarii
					theString = removeFromString(theString,34);
					theString = removeFromString(theString,38);
					theString = removeFromString(theString,39);
					theString = removeFromString(theString,44);
					theString = removeFromString(theString,46);
					theString = removeFromString(theString,47);
					theString = removeFromString(theString,60);
					theString = removeFromString(theString,61);
					theString = removeFromString(theString,62);
					theString = removeFromString(theString,63);
					theString = removeFromString(theString,92);

					theString = cleanString(theString);
					theString = trim(theString);
					
					if (theString == '')
					{
						document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus este eronat';
						FadeColor('tip','#FF0000','#418FA5','5000');
					}
					else if (theString.length < 3)
					{
						document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus este prea scurt';
						FadeColor('tip','#FF0000','#418FA5','5000');
					} /* verifica vocalele */
					else if (procentVocale(theString)<procentVocaleNecesar)
					{
						document.getElementById('tip').innerHTML = 'Cuv&acirc;ntul introdus pare a fi o cretinitate';
						FadeColor('tip','#FF0000','#418FA5','5000');
					}
					else
					{
						var loc = 'rime-' + theString + '.html';
						document.location.href = loc;
					}
				
			}

		}
		
		function replaceCharacters(origString,inChar,outChar) 
		{
			 inkeychar = String.fromCharCode(inChar);
			 outkeychar = String.fromCharCode(outChar);
 			 var newString = origString.replaceAll(inkeychar, outkeychar);
			 return newString;
		}
		
		function removeFromString(origString,inChar) 
		{
			inkeychar = String.fromCharCode(inChar);
			i = origString.indexOf(inkeychar);
			newString = "";
			if (i == -1) return origString;
			newString += origString.substring(0,i) + removeFromString(origString.substring(i + inkeychar.length), inkeychar);
			return newString;
		}
