	function eliminaCaratteri(valore)
	{
		var suppVal , suppVal1;
		var myChar , myChar1 , strLen , i;
		var trovato;

		//tratto i caratteri da sostituire con null
		
		suppVal = valore.replace(/~/g , "");
		valore = suppVal		

		suppVal = valore.replace(/`/g , "");
		valore = suppVal		

		suppVal = valore.replace(/@/g , "");
		valore = suppVal		

		suppVal = valore.replace(/#/g , "");
		valore = suppVal		

		suppVal = valore.replace(/%/g , "");
		valore = suppVal		

		suppVal = valore.replace(/"/g , "");
		valore = suppVal		


		//tratto i caratteri da sostituire con blank

		suppVal = valore.replace(/_/g , " ");
		valore = suppVal		

		suppVal = valore.replace(/-/g , " ");
		valore = suppVal						
		
		suppVal = valore.replace(/,/g , " ");
		valore = suppVal		
		
		suppVal = valore.replace(/:/g , " ");
		valore = suppVal		
				
		suppVal = valore.replace(/;/g , " ");
		valore = suppVal		

		suppVal = valore.replace(/>/g , " ");
		valore = suppVal		

		suppVal = valore.replace(/</g , " ");
		valore = suppVal		


		// tratto i caratteri non gestibili con la funct replace da sostituire con null
		
		strLen = valore.length;
		i=0;
		
		while (strLen>0)
		{
			myChar1 = valore.charCodeAt(i);
									
			if ((myChar1 == 94) || (myChar1 == 36) || (myChar1 == 42) || (myChar1 == 46))
			{
        		suppVal = valore.substring(0, i);            		
               	suppVal1 = valore.substring(i+1, valore.length);				
				valore = suppVal + suppVal1;						
				strLen	= valore.length;
				i=0;
			}			
			else
			{
				strLen	= strLen -1;
				i = i+1;
			}							
		}
		
		
		// tratto i caratteri non gestibili con la funct replace da sostituire con blank
		
		strLen = valore.length;
		i=0;
		
		while (strLen>0)
		{
			myChar1 = valore.charCodeAt(i);
									
			if ((myChar1 == 40) || (myChar1 == 41) || (myChar1 == 92) || (myChar1 == 124) || (myChar1 == 63) || (myChar1 == 47))
			{
        		suppVal = valore.substring(0, i);            		
               	suppVal1 = valore.substring(i+1, valore.length);				
				valore = suppVal + " " + suppVal1;						
				strLen	= valore.length;
				i=0;
			}			
			else
			{
				strLen	= strLen -1;
				i = i+1;
			}							
		}
		
		// trimmo i black
		trovato = true;
		
		while  (trovato)
		{
			i = valore.search("  ");
			//alert(i);		
			if (i != -1)
			{
				valore = valore.replace("  " , " ");				
			}
			else
			{
				trovato=false;
			}
		}

		// elimino le sottostringhe " '" & "' "
		trovato = true;
		
		while  (trovato)
		{
			i = valore.search(" '");
			//alert(i);		
			if (i != -1)
			{
				valore = valore.replace(" '" , "'");				
			}
			else
			{
				trovato=false;
			}
		}
		
		trovato = true;
		
		while  (trovato)
		{
			i = valore.search("' ");
			//alert(i);		
			if (i != -1)
			{
				valore = valore.replace("' " , "'");				
			}
			else
			{
				trovato=false;
			}
		}
						
		//controllo se in testa e in coda sono presenti i caratteri & o ' 
		//in tal caso lo elimino
		trovato = true;
		while (trovato)
		{
			myChar1 = valore.charCodeAt(0);
			if ((myChar1 == 38) || (myChar1 == 39))
			{        	
			    valore = valore.substring(1, valore.length);				
			}
			else
			{
				trovato=false;
			}
		}
				

		trovato = true;
		while (trovato)
		{
			myChar1 = valore.charCodeAt(valore.length -1);
			if ((myChar1 == 38) || (myChar1 == 39))
			{        	
			    valore = valore.substring(0, valore.length-1);				
			}
			else
			{
				trovato=false;
			}
		}
						
		return valore;		
	}	

