/** 
* Common error message
*
* @author Sachin Gadia
* @version $RCSfile: message.js,v $ $Revision: 1.67 $ $Date: 2006/11/13 13:53:57 $ $Author: sgadia $
*/

/**
* Common Messages
*/

var MINLENGTH_MSG = "%%1 should be at least %%2 characters";
var MAXLENGTH_MSG = "%%1 cannot be greater than %%2 characters";
var BLANK_MSG 	  = "%%1 cannot be blank";
var BLANK_INVALID_MSG = "%%1 cannot be blank or is invalid";
var CONFIRM_DIALOG_TITLE = "Financial Application";
var VALUE_OF = " ";
var NUMERIC_MSG	= "should be a valid number";
var VALID_NUMERIC_MSG= "Value should be a valid number.";
var PERCENT_MESG = "should be a percent formatted as 99.99 (5% would be entered as 0.05)";
var CONTACT_SYSTEM_ADMIN = "An error has occurred in system. If the error continues Please contact your administrator.";
var FLOAT_MSG = "should be a number formatted as 99.99"
var VALID_FLOAT_MSG = "is not a valid. The integer part can only hold upto (%%1) digits and decimal part can only hold upto (%%2) digits.";
var BLANK_SPACE = "cannot contain blank space(s) or non-numeric character(s).";
var FLOAT_NON_LENGTH_MSG = "%%1 should be a number"
var DATE_COMPARISION_MSG = "The event %%1 should be the same or later than the %%2";
var ZIPCODE_MSG   = "should be a zip code formatted as 00000-0000 or 00000";
var PHONE_MSG = "should be a phone number formatted as 000-000-0000";
var NULL_MSG = "is required.";
var EMAIL_MSG = "should be a valid email address (like user@yourdomain.com)"
var SSN_MSG	= "should be a social security number formatted as 000-00-0000";
var DATE_MSG = "should be a date formatted as MM/DD/YYYY";
var TIME_MSG = "should be a time formatted as HHMM, where hours (HH) is between 00 and 23 and minutes (MM) is between 00 and 59.";
var PASSWORD_MATCH_MSG = "Password and confirmed password do not match";
var INVALID_PASSWORD = "Password should have at least one alpha- and one numeric-character and must be between six and twelve characters in length";
var INVALID_USER_ID = "Invalid email address. Please try again.";
var NOT_VALID = "is not valid";
var LOGOUT_MSG ="Are you sure you want to logout?"; 
var SEARCH_CRITERIA_EMPTY_MSG = "Please select/enter atleast one search criteria.";
var BROWSER_NOT_SUPPORTED="CFG's Application is optimized for Internet Explorer 6.0+. If you don't have this installed, it can be found at: <a href='http://www.microsoft.com/windows/ie/ie6/default.mspx'>http://www.microsoft.com/windows/ie/ie6/default.mspx</a>";
//Confirmation message on delete
var CONFIRMATION_MSG = "Are you sure you want to delete the selected record(s)?";
var CONFIRMATION_MOVE_MSG = "Are you sure you want to move the selected record(s)?";
var OPTION_SELECTION_CONFIRMATION_MSG = "Please choose any one of the option(s).";
var SELECTION_CONFIRMATION_MSG = "Please select record(s) to perform the action."
var GROUP_SELECTION_REQURIED_MSG = "Please select a group from the list";
var TOPIC_SELECTION_REQURIED_MSG = "Please select a topic from the list";
var SELECTION_CONFIRMATION_MSG = "Please select record(s) to perform the action.";
var PLEASE_SELECT = "Please select";
var SELECT_ROLES_FOR_USER = "Select Roles for User";
var SELECT_GROUP_FOR_USER = "Select Group for User";
var SELECT_ADDRESS_FROM_ADDRESSLIST = "Please select the address from the address list.";
var SELECT_CONTACT = "Please select contact info.";
var SELECT_OWNED_LEASED = "Please select Owned or Leased from the option.";
var PERCENTAGE_CANNOT_BE_MORE_THAN_100 = "cannot be more than 100.00";
var SHOULD_BE_GREATER_THAN_EQUAL = "should be greater than or equal to";
var SHOULD_BE_LESS_THAN_EQUAL = "should be less than or equal to";
var CALENDAR_TYPE_SELECTION_REQUIRED_MSG="At least one calendar type must be selected."
var CONFIRM_ATTACHMENT_WITH_EVENT="Do you want to attach any documents with this event?";
var CONFIRM_ATTACHMENT_WITH_INV_SECURITY="Do you want to attach any documents with this investment?";
var CONFIRM_ATTACHMENT_ASSOCIATE = "Do you want to attach new documents or associate existing documents? Please select.";
var INVALID_ATTACHED_FILE = "Attached file is invalid.";
var INVALID_PAGE_NUMBER = "Invalid page number.";
var PAGE_OUT_OF_RANGE = "Page out of range.";
var PAGEVALUE_NULL_MSG = "Value of page number cannot be blank.";
var INVALID = "is invalid";
var CONFIRMATION_SECURITY_PERFORMANCE_CHANGE_MSG = "You have changed Performance Tracking option, this will delete the existing performance tracking information and will create new information based on selection type. Do you wish to continue?";
var YEAR_LESS_THAN_CURRENT_YEAR = "should be less than or equal to current year."
var CONFIRMATION_SAVE_SEARCH_MSG = "Do you want to save search?"; 
var FILE_EXT_EMPTY_MSG = "File does not contain an extension";
var INVALID_SELECTION_OF_TOPIC = "Please select a Topic with the same group";
var INVALID_FILE_ENTRY = "Please select at least one file to upload";
var ALERT_ADDING_CONTENT_SECTIONS = "Adding section will remove all your current selection of section. Do you want to continue?";
var INVALID_EDITOR_LENGTH = "The content has crossed the limit, please reduce the content. It should be less than 1,600,000 characters.";
var INVALID_IMAGE_VIDEO_FILE = "Please upload image or video files only.";
var INVALID_FILENAME = "A file name cannot contain any of the following characters \\/:*?<>|\"";
var INVALID_FILENAME_IN_FILEPATH = "A file name in file path cannot contain any of the following characters \\/:*?<>|\"";
var DISABLE_MOUSE_CLICK_ON_PREVIEW_PAGE = "Content of this page is for preview purpose only.";
var SELECT_ALIGNMENT_FOR_IMAGE = "Please select an alignment for selected image.";
var CATEGORY_SELECTION_MSG_TO_ADD_SUBCATEGORY = "Please select category to add its sub category."
var CATEGORY_SELECTION_MSG_TO_ADD_CONTENT = "Please select category to add content page."
var SUM_PERCENTAGE_CANNOT_BE_MORE_THAN_100 = "The sum of percentages cannot be more than 100.00";
var ADDING_STATIC_FOLDER = "You can only add static folder under any static folder. You can not add static folder under personal folder";
var CLASSIFICATION_ROW_ALREADY_EXIST = "This classification detail already exists. Please select another option.";
var EDIT_CLASSIFICATION_SELECTION_MSG = "Please select investment before modifying its classification."
var ACCOUNT_SELECTION_MSG = "Please select account before adding investment."
var LESS_THAN_EQUAL_TO_MSG = "Must be less than or equal to";
var USER_SELECTION_MSG = "Please select recipient from the list.";
var EVENT_NOT_SUPPORTED = "Event Not Supported";
var PRINT_READY_SECTION_NOT_FOUND = "Could not find the print ready section in the HTML";
var LBL_ASCENDING = "Ascending";
var LBL_DESCENDING = "Descending";
/** Function builds a Message from provided arguments
    *  sText : The Bare Message 	 
	*  sSlot1 : Dynamic Slot1 to replace
	*  sSlot2 : Dynamic Slot2 to replace
	*  sSlot3 : Dynamic Slot3 to replace
	*  sSlot4 : Dynamic Slot4 to replace
	*  sSlot5 : Dynamic Slot5 to replace
   */
  function fnGetMessage(sText, sSlot1, sSlot2, sSlot3, sSlot4, sSlot5 ){
     var   cKey   = '\0';
     var   sValue = null;

     sText = fnTrim(sText) + "X";
   
     var nPos = sText.indexOf( "%%" );
     while ( nPos != -1 ){  
        cKey = sText.charAt( nPos + 2 );
        switch ( cKey ){
           case '1' : sValue = sSlot1; break;
           case '2' : sValue = sSlot2; break;
           case '3' : sValue = sSlot3; break;
           case '4' : sValue = sSlot4; break;
           case '5' : sValue = sSlot5; break;
        }
        
        if ( sValue != null ){
           sText = sText.substring( 0, nPos ) + sValue + sText.substring( nPos + 3 ); 
           nPos = sText.indexOf( "%%", nPos + sValue.length );
        }
        else
           nPos = sText.indexOf( "%%", nPos + 2 );
     }
     sText = sText.substring( 0, sText.length - 1 );
     return sText;
}
