
//WhoWeAre main JS.
var whoweare =
{
  sortOptions : {
    RAND: 'random',
    DATE_POSTED: 'date_posted',
    TITLE: 'title',
    LITERAL: 'literal',
    NONE: 'none',
    DEFAULT_PAGESIZE: 64,
    PAGESIZE_128: 128,
    PAGESIZE_64: 64,
    PAGESIZE_32: 32,
    MAX_PAGESIZE: 500,
    DEFAULT_PAGE:1
  },
  searchParams : {
    DEFAULT_PRIVACY: 0,
    DEFAULT_FILTER: 'all'
  },
  filters: {
    ALL:'all',
    PUBLIC:'public',
    PRIVATE:'private',
    INCOMPLETE:'incomplete',
    RECENT:'recent'
  },

  SUCCESS:1,
  ERROR:0,
  
  WWA_VIDEO_PENDING: 0, 
  WWA_VIDEO_ENCODING: 2, 
  WWA_VIDEO_ENCODED: 5, 
  WWA_VIDEO_ABUSIVE: 10, 
  WWA_VIDEO_PUBLIC: 20, 
  WWA_VIDEO_FLAGGED: 30, 
  
  lang: 'en',
  //Configuration, injected.
  config: {},
  //URL map, injected.
  urlmap: {},
  //Labels, injected.
  labels: {},
  //API holder
  api: {
    user: {},
    video: {},
    location: {}, 
    comment: {}, 
    news : {}, 
    newsletter : {}, 
    pager_endpoints: {}
  }
};



whoweare.config['contact_email'] = "info@whoweare.ca";
whoweare.config['relative_root'] = "";
whoweare.config['http_root'] = "http://whoweare.ca";
whoweare.config['img_path'] = "http://whoweare.ca/static/images";
whoweare.config['rss_global_path'] = "http://whoweare.ca/static/global_rss.xml";
whoweare.config['rss_video_path'] = "http://whoweare.ca/static/video_rss.xml";
whoweare.config['rss_blog_path'] = "http://whoweare.ca/blog/feed";
whoweare.config['video_player_url'] = "http://whoweare.ca/static/swf/WWA.swf";
whoweare.config['upload_maxfiles'] = "200";
whoweare.config['upload_maxsize'] = "8MB";
whoweare.config['host'] = "whoweare.ca";

whoweare.urlmap['root'] = "";
whoweare.urlmap['home'] = "/home";
whoweare.urlmap['app_credits'] = "/credits";
whoweare.urlmap['app_about'] = "/about";
whoweare.urlmap['app_lang'] = "/language";
whoweare.urlmap['app_lang_en'] = "/language/en";
whoweare.urlmap['app_lang_fr'] = "/language/fr";
whoweare.urlmap['app_blog'] = "/blog";
whoweare.urlmap['app_blog_post'] = "/blog/post";
whoweare.urlmap['app_blog_upload'] = "/blog/wp-content/uploads";
whoweare.urlmap['app_podcast'] = "/podcast";
whoweare.urlmap['app_videos'] = "/videos";
whoweare.urlmap['app_videos_recent'] = "/videos/recent";
whoweare.urlmap['app_videos_popular'] = "/videos/popular";
whoweare.urlmap['app_videos_location'] = "/videos/location";
whoweare.urlmap['app_videos_news'] = "/videos/news";
whoweare.urlmap['app_videos_imports'] = "/videos/imports";
whoweare.urlmap['app_videos_search'] = "/videos/search";
whoweare.urlmap['app_videos_tags'] = "/videos/tags";
whoweare.urlmap['app_profile'] = "/profile";
whoweare.urlmap['app_profile_edit'] = "/profile/edit";
whoweare.urlmap['app_profile_videos'] = "/profile/videos";
whoweare.urlmap['app_profile_upload'] = "/profile/upload";
whoweare.urlmap['app_profile_import'] = "/profile/import";
whoweare.urlmap['app_profile_favorites'] = "/profile/favorites";
whoweare.urlmap['app_profile_comments'] = "/profile/comments";
whoweare.urlmap['app_profile_post_upload'] = "/profile/post_upload";
whoweare.urlmap['app_signup'] = "/signup";
whoweare.urlmap['app_signin'] = "/signup/signin";
whoweare.urlmap['app_signout'] = "/signup/signout";
whoweare.urlmap['app_reminder'] = "/signup/reminder";
whoweare.urlmap['app_rss'] = "/rss";
whoweare.urlmap['app_rss_global'] = "/rss";
whoweare.urlmap['app_rss_videos'] = "/rss/videos";
whoweare.urlmap['app_rss_vcomments'] = "/rss/vcomments";
whoweare.urlmap['app_rss_blog'] = "/blog/feed";
whoweare.urlmap['app_contact'] = "/contact";
whoweare.urlmap['app_help'] = "/help";
whoweare.urlmap['app_conditions'] = "/conditions";
whoweare.urlmap['app_confidentiality'] = "/confidentiality";
whoweare.urlmap['app_farm'] = "/farm";
whoweare.urlmap['app_farm_videos'] = "/farm/videos";
whoweare.urlmap['app_farm_thumbs'] = "/farm/thumbs";
whoweare.urlmap['app_farm_users'] = "/farm/users";
whoweare.urlmap['tools_jsconfig'] = "/tools/jslib.js";
whoweare.urlmap['api_json'] = "/json";

