
// This is the base page controller class. Since we are only using basic
// inheritence, the constructor must only set value and define other methods.
// The constructor will not be called with arguments.
function PageControllerClass(){
	// This defined whether or not the form is busy. This will prevent the 
	// user from submitting the form while still uploading a photo or trying 
	// to upload twice.
	this.PageBusy = false;
}


// Alerts the busy message.
PageControllerClass.prototype.AlertBusy = function(){
	alert( "The page is currently busy, please be patient" );
}


// Gets the current busy flag.
PageControllerClass.prototype.GetBusy = function(){
	return( this.PageBusy );
}


// Sets the current busy flag.
PageControllerClass.prototype.SetBusy = function( blnBusy ){
	this.PageBusy = blnBusy;
}
	
	
// Shows the array of API errors.
PageControllerClass.prototype.ShowAPIErrors = function( arrErrors, blnStayBusy ){
	var strResponse = (
		"Please review the following:\n\n" +
		arrErrors.join( "\n" )
		);
	
	// Alert errors.
	alert( strResponse );
	
	// We are going to assume that after alerting errors, we want to
	// turn off the busy flag. However, use the optional argument to 
	// bypass this mechanism.
	if (!blnStayBusy){
		this.SetBusy( false );
	}
}