/**
* Common Messages
*/
var LBL = {
	TO:"Friend Email Address ",
	SUBJECT: "Subject",
	MESSAGE: "Message",
	KEYWORD: "KeyWord",
	EMAILS : "Emails",
	TITLE:"Title",
	LOCATION:"Location",
	VISIBLETO:"Visible To",
	ID: "id",
	NAME: "Name",
	REVIEW: "Review",
	PRIMARY :"Primary",
	TOP :"Top",
	SUB :"Sub",
	CATEGORY :"Category",
	COMMENT:"Comment",
	DESCRIPTION: "Description",
	STATUS: "Status",
	FIRST: "First",
	LAST: "Last",
    RSS:"Rss",
	ADDRESS1: "Address1",
	APPROVAL: "Approval",
	CITY: "City",
	ZIP: "Zip",
	GENDER: "Gender",
	STATE: "State",
	COUNTRY: "Country",
	PASSWORD: "Password",
	CONFIRM: "Confirm",
	LINK: "Link",
	COMMENT: "Comment",
	DISPLAY: "Display",
	YEAR: "Year",
	MONTH: "Month",
	DAY: "Day",
	EXPIRE: "Expire",
	DATE: "Date",
	CONTACT_PERSON: "Contact Person",
	CI_METHOD: "CI Method",
	RATING: "Rating",
	EMAIL: "Email",
	USER: "User",
	USER_NAME: "Username",
	TITLE: "Title",
	SECURITY: "Security Code",
	COMMENT:"Comments",
	LINK:"Link",
	NAME:"Name",
	CREATED_ON:"Created On",
	MESSAGE: "Message",
	WORD: "Word",
	TAG: "Tag",
	URL:"url_parse",
	URL_LINK:"url link",
	FAV:"fav_",
	BOOK:"book",
	MOVIE:"movie",
	MUSIC:"music",
	PEOPLE:"people",
	TVSHOW:"tvshow",
	FRIENDNAME:"Friend Name",
	FILEPATH:"File Path",
	PASSWORD_NOT_LESSTHAN:"Pass Not Less than 6",
	ACTION:"Action",
	ALBUM_NAME: "Album Name"
};

/**
* Common Messages
*/
var XHRState = {
	SUCCESS: "success",
	ERROR: "error"
};

var StatusMsg = {
	REC_ADDEDD: "Record successfully added.",
	REC_MODIFIED: "Record successfully modified.",
	REC_DELETED: "Record(s) successfully deleted.",
	REC_ACTIVATED: "Record successfully activated.",
	REC_DEACTIVATED: "Record successfully deactivated.",
	REC_APPROVED: "Record successfully approved.",
	REC_DISAPPROVED: "Record successfully disapproved.",
	REC_RESTORED: "Record successfully restored.",
	INVALID_PARAMETERS: "Invalid Parameters.",
	INVALID_ACTION: "Invalid Action",
	ERROR: "Error",
	SELECTION_CONFIRMATION: "Please select record(s) to perform the action.",
	SEARCH_RESULT: "Your search for \'%%1\' yielded below result(s).",
	NO_RECORD_FOUND: "oops! No record found. Please try again."
};
	
