
// EDIT WITH UTF-8 !!!!!!!

pure_ascii = function ( text ) 
{
            var text = text.toLowerCase();
          
            text = text.replace ( /  /g, ' ' );
            text = text.replace ( / /g,  '_' );
            text = text.replace ( /-/g,  '_' );
            text = text.replace ( /\//g, '_' );
          
            text = text.replace ( /__/g, '_' );
            text = text.replace ( /__/g, '_' );
            text = text.replace ( /__/g, '_' );
          
            text = text.replace ( /^_/g, '' );
            text = text.replace ( /_$/g, '' );
          
            text = text.replace ( /ä/g, 'ae' );
            text = text.replace ( /ü/g, 'ue' );
            text = text.replace ( /ö/g, 'oe' );
            text = text.replace ( /ß/g, 'ss' );
          
            text = text.replace ( /Ä/g, 'ae' );
            text = text.replace ( /Ü/g, 'ue' );
            text = text.replace ( /Ö/g, 'oe' );

            text = text.replace(/А/g,'a');
            text = text.replace(/а/g,'a');
           
            text = text.replace(/Ф/g,'f');
            text = text.replace(/ф/g,'f');

            text = text.replace(/Б/g,'b');
            text = text.replace(/б/g,'b');

            text = text.replace(/Х/g,'h');
            text = text.replace(/х/g,'h');
 
            text = text.replace(/В/g,'v');
            text = text.replace(/в/g,'v');
          
            text = text.replace(/Ц/g,'ts');
            text = text.replace(/ц/g,'ts');

            text = text.replace(/Г/g,'g');
            text = text.replace(/г/g,'g');

            text = text.replace(/Ч/g,'ch');
            text = text.replace(/ч/g,'ch');
          
            text = text.replace(/Д/g,'d');
            text = text.replace(/д/g,'d');

            text = text.replace(/Ш/g,'sh');
            text = text.replace(/ш/g,'sh');
          
            text = text.replace(/Е/g,'e');
            text = text.replace(/е/g,'e');

            text = text.replace(/Щ/g,'shtsh');
            text = text.replace(/щ/g,'shtsh');

            text = text.replace(/Ж/g,'zh');
            text = text.replace(/ж/g,'zh');

            text = text.replace(/Ъ/g,'u');
            text = text.replace(/ъ/g,'u');

            text = text.replace(/З/g,'z');
            text = text.replace(/з/g,'z');
          
            text = text.replace(/Ы/g,'y');
            text = text.replace(/ы/g,'y');

            text = text.replace(/И/g,'i');
            text = text.replace(/и/g,'i');

            text = text.replace(/Ь/g,'');
            text = text.replace(/ь/g,'');
          
            text = text.replace(/Й/g,'j');
            text = text.replace(/й/g,'j');

            text = text.replace(/Э/g,'e');
            text = text.replace(/э/g,'e');

            text = text.replace(/[Кк][Сс]/g,'x');
            
            text = text.replace(/К/g,'k');
            text = text.replace(/к/g,'k');

            text = text.replace(/Ю/g,'ju');
            text = text.replace(/ю/g,'ju');

            text = text.replace(/Л/g,'l');
            text = text.replace(/л/g,'l');

            text = text.replace(/Я/g,'ja');
            text = text.replace(/я/g,'ja');
          
            text = text.replace(/М/g,'m');
            text = text.replace(/м/g,'m');
 
            text = text.replace(/Ё/g,'jo');
            text = text.replace(/ё/g,'jo');

            text = text.replace(/Н/g,'n');
            text = text.replace(/н/g,'n');
           
            text = text.replace(/Ђ/g,'dh');
            text = text.replace(/ђ/g,'dh');
          
            text = text.replace(/О/g,'o');
            text = text.replace(/о/g,'o');

            text = text.replace(/Ј/g,'j');
            text = text.replace(/ј/g,'j');
 
            text = text.replace(/П/g,'p');
            text = text.replace(/п/g,'p');

            text = text.replace(/Љ/g,'lj');
            text = text.replace(/љ/g,'lj');
    
            text = text.replace(/Р/g,'r');
            text = text.replace(/р/g,'r');
    
            text = text.replace(/Њ/g,'nj');
            text = text.replace(/њ/g,'nj');
            
            text = text.replace(/С/g,'s');
            text = text.replace(/с/g,'s');

            text = text.replace(/Ћ/g,'ch');
            text = text.replace(/ћ/g,'ch'); 
          
            text = text.replace(/Т/g,'t');
            text = text.replace(/т/g,'t');

            text = text.replace(/Џ/g,'dj');
            text = text.replace(/џ/g,'dj');

            text = text.replace(/У/g,'u');
            text = text.replace(/[уў]/g,'u');

            text = text.replace(/[ÀàÁáÂâÅåĀāĄąăâ]/g, 'a');

            text = text.replace(/[ÇçĈĉĆć]/g, 'c');
            text = text.replace(/[Čč]/g, 'cz');
            text = text.replace(/[Đđ]/g, 'd');
            text = text.replace(/[ĘęËëéèê]/g, 'e');
            text = text.replace(/[ĜĝĞğ]/g, 'g');
            text = text.replace(/[Ĥĥ]/g, 'h');
            text = text.replace(/[ĮįÏïıîíì]/g, 'i');
            text = text.replace(/[Ĵĵ]/g, 'j');
            text = text.replace(/[Łł]/g, 'l');
            text = text.replace(/[ÑñǊǌ]/g, 'nj');
            text = text.replace(/[Õõ]/g, 'o');
            text = text.replace(/[ŐőØøŒœ]/g, 'oe');
            text = text.replace(/[Ǫǫ]/g, 'o');
            text = text.replace(/[ŞşŠš]/g, 'sh');
            text = text.replace(/[Șș]/g, 's');
            text = text.replace(/[ŬŭŲųŮů]/g, 'u');
            text = text.replace(/[Űű]/g, 'ue');
            text = text.replace(/[Žž]/g, 'zh');
            text = text.replace(/[ÆæƏə]/g, 'ae');
            
            text = text.replace(/[Ðð]/g, 'dh');
            text = text.replace(/[Ǆǆ]/g, 'dzh');
            text = text.replace(/[Ȝȝ]/g, 'gh');
            text = text.replace(/[Ƕƕ]/g, 'wh');
            text = text.replace(/[ĸ]/g, 'q');
            text = text.replace(/[Ǉǉ]/g, 'lj');
            text = text.replace(/[Ŋŋ]/g, 'ng');
            text = text.replace(/[ſ]/g, 's');
            text = text.replace(/[Þþ]/g, 'th');
            text = text.replace(/[Ƿƿ]/g, 'w');
            text = text.replace(/[Ĳĳ]/g, 'ij');
            text = text.replace(/[Ȣȣ]/g, 'ou');
            
            text = text.replace(/€/g,'eur');
            text = text.replace(/§/g,'par');
            text = text.replace(/%/g,'percent');
            text = text.replace(/&/g,'and');
            text = text.replace(/\+/g,'plus');
            text = text.replace(/[\"!\'()\[\]\{\}=]/g,'');
            
            text = text.replace(/@/g,'at');
            text = text.replace(/us\-\$/g,'usd');
            text = text.replace(/us\$/g,'usd');
            text = text.replace(/\$([\.,0-9]*)/g,'$1dollar');
            text = text.replace(/£/g,'gbp');
            text = text.replace(/^_+/, '' );
            text = text.replace(/_+$/, '' );
            text = text.replace(/_+/, '_' );
            text = text.replace(/\.+/, '_' );
            
            text = text.replace(/;+/, '_' );
            text = text.replace(/:+/, '_' );
            text = text.replace(/,+/, '_' );
            text = text.replace(/#+/, '_' );
            
            return text;
}
      
