var newwindow;
var isDirty = false;

function setDirty()
{
	isDirty = true;
}

function unsetDirty()
{
	isDirty = false;
}

function confirmExit()
{
	if (isDirty) {
		return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. \n\nIT IS HIGHLY RECOMMENDED THAT YOU CLICK CANCEL AND SAVE YOUR CHANGES!!!!";
	}
}

window.onbeforeunload = confirmExit;

function poptastic(url){
	newwindow = window.open(url, "name", "height=500,width=240,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no");
	if (window.focus) {
		newwindow.focus();
	}
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