var MSG = {
	TAG:"You must enter at least one tag.",
	CAT_CANNOT_BLANK:"You must select at least one category.",
	TAG_CANNOT_BLANK:"You must enter at least one tag.”",
	TAG_LENTH:"You cannot enter more than 75 characters of tags.",
	LINK_ACCEPT:"You accepted the link as a good link.",
	LINK_REJECT:"You rejected the link as a bad link.",
	PROCCESSING_REQUEST: "Please wait system is processing your request...",
	BLANK_SPACE: "cannot contain blank space(s) or non-numeric character(s).",	
	MINLENGTH: "%%1 should be at least %%2 characters",
	MAXLENGTH: "%%1 cannot be greater than %%2 characters",
	BLANK: "%%1 cannot be blank",
	KEYWORD_BLANK: "Keywords cannot be blank",
	EMPTY_REVIEW: "Comment cannot be blank.",
	BLANK_INVALID: "%%1 cannot be blank or is invalid",
	VALUE_OF: "Value of",
	VALID_NUMBER: "Value should be a valid number.",
	CONTACT_SYSTEM_ADMIN: "An error has occurred in system. If the error continues Please contact your administrator.",
	FLOAT: "should be a number formatted as 99.99",
	VALID_FLOAT: "is not a valid. The integer part can only hold upto (%%1) digits and decimal part can only hold upto (%%2) digits.",
	BLANK_SPACE: "cannot contain blank space(s) or non-numeric character(s).",
	FLOAT_NON_LENGTH: "%%1 should be a number",
	DATE_COMPARISION: "The event %%1 should be the same or later than the %%2",
	ZIPCODE: "should be a zip code formatted as 00000-0000 or 00000",
	PHONE: "should be a phone number formatted as 000-000-0000",
	NULL: "cannot be blank",
	EMAIL: "Value should be a valid email address (like user@yourdomain.com)",
	SSN: "should be a social security number formatted as 000-00-0000",
	DATE: "should be a date formatted as MM/DD/YYYY",
	TIME: "should be a time formatted as HHMM, where hours (HH) is between 00 and 23 and minutes (MM) is between 00 and 59.",
	PASSWORD_MATCH: "Password and confirmed password do not match",
	PASSWORD_NOT_LESSTHAN: "Please type in a password that has more than 6 characters",
	INVALID_PASSWORD: "Password should have at least one alpha- and one numeric-character and must be between six and twelve characters in length",
	INVALID_USER_ID: "Invalid email address. Please try again.",
	NOT_VALID: "is not valid",
	LOGOUT: "Are you sure you want to logout?",
	SEARCH_CRITERIA_EMPTY: "Please select/enter atleast one search criteria.",
	DELETE_CONFIRMATION: "Are you sure you want to delete the selected record(s)?",
	DELETE_PHOTO_CONFIRMATION: "Are you sure you want to delete the selected photo(s)?",
	DELETE_ALBUM_CONFIRMATION:"Do you want to delete this album ?",
	UPDATE_CONFIRMATION: "Are you sure you want to update the selected record(s)?",
	RESTORE_CONFIRMATION: "Are you sure you want to restore the selected record(s)?",
	OPTION_SELECTION_CONFIRMATION: "Please choose any one of the option(s).",
	SELECTION_CONFIRMATION: "Please select record(s) to perform the action.",
	SELECTION_PHOTO_CONFIRMATION: "Please select photo(s) to perform the action.",
	PLEASE_SELECT: "Please select",
	SELECT_ROLES_FOR_USER: "Select Roles for User",
	PERCENTAGE_CANNOT_BE_MORE_THAN_100: "cannot be more than 100.00",
	SHOULD_BE_GREATER_THAN_EQUAL: "should be greater than or equal to",
	SHOULD_BE_LESS_THAN_EQUAL: "should be less than or equal to",
	INVALID_ATTACHED_FILE: "Attached file is invalid.",
	INVALID: "is invalid",
	FILE_EXT_EMPTY: "File does not contain an extension",
	INVALID_EDITOR_LENGTH: "The content has crossed the limit, please reduce the content. It should be less than 1,600,000 characters.",
	INVALID_IMAGE_VIDEO_FILE: "Please upload image or video files only.",
	INVALID_FILENAME: "A file name cannot contain any of the following characters \\/:*?<>|\"",
	INVALID_FILENAME_IN_FILEPATH: "A file name in file path cannot contain any of the following characters \\/:*?<>|\"",
	LESS_THAN_EQUAL_TO: "Must be less than or equal to",
	PRINT_READY_SECTION_NOT_FOUND: "Could not find the print ready section in the HTML",
	LBL_ASCENDING: "Ascending",
	LBL_DESCENDING: "Descending",
	SELECT_FRIEND: "Please select friend.",
	SELECT_FILE: "Please select file.",
	BLANK_FILE: "Please select the file to upload"
};

/** 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 = sText.trim() + "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;
}

var SPZ_URL={};
