//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


// -*- mode: java; -*-

// This file is part of Indian Language Converter

// Indian Language Converter is free software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.

// Copyright (C) 2005, 2006 Vijay Lakshminarayanan <liyer.vijay@gmail.com>

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.

// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301, USA.

// 	$Id: malayalam.js,v 1.6 2006-03-26 03:09:58 vijay Exp $	
// 	Author: Vijay Lakshminarayanan	
// 	$Date: 2006-03-26 03:09:58 $	
<!-- 	Modified: Anthony Deign adeign@gmail.com	 -->
<!-- 	$Date: 2006-Aug-15 02:44:19 $	 -->

var vowels = "(a(a|e|i|u)?)|(A|U|E|O|I|H)|(i(i)?)|(e(e|i)?)|(u(u)?)|(o(o|a|u)?)|(r~|r_|r |r`)|(R~|R_|R |R`)|(m_|m )|(n_|n )|(N_|N )|(l_|l )|(L_|L )|(_|~)"

var consonants = "(b(h)?)|(B(h)?)|(c(h(h)?)?)|(C(h)?)|(d(h)?)|(D(h)?)|(f|F)|(g(h)?)|(G)|(h)|(j(h)?)|(J(h)?)|(k(h)?)|(K)|(l)|(L)|(m|M)|(N(t)?)|(n(g|j|k|n|t(h)?)?)|(ph?)|(P)|(q)|(Q)|(r)|(R)|(s(h)?)|(S)|(t(t|h(h)?)?)|(T(h)?)|(v|V)|(w|W)|(x|X)|(y|Y)|(z(h)?)|(Z)"

