  var xmlHttp="";
if (window.XMLHttpRequest)
  {
  XMLHttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject()
{
var xmlHttp=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


  var xmlHttp0="";
if (window.XMLHttpRequest)
  {
  XMLHttp0=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp0=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject0()
{
var xmlHttp0=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp0=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp0=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp0=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp0;
}

  var xmlHttp1="";
if (window.XMLHttpRequest)
  {
  XMLHttp1=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp1=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject1()
{
var xmlHttp1=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp1=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp1;
}

  var xmlHttp2="";
if (window.XMLHttpRequest)
  {
  XMLHttp2=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp2=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject2()
{
var xmlHttp2=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp2=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp2;
}

  var xmlHttp3="";
if (window.XMLHttpRequest)
  {
  XMLHttp3=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp3=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject3()
{
var xmlHttp3=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp3=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp3=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp3=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp3;
}


  var xmlHttp4="";
if (window.XMLHttpRequest)
  {
  XMLHttp4=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  XMLHttp4=new ActiveXObject("Microsoft.XMLHTTP");

  }
function GetXmlHttpObject4()
{
var xmlHttp4=null;

try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp4=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp4=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp4=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp4;
}














































  function listajzemlje1(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="../zemlje1.php?zemlja="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=zemlja;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
 function listajzemlje(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="zemlje.php?zemlja="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=zemlja;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function zemlja()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
   document.getElementById("container").innerHTML=xmlHttp.responseText;

  }
  else

document.getElementById("container").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

  }

  function listajdrzave(val)

  {
  xmlHttp=GetXmlHttpObject()
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="drzave.php?drzava="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=drzava;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function listajdrzave1(val)

  {
  xmlHttp=GetXmlHttpObject()
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="../drzave1.php?drzava="+val;
url=url+"&sid="+Math.random();

 // alert (url);
  xmlHttp.onreadystatechange=drzava;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function drzava()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
   document.getElementById("ord2").innerHTML=xmlHttp.responseText;

  }else

document.getElementById("ord2").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';
  }

function searchpodaci()
{


xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("browsver ne podrzava AJAX");
 return;
 }



var podaciSaForme = '';
podaciSaForme += 'country=' + document.getElementById("country").value;
//alert(podaciSaForme);
podaciSaForme += '&state=' + document.getElementById("state").value;
//alert(podaciSaForme);
podaciSaForme += '&city=' + document.getElementById("city").value;
//alert(podaciSaForme);
podaciSaForme += '&hotel=' + document.getElementById("hotel").value;
//alert(podaciSaForme);
podaciSaForme += '&checkin=' + document.getElementById("DPC_date1").value;
//alert(podaciSaForme);
podaciSaForme += '&checkout=' + document.getElementById("DPC_date2").value;
//alert(podaciSaForme);
podaciSaForme += '&rooms=' + document.getElementById("rooms").value;
//alert(podaciSaForme);
podaciSaForme += '&adults=' + document.getElementById("adults").value;
//alert(podaciSaForme);
podaciSaForme += '&kids=' + document.getElementById("kids").value;
//alert(podaciSaForme);
//podaciSaForme += '&star=' + document.getElementById("star").value;
//alert(podaciSaForme);
podaciSaForme += '&valuta=' + document.getElementById("valuta").value;
//alert(podaciSaForme);
podaciSaForme += '&a0=' + document.getElementById("a0").checked;
//alert(podaciSaForme);
podaciSaForme += '&a1=' + document.getElementById("a1").checked;
//alert(podaciSaForme);
podaciSaForme += '&a2=' + document.getElementById("a2").checked;
//alert(podaciSaForme);
podaciSaForme += '&a3=' + document.getElementById("a3").checked;
//alert(podaciSaForme);
podaciSaForme += '&a4=' + document.getElementById("a4").checked;
//alert(podaciSaForme);
podaciSaForme += '&a5=' + document.getElementById("a5").checked;
//alert(podaciSaForme);
podaciSaForme += '&a6=' + document.getElementById("a6").checked;
//alert(podaciSaForme);
podaciSaForme += '&a7=' + document.getElementById("a7").checked;
//alert(podaciSaForme);
podaciSaForme += '&a8=' + document.getElementById("a8").checked;
//alert(podaciSaForme);
podaciSaForme += '&a9=' + document.getElementById("a9").checked;
//alert(podaciSaForme);
podaciSaForme += '&a10=' + document.getElementById("a10").checked;
//alert(podaciSaForme);
podaciSaForme += '&a11=' + document.getElementById("a11").checked;
//alert(podaciSaForme);
podaciSaForme += '&a12=' + document.getElementById("a12").checked;
//alert(podaciSaForme);
podaciSaForme += '&a13=' + document.getElementById("a13").checked;
//alert(podaciSaForme);
podaciSaForme += '&a14=' + document.getElementById("a14").checked;
//alert(podaciSaForme);
podaciSaForme += '&a15=' + document.getElementById("a15").checked;
//alert(podaciSaForme);
podaciSaForme += '&a16=' + document.getElementById("a16").checked;
//alert(podaciSaForme);
podaciSaForme += '&a17=' + document.getElementById("a17").checked;
//alert(podaciSaForme);
podaciSaForme += '&a18=' + document.getElementById("a18").checked;
//alert(podaciSaForme);
podaciSaForme += '&a19=' + document.getElementById("a19").checked;
//alert(podaciSaForme);
podaciSaForme += '&a20=' + document.getElementById("a20").checked;
//alert(podaciSaForme);
podaciSaForme += '&a21=' + document.getElementById("a21").checked;
//alert(podaciSaForme);
podaciSaForme += '&a22=' + document.getElementById("a22").checked;
//alert(podaciSaForme);
podaciSaForme += '&a23=' + document.getElementById("a23").checked;
//alert(podaciSaForme);
podaciSaForme += '&a24=' + document.getElementById("a24").checked;
//alert(podaciSaForme);


xmlHttp.onreadystatechange=member;
xmlHttp.open("POST","search.php",true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",podaciSaForme.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.send(podaciSaForme);

}

// list island

// function listisland(val)
//  {
//  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
//  if (xmlHttp==null)
//  {
//   alert ("browsver ne podrzava AJAX");
//   return;
//  }
//  var url="island.php?island="+val;
//url=url+"&sid="+Math.random();
//
//  xmlHttp.onreadystatechange=islandRedirect;
//  xmlHttp.open("GET",url,true);
//  xmlHttp.send(null);
//  }
function listisland(val)
{
  self.location="http://www.JuicyHotels.com/islands.php?island="+val
}


function islandRedirect()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("wait").innerHTML=xmlHttp.responseText;

document.getElementById("wait").innerHTML='';

 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}





function member()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("top").innerHTML=xmlHttp.responseText;

document.getElementById("wait").innerHTML='';

 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

function izlistajhotele(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="prvinivoprikaz.php?koje="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=promenljivdeoprva;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

function promenljivdeoprva()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("working").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
getHotelRates();

 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

function prikazidrugustranu(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="druginivoprikaz.php?koje="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=promenljivdeodruga;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

function promenljivdeodruga()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("working").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else
 document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';
}
function dinning()
{

  xmlHttp=GetXmlHttpObject()
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="dinning.php";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=showdinning;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null)

}
function amenity()
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="searchformdinamic.php?akcija=otvori";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=showamenity;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

function closeamenity()
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="searchformdinamic.php?akcija=zatvori";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=showamenity;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

function showamenity()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("amenity").innerHTML=xmlHttp.responseText;
 }else
 document.getElementById("amenity").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';


}

function availability(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX")
   return
  }
  var url="availability.php?hotel="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=showreservation;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}
function showreservation()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("detalji1").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else
 document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

function reviews(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="reviews.php?hotel="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=showreservation;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

  function dodajDatumi()

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showdate.php";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=datumi;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function datumi()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
   document.getElementById("cal").innerHTML=xmlHttp.responseText;

  }else

document.getElementById("cal").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';
  }
function specialrequest()
{
//alert ("unutra sam");
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="searchdodatak.php";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=searchdodatak;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}
function searchdodatak()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("top").innerHTML=xmlHttp.responseText;
 }else
 document.getElementById("top").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function showKalendar(){

if (document.getElementById('kalendar').style.display == "block")
{
  document.getElementById('kalendar').style.display = "none"
  document.getElementById('kalendar').style.width = "0pt"
  document.getElementById('kalendar').style.height = "0pt"
}
else
{
  document.getElementById('kalendar').style.display = "block"
  document.getElementById('kalendar').style.width = "auto"
  document.getElementById('kalendar').style.height = "auto"
}

}
function showNewAmenities()
{
//alert ("unutra sam");
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="newamenityadding.php";
//alert('radi');
url=url+"&sid="+Math.random();

var podaciSaForme = '';
podaciSaForme += 'country=' + document.getElementById("country").value;
//alert(podaciSaForme);
podaciSaForme += '&state=' + document.getElementById("state").value;
//alert(podaciSaForme);
podaciSaForme += '&city=' + document.getElementById("city").value;
//alert(podaciSaForme);
podaciSaForme += '&hotel=' + document.getElementById("hotel").value;
//alert(podaciSaForme);
podaciSaForme += '&checkin=' + document.getElementById("DPC_date1").value;
//alert(podaciSaForme);
podaciSaForme += '&checkout=' + document.getElementById("DPC_date2").value;
//alert(podaciSaForme);
podaciSaForme += '&rooms=' + document.getElementById("rooms").value;

//alert(podaciSaForme);
podaciSaForme += '&adults=' + document.getElementById("adults").value;
//alert(podaciSaForme);
podaciSaForme += '&kids=' + document.getElementById("kids").value;
//alert(podaciSaForme);
podaciSaForme += '&star=' + document.getElementById("star").value;
//alert(podaciSaForme);
podaciSaForme += '&valuta=' + document.getElementById("valuta").value;
//alert(podaciSaForme);
podaciSaForme += '&a0=' + document.getElementById("a0").checked;
//alert(podaciSaForme);
podaciSaForme += '&a1=' + document.getElementById("a1").checked;
//alert(podaciSaForme);
podaciSaForme += '&a2=' + document.getElementById("a2").checked;
//alert(podaciSaForme);
podaciSaForme += '&a3=' + document.getElementById("a3").checked;
//alert(podaciSaForme);
podaciSaForme += '&a4=' + document.getElementById("a4").checked;
//alert(podaciSaForme);
podaciSaForme += '&a5=' + document.getElementById("a5").checked;
//alert(podaciSaForme);
podaciSaForme += '&a6=' + document.getElementById("a6").checked;
//alert(podaciSaForme);
podaciSaForme += '&a7=' + document.getElementById("a7").checked;
//alert(podaciSaForme);
podaciSaForme += '&a8=' + document.getElementById("a8").checked;
//alert(podaciSaForme);
podaciSaForme += '&a9=' + document.getElementById("a9").checked;
//alert(podaciSaForme);
podaciSaForme += '&a10=' + document.getElementById("a10").checked;
//alert(podaciSaForme);
podaciSaForme += '&a11=' + document.getElementById("a11").checked;
//alert(podaciSaForme);
podaciSaForme += '&a12=' + document.getElementById("a12").checked;
//alert(podaciSaForme);
podaciSaForme += '&a13=' + document.getElementById("a13").checked;
//alert(podaciSaForme);
podaciSaForme += '&a14=' + document.getElementById("a14").checked;
//alert(podaciSaForme);
podaciSaForme += '&a15=' + document.getElementById("a15").checked;
//alert(podaciSaForme);
podaciSaForme += '&a16=' + document.getElementById("a16").checked;
//alert(podaciSaForme);
podaciSaForme += '&a17=' + document.getElementById("a17").checked;
//alert(podaciSaForme);
podaciSaForme += '&a18=' + document.getElementById("a18").checked;
//alert(podaciSaForme);
podaciSaForme += '&a19=' + document.getElementById("a19").checked;
//alert(podaciSaForme);
podaciSaForme += '&a20=' + document.getElementById("a20").checked;
//alert(podaciSaForme);
podaciSaForme += '&a21=' + document.getElementById("a21").checked;
//alert(podaciSaForme);
podaciSaForme += '&a22=' + document.getElementById("a22").checked;
//alert(podaciSaForme);
podaciSaForme += '&a23=' + document.getElementById("a23").checked;
//alert(podaciSaForme);
podaciSaForme += '&a24=' + document.getElementById("a24").checked;
//alert(podaciSaForme);


xmlHttp.onreadystatechange=member;
xmlHttp.open("POST","newamenityadding.php",true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",podaciSaForme.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.send(podaciSaForme);

}

function newAmenities(val)
{
//alert ("unutra sam");
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }

//alert('radi');


var rB=0;
var podaciSaForme='';
var idPolja='';

for (i=0; i<val; i++)
{
  idPolja='b'+i;
  if (document.getElementById(idPolja).checked==true)
  {
  podaciSaForme += '&b'+rB+'=' + document.getElementById(idPolja).value;
  rB++;
  //alert(idPolja);
  //alert(podaciSaForme);
  }
}


xmlHttp.onreadystatechange=member;
xmlHttp.open("POST","newamenitycontinue.php",true)
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",podaciSaForme.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.send(podaciSaForme);
}

