function openwindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function newsletter(f) 
{

if (f.email.value.length<1)
	{
   	f.email.focus();
   	alert("Proszę podać prawidłowy adres e-mail");
   	return false;
	}
   
if (f.email.value.indexOf('@') < 0)
	{
	f.email.focus();
	alert("Proszę podać prawidłowy adres e-mail");
	return false;
	}
if (f.email.value.indexOf('.') < 0)
    {
    f.email.focus();
   	alert("Proszę podać prawidłowy adres e-mail");
	return false;
	}

	return true;
} 

function skocz(t)
{
  if (t.selectedIndex!=0 && t[t.selectedIndex].value!='nie') window.location = t[t.selectedIndex].value;
}


function sprawdz(f) 
{

if (f.szukaj.value.length<3)
	{
   	f.szukaj.focus();
   	alert("Szukana fraza musi składać się z minimum 3 znaków");
   	return false;
	}
	
if (f.szukaj.value=='wyszukaj produkt')
	{
   	f.szukaj.focus();
   	alert("Szukana fraza musi składać się z minimum 3 znaków");
   	return false;
	}

	return true;
} 

//rozwinieta zakladka numer
var nM = -1;
var last_object = null
var last_object_b = null
function show(n,id)
{


	if(nM==n)
		{

			obj = document.getElementById(id).style.display = "none"	
			styl = 'b' + n
			document.getElementById(styl).className = 'tlo1';
			last_object=null
			nM=-1
			
		} else {
					if(last_object != null)
					{
						last_object.style.display = "none"
						last_object_b.className = 'tlo1';
					}
					obj = document.getElementById(id).style.display = "block"
					last_object = document.getElementById(id)
					
					styl = 'b' + n
					document.getElementById(styl).className = 'tlo2';
					nM = n
					last_object_b = document.getElementById(styl)
				}
}

//rozwinieta zakladka numer
var sM = -1;
var last_object_s = null
var last_object_b = null
function show_s(s,sp)
{


	if(sM==s)
		{

			obj = document.getElementById(sp).style.display = "none"
			last_object_s=null
			sM=-1
			
		} else {
					if(last_object_s != null)
					{
						last_object_s.style.display = "none"
					}
					obj = document.getElementById(sp).style.display = "block"
					last_object_s = document.getElementById(sp)
					
					sM = s
				}
}


function go(adres, f)
 {
  document.getElementById(f).action=adres;
  document.getElementById(f).target="_blank";
  document.getElementById(f).submit();
}

function testuj_form(f) 
{
	
if (f.imie.value.length<1)
	{
   	f.imie.focus();
   	alert("Proszę wpisać imię i nazwisko");
   	return false;
	}
	
if (f.email.value.length<1)
	{
   	f.email.focus();
   	alert("Proszę wpisać adres e-mail");
   	return false;
	}
   
if (f.email.value.indexOf('@') < 0)
	{
	f.email.focus();
	alert("Proszę wpisać prawidłowy adres e-mail");
	return false;
	}
if (f.email.value.indexOf('.') < 0)
    {
    f.email.focus();
   	alert("Proszę wpisać prawidłowy adres e-mail");
	return false;
	}
	
if (f.pytanie.value.length<1)
	{
   	f.pytanie.focus();
   	alert("Proszę wpisać treść pytania");
   	return false;
	}
		
  return true;
}

function kolor(f) 
{

  if (f.value.length>=1)
   {
   	f.style.backgroundColor='#ffffff'
   }
  else
   {
   	f.style.backgroundColor='#eeeeee'
   }

  return true;
}

function kolor_email(f) 
{

  if (f.value.length<1)
   {
   	f.style.backgroundColor='#eeeeee'
   }
  if (f.value.indexOf('@') < 0)
   {
   	f.style.backgroundColor='#eeeeee'
   }
  if (f.value.indexOf('.') < 0)
   {
   	f.style.backgroundColor='#eeeeee'
   }
  else
   {
   	f.style.backgroundColor='#ffffff'
   }

  return true;
}

function flash()
 {
  open("nagroda.html","okno","width=403,height=630");
}