/******************************************************************************
File Name      :    CommonFunction.js
Created By     :    Ankur Kumar Singh
Created On     :    29/11/2007
Description    :    File Contains Common function for all application
*******************************************************************************/


/*******************************************************************************
 *Function          :    XHRCreator;
 *Input             :    None;
 *Output            :    object of XMLHTTP Request Class.
 *Description       :    Function Return object of XHR(XmlHttpRequest)object
*******************************************************************************/

     function XHRCreator(type)
     {
          if(type == "") type = 'html';
          
          var objXHR = false;
          if(window.XMLHttpRequest)
          {
               objXHR = new XMLHttpRequest();
               //objXHR.overrideMimeType('text/'+type);
          }
          else if(window.ActiveXObject)
          {
               try
               {
                   objXHR = new ActiveXObject("Msxml2.XMLHTTP");
               }
               catch(e)
               {
                   try
                   {
                     objXHR = new ActiveXObject("Microsoft.XMLHTTP");
                   }
                   catch(e)
                   {
                     
                   }
               }
           }
           
           
          
          if(!objXHR)
          {
               alert("Your Browser does not support the application");
               return false;
          }
          return objXHR;          
     }
      