function searchdostupno()
{
//alert ("unutra sam");
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }

//alert('radi');

var podaciSaForme = '';

//alert(podaciSaForme);
podaciSaForme += '&checkin=' + document.getElementById("DPC_date11").value;
//alert(podaciSaForme);
podaciSaForme += '&checkout=' + document.getElementById("DPC_date21").value;
//alert(podaciSaForme);
podaciSaForme += '&rooms=' + document.getElementById("rooms1").value;
//alert(podaciSaForme);
podaciSaForme += '&adults=' + document.getElementById("adults1").value;
//alert(podaciSaForme);
podaciSaForme += '&kids=' + document.getElementById("kids1").value;
//alert(podaciSaForme);




xmlHttp.onreadystatechange=adddate;
xmlHttp.open("POST","availability-session.php",true);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",podaciSaForme.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.send(podaciSaForme);
}

function adddate()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("detalji1").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

function openLastMinuteDeals()
{
//alert ("unutra sam");
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="chooselastminutedeals.php";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=searchdodatak;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}
function openWeather(min,max,measure,region)
{

    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="inc/msn.weather.php?min="+min;
  url=url+"&max="+max;
  url=url+"&temp="+measure;
  url=url+"&region="+region;
  //alert (url);
  url=url+"&sid="+Math.random();

  var str =  min+","+max+",'"+measure+"','"+region+"'";
  breadCrumb = 'openWeather('+str+')';

  xmlHttp.onreadystatechange=member
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
}


