﻿function CalObject(startdate, enddate, tds)
{
	this.startdate = startdate;
	this.enddate = enddate;
	this.tds = tds;
}

function handleMouseover(fromdate)
{
	if (arrBooking[fromdate]) {
		var tds = arrBooking[fromdate].tds;
		for (var i = 0; i < tds.length; i++) {
			var tdEl = document.getElementById(tds[i]);
			if (tdEl != null) {
				tdEl.setAttribute("oc", tdEl.style.backgroundColor);
				tdEl.style.backgroundColor = "#FF0000";
			}
		}
	}
	window.status = fromdate;
}

function handleMouseout(fromdate)
{
	if (arrBooking[fromdate]) {
		var tds = arrBooking[fromdate].tds;
		for (var i = 0; i < tds.length; i++) {
			var tdEl = document.getElementById(tds[i]);
			if (tdEl != null) {
				tdEl.style.backgroundColor = tdEl.getAttribute("oc", tdEl.style.backgroundColor);
				tdEl.removeAttribute("oc");
			}
		}
	}
	window.status = "";
}

function currency(anynum) 
{
	var price = String(parseInt(anynum * 100));
	return price.length > 5 ? price.replace(/(\d*)(\d{3})(\d{2})/, "$1.$2,$3") : price.replace(/(\d*)(\d{2})/, "$1,$2");
}
