function showSWF(in_o)
{
	s_obj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
	s_param = ""; 
	s_embd = '<embed pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" '; 
	for(str in in_o)
	{
		s_obj += str + '="' + in_o[str] + '" ';
		s_param += '<param name="' + str + '" value="' + in_o[str] + '">';
		s_embd += str + '="' + in_o[str] + '" ';
		if (str == "movie") s_embd += 'src="' + in_o[str] + '" ';
	}
	out_h = s_obj + ">\n" + s_param + "\n" + s_embd + "></embed></object>";
    document.write(out_h);
}
function trim(str) 
{
 return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
function checkE() 
{
  if (window.event && window.event.keyCode == 13)
    onPsearch();
  else
    return true;
}
function checkemail(str)
{
 var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
 if (filter.test(str)) 
  testresults = true
 else
 {
  testresults = false
 }
 return (testresults)
}
function onPsearch()
{
  if (!(document.getElementById('s01')))
   return true;
  var ss = trim(document.getElementById('s01').value);
  if (ss.length<2)
  {
   alert('Poszukiwany ciąg musi być dłuższy (min 2 znaki).');
   return true;
  }
  location.href = '/produkt/szukaj/' + encodeURIComponent(ss) + '.html';
}
function goLevelx(cntr)
{
  var marka = '';
  var rodz = '';
  if (document.getElementById('fp_marka'))
   marka = document.getElementById('fp_marka').value;
  if (document.getElementById('fp_rodz'))
   rodz = document.getElementById('fp_rodz').value;
  if ((marka=='') || (marka==-1))
   location.href =  '/produkt/wybierz--.html';
  else if (cntr == 1)
   location.href =  '/produkt/wybierz-' + marka + '-' + '.html';
  else if ((rodz=='') || (rodz==-1))
   location.href =  '/produkt/wybierz-' + marka + '-' + '.html';
  else if (cntr == 2)
   location.href =  '/produkt/wybierz-' + marka + '-' + rodz + '.html';
  else if (cntr == 3)
   location.href =  '/produkt/wybierz-' + marka + '-' + rodz + '.html';   
  else
   location.href =  '/produkt/wybierz--.html';
}
function goGdzieK(xlink)
{
 var miasto = '';
 if (document.getElementById('gdziekupic_miasto'))
  miasto = document.getElementById('gdziekupic_miasto').value;
 location.href = xlink + '-' + miasto + '.html';
} 
function js_media_send()
{
 if ( (trim(document.getElementById('imie_nazwisko').value).length) < 2  ) { alert('Wypełnij pole: Imię, nazwisko'); return true; }
 if ( (trim(document.getElementById('telefon_kont').value).length) < 2  ) { alert('Wypełnij pole: Telefon kontaktowy'); return true; }
 if (checkemail(document.getElementById("email").value))
 {
   xajax_media_send('PL', document.getElementById("imie_nazwisko").value, document.getElementById("telefon_kont").value, document.getElementById("email").value);
 }  
 else 
  alert("Nieprawidłowy adres e-mail w polu: Adres e-mail");
} 
function js_zapytaj_send()
{
 //if ( (trim(document.getElementById('imie_nazwisko').value).length) < 2  ) { alert('Wypełnij pole: Imię, nazwisko'); return true; }
 //if ( (trim(document.getElementById('telefon_kont').value).length) < 2  ) { alert('Wypełnij pole: Telefon kontaktowy'); return true; }
 if (checkemail(document.getElementById("email").value))
 { 
   xajax_zapytaj_send('PL', document.getElementById("imie_nazwisko").value, document.getElementById("telefon_kont").value, document.getElementById("email").value, document.getElementById("pytanie").value);
 }  
 else 
  alert("Nieprawidłowy adres e-mail w polu: Adres e-mail");
} 
function js_newslt_send()
{
 if ( (trim(document.getElementById('imie_nazwisko').value).length) < 2  ) { alert('Wypełnij pole: Imię, nazwisko'); return true; }
 if ( (trim(document.getElementById('telefon_kont').value).length) < 2  ) { alert('Wypełnij pole: Telefon kontaktowy'); return true; }
 if (checkemail(document.getElementById("email").value))
 {
   xajax_newslt_send('PL', document.getElementById("imie_nazwisko").value, document.getElementById("telefon_kont").value, document.getElementById("email").value);
 }  
 else 
  alert("Nieprawidłowy adres e-mail w polu: Adres e-mail");
}
function js_sp2011_send(towar)
{
 if (!(document.getElementById('zapoz_check').checked)) { alert('Zaakceptuj regulamin.'); return true; }
 if ( (trim(document.getElementById('pytanie').value).length) < 10  ) { alert('Wypełnij pole: uzasadnij dokonany wybór'); return true; }
 if ( (trim(document.getElementById('imie_nazwisko').value).length) < 5  ) { alert('Wypełnij pole: Imię, nawisko, firma'); return true; }
 if ( (trim(document.getElementById('adres_kor').value).length) < 5  ) { alert('Wypełnij pole: Adres korespondencyjny'); return true; }
 if (checkemail(document.getElementById("email").value))
 {
   xajax_sp2011_send(towar, document.getElementById("imie_nazwisko").value, document.getElementById("adres_kor").value, document.getElementById("email").value, document.getElementById('pytanie').value);
 }  
 else 
  alert("Nieprawidłowy adres e-mail w polu: Adres e-mail");
}

