function JScript()
{
	this._ajaxurl = 'gift_registry.php';
	this._timeOut = null;
	
	this._dg = null;
	this._numRecords = 10;
	this._isDynamic = true;
	
	$('#start_date').datepicker({
		buttonImage:		'images/cal.gif',
		buttonImageOnly:	true,
		buttonText:			'Select Date',
		showOn:				'both',
		showStatus:			true,
		dateFormat:			'dd/mm/yy'
	})
	.attr('readonly', true);
	$('#end_date').datepicker({
		buttonImage:		'images/cal.gif',
		buttonImageOnly:	true,
		buttonText:			'Select Date',
		showOn:				'both',
		showStatus:			true,
		dateFormat:			'dd/mm/yy'
	})
	.attr('readonly', true);
}
JScript.prototype.showError = function(errors)
{
	var obj = this;
	$('.errors:eq(1)').html(obj.formatErrors(errors.errors)).slideDown(500);
	if (errors.fields.length > 0)
	{
		$(errors.fields.join(',')).addClass('wrongBox');
	}
	$.scrollTo('#edit-cms-grid', 500);
}
JScript.prototype.formatErrors = function(errors)
{
	return '<ul><li>' + errors.join('</li>\n<li>') + '</li></ul>'
}
JScript.prototype.loading = function(text)
{
	$.unblockUI();
	$.blockUI({
		message: '<p style="margin:3px 0px 2px 0px;">' + text + '</p><br clear="all" /><p style="margin:2px 0px 3px 0px;"><img src="' + $('#loading').attr('src') + '" alt="Loading..." title="Loading..." /></p>',
		css: {
			color: '#000000',
			'font-size': '12px',
			border: '1px #CCCCCC dashed',
			padding: '10px 3px',
			opacity: 0.5
		}
	});
}