function openAllWeather(min,max,measure,region)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="inc/msn.all.weather.php?min="+min;
  url=url+"&max="+max;
  url=url+"&temp="+measure;
  url=url+"&region="+region;

url=url+"&sid="+Math.random();


  //alert (url);
  xmlHttp.onreadystatechange=member
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
}



function showGoodWeather(val)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="inc/page.weather.php?start="+val;
url=url+"&sid="+Math.random();

  alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function showAllWeather(val)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="inc/page.all.weather.php?start="+val;
url=url+"&sid="+Math.random();

  alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function openHT(val)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="openhs.php?id="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function showHSPic(val)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="picture.php?hsid="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=slika;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function slika()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("picture").innerHTML=xmlHttp.responseText;

 }
}
var breadCrumb = '';

function noteBack(str){
        document.getElementById('back_link').innerHTML = '<a class="one" onclick="clearLink(this);'+breadCrumb+'" style="cursor:pointer;text-decoration:none;"><img src="images/arrow_left.gif" />Back To Result</a>';
        breadCrumb = '';
}
function listHotelsFromWeathers(val)
{ 
    noteBack('listHotelsFromWeathers('+val+')');
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="listhotelsfromweather.php?id="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function listArchive(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="whatshotintravel-archives.php?start="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

function listCategory(val)
{

  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  url="trazipokategoriji.php?kategorija="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}
function showMenuPic(val)
{
    xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="picturemenu.php?id="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=slika;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function loadPhotoDest(val)
{

  img='<img width="788" height="250" src="'+val;
  img=img+'" />';
//alert (img);
  document.getElementById("picture").innerHTML=img;

}




  function listcountries(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="land_admin.php?land="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=zemlja1;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }



  function zemlja1()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
   document.getElementById("city").innerHTML=xmlHttp.responseText;

  }
  else

document.getElementById("city").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';


  }

  function liststates(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="land_admin.php?state="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=zemlja1;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

 function cityshortcut(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="cityshortcut.php?id="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

function loadLMD()
{
  val='http://www.JuicyHotels.com/images/btns/btn-lastminutedeals.jpg';
  img='<img src="'+val;
  img=img+'" />';
  document.getElementById("bottompic").innerHTML=img;

}
function loadOneHotStuff()
{
  val='http://www.JuicyHotels.com/images/btns/btnheader-hot.jpg ';
  img='<img src="'+val;
  img=img+'" />';
  document.getElementById("bottompic").innerHTML=img;

}


  function listcountryhome(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="countryhome.php?country="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=countryh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function countryh()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
     document.getElementById("chome").innerHTML=xmlHttp.responseText;

  }
  else

    document.getElementById("chome").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

  }

  function liststatehome(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="statehome.php?state="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=stateh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  function stateh()
  {
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {
   document.getElementById("shome1").innerHTML=xmlHttp.responseText;

  }else

document.getElementById("shome1").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';
  }

function maphome()
{


xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("browsver ne podrzava AJAX");
 return;
 }



var podaciSaForme = '';
podaciSaForme += 'country=' + document.getElementById("countryhome").value;
//alert(podaciSaForme);
podaciSaForme += '&state=' + document.getElementById("statehome").value;
//alert(podaciSaForme);
podaciSaForme += '&city=' + document.getElementById("cityhome").value;
//alert(podaciSaForme);
podaciSaForme += '&star=' + document.getElementById("starhome").value;
//alert(podaciSaForme);
podaciSaForme += '&miles=' + document.getElementById("miles").value;

xmlHttp.onreadystatechange=road;
xmlHttp.open("POST","http://www.JuicyHotels.com/ver8.php/mapajax.php",true)
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",podaciSaForme.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.send(podaciSaForme);

}

function road()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("mapmain").innerHTML=xmlHttp.responseText;

document.getElementById("wait").innerHTML='';

 }else

document.getElementById("mapmain").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

  function showMax()

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showdistanceform.php?id=1";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancesh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

  function showSpecific()

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showdistanceform.php?id=0";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancesh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }




  function milesToDrive()

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showdistanceform.php?unit=0";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancesh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

  function kmToDrive()

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showdistanceform.php?unit=1";
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancesh;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }






