

function getRequest(){
	try {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} catch(e) {
		return new XMLHttpRequest();
	}
}

// for reserveren
function getAvailable(highlight)
{
	if($("#periode").val() != '0' && $("#duur").val() != '0' && $("#pers").val() != '0')
	{
		$.ajax({
			url: '/files/getavailable.php?d='+ $("#duur").val() +'&pers='+ $("#pers").val() +'&p='+ $("#periode").val() +'&h='+ $("#huisdier").val()+'&id='+$("#huis").val()+'&highlight='+highlight,
			success: function(data) {
				$('#available').html(data);
			}
		});
	}
}

function httpResponse(){
	if (r.readyState == 1)
		document.getElementById('available').innerHTML = "<center><br><br><br><br><font size='2' family='Arial'><i>Gegevens worden geladen...</i></font></center>";

	else if (r.readyState == 4 && r.status == 200){
		if(r.responseText != "")
			setTimeout('document.getElementById(\"available\").innerHTML = r.responseText', 250);
		else
			document.getElementById("available").innerHTML = "<center><br><br><br><br><font size='2' family='Arial'><i>Er zijn geen bungalows gevonden...</i></font></center>";

	}
}

function mycarousel_initCallback(carousel)
{
  // Pause autoscrolling if the user moves with the cursor over the clip.
  carousel.clip.hover(function() {
	  carousel.stopAuto();
  }, function() {
	  carousel.startAuto();
  });

  jQuery('#mycarousel-next').bind('click', function() {
	carousel.next();
	return false;
  });

  jQuery('#mycarousel-prev').bind('click', function() {
	carousel.prev();
	return false;
  });
};

jQuery(document).ready(function() {
  jQuery('#mycarousel').jcarousel({
	  auto: 5,
	  scroll: 1,
	  visible: 1,
	  wrap: 'circular',
	  buttonNextHTML: null,
	  buttonPrevHTML: null,
	  initCallback: mycarousel_initCallback
  });
});
