﻿/* ---------------------------------------------------------------------- */
		function MiseAJour()
		{
				// document.getElementById('NameNoAccents').value=AllAccents(document.getElementById('Name').value.toUpperCase())
				document.getElementById('NameNoAccents').value=AllAccents(document.getElementById("Name").value.toUpperCase());
		}

// Remplace toutes les occurences d'une chaine 
		function replaceAll(str, search, repl) { 
		  while (str.indexOf(search) != -1) 
			str = str.replace(search, repl); 
		  return str; 
		}    

// Remplace les caractères accentués (+ espace) 
		function AllAccents(str) { 
		var spec = new Array("Œ","Æ","Ĳ","Þ","Á","À","Â","Ä","Ǎ","Ă","Ã","Å","Å","Ą","Ā","Ć","Ċ","Ĉ","Č","Ç","Ď","Đ","É","È","Ė","Ê","Ë","Ě","Ĕ","Ē","Ę","Ġ","Ĝ","Ğ","Ģ","Ĥ","Ħ","Í","Ì","İ","İ","Î","Î","Ï","Ǐ","Ĭ","Ī","Ĩ","Į","Ĵ","Ķ","Ĺ","Ŀ","Ľ","Ļ","Ł","Ń","Ň","Ñ","Ņ","Ŋ","Ó","Ò","Ô","Ö","Ö","Ö","Ǒ","Ŏ","Ō","Õ","Õ","Ő","Ø","Ơ","Ŕ","Ř","Ŗ","Ś","Ŝ","Š","Ş","Ş","ß","Ť","Ţ","Ţ","Ŧ","Ú","Ù","Û","Ü","Ǔ","Ŭ","Ū","Ũ","Ů","Ų","Ű","Ű","Ư","Ŵ","Ý","Ŷ","Ÿ","Ź","Ż","Ž");
		var norm = new Array("OE","AE","IJ","TH","A","A","A","A","A","A","A","A","A","A","A","C","C","C","C","C","D","D","E","E","E","E","E","E","E","E","E","G","G","G","G","H","H","I","I","I","I","I","I","I","I","I","I","I","I","J","K","L","L","L","L","L","N","N","N","N","N","O","O","O","O","O","O","O","O","O","O","O","O","O","O","R","R","R","S","S","S","S","S","SS","T","T","T","T","U","U","U","U","U","U","U","U","U","U","U","U","U","W","Y","Y","Y","Z","Z","Z");
		  for (var i = 0; i < spec.length; i++) 
			str = replaceAll(str, spec[i], norm[i]); 
			//while (str.indexOf(spec) != -1) 
			//	str = str.replace(norm[i], spec[i]); 
		  return str; 
		}
		
		// Pour transformer les caractères Windows-1250 qui "échapent" à la norme ISO : S et Z caron
		function MiseAJourCaron()
		{
			document.getElementById('Name').value=Caron(document.getElementById('Name').value) ;
		}
		// Remplace les caractères accentués (+ espace) 
		function Caron(str) { 
		var spec = new Array("Š","Ž","š","ž");
		var norm = new Array("&#352;","&#381;","&#353;","&#382;");
		  for (var i = 0; i < spec.length; i++) 
			str = replaceAll(str, spec[i], norm[i]); 
		  return str; 
		}  

/* ---------------------------------------------------------------------- */