﻿
var TareebTextboxesArray = new Array();
var TareebContainersArray = new Array();
var EnableTranslation = true;
// Load the Google Transliteration API
google.load("elements", "1", {
	packages: "transliteration"
});

function onLoad() {
var options = {
		sourceLanguage:
		  google.elements.transliteration.LanguageCode.ENGLISH,
		destinationLanguage:
		  [google.elements.transliteration.LanguageCode.ARABIC],
		shortcutKey: 'ctrl+g',
		transliterationEnabled: EnableTranslation
	};	
	// Create an instance on TransliterationControl with the required options.
	var control =
		new google.elements.transliteration.TransliterationControl(options);

    for(var i=0;i<TareebTextboxesArray.length;i++)
    {
        // Enable transliteration in the textfields with the given ids. You can add multiple ids separated by ','
	    var ids = [TareebTextboxesArray[i]];
	    control.makeTransliteratable(ids);
    }
	// Show the transliteration control which can be used to toggle between English and Arabic.
	
	for(var i=0;i<TareebContainersArray.length;i++)
	{
	    control.showControl(TareebContainersArray[i]);
	}   
}
google.setOnLoadCallback(onLoad);
