// JavaScript Document
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function showrow(roomrows){
	//if (roomrows==''){
		roomrows = $('#rooms').val();
		//alert(roomrows);
	//};
	ieversion = getInternetExplorerVersion();
	if (roomrows == 1){

		$('#room2_row').hide();
		$('#room3_row').hide();
		var div_form = $('#morethanthree');
		if (div_form.is(":visible")) {
		$("#morethanthree").toggle("medium");
		}
	}
	if (roomrows == 2){
		$('#room2_row').show();
		$('#room3_row').hide();
		var div_form = $('#morethanthree');
		if (div_form.is(":visible")) {
		$("#morethanthree").toggle("medium");
		}
	}
	if (roomrows == 3){
		$('#room2_row').show();
		$('#room3_row').show();
		var div_form = $('#morethanthree');
		if (div_form.is(":visible")) {
		$("#morethanthree").toggle("medium");
		}
	}
	if (roomrows >= 4){
		var div_form = $('#morethanthree');
		if (!div_form.is(":visible")) {
		$("#morethanthree").toggle("medium");
		}
		$("#morethanthree").html("<span style=\"color:red; font-weight:bold\">If you wish to book 4 or more rooms, please contact us directly.</span>");
		$("#morethanthree").css("border", "1px solid black");
		$("#morethanthree").css("background", "white");	
		$("#morethanthree").css("text-align", "center");		
	}
}
