function dlugosc()
 {
  var adres = document.location.href;
  if (adres.search(/26d%3D/) == -1) {adres = adres + "%26d%3D1";}
  if (document.filtr.okres.value=="26d%3D1") {
     document.location.href = adres.replace(/26d%3D4/,"26d%3D1");
   }
  else
   {
    document.location.href = adres.replace(/26d%3D1/,"26d%3D4");
   }
}

function wyzywienie()
{
  var adres = document.location.href;
  if (document.filtr.zywienie.value=="26bt%3D1") {
     if (adres.search(/26bt%3D4/) == -1) {
      document.location.href = document.location.href + "%26bt%3D1";
     }
     else {document.location.href = adres.replace(/26bt%3D4/,"26bt%3D1");}
  }
  if (document.filtr.zywienie.value=="26bt%3D4") {
     if (adres.search(/26bt%3D1/) == -1) {
      document.location.href = document.location.href + "%26bt%3D4";
     }
     else {document.location.href = adres.replace(/26bt%3D1/,"26bt%3D4");}
  }
  if (document.filtr.zywienie.value=="26bt%3D0") {
     if (adres.search(/26bt%3D/) != -1) {
      document.location.href = adres.slice(0,adres.indexOf("%26bt")) + adres.slice(adres.indexOf("%26bt%3D")+9);
     }
  }
}

function miesiac()
 {
  var adres = document.location.href;
  if (document.filtr.termin.value=="styczen") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.01.2010%26ed%3D15.02.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
   }
  if (document.filtr.termin.value=="luty") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.02.2010%26ed%3D15.03.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
   }
  if (document.filtr.termin.value=="marzec") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.03.2010%26ed%3D15.04.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="kwiecien") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.04.2010%26ed%3D15.05.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="maj") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.05.2010%26ed%3D15.06.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="czerwiec") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.06.2010%26ed%3D15.07.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="lipiec") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.07.2010%26ed%3D15.08.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="sierpien") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.08.2010%26ed%3D15.09.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="wrzesien") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.09.2010%26ed%3D15.10.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="pazdziernik") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.10.2010%26ed%3D15.11.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="listopad") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.11.2010%26ed%3D15.12.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
  if (document.filtr.termin.value=="grudzien") {
     document.location.href = (adres.slice(0,adres.indexOf("sd%3D")+5) + "01.12.2010%26ed%3D15.01.2010" + adres.slice(adres.indexOf("%26",adres.indexOf("%26ed%3D")+5)));
  }
}
function ustawmsc()
{
 if(/01.01/.test(location.href)) {document.filtr.termin[0].selected="1"; }
 if(/01.02/.test(location.href)) {document.filtr.termin[1].selected="1"; }
 if(/01.03/.test(location.href)) {document.filtr.termin[2].selected="1"; }
 if(/01.04/.test(location.href)) {document.filtr.termin[3].selected="1"; }
 if(/01.05/.test(location.href)) {document.filtr.termin[4].selected="1"; }
 if(/01.06/.test(location.href)) {document.filtr.termin[5].selected="1"; }
 if(/01.07/.test(location.href)) {document.filtr.termin[6].selected="1"; }
 if(/01.08/.test(location.href)) {document.filtr.termin[7].selected="1"; }
 if(/01.09/.test(location.href)) {document.filtr.termin[8].selected="1"; }
 if(/01.10/.test(location.href)) {document.filtr.termin[9].selected="1"; }
 if(/01.11/.test(location.href)) {document.filtr.termin[10].selected="1"; }
 if(/01.12/.test(location.href)) {document.filtr.termin[11].selected="1"; }
}

function ustaw()
{
  var str= new RegExp("26bt%3D4");
  var str1= new RegExp("26bt%3D1");
  if(str.test(location.href)) { document.filtr.zywienie[1].selected="1"; }
  if(str1.test(location.href)) { document.filtr.zywienie[2].selected="1"; }
}

var xmlhttp;

function showHotels(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="http://www.clubwakacje.pl/gethotels.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function Szukajhotel()
{
 document.szukaj_hotel.action ="opinia?id=" + document.getElementById("hotel").value;
 return true;
}

function checkform (form)
{
    if (form.telefon.value == "") {
        alert( "Podaj numer telefonu." );
        form.telefon.focus();
        return false ;
    }
	return true;
}