var agt=navigator.userAgent.toLowerCase();
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));


function hide(n) {
   n = document.getElementById(n);
   if (n != null) {
      n.style.display = 'none';
   }
}

function show(n) {
   n = document.getElementById(n);
   if (n != null) {
      n.style.display = '';
   }
}

function addbookmark() {
	if (is_ie)
	{
	bookmarkurl="http://www.lysieniestop.com.pl/"
	bookmarktitle="Łysienie stop"
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
	else {
		alert("Niestety twoja przeglądarka nie obsługuje tej opcji. Prosimy o samodzielne dodanie tej strony do zakładek."); }
}

/***************************************
*                                      *
*       AJAX (hidden between wind)     *
*                                      *
****************************************/

function getAJAX() {
   var xmlHttp = null;
   try { // Firefox, Opera 8.0+, Safari
      xmlHttp = new XMLHttpRequest();
   } catch (e) { // Internet Explorer
      try {
         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
         xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
   }
   return xmlHttp;
}

function query(query) {
   xmlHttp = getAJAX();
   if (xmlHttp == null) {
       alert ("Your browser does not support AJAX!");
       return;
   }
   var url="ajax.php5?" + query;
   xmlHttp.onreadystatechange = AJAXReader;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);
}

function AJAXReader() {
   if (xmlHttp.readyState==4) {
      handler(xmlHttp.responseText);
   }
}