/*** Freeware Open Source writen by ngoCanh 2002-05                  */
/*** Original by Vietdev  http://vietdev.sourceforge.net             */
/*** Release 2004-03-14  R9.0                                        */
/*** GPL - Copyright protected                                       */
/*** Bo^. go~ tie^'ng Vie^.t cho input-text, textarea va` iframe     */
/*********************************************************************/
if(typeof(USEFRAME)=="undefined") USEFRAME=1; // Frame
if(typeof(ON_OFF)=="undefined") ON_OFF=1; // VietTyping 1:ON, 0:OFF
if(typeof(TYPMOD)=="undefined") TYPMOD=1; // 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(MENUFORM)=='undefined') MENUFORM=1; // 1:quandrant, 2:bar
if(typeof(MENUPOS)=='undefined') MENUPOS=3; // 1:left-top,2:R-T,3:R-Bott,4:L-B,12:center-top,23,34,14; =0:status bar
if(typeof(NEWACCENT)=='undefined') NEWACCENT=0; // 0,1  1= hoa`; 0= ho`a
if(typeof(STATUSMSG)=='undefined') STATUSMSG=1; // statusmessage


if(typeof(getFullScriptPath)=='undefined')
{
function getFullScriptPath(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= getFullScriptPath('/viettypingplus.js');

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