whoweare.labels['F1'] = "My profile";
whoweare.labels['F2'] = "My videos";
whoweare.labels['F3'] = "Propose a video";
whoweare.labels['F4'] = "My favourites";
whoweare.labels['F5'] = "My comments";
whoweare.labels['F6'] = "My profile";
whoweare.labels['F7'] = "Welcome";
whoweare.labels['F8'] = "close";
whoweare.labels['F9'] = "Add a video";
whoweare.labels['F10'] = "My favourites";
whoweare.labels['F11'] = "?";
whoweare.labels['F12'] = "More";
whoweare.labels['F13'] = "My comments";
whoweare.labels['F14'] = "?";
whoweare.labels['F15'] = "About";
whoweare.labels['F16'] = "?";
whoweare.labels['F17'] = "?";
whoweare.labels['F18'] = "Alias";
whoweare.labels['F19'] = "?";
whoweare.labels['F20'] = "Password";
whoweare.labels['F20_2'] = "Rep. password";
whoweare.labels['F21'] = "Change";
whoweare.labels['F22'] = "Avatar";
whoweare.labels['F23'] = "Browse";
whoweare.labels['F24'] = "?";
whoweare.labels['F25'] = "Contact";
whoweare.labels['F26'] = "Email";
whoweare.labels['F27'] = "?";
whoweare.labels['F28'] = "Telephone";
whoweare.labels['F29'] = "?";
whoweare.labels['F30'] = "Postal adress";
whoweare.labels['F31'] = "?";
whoweare.labels['F32'] = "City";
whoweare.labels['F33'] = "Select";
whoweare.labels['F34'] = "Province, state or territory";
whoweare.labels['F35'] = "?";
whoweare.labels['F36'] = "Country";
whoweare.labels['F37'] = "?";
whoweare.labels['F38'] = "Origins and destinations";
whoweare.labels['F39'] = "Origins";
whoweare.labels['F40'] = "?";
whoweare.labels['F41'] = "?";
whoweare.labels['F42'] = "Destinations";
whoweare.labels['F43'] = "?";
whoweare.labels['F44'] = "Interests";
whoweare.labels['F45'] = "?";
whoweare.labels['F46'] = "Close account";
whoweare.labels['F47'] = "Update";
whoweare.labels['F48'] = "?";
whoweare.labels['F49'] = "?";
whoweare.labels['F50'] = "Original videos";
whoweare.labels['F51'] = "Related videos";
whoweare.labels['F52'] = "Send to a friend";
whoweare.labels['F53'] = "Add this video to";
whoweare.labels['F54'] = "Posted on";
whoweare.labels['F56'] = "Remove";
whoweare.labels['F57'] = "Change";
whoweare.labels['F58'] = "?";
whoweare.labels['F59'] = "Submit a video";
whoweare.labels['F60'] = "Post your video";
whoweare.labels['F61'] = "Add a video link";
whoweare.labels['F62'] = "Video file";
whoweare.labels['F63'] = "?";
whoweare.labels['F64'] = "?";
whoweare.labels['F65'] = "Loading";
whoweare.labels['F66'] = "Cancel";
whoweare.labels['F67'] = "?";
whoweare.labels['F68'] = "?";
whoweare.labels['F69'] = "Estimated wait";
whoweare.labels['F70'] = "Video";
whoweare.labels['F70_2'] = "Videos";
whoweare.labels['F71'] = "Erase and start over";
whoweare.labels['F72'] = "File name";
whoweare.labels['F73'] = "Duration";
whoweare.labels['F74'] = "Size";
whoweare.labels['F75'] = "Choose an image";
whoweare.labels['F76'] = "Title";
whoweare.labels['F77'] = "Description";
whoweare.labels['F78'] = "Tags";
whoweare.labels['F79'] = "Subject info";
whoweare.labels['F79_2'] = "Name(s)";
whoweare.labels['F80'] = "Director info";
whoweare.labels['F81'] = "I am the subject";
whoweare.labels['F82'] = "I am the director";
whoweare.labels['F83'] = "Name(s)";
whoweare.labels['F84'] = "?";
whoweare.labels['F85'] = "In Canada since";
whoweare.labels['F86'] = "?";
whoweare.labels['F87'] = "?";
whoweare.labels['F88'] = "Destinations";
whoweare.labels['F89'] = "?";
whoweare.labels['F90'] = "Born in Canada";
whoweare.labels['F90_2'] = "Immigrated in";
whoweare.labels['F91'] = "years";
whoweare.labels['F92'] = "?";
whoweare.labels['F93'] = "Save";
whoweare.labels['F94'] = "Thank you. Your video has been succesfully submitted.";
whoweare.labels['F95'] = "My favourite videos";
whoweare.labels['F96'] = "favourite videos";
whoweare.labels['F97'] = "Remove from favourites ";
whoweare.labels['F98'] = "?";
whoweare.labels['F99'] = "participations to discussions";
whoweare.labels['F100'] = "Comments on";
whoweare.labels['F101'] = "Your comments";
whoweare.labels['F102'] = "Public profile";
whoweare.labels['F103'] = "?";
whoweare.labels['F104'] = "?";
whoweare.labels['F105'] = "?";
whoweare.labels['F106'] = "Reacting to";
whoweare.labels['F107'] = "Read in context";
whoweare.labels['F108'] = "In answer to";
whoweare.labels['F109'] = "Nickname";
whoweare.labels['F110'] = "Personal Informations";
whoweare.labels['F111'] = "Born in";
whoweare.labels['F112'] = "Lived in";
whoweare.labels['F113'] = "Resides in";
whoweare.labels['F114'] = "To see more";
whoweare.labels['F115'] = "?";
whoweare.labels['F116'] = "Submit";
whoweare.labels['F117'] = "Add";
whoweare.labels['F118'] = "Video title";
whoweare.labels['F119'] = "?";
whoweare.labels['F120'] = "Add a video online";
whoweare.labels['F121'] = "Download your video";
whoweare.labels['F122'] = "Previous post";
whoweare.labels['F123'] = "Next post";
whoweare.labels['F124'] = "Recent comments";
whoweare.labels['F125'] = "Previous comments";
whoweare.labels['F126'] = "Add to my favourites";
whoweare.labels['F126_2'] = "Remove from my favourite";
whoweare.labels['F127'] = "Favourites";
whoweare.labels['F128'] = "Share";
whoweare.labels['F129'] = "Bookmarked videos";
whoweare.labels['F130'] = "Erase";
whoweare.labels['F131'] = "Viewed video";
whoweare.labels['F132'] = "times";
whoweare.labels['F133'] = "Promote your content";
whoweare.labels['F134'] = "Import a video";
whoweare.labels['F135'] = "Video url";
whoweare.labels['F135_2'] = "Video url (optional)";
whoweare.labels['F136'] = "Detection of video file";
whoweare.labels['F137'] = "At this time, the URLs of the following sites are supported.";
whoweare.labels['F138'] = "Note";
whoweare.labels['F139'] = "Invalid URL";
whoweare.labels['F140'] = "Image that will represent this video on the site.";
whoweare.labels['F141'] = "No corresponding video for the stated url. Please verify the url and start the import again.";
whoweare.labels['F142'] = "Posted by";
whoweare.labels['F143'] = "At";
whoweare.labels['F144'] = "See news for";
whoweare.labels['F145'] = "The news";
whoweare.labels['F146'] = "Read full article on original site";
whoweare.labels['F147'] = "Author";
whoweare.labels['F148'] = "Remove";
whoweare.labels['F149'] = "Comments";
whoweare.labels['F149_2'] = "Comment by";
whoweare.labels['F150'] = "Uploaded";
whoweare.labels['F151'] = "Subject";
whoweare.labels['F152'] = "Director";
whoweare.labels['F153'] = "Content type";
whoweare.labels['F154'] = "videos related to your search";
whoweare.labels['F155'] = "Close this message";
whoweare.labels['F156'] = "To begin, choose a news item in the top menu";
whoweare.labels['F157'] = "Portraits of Canadians coming for this region will appear here, contextualizing their stories.";
whoweare.labels['F158'] = "Member since";
whoweare.labels['F159'] = "Comments on blog entry";
whoweare.labels['F160'] = "In response to blog entry";
whoweare.labels['F161'] = "In response to video";
whoweare.labels['F162'] = "Comment";
whoweare.labels['F163'] = "Add a comment";
whoweare.labels['F164'] = "RSS feed for comments";
whoweare.labels['F165'] = "News";
whoweare.labels['F166'] = "Send";
whoweare.labels['F167'] = "Blog";
whoweare.labels['F168'] = "Last posts";
whoweare.labels['F169'] = "See all recent posts";
whoweare.labels['F170'] = "Profiles";
whoweare.labels['F171'] = "Search results";
whoweare.labels['F172'] = "Search in blog";
whoweare.labels['F173'] = "Leave a comment";
whoweare.labels['F174'] = "for :";
whoweare.labels['F175'] = "Connection";
whoweare.labels['F176'] = "Contact us";
whoweare.labels['F177'] = "Subscribe";
whoweare.labels['F178'] = "Help";
whoweare.labels['F179'] = "Terms of use";
whoweare.labels['F180'] = "Privacy  policy";
whoweare.labels['F181'] = "FAQ";
whoweare.labels['F182'] = "Return to top of page";
whoweare.labels['F183'] = "Connect";
whoweare.labels['F184'] = "I want to create an account";
whoweare.labels['F185'] = "All fields must be filled";
whoweare.labels['F186'] = "I already have an account";
whoweare.labels['F187'] = "Forgot your password?";
whoweare.labels['F188'] = "noussommes.ca";
whoweare.labels['F189'] = "Enter an origine / destination";
whoweare.labels['F190'] = "Hide list";
whoweare.labels['F191'] = "Most popular";
whoweare.labels['F192'] = "No bookmarked videos";
whoweare.labels['F193'] = "No original videos";
whoweare.labels['F194'] = "No videos have been posted";
whoweare.labels['F194_2'] = "No videos in favorites";
whoweare.labels['F195'] = "Written by";
whoweare.labels['F196'] = "Read";
whoweare.labels['F197'] = "times";
whoweare.labels['F198'] = "Read more";
whoweare.labels['F199'] = "Comments";
whoweare.labels['F200'] = "Home";
whoweare.labels['F201'] = "Podcast";
whoweare.labels['F202'] = "My account";
whoweare.labels['F203'] = "You must be connected in order to post.";
whoweare.labels['F204'] = "Display list";
whoweare.labels['F205'] = "Coming soon";
whoweare.labels['F206'] = "Do you want to delete the video?";
whoweare.labels['F207'] = "Yes";
whoweare.labels['F208'] = "No";
whoweare.labels['F209'] = "The video can't be deleted";
whoweare.labels['F210'] = "Previous posts";
whoweare.labels['F211'] = "Recent posts";
whoweare.labels['F212'] = "Your search yielded no results";
whoweare.labels['F213'] = "Modify your terms and relaunch your search";
whoweare.labels['F214'] = "Read the remainder of this post";
whoweare.labels['F215'] = "No article in the blog corresponds to this adress";
whoweare.labels['F216'] = "Most popular posts";
whoweare.labels['F217'] = "search";
whoweare.labels['F218'] = "Whoweare.ca allows you to publish your own original video content or to bookmark existing videos";
whoweare.labels['F219'] = "The information you provide us make your video more accessible to the visitors of whoweare.ca. All fields marked by an asterisk (*) are obligatory.";
whoweare.labels['F220'] = "Fill in all fields to bookmark an existing video on whoweare.ca.";
whoweare.labels['F221'] = "These are the videos you have selected as favortie.";
whoweare.labels['F222'] = "You must be registered to publish videos, links and comments on whoweare.ca. We invite you to provide us with information that will help us locate you on the whoweare.ca world map. You can further personalize your profile by choosing a pseudo and an avatar.";
whoweare.labels['F223'] = "Type the name of the city and country where you were born.";
whoweare.labels['F224'] = "Type the name of the city and province where you currently live.";
whoweare.labels['F225'] = "whoweare.ca is simply, who we are. Canada, first hand, straight up and from the mouths of Canadians. From the fields and trenches of independent film comes the voices of the the new Canada.";
whoweare.labels['F226'] = "<em>Choose</em> a <em>city</em> or a <em>country</em> to view the corresponding videos.";
whoweare.labels['F226_2'] = "No result: <em>Choose</em> am other <em>city</em> or an other <em>country</em> to view the corresponding videos.";
whoweare.labels['F227'] = "These informations allow us to enrich the whoweare.ca world map.";
whoweare.labels['F228'] = "Click here if you are the subject of the video that you wish to publish on whoweare.ca. The form will be completed automatically.";
whoweare.labels['F229'] = "Click here if you are the director of the video that you wish to publish on whoweare.ca. The form will be completed automatically.";
whoweare.labels['F230'] = "Places LIVED IN correspond to the cities or countries where the subject of the video made his home in the course of his life.";
whoweare.labels['F231'] = "Places LIVED IN correspond to the cities or countries where the director of the video made his home in the course of his life.";
whoweare.labels['F232'] = "These informations allow us to enrich the whoweare.ca world map.";
whoweare.labels['F233'] = "If you want, you can provide the url of a video you wish to link to this comment. YouTube, Daily Motion and Vimeo videos are compatible with whoweare.ca.";
whoweare.labels['F234'] = "By creating an account on whoweare.ca, you will be able to post videos, links and comments.";
whoweare.labels['F235'] = "To create an account, you must fill in the fields below. Shortly after your request has been sent, you will receive a confirmation email. You will then be able to add further information to your profile.";
whoweare.labels['F236'] = "Enter your email to receive your password.";
whoweare.labels['F237'] = "Search";
whoweare.labels['F238'] = "Do you want to delete this comment ?";
whoweare.labels['F239'] = "Produced with the financial participation of:";
whoweare.labels['F240'] = "The comment you have posted is currently pending.  If you sign in, it will be made public.";
whoweare.labels['F241'] = "Embed code";
whoweare.labels['F242'] = "My email ";
whoweare.labels['F243'] = "My name ";
whoweare.labels['F244'] = "My friend's email ";
whoweare.labels['F245'] = "Fields must be filled";
whoweare.labels['F246'] = "My message (optionnal)";
whoweare.labels['F247'] = "You can add up to 10 email address, separated by coma.";
whoweare.labels['F248'] = "Hello... whoweare user send your a message !";
whoweare.labels['F249'] = "Links";
whoweare.labels['title_site'] = "Movement of people || Whoweare.ca";
whoweare.labels['description_site'] = "Description par defaut";
whoweare.labels['website_name'] = "whoweare.ca";
whoweare.labels['description'] = "It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
whoweare.labels['home'] = "Home";
whoweare.labels['blog'] = "Blog";
whoweare.labels['podcast'] = "Podcast";
whoweare.labels['video'] = "Video";
whoweare.labels['account'] = "My account";
whoweare.labels['submit'] = "Submit";
whoweare.labels['connected'] = "Connected ";
whoweare.labels['notconnected'] = "You are not connected ";
whoweare.labels['deconnection'] = "Sign out";
whoweare.labels['connection'] = "Sign in";
whoweare.labels['help'] = "Help";
whoweare.labels['lang'] = "Fran&ccedil;ais";
whoweare.labels['contactus'] = "Contact us";
whoweare.labels['subscribe'] = "Sign up";
whoweare.labels['termofuse'] = "Terms of use";
whoweare.labels['privacy_policy'] = "Confidentiality Policy";
whoweare.labels['copyright'] = "Whoweare.ca © All rights reserved";
whoweare.labels['to_search'] = "search";
whoweare.labels['keywords'] = "Tags";
whoweare.labels['tags'] = "Tags";
whoweare.labels['email_address'] = "email address";
whoweare.labels['to_send'] = "send";
whoweare.labels['previous'] = "previous";
whoweare.labels['next'] = "next";
whoweare.labels['pager_previous'] = "previous page";
whoweare.labels['pager_next'] = "next page";
whoweare.labels['from'] = "from";
whoweare.labels['deconnection_link_title'] = "Click here to sign out";
whoweare.labels['help_link_title'] = "Click here to obtain help";
whoweare.labels['switch_lang_link_title'] = "Cliquez ici pour changer la langue du site";
whoweare.labels['connection_link_title'] = "Click here to sign in";
whoweare.labels['contactus_link_title'] = "Click here to contact us";
whoweare.labels['subscribe_link_title'] = "Click here to create an account";
whoweare.labels['search_video_title'] = "Search videos";
whoweare.labels['rss_title'] = "Keep informed";
whoweare.labels['rss_global'] = "Global RSS feed";
whoweare.labels['rss_global_description'] = "blog and videos";
whoweare.labels['rss_podcast'] = "Podcast RSS feed";
whoweare.labels['rss_video'] = "Videos RSS feed";
whoweare.labels['rss_blog'] = "Blog RSS feed";
whoweare.labels['rss_subscribe_title'] = "by email";
whoweare.labels['rss_subscribe_information'] = "Enter your email address here to receive email alerts about WhoWeAre content updates";
whoweare.labels['pager_label'] = "posts displayed";
whoweare.labels['msg_close'] = "Close this message";
whoweare.labels['generic_error_title'] = "An error occured.";
whoweare.labels['signup_error_title'] = "There is an error in your submission!";
whoweare.labels['signup_error_email'] = "The email address is invalid.";
whoweare.labels['signup_error_username'] = "The username is invalid.  It must contain only alphanumeric characters and/or dashes.";
whoweare.labels['signup_error_password'] = "The password is invalid.  It must contain at least 8 characters, all alphanumeric.";
whoweare.labels['download_date_label'] = "Downloaded ";
whoweare.labels['blog_popular_title'] = "Most popular entries";
whoweare.labels['myProfile'] = "My profile";
whoweare.labels['profile_activities'] = "What is happening";
whoweare.labels['personnal_information'] = "Personnal informations";
whoweare.labels['profile_origins'] = "Origins / destinations";
whoweare.labels['profile_my_videos'] = "My videos";
whoweare.labels['profile_upload_video'] = "Submit a video";
whoweare.labels['profile_favorite_videos'] = "My favorite videos";
whoweare.labels['profile_related'] = "Related content";
whoweare.labels['profile_edit_success'] = "Profile saved!";
whoweare.labels['profile_edit_error'] = "Profile could not be saved.";
whoweare.labels['profile_edit_username'] = "Username";
whoweare.labels['profile_edit_password'] = "Password";
whoweare.labels['profile_edit_passwordv'] = "Retype password";
whoweare.labels['profile_edit_avatar'] = "Avatar";
whoweare.labels['profile_edit_contact'] = "Contact";
whoweare.labels['profile_edit_email'] = "Email";
whoweare.labels['profile_edit_tel'] = "Tel.";
whoweare.labels['profile_edit_address'] = "Address";
whoweare.labels['profile_edit_location'] = "Location";
whoweare.labels['profile_edit_origins'] = "Origins";
whoweare.labels['profile_edit_destinations'] = "Destinations";
whoweare.labels['profile_edit_interests'] = "Interests";
whoweare.labels['profile_edit_origins_help'] = "Le texte de l'alerte pour le champ qui suit avec un texte relativement long pour voir ce que cela peut donner...";
whoweare.labels['profile_edit_destinations_help'] = "Le texte de l'alerte pour le champ qui suit avec un texte relativement long pour voir ce que cela peut donner...";
whoweare.labels['profile_edit_interests_help'] = "Le texte de l'alerte pour le champ qui suit avec un texte relativement long pour voir ce que cela peut donner...";
whoweare.labels['profile_activities_myvideo'] = "My video entitled <a href='%s' title='%s'>%s</a>  has been commented by <a href='%s' title='%s'>%s</a>";
whoweare.labels['profile_activities_bookmarked'] = "My video entitled <a href='%s' title='%s'>%s</a> has been bookmarked by <a href='%s' title='%s'>%s</a>";
whoweare.labels['profile_activities_blogreply'] = "<a href='%s' title='%s'>%s</a> has replied to the discussion about the blog article <a href='%s' title='%s'>%s</a>";
whoweare.labels['profile_activities_videoreply'] = "<a href='%s' title='%s'>%s</a> has replied to the discussion about the video <a href='%s' title='%s'>%s</a>";
whoweare.labels['uploader_file'] = "Video file :";
whoweare.labels['uploader_cancel'] = "Cancel";
whoweare.labels['uploader_uploaded'] = "Uploaded : ";
whoweare.labels['uploader_toobigfile'] = "The video you have chosen is too big. You should compress it, or choose another one.";
whoweare.labels['uploader_toomanyfiles'] = "You may only select one video!";
whoweare.labels['uploader_alreadyuploading'] = "A video is already uploading.";
whoweare.labels['uploader_status_ready'] = "Waiting for a file...";
whoweare.labels['uploader_status_uploading'] = "Uploading in progress...";
whoweare.labels['uploader_status_encoding'] = "Encoding in progress (this can take several minutes)...";
whoweare.labels['uploader_status_complete'] = "Uploading complete!";
whoweare.labels['encoder_status_waiting'] = "Encoding - Waiting for upload...";
whoweare.labels['encoder_status_processing'] = "Encoding - In progress...";
whoweare.labels['encoder_status_complete'] = "Encodage - Complete.";
whoweare.labels['encoder_status_time'] = "Undetermined";
whoweare.labels['reminder_mail_from_name'] = "WhoWeAre.ca Team";
whoweare.labels['reminder_mail_subject'] = "Signup confirmation";
whoweare.labels['reminderpassword_mail_subject'] = "Your new password WhoWeAre.ca";
whoweare.labels['sendtofriends_subject_video'] = "Watch %s on whoweare.ca";
whoweare.labels['sendtofriends_subject_blog'] = "Read %s on whoweare.ca";
whoweare.labels['sendtofriends_success'] = "Email sent!";
whoweare.labels['videos_menu_filterby'] = "Filter by : ";
whoweare.labels['videos_menu_recent'] = "Most recent";
whoweare.labels['videos_menu_popular'] = "Most viewed";
whoweare.labels['videos_menu_location'] = "Origins / Destinations";
whoweare.labels['videos_menu_news'] = "News";
whoweare.labels['videos_menu_imports'] = "Imported Videos";
whoweare.labels['comments_deleted_body'] = "[This message has been erased.]";
whoweare.labels['i_user_email_changed'] = "You must confirm your new email address before it can be changed. An email has been sent to the new address.";
whoweare.labels['err_invalid_form'] = "You did not fill out all the required fields.";
whoweare.labels['err_invalid_video'] = "You did not upload a valid video.";
whoweare.labels['err_invalid_feeditem'] = "The news item does not contain all the required information.";
whoweare.labels['err_invalid_upload'] = "The file you have uploaded is invalid.";
whoweare.labels['err_irrelevant_news'] = "The news item does not contain any keyword.";
whoweare.labels['err_username_not_available'] = "The username you have chosen has already been taken.";
whoweare.labels['err_email_not_available'] = "The email address you have typed is already in use.";
whoweare.labels['err_validation_failed'] = "Some fields are invalid.";
whoweare.labels['err_not_authenticated'] = "You are not connected.";
whoweare.labels['err_already_voted'] = "You have already voted for this comment.";
whoweare.labels['err_email_not_found'] = "There is no account associated with this email address.";
whoweare.labels['err_mailer'] = "An error occured when attempting to send email.";
whoweare.labels['auth_logged'] = "You have been correctly identified by the system.";
whoweare.labels['auth_wrong_password'] = "The password is incorrect.";
whoweare.labels['auth_wrong_login'] = "The email address or password is incorrect.";
whoweare.labels['unauthorized'] = "You are not authorized.";
whoweare.labels['newsletter_added'] = "You have been added to the newsletter.";
whoweare.labels['modded_up'] = "Vote entered.";
whoweare.labels['modded_down'] = "Vote entered.";
whoweare.labels['err_no_results'] = "No results found.";
whoweare.labels['fourohfour'] = "Page not found";
whoweare.labels['validator_comment_body'] = "You must enter a message.";
whoweare.labels['validator_external_link'] = "The link must point to a YouTube, DailyMotion, Vimeo or WhoWeAre video.";
whoweare.labels['validator_email'] = "The email address is invalid.";
whoweare.labels['validator_username'] = "The username is invalid.  It must contain only letters, numbers, and/or the following characters : _-";
whoweare.labels['validator_password'] = "The password is invalid.  It must be at least 8 characters long and contain only letters or numbers.";
whoweare.labels['validator_passwords_not_identical'] = "The passwords do not match.";
whoweare.labels['validator_title'] = "The title is invalid.";
whoweare.labels['validator_description'] = "The description is invalid.";
whoweare.labels['validator_tags'] = "The tags are invalid.  Each tag must be separated by a space, a comma, or a semicolon.";
whoweare.labels['validator_subject_name'] = "The subject name is invalid.";
whoweare.labels['validator_director_name'] = "The director name is invalid.";
whoweare.labels['validator_location'] = "Location fields must contain a valid city name.";
whoweare.labels['validator_telnum'] = "The telephone number is invalid.";
whoweare.labels['validator_address'] = "The postal address is invalid.";
whoweare.labels['validator_subject_bornin'] = "The 'Born in' field of the subject is invalid.";
whoweare.labels['validator_director_bornin'] = "The 'Born in' field of the director is invalid.";
whoweare.labels['validator_subject_residesin'] = "The 'Resides in' field of the subject is invalid.";
whoweare.labels['validator_director_residesin'] = "The 'Resides in' field of the director is invalid.";
whoweare.labels['admin_news_delete_action'] = "Administration : Erase this news item";
whoweare.labels['admin_news_delete_confirmation'] = "Do you really wish to erase this news forever?";
whoweare.labels['admin_news_deleted'] = "News erased.";
/**/


