function tabelka(id)
{


  if(document.getElementById('tab'+id).style.display=='none')
  {
    document.getElementById('tab'+id).style.display='block';

  }
  else
  {
    document.getElementById('tab'+id).style.display='none';

  }


}

	function prepareObject()
{
		if(window.XMLHttpRequest)
		{
		  req=new XMLHttpRequest();	
		}
		else if(window.ActiveXObject)
		{
		  req=new ActiveXObject("Msxml2.XMLHTTP");
		  
		  if(!req)
		  req=new ActiveXObject("Microsoft.XMLHTTP");
		}


}

function sendNewsletterRequest(formularz,url,asynch)
{
  prepareObject();
  if(!req)
  {    
    alert('Przegl�darka nie obs�uguje wymaganych narz�dzi do obs�ugi tego ��dania');
    return;
   }
var form=document.forms[formularz];

try
{
  req.onreadystatechange=newsletterResponse;
  req.open(form.method,url,asynch);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=iso-8859-2");
req.send('email='+encodeURIComponent(form.email.value));
  
}
catch(e)
{
  alert('Wyst�pi� problem z komunikacj� z serwerem');
}
  
}


function newsletterResponse()
{
try
{
  if(req.readyState==4 )
  {
    
    	if(req.status==200)
    	{
	
		     document.getElementById('newsletter_div').innerHTML=req.responseText;
		     document.getElementById('newsletter_div').style.display='block';
		
		  
		}
		else
		{
		  alert('Wyst�pi� problem z komunikacj� z serwerem');
		}
    
	}
}
catch(e)
{
  alert('Wyst�pi� problem z komunikacj� z serwerem');
} 
 
}

function popup(foto,szer,wys,nazwa)
{

config='toolbar=no,location=no,directories=no,status=no,menubar=no,width='+szer+',height='+wys+' ,scrollbars=no,resizable=no';
var okno = window.open ("",nazwa,config);

okno.document.write('<html><head></head><body onClick="window.close()" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0"><a href="#"><img src="'+foto+'" border=0  > </a></body></html>');

okno.document.close();
}

function popup2(link,szer,wys,nazwa)
{
config='toolbar=no,location=no,directories=no,status=no,menubar=no,width='+szer+',height='+wys+' ,scrollbars=no,resizable=no';
var okno = window.open (link,nazwa,config);
}


function check_type(nazwaTab,typTab,f)
{
 var ile=nazwaTab.length;
 var nazwaPliku,typ,ok;
 var brak=0;
 var ile_typow;
 var good_type=0;
 for(var i=0;i<ile;i++)
 {
   nazwaPliku=f.elements[nazwaTab[i]].value;
   if(nazwaPliku!='')
   {
 
    typ=nazwaPliku.substring(nazwaPliku.length-3,nazwaPliku.length).toLowerCase();
 
     ile_typow=typTab[i].length;
     for(var l=0;l<ile_typow;l++)
     {
 
		    if(typ==typTab[i][l])
		    {
			++good_type;
		    break;
		    }
			
      }
   }
   else
   {
     ++brak;
	}
 
 
 }
    
 
     		  if(brak==nazwaTab.length)
		      {
			    return true;
			  }
			  else
			  {
				
					 if(good_type+brak==nazwaTab.length)
    				 {
					 return true;
					 
					 }
					 else
					 {
					 alert('Niezgodny format pliku.\n Akceptowane typy pliku to: '+typTab+' \n Plik nie powinien zawiera� poskich znak�w ani znak�w specjalnych.');
		     		 return false;
					 }
 
		    	}

}


function pokazforum()
{


  if(document.getElementById('formularzForum').style.display=='none')
  {
    document.getElementById('formularzForum').style.display='block';

  }
  else
  {
    document.getElementById('formularzForum').style.display='none';

  }


}
 
 
 function pokaz(id)
 {


   if(document.getElementById('tab'+id).style.display=='none')
   {
     document.getElementById('tab'+id).style.display='block';

   }
   else
   {
     document.getElementById('tab'+id).style.display='none';

   }


 }


 


