
var artilinki = {};
artilinki.options = {
  user: {
    culture: "en"
  },

  lightbox: {
    login_url     : "/signin/ajax_login",
    homepage_url    : "/en/home",
    secure_access_url : "/en/space/secure_access/",
    login_title   : "Access for those under the age of 16: Identification required",
    confirmation_default_message : "Are you sure?",
    verification_code : "Verification code required",
    auth_required : "Identification required"
  },     
  
  error_404: "We're sorry, but the page no longer exists:",
  error_500: "We're sorry, but an error has occurred:",     
  error_401: "We're sorry, but an error has occurred:",
  error401: "Sorry but you must be logged in to access this page.",
  error_redirect: "Redirect cannot be processed due to missing setting in the URL. You will be redirected to the home page.", 
  tiny_keywords_def_val: "Your search",
  url_ajax_request: "/en/ajaxrequest/",
  url_abs_root: "/",
  confirm: "confirm",
  cancel: "cancel",
  add_affiliate_btn: "Add an event",
  add_around_btn: "Add",
  register_space_type_url: "/en/register_space_type",
  
  space: {
    space_profile_resources_message: "Enter your resources here in the form of keywords",
    space_profile_needs_message: "Enter your needs here in the form of keywords",
    space_profile_siteurl_message: "Enter one or more urls separated by commas",
    space_available_characters: "%d remaining character(s)",
    space_error_members_in_group: "You must delete all the members of your team before",
    experience_edit_label: "Change my length of experience",
    experience_add_label: "Add your experience information",
    close_player: "turn off the player"
  },
  
  live: {
    play_state_label: "Start scroll",
    pause_state_label: "Stop scroll"
  },
  
  briefcase: {
    alerts_empty_part1: "You have no alerts at this time!",
    alerts_empty_part2: "Alerts will keep you from missing out on any of the items contained in your favorites.",
    alerts_empty_link: "manage my alerts",
    alerts_empty_url: "/en/parameters/preferences#alerts",
    fav_empty_part1: "Too bad you don't have any favorites yet!",
    fav_empty_part2: "Follow the latest news in the arts live by adding as many items as you would like here: profiles, albums, events, projects or media!"
  },
  
  crop: {
    error_select_crop_zone : "Please select a photo area before saving.",
    error_upload_before : "Please upload image, then select an area before saving."
  },
  
  upload: {
    error_valid_form: "Before validating the form, make sure you have:\n- properly sent your file and that the send is complete (this can take a while).\n- or specified the embed tag for your media file.",
    error_valid_form2: "Before submitting the form, make sure you have sent your file, and sending is completed.",
    ENCODING: "Your file is being processed. It will be posted shortly.",
    ERROR_ENCODING: "Your file%s could not be published. It probably contained errors.",
    ERROR_QUOTA: "You do not have enough free disk space to save your file%s.",
    EMBED: "You are currently using an embed tag for this media file.",
    FILE: "This medium uses the file%s.",
    ERROR_WIDGET: "An error has occurred on the page. Please try to update it.",
    dynamic_POSTED: "Your file%s has been sent. It will be added to your media as soon as you have saved the changes.",
    dynamic_SIZE_EXCEEDS: "The authorized size limit is %s, %s for images.",
    dynamic_ERROR_QUOTA: "You do not have enough free disk space to save your file.",
    dynamic_ERROR_MIME_TYPE: "The site does not support this file format.",
    dynamic_ERROR_CHANGE_MIME_TYPE: "This type of file is not compatible with that of the media pending.",
    dynamic_ERROR_TEMP_QUOTA_OVERFLOW: "An error has occurred: you have exceeded the temporary disk space usage quota. Please wait until any encoding under way is finished. This problem can also arise if you have cancelled an upload while it is in progress. Please wait 24 hours.",
    dynamic_ERROR_MOVING_FILE: "Your file cannot be processed: an error occurred during the transfer.",
    dynamic_ERROR: "An error occurred when sending your file. Please try again.",
    NO_FILE: "You have not actually uploaded any files for this media.",
    BUTTON_LABEL: "Browse",
    UPLOAD_CANCELLED: "Upload cancelled.",
    UPLOAD_BEGIN: "Upload started...",
    UPLOAD_PROGRESS: "Upload in progress...",
    UPLOAD_FINISH: "File saving...",
    UPLOAD_COMPLETE: "Upload completed."
  },
  
  mge: {
    loading: "Downloading...",
    all_gender: "All genres",
    add_gender: "Add a genre (max %d)",
    remove: "DELETE",
    add_medium: "ADD A CREATIVE FIELD",
    gender_already_selected : "Error: this genre is already selected.",
    medium_already_selected : "Error: this discipline is already selected.",
    too_mediums : "Error: you cannot have more than %d different disciplines on your profile.",
    info_max_medium : "maximum: %d creative fields",
    widget_error: "WidgetMGE Error: unable to find form with id='%d'.\nPlease check your code of <form> tag."
  },
  
  search: {
    keywords_def_val: "YOUR SEARCH",
    creation_date: "Date of album",
    creation_title: "Title of album",
    event_date: "Date of event",
    event_title: "Title of event",
    project_date: "Date of project",
    project_title: "Title of project",
    activity_date: "Date",
    activity_title: "Title",
    author_experience: "Artist's experience...",
    experience: "Length of experience...",
    support: "Medium",
    media_name: "Name of media file",
    space_name: "Name of profile",
    type: "Type",
    activity: "Album"
  },
  
  filemanager: {
    link_media_url: "/filemanager/link_media",
    unlink_media_url: "/filemanager/unlink_media",
    link_media_group_url: "/filemanager/link_media_group",
    activity_lefter_url: "/en/filemanager/activity_lefter",
    activities_lefter_url: "/en/filemanager/activities_lefter",
    activity_medias_url: "/en/filemanager/activity_medias",
    ajax_error: "/en/filemanager/ajax_error",
    media_create_url: "/en/media/create",
    delete_media_url: "/en/filemanager/delete_media",
    show_activities_url: "/en/filemanager/show_activities",
    remove_banner_url: "/filemanager/remove_banner",
    activity_medias_label: "Non utilisé",
    activity_all_medias_label: "All media",
    project_medias_label: "Project media",
    news_medias_label: "Event media",
    creation_medias_label: "Album media"
  },

  listing: {
    more_url: "/en/objects/listing",
    sort_medias: "/objects/sort_medias",
    sort_activities: "/objects/sort_activities"
  }
  
};