var letter_codes = {
  "~a": "&#3333;",
  "~aa": "&#3334;", "~A": "&#3334;",
  "~i": "&#3335;",
  "~ee": "&#3336;", "~ii": "&#3336;", "~I": "&#3336;",
  "~u": "&#3337;",
  "~oo": "&#3338;", "~uu": "&#3338;", "~U": "&#3338;",
  "~r~": "&#3339;", "~R~": "&#3339;",
  "~e": "&#3342;",
  "~ae": "&#3343;", "~E": "&#3343;",
  "~ai": "&#3344;", "~ei": "&#3344;",
  "~o": "&#3346;",
  "~oa": "&#3347;", "~O": "&#3347;",
  "~au": "&#3348;", "~ou": "&#3348;",
  "~m_": "&#3330;", "~m ": "&#3330;&#160;", //anuswara
  "~H": "&#3331;",  //visarga
  "~n_": "&#3368;&#3405;&#8205;", "~n ": "&#3368;&#3405;&#8205;&#160;", //chillu
  "~N_": "&#3363;&#3405;&#8205;", "~N ": "&#3363;&#3405;&#8205;&#160;",
  "~l_": "&#3378;&#3405;&#8205;", "~l ": "&#3378;&#3405;&#8205;&#160;", 
  "~L_": "&#3379;&#3405;&#8205;", "~L ": "&#3379;&#3405;&#8205;&#160;",
  "~r_": "&#3376;&#3405;&#8205;", "~r ": "&#3376;&#3405;&#8205;&#160;", 
  "~R_": "&#3376;&#3405;&#8205;", "~R ": "&#3376;&#3405;&#8205;&#160;",
  "~_": "&#3405;&#8204;", //chandrakkala(Virama)
  "~~": "&#3405;&#8204;", //chandrakkala(Virama)
  "~r`": "&#3376;&#3405;&#8204;", //ra with anusvara
  "~R`": "&#3377;&#3405;&#8204;", //rra with anusvara
  
  "m_": "&#3330;",  "m ": "&#3330;&#160;&#8203;", //anuswara
  "H": "&#3331;",   //visarga
  "a": "",
  "*": "&#3405;",
  "aa": "&#3390;", "A": "&#3390;",
  "i": "&#3391;",
  "ee": "&#3392;", "ii": "&#3392;", "I": "&#3392;",
  "u": "&#3393;",
  "oo": "&#3394;", "uu": "&#3394;", "U": "&#3394;",
  "r~": "&#3395;", "R~": "&#3395;",
  "e": "&#3398;",
  "ae": "&#3399;", "E": "&#3399;",
  "ai": "&#3400;", "ei": "&#3400;",
  "o": "&#3402;",
  "oa": "&#3403;", "O": "&#3403;",
  /*
  "au": "&#3404;", "ou": "&#3404;",
  */
  "au": "&#3415;", "ou": "&#3404;",
  "n_": "&#3368;&#3405;&#8205;", "n ": "&#3368;&#3405;&#8205;&#160;", //chillu
  "N_": "&#3363;&#3405;&#8205;", "N ": "&#3363;&#3405;&#8205;&#160;", //chillu
   "l_": "&#3378;&#3405;&#8205;", "l ": "&#3378;&#3405;&#8205;&#160;", 
   "L_": "&#3379;&#3405;&#8205;", "L ": "&#3379;&#3405;&#8205;&#160;",
  "r_": "&#3376;&#3405;&#8205;", "r ": "&#3376;&#3405;&#8205;&#160;",
  "R_": "&#3376;&#3405;&#8205;", "R ": "&#3376;&#3405;&#8205;&#160;",
  "_": "&#3405;&#8204;", //chandrakkala(Virama)
  "~": "&#3405;&#8204;", //chandrakkala(Virama)
  "r``": "&#3376;&#3405;&#8204;", //ra with anusvara
  "R`": "&#3377;&#3405;&#8204;", //rra with anusvara

  "k": "&#3349;", "c": "&#3349;",
  "kh": "&#3350;", "q": "&#3350;", "Q": "&#3350;",
  "g": "&#3351;",
  "gh": "&#3352;",
  "ng": "&#3353;",
  "ch": "&#3354;", "C": "&#3354;",
  "chh": "&#3355;", "Ch": "&#3355;",
  "j": "&#3356;",
  "jh": "&#3357;",  "Jh": "&#3357;",
  "nj": "&#3358;",
  "T": "&#3359;",
  "Th": "&#3360;",
  "D": "&#3361;",
  "Dh": "&#3362;",
  "N": "&#3363;",
  "th": "&#3364;",
  "thh": "&#3365;",
  "d": "&#3366;",
  "dh": "&#3367;",
  "n": "&#3368;",
  "p": "&#3370;",
  "f": "&#3371;",  "ph": "&#3371;", "F": "&#3371;",
  "b": "&#3372;",
  "bh": "&#3373;",
  "m_ba": "&#3374;&#3405;&#3370;",
  "m": "&#3374;",
  "y": "&#3375;",
  "r": "&#3376;",
  "l": "&#3378;",
  "v": "&#3381;",   "w": "&#3381;",
  "S": "&#3382;",   "z": "&#3382;",
  "sh": "&#3383;",
  "s": "&#3384;",
  "h": "&#3385;",
  "L": "&#3379;",
  "zh": "&#3380;",
  "R": "&#3377;",
  "mp": "&#3374;&#3405;&#3370;",
  "t": "&#3377;&#3405;&#3377;",
  "tt": "&#3359;&#3405;&#3359;",
  "nt": "&#3368;&#3405;&#3377;",
  "nth": "&#3368;&#3405;&#3364;",
  "nk": "&#3353;&#3405;&#3349;",
  "nn": "&#3368;&#3405;&#3368;",
  "Nt": "&#3363;&#3405;&#3359;",
  "B": "&#3372;&#3405;&#3372;",
  "G": "&#3351;&#3405;&#3351;",
  "J": "&#3356;&#3405;&#3356;",
  "K": "&#3349;&#3405;&#3349;",
  "M": "&#3374;&#3405;&#3374;",
  "P": "&#3370;&#3405;&#3370;",
  "V": "&#3381;&#3405;&#3381;", "W": "&#3381;&#3405;&#3381;",
  "x": "&#3349;&#3405;&#3383;", "X": "&#3349;&#3405;&#3383;",
  "Y": "&#3375;&#3405;&#3375;",
  "Z": "&#3382;&#3405;&#3382;"
  }