function distancesh()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("distanceshow").innerHTML=xmlHttp.responseText;
 }else

document.getElementById("distanceshow").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}



// add city to SESSION

  function citytosession(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="citytosession.php?city="+val;
url=url+"&sid="+Math.random();

  // alert (url);
  xmlHttp.onreadystatechange=cityLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
function cityLoc()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {

document.getElementById("wait").innerHTML='';
 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

  function startosession(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="startosession.php?star="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=starLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

  function startosession1(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="../startosession.php?star="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=starLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

function starLoc()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
//document.getElementById("top").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

  function distancetypetosession(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="distancetypetosession.php?distancetype="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancetypeLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

  function unitstosession(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="unittypetosession.php?unittype="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distancetypeLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }


function distancetypeLoc()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
//document.getElementById("top").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else

document.getElementById("wait").innerHTML='<img src="../http://JuicyHotels.com/wait30trans.gif">';

}

  function distancetosession(val)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="../distancetosession.php?distance="+val;
url=url+"&sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=distanceLoc;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
function distanceLoc()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
//document.getElementById("top").innerHTML=xmlHttp.responseText;
document.getElementById("wait").innerHTML='';
 }else

document.getElementById("wait").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}

function removeHotelDefault()
{
  if (document.getElementById("hotel").value==' Hotel name (optional)')
  {
    document.getElementById("hotel").value='';
  }
}
function removeSearchDefault()
{
  if (document.getElementById("query").value=='Search...')
  {
    document.getElementById("query").value='';
  }
}

function removeHotelDefault()
{
  if (document.getElementById("hotel").value==' Hotel name (optional)')
  {
    document.getElementById("hotel").value='';
  }
}

  function amenityremover()
  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="amenityremover.php";
url=url+"?sid="+Math.random();

  //alert (url);
  xmlHttp.onreadystatechange=member;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }


function clearAll()
{
for(i=0; i<document.forma.elements.length; i++)
{
if(document.forma.elements[i].type=="checkbox")
{
document.forma.elements[i].checked=false;
}
}
}


  function showAmenitiesHotel(val,loc)

  {
  xmlHttp=GetXmlHttpObject();
  //alert ("u js sam");
  if (xmlHttp==null)
  {
   alert ("browsver ne podrzava AJAX");
   return;
  }
  var url="showamenitieshotel.php?id="+val;
url=url+"&pos="+loc;
url=url+"&sid="+Math.random();

  //alert (url);
  if(loc==0)
  {
    xmlHttp.onreadystatechange=amenities0;
  }else   if(loc==1)
  {
    xmlHttp.onreadystatechange=amenities1;
  }else  if(loc==2)
  {
    xmlHttp.onreadystatechange=amenities2;
  }else  if(loc==3)
  {
    xmlHttp.onreadystatechange=amenities3;
  }else  if(loc==4)
  {
    xmlHttp.onreadystatechange=amenities4;
  }
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }


function amenities0()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
document.getElementById("amenities0").innerHTML=xmlHttp.responseText;
//document.getElementById("wait").innerHTML='';
 }else

