function clsCalendar()
{
	this.target;
	this.to;
	this.container;
}

var myCalendar = clsCalendar.prototype = {

	/*
	 * @target - is a reference to the input box that holds our date
	 * @to - is an id of an input box with return date that we change when departure date changes
	 */
	 
	Display: function(target,to)
	{
		if (!target) {return false;}
		
		this.target = target;
		
		var to = document.getElementById(to);
		if (to) {this.to = to;}
		
		if (!this.container){this.container = this.CreateContainer();}
		this.container.innerHTML = this.CreateContent();
		
		document.body.appendChild(this.container);	
		
		this.Position();
		this.Hide();
		
		$(this.container).slideDown(250);
	},
	
	CreateContainer: function()
	{
		var div = document.createElement('div');
		div.style.position = 'absolute';

		return div;
	},

	CreateContent: function()
	{
		return 	'<iframe src="/scripts/calendar/calendar.html" frameborder="0" width="200" height="176" scrolling="no" style="padding:0px;background-color:#ffffff;"></iframe>';
	},
	
	Position: function()
	{
		var offset = $(this.target).offset();
		this.container.style.left = offset.left + 'px';
		this.container.style.top = offset.top + this.target.offsetHeight + 2 + 'px';	
	},
	
	Hide: function()
	{
		if (this.container) {
			$(this.container).hide();
		}
	}

}