<!--


function getElement(psID) {  // uniwersalne dla wszystskich przegladarek
   if(document.all) {
      return document.all[psID];
   } else if(document.getElementById) {
      return document.getElementById(psID);
   } else {
      for (iLayer = 1; iLayer < document.layers.length; iLayer++) {
         if(document.layers[iLayer].id == psID)
            return document.layers[iLayer];
      }      
   }
   return Null;
} 

function display(id, wartosc)
{
	document.getElementById(id).style.display = wartosc;
}



function showhide(objname)
{
	if (!DHTML) return;
	var x = new getObj(objname);
	if (x.style.display == 'none') { display(objname,''); }
	else { display(objname,'none') }
}


function okno(plik, szer, wys) {
	var szer = szer + 17;
	var lewy = (screen.availWidth - szer) /2;
	var gora = (screen.availHeight - wys) /2;
	var okienko = window.open(plik,"okno",'width=' + szer + ',height=' + wys + ',menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=yes,left=' + lewy + ',top=' + gora + '');
}








var DHTML = (document.getElementById || document.all || document.layers);

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function tophide (obj) {
	if (!DHTML) return;
	var x = new getObj(obj);
	x.style.visibility = 'hidden';
}

function invi(objname)
{
	if (!DHTML) return;
	var x = new getObj(objname);
	if (x.style.visibility == 'visible') { x.style.visibility = 'hidden' }
	else { x.style.visibility = 'visible' }
}

function topshow (obj) {
	if (!DHTML) return;
	var x = new getObj(obj);
	x.style.visibility = 'visible';
}


function tylkocyfry(t,v){if(!~~(v=t.value+1))t.value=(v=parseFloat(v))?v:''}

function tylkodozwolone(AEvent, Dozwolone) //Pozwala wprowadzic tylko zanaki wyienione w apostrofach
{
    if (window.Event) {
        kodKlawisza = AEvent.which;
    } else {
        kodKlawisza = AEvent.keyCode;
    }
    if (kodKlawisza == 13) {
        return true;  // Enter
    };
    if (kodKlawisza == 8) {
        return true;  // Backspace
    };    
    if (kodKlawisza == 0) {
        return true;  // klawisze sterujace
    };
    klawisz = String.fromCharCode(kodKlawisza);
    if (Dozwolone.indexOf(klawisz) == -1) {
        return false;
    } else {
        return true;
    }
}

function emailcheck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1) return false;
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false; 
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false;
		if (str.indexOf(at,(lat+1))!=-1) return false;
	 	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false; 
 		if (str.indexOf(dot,(lat+2))==-1) return false; 
 		if (str.indexOf(" ")!=-1) return false ;
 		return true;
}






function makeRequest(url,iddiv) {
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { topContents(http_request,iddiv); };
    http_request.open('GET', url, true);
    http_request.send('');
}

function topContents(http_request,iddiv) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            document.getElementById(iddiv).innerHTML = http_request.responseText;
        } else {
            alert('There was a problem with the request.\nError: ' + http_request.status);
        }
    }else{
    	document.getElementById(iddiv).innerHTML = 'Komunikacja z serwerem prosze czekac'
    }
}


function makeRequestForSelect(url,iddiv) {
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { topContentsForSelect(http_request,iddiv); };
    http_request.open('GET', url, true);
    http_request.send('');
}

function topContentsForSelect(http_request,iddiv) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            document.getElementById(iddiv).innerHTML = http_request.responseText;
            if(document.getElementById(iddiv).hasAttribute('disabled')){
            	document.getElementById(iddiv).removeAttribute('disabled')
            }
        } else {
            alert('There was a problem with the request.\nError: ' + http_request.status);
        }
    }else{
    	document.getElementById(iddiv).innerHTML = 'Komunikacja z serwerem prosze czekac'
    }
}


//Funkcja ajaxowa wykorzystywana do stronicowania
//Dodatkowy parametr - recPerSite jest uzywany w celu odpowieniego wyswietlania elementow strony w trakcie pobierania danych
function makeRequestForPaging(url, iddiv, iddiv2, iddiv3) {
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { topContentsForPaging(http_request, iddiv, iddiv2, iddiv3); };
    http_request.open('GET', url, true);
    http_request.send('');
}

function topContentsForPaging(http_request, iddiv, iddiv2, iddiv3) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
        	var tab = http_request.responseText.split("divider");
        	if(tab[2] == 0){
        		document.getElementById(iddiv3).style.display='none';
        	}
        	else{
            	document.getElementById(iddiv).innerHTML = tab[0];
				if(tab[1]!=null){
					document.getElementById(iddiv2).innerHTML = tab[1];
				}
			}
        } else {
            alert('There was a problem with the request.\nError: ' + http_request.status);
        }
    }
}

