﻿// JScript File

// set null when focus on textbox
function SetNullValue(txtName)
{
    txtName.value = "";
}

// set default value for textbox
function SetTextBoxDefaultValue(txtName, DV)
{
    if(txtName.value == "" || txtName.value == null)
        txtName = DV;
}


function CheckSupportBrowser()
{
     var bname = navigator.appName;
    if (bname == "Microsoft Internet Explorer")
    {
        
        document.write("explorer_version");
        if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
        { //test for MSIE x.x;
            var ieversion = new Number(RegExp.$1) // capture x.x portion and store as a number
             if (ieversion != 7 )
              {
                window.location="ErrorBrowser.htm";
              }
        }

      
    }
    if(bname == "Netscape")
    {
      // document.write("FireFox");
       if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
       { 
           //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
             var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
             if (ffversion<3)
                  window.location="ErrorBrowser.htm";
//                 else if (ffversion>=2)
//                  window.location="#";
//                 else if (ffversion>=1)
//                  window.location="#";
       }
       else
            //document.write("Chuong trinh khong ho tro trinh duyet nay!")
            window.location="ErrorBrowser.htm";
    }
}