document.getElementById("amenities0").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function amenities1()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
document.getElementById("amenities1").innerHTML=xmlHttp.responseText;
//document.getElementById("wait").innerHTML='';
 }else

document.getElementById("amenities1").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function amenities2()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
document.getElementById("amenities2").innerHTML=xmlHttp.responseText;
//document.getElementById("wait").innerHTML='';
 }else

document.getElementById("amenities2").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function amenities3()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
document.getElementById("amenities3").innerHTML=xmlHttp.responseText;
//document.getElementById("wait").innerHTML='';
 }else

document.getElementById("amenities3").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function amenities4()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
document.getElementById("amenities4").innerHTML=xmlHttp.responseText;
//document.getElementById("wait").innerHTML='';
 }else

document.getElementById("amenities4").innerHTML='<img src="http://JuicyHotels.com/wait30trans.gif">';

}
function goIsland() { 
   window.location = "http://www.JuicyHotels.com/islands.php";
}
function isset () {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: FremyCompany
    // +   improved by: Onno Marsman
    // *     example 1: isset( undefined, true);
    // *     returns 1: false
    // *     example 2: isset( 'Kevin van Zonneveld' );
    // *     returns 2: true
    
    var a=arguments, l=a.length, i=0;
    
    if (l===0) {
        throw new Error('Empty isset'); 
    }
    
    while (i!==l) {
        if (typeof(a[i])=='undefined' || a[i]===null) { 
            return false; 
        } else { 
            i++; 
        }
    }
    return true;
}

