﻿
// Load the Google Transliteration API     
google.load("elements", "1", {
    packages: "transliteration"
});
var control = null;
function onLoad() {
    var options = {
        sourceLanguage: 'en',
        destinationLanguage: ['te'],
        shortcutKey: 'ctrl+g',
        transliterationEnabled: true
    };
    control = new google.elements.transliteration.TransliterationControl(options);
    control.makeTransliteratable(teCtrls);
}
var teCtrls = [];
function setTeControls(ctrls) {
    teCtrls = ctrls;
}

function ToggleTelugu(image) {
    if (control != null) {
        control.toggleTransliteration();
        if (control.isTransliterationEnabled()) {
            image.src = "images/te_e.gif";
            image.title = "Disable telugu typing";
        } else {
            image.src = "images/te_d.gif";
            image.title = "Enable telugu typing";
        }
    }
}
