/* This is a core package file.  DO NOT EDIT. */

function Frame()
{
    this.isChanged = false;
    this.isRefreshParent = false;
	this.beforeCloseFn = null;
}
 
Frame.prototype.close = function()
{
/* Commenting out for now since check is happening on non-data changing forms.
	if (this.isChanged) {
		nbcu.util.frame.sendEvent('CONFIRM_CANCEL');
		if (!confirm("Are you sure you want to close this window?  You will lose any changes you have made.")) {
			return false;
		}
	}
*/
	try	{
		nbcu.util.frame.sendEvent('CLOSE_FRAME');
		
		if (this.isRefreshParent) {
			nbcu.util.frame.sendEvent('RELOAD_PARENT');
			self.parent.location.reload();
		}

		if (typeof this.beforeCloseFn == 'function') {
			this.beforeCloseFn();
		}
		
		nbcu.util.frame.close();
	}
	catch(err) {}
}

Frame.prototype.redirectParent = function(url)
{
	try	{
		nbcu.util.frame.sendEvent('REDIRECT_PARENT', { redirectUrl: 'url' });
		self.parent.location.href = url;
		nbcu.util.frame.close();
	}
	catch(err){}
}

nbcuFrame = new Frame;

jqN(document).ready(function() {
	var jInput = jqN(":input");
	
	// Bind the onchange event of the inputs
	jInput.change(
		function(objEvent) {
			nbcuFrame.isChanged = true;
		}
	);
});

