/*function cell_over(cell, color) {
	cell.style.backgroundColor=color;
	cell.style.cursor='pointer';
}*/


function hidify_showify(e_table, e_img, alt_less, alt_more, imagepath) {
   

   if(document.getElementById) {
      var id_table = document.getElementById(e_table).style;
      var id_img = document.getElementById(e_img);

      //Set the object to table-cell if the browser is
      //Firefox and block if it's anything else.
      if(navigator.userAgent.indexOf("Firefox") != -1){
         if(id_table.display == "table-cell") {
            id_table.display = "none";
            id_img.src = imagepath + "/arrow_down.gif";
            id_img.alt = alt_more;
         }
         else {
            id_table.display = "table-cell";
            id_img.src = imagepath + "/arrow_up.gif";
            id_img.alt = alt_less;
         }
      }
      else {
         if(id_table.display == "block") {
            id_table.display = "none";
            id_img.src = imagepath + "/arrow_down.gif";
            id_img.alt = alt_more;
         }
         else {
            id_table.display = "block";
            id_img.src = imagepath + "/arrow_up.gif";
            id_img.alt = alt_less;
         }
      }
      return false;
   }
   else {
      return true;
   }
}

function disable_calendar_mouseovers() {
	//alert("disable");
	


	
	screenLayer = document.getElementById('calendarScreen');
	screenLayer.style.visibility = "visible";
	screenLayer.className = "screenOn";
	

}

function enable_calendar_mouseovers() {

	//bookingSummary = document.getElementById('bookingdetails');
	//bookingSummary.style.visibility = "hidden";

	target = document.getElementById('bookingInfoBox');
	bookingHideSummary(target);

	screenLayer = document.getElementById('calendarScreen');
	screenLayer.style.visibility = "hidden";
	

	
}

function booking_cell_over(cell, style) {
	cell.className = style;
	cell.style.cursor='pointer';
}

/*function cell_out(cell, color) {
	cell.style.backgroundColor = color;
}*/

function booking_cell_out(cell, style) {
	cell.className = style;
}

function booking(link) {
	 location.href = link;
}

function isIE() {
	return document.all;
}

  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function bookingShowSummary(object, text) {
	
	clearOld = document.getElementById('bookingInfoBox');
	if (clearOld && clearOld.parentNode != object) {
		clearOld.parentNode.removeChild(clearOld);
	}
	

	var contents = document.createElement('div');
	contents.setAttribute('id','bookingInfoBox');
	contents.setAttribute('class','bookingInfo')
	
	
	object.parentNode.parentNode.parentNode.appendChild(contents);

	target = document.getElementById('bookingInfoBox');
	target.innerHTML = text;
	
}

function bookingHideSummary(object) {
	object.parentNode.removeChild(object);
}

