function OpenDialog(url)
{
	window.open(url,"","toolbars=no,resizable=no,width=450,height=600");
}

function ConfirmDelete()
{
	return confirm("Are you sure you want to delete this item(s)?");
}

/* This function is used by DatePicker to add header and footer rows */
function addRows(tableId)
{
	var table = document.getElementById(tableId);
	
	if(table != null)
	{
		var headerRow = table.insertRow(1);
		var footerRow = table.insertRow();
		var headerRowCell = headerRow.insertCell();
		var footerRowCell = footerRow.insertCell();
		
		headerRowCell.colSpan = 7;
		headerRowCell.style.padding = 0;
		headerRowCell.innerHTML = "<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">"
									+ "<tr>"
									+ "<td vAlign=\"bottom\">"
									+ "<img src=\"_img/calendar_top_left.gif\" alt=\"Header Left\">"
									+ "</td>"
									+ "<td style=\"BACKGROUND-POSITION-Y: bottom; BACKGROUND-IMAGE: url(_img/calendar_top.gif); BACKGROUND-REPEAT: repeat-x\" width=\"100%\">"
									+ "&nbsp;"
									+ "</td>"
									+ "<td vAlign=\"bottom\">"
									+ "<img src=\"_img/calendar_top_right.gif\" alt=\"Header Right\">"
									+ "</td>"
									+ "</tr>"
									+ "</table>";
		
		footerRowCell.colSpan = 7;
		footerRowCell.style.padding = 0;
		footerRowCell.innerHTML = "<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\">"
									+ "<tr>"
									+ "<td vAlign=\"top\">"
									+ "<img src=\"_img/calendar_bottom_left.gif\" alt=\"Footer Left\">"
									+ "</td>"
									+ "<td style=\"BACKGROUND-POSITION-Y: top; BACKGROUND-IMAGE: url(_img/calendar_bottom.gif); BACKGROUND-REPEAT: repeat-x\" width=\"100%\">"
									+ "&nbsp;"
									+ "</td>"
									+ "<td vAlign=\"top\">"
									+ "<img src=\"_img/calendar_bottom_right.gif\" alt=\"Footer Right\">"
									+ "</td>"
									+ "</tr>"
									+ "</table>";
	}
}

/* This function is used by DatePicker to set the date value in a textbox */
function setDate(controlId, value)
{
	var control = window.opener.document.getElementById(controlId);
	
	if(control != null)
	{
		control.value = value;
	}
	window.close();
}