whoweare.api.pager_endpoints.video = whoweare.urlmap.api_json+'/video/pager';
whoweare.api.pager_endpoints.comment = whoweare.urlmap.api_json+'/comment/pager';

whoweare.api.pager = function(callback, endpoint, searchParams, searchOptions, searchContext) {
  var parameters = {};
  parameters['searchParams'] = searchParams;
  parameters['searchOptions'] = searchOptions;
  parameters['searchContext'] = searchContext;

  jQuery.ajax({
    url: endpoint,
    data:{ parameters: JSON.stringify(parameters) },
    success:callback
  });
};

jQuery.ajaxSetup({ type:"POST", dataType:'json',  error: whoweare.errorHandler });

/**
 * Standard error handler.
 * @param {Object} XMLHttpRequest
 * @param {Object} textStatus
 * @param {Object} errorThrown
 */
whoweare.errorHandler = function(XMLHttpRequest, textStatus, errorThrown)
{
  alert('Ajax Error: '+textStatus+' :: '+errorThrown);
};

whoweare.api.video.load = function(callback, slug) {
  var params = { 'slug' : slug };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/load',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.get_pending = function(callback) {

  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/get_pending',
    data: { parameters: ''  },
    success:callback
  });
};


whoweare.api.video.create = function(callback) {
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/create', 
    data: { parameters: '' }, 
    success:callback
  });
};