function showPP(id)
{
   var field='pp_'+id;
   var img='img_'+id;

   if (document.getElementById(field).style.display == 'none' && document.getElementById(field).style.visibility=='hidden')
   {
         document.getElementById(field).style.display ='inline';
         document.getElementById(field).style.visibility='visible'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowdown.gif">';
   }
   else
   {
         document.getElementById(field).style.display ='none';
         document.getElementById(field).style.visibility='hidden'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowrt.gif">';

   }
}
function showWIFI(id)
{
   var field='wifi_'+id;
   var img='img_wifi_'+id;

   if (document.getElementById(field).style.display == 'none' && document.getElementById(field).style.visibility=='hidden')
   {
         document.getElementById(field).style.display ='inline';
         document.getElementById(field).style.visibility='visible'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowdown.gif">';
   }
   else
   {
         document.getElementById(field).style.display ='none';
         document.getElementById(field).style.visibility='hidden'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowrt.gif">';

   }
}
function showAmenities(id)
{
   var field='amenities_'+id;
   var img='img_amenities_'+id;

   if (document.getElementById(field).style.display == 'none' && document.getElementById(field).style.visibility=='hidden')
   {
         document.getElementById(field).style.display ='inline';
         document.getElementById(field).style.visibility='visible'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowdown.gif">';
   }
   else
   {
         document.getElementById(field).style.display ='none';
         document.getElementById(field).style.visibility='hidden'
         document.getElementById(img).innerHTML='<img src="http://www.JuicyHotels.com/images/smarrowrt.gif">';

   }
}