ContentAddModule = function()
{
  this.sTitle = null;
  this.sName = null;
  this.sImportanceLevel = null;
  this.bValidated = false;
  this.sValidationFunction = null;
  this.sPromptMessage = null;
  this.aErrorMessages = null;
  this.sGroupId = null;
  
  this.IMPORTANCE_LEVEL_REQUIRED = 'IMPORTANCE_LEVEL_REQUIRED'; //Must be filled out before save
  this.IMPORTANCE_LEVEL_PROMPT = 'IMPORTANCE_LEVEL_PROMPT';   //Ask if user would like to fill out
  
  
  this.setTitle = function( sTitle )
  {
    this.sTitle = sTitle;
  };
  
  this.getTitle = function()
  {
    return this.sTitle;
  };
  
  this.setName = function( sName )
  {
    this.sName = sName;
  };
  
  this.getName = function()
  {
    return this.sName;
  };
  
  this.setView = function( oView )
  {
    this.oView = oView;
  };
  
  this.getView = function()
  {
    return this.oView;
  };
  
  this.setValidated = function( bValidated )
  {
    this.bValidated = bValidated;
  };
  
  this.isValidated = function()
  {
    return this.bValidated;
  };
  
  this.setValidationFunction = function( sValidationFunction )
  {
    this.sValidationFunction = sValidationFunction;
  };
  
  this.getPromptMessage = function()
  {
    return this.sPromptMessage;
  };
  
  this.setPromptMessage = function( sPromptMessage )
  {
    this.sPromptMessage = sPromptMessage;
  };
  
  this.getGroupId = function()
  {
    return this.sGroupId;
  };
  
  this.setGroupId = function( sGroupId )
  {
    this.sGroupId = sGroupId;
  };

  this.getErrorMessages = function()
  {
    return this.aErrorMessages;
  }
  
  this.setErrorMessages = function( aErrorMessages)
  {
    return this.aErrorMessages = aErrorMessages;
  }
  
  this.setRequired = function()
  {
    this.sImportanceLevel = this.IMPORTANCE_LEVEL_REQUIRED;
  };

  this.setPrompt = function()
  {
    this.sImportanceLevel = this.IMPORTANCE_LEVEL_PROMPT;
  };
  
  this.clearPrompt = function()
  {
    if( this.isPrompt() )
    {
      this.sImportanceLevel = null;
      var e =1;
    }
  }
  
  this.isRequired = function()
  {
    if( typeof this.sImportanceLevel == 'string' && this.sImportanceLevel != null )
    {
      if( this.sImportanceLevel == this.IMPORTANCE_LEVEL_REQUIRED )
      {
        return true;
      }
    }
    return false;
  };

  this.isPrompt = function()
  {
    if( typeof this.sImportanceLevel == 'string' && this.sImportanceLevel != null )
    {
      if( this.sImportanceLevel == this.IMPORTANCE_LEVEL_PROMPT )
      {
        return true;
      }
    }
    return false;
  };
  
  this.validate = function()
  {
    if( typeof this.sValidationFunction == 'string' && this.sValidationFunction != null && this.sValidationFunction != '' )
    {
      var bRequired = false;
      if( this.sImportanceLevel === this.IMPORTANCE_LEVEL_REQUIRED )
      {
        bRequired = true;
      }
      this.aErrorMessages = new Array();
      this.aErrorMessages = window[ this.sValidationFunction ]( bRequired, this.oView );
      if( typeof this.aErrorMessages != 'undefined' && this.aErrorMessages instanceof Array && this.aErrorMessages.length > 0 )
      {
        this.bValidated = false;
      }
      else
      {
        this.bValidated = true;
      }
      
    }
    else
    {
      this.bValidated = true;
    }
    return this.bValidated;
  };

};

ModuleTab = function()
{
    this.sTitle = null;
    this.sName = null;
    this.sTabBarName = null;
    this.oView = null;
  
  this.setTitle = function( sTitle )
  {
    this.sTitle = sTitle;
    if( typeof this.oView != 'undefined' && this.oView != null )
    {
      this.oView.text( sTitle );
    }
  };
  
  this.getTitle = function()
  {
    return this.sTitle;
  };
  
  this.setName = function( sName )
  {
    this.sName = sName;
  };
  
  this.getName = function()
  {
    return this.sName;
  };
  
  this.setView = function( oView )
  {
    this.oView = oView;
    if( this.oView.text() != null && this.oView.text() != '' )
    {
      this.sTitle = this.oView.text();
    }
  };
  
  this.getView = function()
  {
    return this.oView;
  };
  
  this.setTabBarName = function( sTabBarName )
  {
    this.sTabBarName = sTabBarName;
  };
  
  this.getTabBarName = function()
  {
    return this.sTabBarName;
  };
  
  this.setRequired = function( bRequried )
  {
    if( bRequried )
    {
      this.oView.addClass( 'required' );
    }
    else
    {
      this.oView.removeClass( 'required' );
    }
  }
  
};