whoweare.api.video.edit = function(callback, slug, date_filmed, title, description, external_link, director_info, subject_info, tags, frames) {
  var params = {
    'slug' : slug, 
    'date_filmed' : date_filmed, 
    'title' : title, 
    'description' : description, 
    'external_link' : external_link, 
    'director_info' : director_info, 
    'subject_info' : subject_info, 
    'tags' : tags, 
    'frames' : frames
  };
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/edit',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.erase = function(callback, slug) {
  var params = { 'slug' : slug };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/erase',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.search = function(callback, searchParams, searchOptions) {
  var params = { 
    'searchParams' : searchParams, 
    'searchOptions' : searchOptions
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/search',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.increment_viewcount = function(callback, slug) {
  var params = {
    'slug' : slug
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/increment_viewcount',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.bookmark = function(callback, slug) {
  var params = {
    'slug' : slug
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/bookmark',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.unbookmark = function(callback, slug) {
  var params = {
    'slug' : slug
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/unbookmark',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.video.import_preview = function(callback, external_link) {
  var params = {
    'external_link' : external_link
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/video/import_preview', 
    data: { parameters: JSON.stringify(params) }, 
    success:callback
  });
};

whoweare.api.user.getLoggedUser = function(callback) {

  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/user/getLoggedUser',
    data: { parameters: ''  },
    success:callback
  });
};

whoweare.api.user.login = function(callback, email, password) {
  var params = {
    'email' : email, 
    'password' : password
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/user/login',
    data: { parameters: JSON.stringify(params) },
    success:callback
  });
};