// -*- mode: java; -*-

// Indian Language Converter - transliterates from Roman scripts to
// Indic scripts.

// Copyright (C) 2005, 2006 Vijay Lakshminarayanan <liyer.vijay@gmail.com>

// Indian Language Converter is free software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.

// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301, USA.

// 	$Id: converter.js,v 1.8 2006-03-26 03:08:29 vijay Exp $	
// 	Author: Vijay Lakshminarayanan	
// 	$Date: 2006-03-26 03:08:29 $	
<!-- 	Modified: Anthony Deign adeign@gmail.com	 -->
<!-- 	$Date: 2006-Aug-01 02:44:19 $	 -->

function split_word(word)
{
  var syllables = new Array(0);
  var vowel_start_p = true;
  while (word.length) {
    re = new RegExp(vowels);
    var index = word.search(vowels);
    if (index == 0) {  //the vowel's at the start of word
      var matched = re.exec(word)[0]; //what is it?
      if (vowel_start_p) {
	syllables.push(("~"+matched)); //one more to the syllables
      } else {
	syllables.push(matched);
      }
      vowel_start_p = true;
      word = word.substring(matched.length);
    } else {
      re = new RegExp(consonants);
      var index = word.search(consonants);
      if (index == 0) {
	var matched = re.exec(word)[0];
	syllables.push(matched);
	vowel_start_p = false;
	word = word.substring(matched.length);

	//look ahead for virama setting
	var next = word.search(vowels);
	if (next != 0 || word.length == 0)
	  syllables.push('*');
      } else {
	syllables.push(word.charAt(0));
	word = word.substring(1);
      }
    }
  }
  return syllables;
}

function match_code(syllable_mcc)
{
  var matched = letter_codes[syllable_mcc];

  if (matched != null) return matched;
  return syllable_mcc;
}

function one_word(word_ow)
{
  if (!word_ow) return "";
  var syllables_ow = split_word(word_ow);
  var letters_ow = new Array(0);

  for (var i_ow = 0; i_ow < syllables_ow.length; i_ow++) {
    letters_ow.push(match_code(syllables_ow[i_ow]));
  }
  return letters_ow.join("");
}

function many_words(sentence)
{
  var regex = "((" + vowels + ")|(" + consonants + "))+";
  var words = new Array(0);
  while (sentence.length >= 1) {
    re = new RegExp("^``" + regex);
    var match = re.exec(sentence);
    if (match != null) {
      match = match[0];
      words.push("`");
      words.push(one_word(match.substring(2)));
      sentence = sentence.substring(match.length);
    } else {
      re = new RegExp("^`" + regex);
      match = re.exec(sentence);
      if (match != null) {
	match = match[0];
	words.push(match.substring(1));
	sentence = sentence.substring(match.length);
      } else {
	re = new RegExp("^" + regex);
	match = re.exec(sentence);
	if (match != null) {
	  match = match[0];
	  words.push(one_word(match));
	  sentence = sentence.substring(match.length);
	} else {
	  words.push(sentence.charAt(0));
	  sentence = sentence.substring(1);
	}
      }
    }
  }
  return words.join("");
}

function print_many_words(index_pmw)
{
  var text_pmw = many_words(document.convarea.many_words_text.value);

  var ans = "";
  while (text_pmw.length) {
    var unicode_chars = /&#[0-9]+;/;
    re = unicode_chars;
    var matche = re.exec(text_pmw);
    if (matche != null) {
      matche = matche[0];
      search = text_pmw.search(unicode_chars);
      ans += text_pmw.substring(0, search);
      ans += String.fromCharCode(matche.match(/[0-9]+/));
      text_pmw = text_pmw.substring(search + matche.length);
    } else {
      ans += text_pmw.substring(0);
      text_pmw = "";
    }
  }

  document.convarea.converted_text.value = ans;
  
}

function ClipBoard()
{
var x = document.convarea.converted_text.value;
window.clipboardData.setData('Text',x);
}