function loadContent(file) {

   var head = document.getElementsByTagName('head').item(0); 
   var scriptTag = document.getElementById('loadScript');

   if(scriptTag) {
   		head.removeChild(scriptTag);
   }
   script = document.createElement('script');
   script.src = file;
   script.type = 'text/javascript';
   script.id = 'loadScript';

   head.appendChild(script);
}


var temp_str = window.location.href;
str = new String(temp_str);
str = str.split("/");

check_translation = str[1].split("/");
tran_length = check_translation.length;

if(check_translation[1] == "translation") {
	str = check_translation[tran_length-1];
} else {         
	str = str[1].substring(0,2);
}

if(str == "si") {
	loadContent("modules/i18n/IndicInput_IME_sinhala.js");
} else if(str == "ta") {
	loadContent("modules/i18n/IndicInput_IME_WX.js");
}