 /* $Id: HttpRequest.js,v 1.1 2009/04/10 09:33:17 divano Exp $ */

 /****************************************/
 /*       Vytvori instanci ovladace AJAX */
 /****************************************/
 function HttpRequest()
 {
   var xmlHttp;
   
   try
   {
     xmlHttp = new XMLHttpRequest();
   }
   catch (e)
   {
     var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
                                     "MSXML2.XMLHTTP.5.0",
                                     "MSXML2.XMLHTTP.4.0",
                                     "MSXML2.XMLHTTP.3.0",
                                     "MSXML2.XMLHTTP",
                                     "Microsoft.XMLHTTP"
                                    );
                                    
     for (var i=0; i < XmlHttpVersions.length && !xmlHttp; i++)
     {
       try
       {
          xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
       }
       catch(e)
       {
         // do nothing
       }
     }
   }
   
   if (!xmlHttp)
   {
     alert("[AJAX] Error creating the HttpRequest object.");
   }
   else
   {
     return xmlHttp;
   }
 }

/****************************************************/
/*           Function: openPopup                    */
/****************************************************/
function openPopup(link, sx, sy)
{ // BEGIN function openPopup

  pleft = (screen.width)  ? (screen.width  - sx) /2 : 100;
  ptop  = (screen.height) ? (screen.height - sy) /2 : 100;

  Settings = 'left='+pleft+',top='+ptop+',width='+sx+',height='+sy+',toolbnar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no';

	w = window.open(link,"",Settings);
	w.focus();
	
	return w;
} // END function openPopup

