// JavaScript Document
function goNext()
{
	      var pos = 0;
	      if(arguments.length > 0)
			  pos = arguments[0];
		  showThis(pos);
	      if(pos == 1)
		  {
		      var objhf = document.getElementById("SelectDate");
			  objhf.value = arguments[1];
		  }
}

function goBack()
{
	      var pos = 0;
	      if(arguments.length > 0)
			  pos = arguments[0];
		  showThis(pos);
}

function showThis(index)
{
	      var buttons = new Array("BookFirst","BookSecond","BookThird","BookFourth");
		  var boxes = new Array("FirstBox","SecondBox","ThirdBox","FourthBox");
		  var objb = null;
		  var obji = null;
		  for(var i = 0;i < buttons.length; i++)
		  {
			  objb = document.getElementById(buttons[i]);
			  if(objb)
			  {
				  if(i == index)
				     objb.className = "book_"+ (i + 1) +"_2";
				  else
				     objb.className = "book_"+ (i + 1) +"_1";
			  }
			  obji = document.getElementById(boxes[i]);
			  if(obji)
			  {
				  if(i == index)
				     obji.style.display = "block";
				  else
				     obji.style.display = "none";
			  }
		  }
}

function checkAgreed()
{
	      var obj = document.getElementById("cb_agreed");
		  if(obj.checked == false)
		  {
			  alert("Sorry, only when you read our Terms and Conditions and agree with it, you can continue to make a booking.")
			  obj.focus();
		  }
		  else
		  {
		      goNext(2);
		  }
}

function ReadAgreed()
{
	      var obj = document.getElementById("cb_agreed");
		  if(obj.checked == false)
		  {
			  alert("Sorry, only when you read our Terms and Conditions and agree with it, you can continue to make a booking.")
			  obj.focus();
			  return false;
		  }
		  else
		  {
		      return true;
		  }
}

function groupfocus(obj)
{
		 if(obj.value=="e.g. 2 adults and 1 child ( 12-year-old)")
		   obj.value = "";
}

function groupblur(obj)
{
	     if(obj.value.length==0)
			 obj.value = "e.g. 2 adults and 1 child ( 12-year-old)";
}

function changerb()
{
	     var obj = document.getElementById("rb_TravelDate");
		 obj.checked = false;
}

function changetxt()
{
	     var obj = document.getElementById("txt_TravelDate");
		 obj.value = "";
}