whoweare.api.user.sendToFriends = function(callback, slug, fromName, from, recipients, message, is_video) {
  var params = {
    'slug' : slug, 
    'from' : from, 
    'from_name' : fromName, 
    'recipients' : recipients, 
    'message' : message, 
    'is_video' : is_video
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/user/sendtoFriends',
    data: { parameters: JSON.stringify(params) },
    success:callback
  });
};

whoweare.api.comment.post = function(callback, video_slug, news_slug, blogentry_id, body, external_link, parent_id) {
  var params = {
    'news_slug' : news_slug, 
    'video_slug' : video_slug, 
    'blogentry_id' : blogentry_id,
    'body' : body, 
    'external_link' : external_link, 
    'parent_id' : parent_id
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/comment/post',
    data: { parameters: JSON.stringify(params) },
    success:callback
  });
};

whoweare.api.comment.erase = function(callback, comment_id) {
  var params = {
    'id' : comment_id
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/comment/erase',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.comment.mod_up = function(callback, comment_id) {
  var params = {
    'id' : comment_id
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/comment/mod_up',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.comment.mod_down = function(callback, comment_id) {
  var params = {
    'id' : comment_id
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/comment/mod_down',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.news.search = function(callback, searchParams, searchOptions) {
  var params = { 
    'searchParams' : searchParams, 
    'searchOptions' : searchOptions
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/news/search',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.news.erase = function(callback, slug) {
  var params = { 
    'slug' : slug
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/news/erase',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.newsletter.add = function(callback, email) {
  var params = { 
    'email' : email
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/newsletter/add',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.location.load = function(callback, id) {
  var params = { 
    'id' : id
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/location/load',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};

whoweare.api.location.find = function(callback, str) {
  var params = { 
    'str' : str
  };
  
  jQuery.ajax({
    url: whoweare.urlmap.api_json+'/location/find',
    data: { parameters: JSON.stringify(params)  },
    success:callback
  });
};




