User:RaviC/Girgit.js

///////////////////////////////////////////////////////			// Copyright Alok Kumar, 2005 // Under the GPL http://www.gnu.org/copyleft/gpl.html // This page is available at http://devanaagarii.net/hi/girgit ///////////////////////////////////////////////////////			// Changed by Pratik Dixit, 2005 // Under the GPL http://www.gnu.org/copyleft/gpl.html //////////////////////////////////////////////////////////			var DEVANAGARI_SIGN_CANDRABINDU			= 0x0901; var DEVANAGARI_DIGIT_NINE				= 0x096F;

var DEVANAGARI_ABBREVIATION_SIGN		= 0x0970;

var DEVANAGARI_LETTER_GLOTTAL_STOP		= 0x097D; var GUJARATI_SIGN_CANDRABINDU			= 0x0A81; var GUJARATI_RUPEE_SIGN					= 0x0AF1 var DEVANAGARI_START					= DEVANAGARI_SIGN_CANDRABINDU; var DEVANAGARI_END					= DEVANAGARI_DIGIT_NINE; var GUJARATI_START						= GUJARATI_SIGN_CANDRABINDU; var GUJARATI_END						= GUJARATI_RUPEE_SIGN; var SHIFT_FOR_GUJARATI					= GUJARATI_START - DEVANAGARI_START;

var BENGALI_SIGN_CANDRABINDU			= 0x0981; var BENGALI_ISSHAR						= 0x09FA; var BENGALI_START						= BENGALI_SIGN_CANDRABINDU; var BENGALI_END							= BENGALI_ISSHAR; var SHIFT_FOR_BENGALI					= BENGALI_START - DEVANAGARI_START; var TAMIL_SIGN_ANUSVARA					= 0x0B82; var TAMIL_NUMBER_SIGN					= 0x0BFA; var TAMIL_START							= TAMIL_SIGN_ANUSVARA - 1; var TAMIL_END							= TAMIL_NUMBER_SIGN; var SHIFT_FOR_TAMIL						= TAMIL_START - DEVANAGARI_START; var GURMUKHI_SIGN_ADAK_BINDI			= 0x0A01; var GURMUKHI_EK_ONKAR					= 0x0A74; var GURMUKHI_START						= GURMUKHI_SIGN_ADAK_BINDI; var GURMUKHI_END						= GURMUKHI_EK_ONKAR; var SHIFT_FOR_GURMUKHI					= GURMUKHI_START - DEVANAGARI_START; var TELUGU_SIGN_CANDRABINDU				= 0x0C01; var TELUGU_DIGIT_NINE					= 0x0C6F; var TELUGU_START						= TELUGU_SIGN_CANDRABINDU; var TELUGU_END							= TELUGU_DIGIT_NINE; var SHIFT_FOR_TELUGU					= TELUGU_START - DEVANAGARI_START; var KANNADA_SIGN_ANUSVARA				= 0x0C82; var KANNADA_DIGIT_NINE					= 0x0CEF; var KANNADA_START						= KANNADA_SIGN_ANUSVARA - 1; var KANNADA_END							= KANNADA_DIGIT_NINE; var SHIFT_FOR_KANNADA					= KANNADA_START - DEVANAGARI_START; var MALAYALAM_SIGN_ANUSVARA				= 0x0D02; var MALAYALAM_DIGIT_NINE				= 0x0D6F; var MALAYALAM_START						= MALAYALAM_SIGN_ANUSVARA - 1; var MALAYALAM_END						= MALAYALAM_DIGIT_NINE; var SHIFT_FOR_MALAYALAM					= MALAYALAM_START - DEVANAGARI_START; var ORIYA_SIGN_CANDRABINDU				= 0x0B01; var ORIYA_LETTER_WA						= 0x0B71; var ORIYA_START							= ORIYA_SIGN_CANDRABINDU; var ORIYA_END							= ORIYA_LETTER_WA; var SHIFT_FOR_ORIYA						= ORIYA_START - DEVANAGARI_START; var TGTLANGSTART						= DEVANAGARI_START;

function writeMessage {				var s = document.getElementById("InputTextArea").value; var t = ""; for(i = 0; i < s.length; ++i) {					if(s.charCodeAt(i) >= GUJARATI_START && s.charCodeAt(i) <= GUJARATI_END) {						t = t + String.fromCharCode(s.charCodeAt(i) - GUJARATI_START + TGTLANGSTART); }					else {						if(s.charCodeAt(i) >= BENGALI_START && s.charCodeAt(i) <= BENGALI_END) {							t = t + String.fromCharCode(s.charCodeAt(i) - BENGALI_START + TGTLANGSTART); }						else {							if(s.charCodeAt(i) >= TAMIL_START && s.charCodeAt(i) <= TAMIL_END) {								t = t + String.fromCharCode(s.charCodeAt(i) - TAMIL_START + TGTLANGSTART); }							else {								if(s.charCodeAt(i) >= GURMUKHI_START && s.charCodeAt(i) <= GURMUKHI_END) {									t = t + String.fromCharCode(s.charCodeAt(i) - GURMUKHI_START + TGTLANGSTART); }								else {									if(s.charCodeAt(i) >= TELUGU_START && s.charCodeAt(i) <= TELUGU_END) {										t = t + String.fromCharCode(s.charCodeAt(i) - TELUGU_START + TGTLANGSTART); }									else {										if(s.charCodeAt(i) >= KANNADA_START && s.charCodeAt(i) <= KANNADA_END) {											t = t + String.fromCharCode(s.charCodeAt(i) - KANNADA_START + TGTLANGSTART); }										else {											if(s.charCodeAt(i) >= MALAYALAM_START && s.charCodeAt(i) <= MALAYALAM_END) {												t = t + String.fromCharCode(s.charCodeAt(i) - MALAYALAM_START+ TGTLANGSTART); }											else {												if(s.charCodeAt(i) >= ORIYA_START && s.charCodeAt(i) <= ORIYA_END) {													t = t + String.fromCharCode(s.charCodeAt(i) - ORIYA_START+TGTLANGSTART); }												else {															if(s.charCodeAt(i) >= DEVANAGARI_START && s.charCodeAt(i) <= DEVANAGARI_END) {														t = t + String.fromCharCode(s.charCodeAt(i) - DEVANAGARI_START+ TGTLANGSTART); }													else {

t = t + s.substring(i,i+1); }											}										}									}								}							 }						}					}				}		}					document.getElementById("OutputTextArea").value = t;			}