
/*** Bo^. go~ tie^'ng Vie^.t cho input-text, textarea va` iframe     */
/*********************************************************************/
if(typeof(ALLFRAME)=="undefined") ALLFRAME=1; // Frame
if(typeof(ON_OFF)=="undefined") ON_OFF=0; // VietTyping 1:ON, 0:OFF
if(typeof(MOD)=="undefined") MOD=2; // VietTyping-mode 0:Auto, 1:Vni, 2:Telex, 3:VIQR, 4:VIQR-GER
if(typeof(SPELL)=="undefined") SPELL=1; // Check vietnamese word  0:No-check, 1:Yes
if(typeof(NEWV)=='undefined') NEWV=0; // 0,1  1= hoa`; 0= ho`a
if(typeof(STATUS)=='undefined') STATUS=1; // statusmessage
if(typeof(MENUPOS)=='undefined') MENUPOS=1;
var ESC=0, fID=null, TXT=null;


if(typeof(getScriptPath)=='undefined')
{
function getScriptPath(script)
{
  var i=0, path='';
  while(document.getElementsByTagName('script')[i])
  { 
   var src= document.getElementsByTagName('script')[i].src
   if( src && src.lastIndexOf(script)>=0 ){ path=src.substring(0,src.lastIndexOf(script)); break;}
   i++
  }


  if(path.indexOf("://")>=0) return path
  path= path.replace(/^\.\//,"/")

  var href= document.location.href
  href= href.substring(0,href.lastIndexOf('/'))

  if(path=='.' || path=='') return href
  else if(path.indexOf('..')>=0)
   {
    var sub= ''
    if(path.length>2) sub= path.substr(path.lastIndexOf('../')+2)
    var temp= path.split('..')
    for( var i=1; i<temp.length;i++)
     { href= href.substring(0,href.lastIndexOf('/')); }
    if(sub!='/..') href += sub
   }
  else if(path!='') href += path;
  return href
}
}

var QBPATHV= getScriptPath('/viettypingplus.js');

if(document.all) document.writeln('<script src="'+QBPATHV+'/viettyping_IE.js"></script>');
else document.writeln('<script src="'+QBPATHV+'/viettyping_Moz.js"></script>');


