function NlShowRules()
{
	window.open('http://radio.nadaje.com/regulamin.php', 'rules', "width=1024,height=768,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no");
}

function loadCities()
{
	var miasto = document.getElementById('citiesLoaded');
	var wojew = document.getElementById('woj').value;
	url = encodeURI("http://radio.nadaje.com/inc/miasta_ajax.php?woj=" + wojew);
	startGETRequest(url, onCompleteCit, onEndCit);
	miasto.innerHTML = '<img src="http://img.nadaje.com/radio/kalendarz/loader.gif" alt="Ladowanie..." />';
}

function onCompleteCit(text, xml)
{
	var miasto = document.getElementById('citiesLoaded');
	miasto.innerHTML = text;
}

function onEndCit()
{

}

function wyslijdane()
{
   var t_email = document.getElementById("email").value;
   var t_woj = document.getElementById("woj").value;

  var is = document.getElementById("is").checked;


   var test = /^[^@\#\$\%\&\^\*]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/;

   
   var w = t_email.match(test);
   
  
   if(w==null)
   {
 var rez = document.getElementById('bad');
 rez.innerHTML = 'Prosimy o podanie poprawnego adres e-mail';
   }
   else
   {
    var rez = document.getElementById('bad');
 rez.innerHTML = '';
   }
   
  if(is==false)
   {
 var rez = document.getElementById('bad_1');
 rez.innerHTML = 'Prosimy o zaakceptowanie regulaminu';
   }
      else
   {
    var rez = document.getElementById('bad_1');
 rez.innerHTML = '';
   }
   

if(w!=null&&is==true)
{
  var rez = document.getElementById('newsletter_opis_e');
  rez.innerHTML = 'Trwa zapisywanie...';


url = "http://radio.nadaje.com/inc/dodaj_email_embed.php?email=" + t_email + "&woj=" + t_woj;
url = encodeURI(url);
startGETRequest(url, onComplete, onEnd);
}

}

function onComplete(text, xml)
{
    var formMain = document.getElementById('newsletter_opis_e');
    formMain.innerHTML = text;

}



function onEnd()
{

}
