// JScript File

        /* calling functions  */
    
        var txtValue;
        var txtValue1;
        var txtValue2;
        
          function addLoadEvent(func) {
            
         
            if (window.addEventListener) 
                window.addEventListener("load", func,false);
            else if (window.attachEvent) 
                window.attachEvent("onload", func);
        }

        function addTranslit(editForm,textBox) {
         
            checkrt(editForm); // check for translit support

            if (textBox.addEventListener) 
                textBox.addEventListener("keypress", processKeys, false);
            else if (textBox.attachEvent) 
                textBox.attachEvent("onkeypress", processKeys);
        }

 
  function addTextEvent()       
  {
      
 //if condition to check the Browser version
 if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
{
 
 var editForm = document.forms.item('editform');
 
  if(editForm != null) 
            {
              
              
                //     var textBox=document.forms.item(txtValue);
        //      var txtCityVal =document.forms.item(txtValue2);
               var textBox=document.getElementById(txtValue);
            //  var txtCityVal =document.getElementById(txtValue2);
                addTranslit(editForm,textBox);
              //  addTranslit(editForm1,txtCityVal);
               var txtCityVal =document.getElementById(txtValue2);
                             if(txtCityVal != null)
                             {
                            addTranslit(editForm,txtCityVal);
                            }
               var txtComment= document.getElementById(txtValue1);
               addTranslit(editForm,txtComment);
            }
}

else
{
                   var editForm =document.getElementById('editform');
             
                        if(editForm != null) {
                            var textBox=document.getElementById(txtValue);
                            
                            addTranslit(editForm,textBox);
                            //for city text field in Comments page
                            var txtCityVal =document.getElementById(txtValue2);
                             if(txtCityVal != null)
                             {
                            addTranslit(editForm,txtCityVal);
                            }
                           // addCheckbox(editForm,textBox ); 
                            //if(textSummary) { addTranslit(editForm,textSummary); }
                        }

                        // add transliteration feature to search form also
                        var searchform = document.getElementById('editform');
                        if(searchform != null)
                         {
                         
                        var searchInput = document.getElementById(txtValue1);
                        
                      
                        addTranslit(searchform,searchInput); 
                     
                         }
                         
                 }
  }


        var imeStatus = false;
        var rtsupported=false;
        function processKeys(event) {
        
            if (rtsupported) {

                    imeStatus = false;
                    transliterateKey(event); // call transliteration function
             //   }
            } 
        }

        var realTime = true;

        function rtClick(event) {
            realTime = !realTime;
        }

     
        var error; 

        function checkrt(editform) {
            try {
        	
          
        	
                rtsupported = (document.selection != undefined)
        		
                if (!rtsupported) {
	                var element = document.createElement("TEXTAREA");
	                editform.appendChild(element);
        			
	                if (element.selectionStart != undefined)
		                rtsupported = true;
		                editform.removeChild(element);
                }
        		
            } catch (error) {}
        }

        addLoadEvent(addTextEvent);
        
    
