// JavaScript Document

$(document).ready(function()
{
	$('#tabs').tabs(
	{
		select: function(event, ui)
		{
			var url = $.data(ui.tab, 'load.tabs');
			if( url )
			{
				location.href = url;
				return false;
			}

			return true;
		}
	});

	var h = $("#rsvunits").height();

	$("#cal_main").height( h );
	$("#cal_div").height( h );

});

function ResCalBookedMouseOver( doc )
{
	doc.style.cursor='pointer';
}

function ResCalBookedMouseOut( doc )
{
}

function ResCalBookedOnClick( doc, type )
{
	if( type ==  110 )
	{
		return;
	}
	else
	{
		strUrl = "http://" + document.domain + "/index.php?root=admin&page=reservations_add&res_id=" + doc.id;

		if( type == 170 )
			strUrl += "&mode=q";

		window.open( strUrl, "_top" );
	}
}

function ResCalOpenOnClick( date )
{
	var strUrl = "http://" + document.domain + "/index.php?root=admin&page=reservations_add&date_start=" + date ;

	window.open( strUrl, "_top" );
}

function changeTab()
{
	var sel_tab = $("#sel_tab").val();

	$("#tabs").tabs({selected: sel_tab});
}

function confirmDelete()
{
	var agree=confirm("Are you sure you wish to delete this entry?");
	if (agree)
		return true ;
	else
		return false ;
}

function resizePage( addHeight )
{
	var h = 0;
	var ht = 0;
	var y = addHeight * 1;

   var main = document.getElementById( 'main' );

   if( main.style.offsetHeight )
		h = main.style.offsetHeight;
	else if( main.style.pixelHeight )
		h = main.style.pixelHeight;
   else
		h = main.clientHeight;

	ht = h + y;

	document.getElementById( 'main' ).style.height =  ht;
}