function tooltip(d,E,b,i,a){
  d=document;E=d.documentElement;b=d.body;if(!E)return;
  for(i=0;a=b.getElementsByTagName("span")[i];i++){
    if(a.title){
      with(a.t=d.createElement("div")){
        id="tooltip"
        innerHTML=a.title.replace(/\|/g,"<br />")
      }
      a.onmouseover=function(e){
        with(this){title="";onmousemove(e)}
        b.appendChild(this.t)
      }
      a.onmouseout=function(x){
        with(this){title=t.innerHTML.replace(/<br \/>/g,"\|")}
        if(x=d.getElementById("tooltip"))b.removeChild(x)
      }
      a.onmousemove=function(e){
        e=e||event;with(this.t.style){
         left=e.clientX+(E.scrollLeft||b.scrollLeft)+"px"
         top=e.clientY+(E.scrollTop||b.scrollTop)+"px"
        }
      }
    }
  }
}
function addEvent(O,E,F,x){
  return(x=O.addEventListener)?x(E,F,1):(x=O.attachEvent)?x('on'+E,F):!1
}
addEvent(window,'load',tooltip);

















	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, October 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Updated:	
		March, 11th, 2006 - Fixed positioning of tooltip when displayed near the right edge of the browser.
		April, 6th 2006, Using iframe in IE in order to make the tooltip cover select boxes.
		
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/	
	var dhtmltooltip = false;
	var dhtml_shadowSize = 4;
	var dhtmltooltipMaxWidth = 200;
	var dhtmltooltipMinWidth = 100;
	var dhtml_iframe = false;
	var tooltip_is_msie = (navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('opera')==-1 && document.all)?true:false;
	function showTooltip(e,tooltipTxt)
	{
		
		var bodyWidth = Math.max(document.body.clientWidth,document.documentElement.clientWidth) - 20;
	
		if(!dhtmltooltip){
			dhtmltooltip = document.createElement('DIV');
			dhtmltooltip.id = 'dhtmltooltip';
			
			document.body.appendChild(dhtmltooltip);
			
			if(tooltip_is_msie){
				dhtml_iframe = document.createElement('IFRAME');
				dhtml_iframe.frameborder='5';
				dhtml_iframe.style.backgroundColor='#FFFFFF';
				dhtml_iframe.src = '#'; 	
				dhtml_iframe.style.zIndex = 100;
				dhtml_iframe.style.position = 'absolute';
				document.body.appendChild(dhtml_iframe);
			}
			
		}
		
		dhtmltooltip.style.display='block';
		if(tooltip_is_msie)dhtml_iframe.style.display='block';
		
		var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
		var leftPos = e.clientX + 10;
		
		dhtmltooltip.style.width = null;	// Reset style width if it's set 
		dhtmltooltip.innerHTML = tooltipTxt;
		dhtmltooltip.style.left = leftPos + 'px';
		dhtmltooltip.style.top = e.clientY + 10 + st + 'px';
		
		if(dhtmltooltip.offsetWidth>dhtmltooltipMaxWidth){	/* Exceeding max width of tooltip ? */
			dhtmltooltip.style.width = dhtmltooltipMaxWidth + 'px';
		}
		
		var tooltipWidth = dhtmltooltip.offsetWidth;		
		if(tooltipWidth<dhtmltooltipMinWidth)tooltipWidth = dhtmltooltipMinWidth;
				
		dhtmltooltip.style.width = tooltipWidth + 'px';	

		if(tooltip_is_msie){
			dhtml_iframe.style.left = dhtmltooltip.style.left;
			dhtml_iframe.style.top = dhtmltooltip.style.top;
			dhtml_iframe.style.width = dhtmltooltip.offsetWidth + 'px';
			dhtml_iframe.style.height = dhtmltooltip.offsetHeight + 'px';
		
		}
				
	}
	
	function hideTooltip()
	{
		dhtmltooltip.style.display='none';	
		if(tooltip_is_msie)dhtml_iframe.style.display='none';		
	}
	
// function multipleOnload (){} provides multiple onload method

  navMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
  navMacIE = ((document.all)&&(navMac)) ? true : false;
  navIE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
	  
  var multiArray = new Array();
	  
  function multipleOnLoad(func){
  	if (navMac && navIE4) {
	   window.onload = ReadOnload;
	   multiArray[multiArray.length] = func;
	}else if  (window.onload){
		if (window.onload != getPrev){
		   multiArray[0] = window.onload;window.onload = getPrev;
		}		
		multiArray[multiArray.length] = func;
	}else window.onload = func;
   }
   
   function getPrev(){
    	for (var i=0;i<multiArray.length;i++)
    	{
    	 multiArray[i]();
    	 }
   }

function getPrev(){
	for (var i=0;i<multiArray.length;i++) multiArray[i]();
}

// end of MultipleOnload();











-->