/**
 *
 * Javascript sprintf
 * http://www.webtoolkit.info/
 * %% – Returns a percent sign
 * %b – Binary number
 * %c – The character according to the ASCII value
 * %d – Signed decimal number
 * %f – Floating-point number
 * %o – Octal number
 * %s – String
 * %x – Hexadecimal number (lowercase letters)
 * %X – Hexadecimal number (uppercase letters)
 * Additional format values. These are placed between the % and the letter (example %.2f):
 * + (Forces both + and – in front of numbers. By default, only negative numbers are marked)
 * – (Left-justifies the variable value)
 * 0 zero will be used for padding the results to the right string size
 * [0-9] (Specifies the minimum width held of to the variable value)
 * .[0-9] (Specifies the number of decimal digits or maximum string length)
 **/

sprintfWrapper = {
 
  init : function () {
 
    if (typeof arguments == "undefined") { return null; }
    if (arguments.length < 1) { return null; }
    if (typeof arguments[0] != "string") { return null; }
    if (typeof RegExp == "undefined") { return null; }
 
    var string = arguments[0];
    var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);
    var matches = new Array();
    var strings = new Array();
    var convCount = 0;
    var stringPosStart = 0;
    var stringPosEnd = 0;
    var matchPosEnd = 0;
    var newString = '';
    var match = null;
 
    while (match = exp.exec(string)) {
      if (match[9]) { convCount += 1; }
 
      stringPosStart = matchPosEnd;
      stringPosEnd = exp.lastIndex - match[0].length;
      strings[strings.length] = string.substring(stringPosStart, stringPosEnd);
 
      matchPosEnd = exp.lastIndex;
      matches[matches.length] = {
        match: match[0],
        left: match[3] ? true : false,
        sign: match[4] || '',
        pad: match[5] || ' ',
        min: match[6] || 0,
        precision: match[8],
        code: match[9] || '%',
        negative: parseInt(arguments[convCount]) < 0 ? true : false,
        argument: String(arguments[convCount])
      };
    }
    strings[strings.length] = string.substring(matchPosEnd);
 
    if (matches.length == 0) { return string; }
    if ((arguments.length - 1) < convCount) { return null; }
 
    var code = null;
    var match = null;
    var i = null;
 
    for (i=0; i < matches.length; i++) {
 
      if (matches[i].code == '%') { substitution = '%' }
      else if (matches[i].code == 'b') {
        matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2));
        substitution = sprintfWrapper.convert(matches[i], true);
      }
      else if (matches[i].code == 'c') {
        matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument)))));
        substitution = sprintfWrapper.convert(matches[i], true);
      }
      else if (matches[i].code == 'd') {
        matches[i].argument = String(Math.abs(parseInt(matches[i].argument)));
        substitution = sprintfWrapper.convert(matches[i]);
      }
      else if (matches[i].code == 'f') {
        matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6));
        substitution = sprintfWrapper.convert(matches[i]);
      }
      else if (matches[i].code == 'o') {
        matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8));
        substitution = sprintfWrapper.convert(matches[i]);
      }
      else if (matches[i].code == 's') {
        matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length)
        substitution = sprintfWrapper.convert(matches[i], true);
      }
      else if (matches[i].code == 'x') {
        matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16));
        substitution = sprintfWrapper.convert(matches[i]);
      }
      else if (matches[i].code == 'X') {
        matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16));
        substitution = sprintfWrapper.convert(matches[i]).toUpperCase();
      }
      else {
        substitution = matches[i].match;
      }
 
      newString += strings[i];
      newString += substitution;
 
    }
    newString += strings[i];
 
    return newString;
  },
 
  convert : function(match, nosign){
    if (nosign) {
      match.sign = '';
    } else {
      match.sign = match.negative ? '-' : match.sign;
    }
    var l = match.min - match.argument.length + 1 - match.sign.length;
    var pad = new Array(l < 0 ? 0 : l).join(match.pad);
    if (!match.left) {
      if (match.pad == "0" || nosign) {
        return match.sign + pad + match.argument;
      } else {
        return pad + match.sign + match.argument;
      }
    } else {
      if (match.pad == "0" || nosign) {
        return match.sign + match.argument + pad.replace(/0/g, ' ');
      } else {
        return match.sign + match.argument + pad;
      }
    }
  }
}
 
sprintf = sprintfWrapper.init;

