
jQuery.ajaxSetup({ type:"POST", dataType:'json' });

var heap = {
  SUCCESS: 1,
  FAILURE: 0
};

heap.form = {};
heap.submit = {};
heap.media = {};
heap.media.sizes = {};

heap.api = {};
heap.config = { language:'en' };
heap.labels = {};
heap.urlmap = {};


heap.config['deploymode'] = 'prod';
heap.config['relative_root'] = '/heap';
heap.config['http_root'] = 'http://gdp.nfb.ca';
heap.config['request_uri'] = '/cache/heap.en.js';
heap.config['script_url'] = '/cache/heap.en.js';
heap.config['upload_maxfiles'] = 50;
heap.config['upload_maxsize'] = '300MB';
heap.config['version'] = '1x $Rev: 42629 $';
heap.config['last_build'] = '$Date:: 2009-06-26$:';
heap.config['thread_max_depth'] = '3';
heap.config['atom_types'] = {'editorial':{'url_scheme':{'fr':'/accueil/apercu/%id%','en':'/home/preview/%id%'},'meta_fields':{'vedette1':{'label':'Vedette 1','type':'slug_selector','classes':['HEAPM_Atom'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai'],'status':0}}},'vedette2':{'label':'Vedette 2','type':'slug_selector','classes':['HEAPM_Atom'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai'],'status':0}}},'vedette3':{'label':'Vedette 3','type':'slug_selector','classes':['HEAPM_Atom'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai'],'status':0}}},'reaction-ugc_fr':{'label':'Reaction UGC [fr]','type':'slug_selector','classes':['HEAPM_Reaction'],'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}},'break':'1'},'reaction-ugc_en':{'label':'Reaction UGC [en]','type':'slug_selector','classes':['HEAPM_Reaction'],'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}}},'statistique1_fr':{'label':'Statistique 1 [fr]','type':'text','break':'1'},'statistique2_fr':{'label':'Statistique 2 [fr]','type':'text'},'statistique3_fr':{'label':'Statistique 3 [fr]','type':'textarea','mce':'1'},'statistique1_en':{'label':'Statistique 1 [en]','type':'text','break':'1'},'statistique2_en':{'label':'Statistique 2 [en]','type':'text'},'statistique3_en':{'label':'Statistique 3 [en]','type':'textarea','mce':'1'}}},'theme':{'url_scheme':'/theme/%id%/%title|cleanSlug|strtolower%','meta_fields':{'statistique1_fr':{'label':'Statistique 1 [fr]','type':'text'},'statistique2_fr':{'label':'Statistique 2 [fr]','type':'text'},'statistique3_fr':{'label':'Statistique 3 [fr]','type':'textarea'},'statistique1_en':{'label':'Statistique 1 [en]','type':'text'},'statistique2_en':{'label':'Statistique 2 [en]','type':'text'},'statistique3_en':{'label':'Statistique 3 [en]','type':'textarea'},'citation_fr':{'label':'Citation [fr]','type':'textarea'},'citation_en':{'label':'Citation [en]','type':'textarea'},'auteur_fr':{'label':'Auteur[fr]','type':'text'},'auteur_en':{'label':'Auteur[en]','type':'text'}}},'episode':{'url_scheme':'/episode/%id%/%title|cleanSlug|strtolower%','meta_fields':{'source':{'label':'source','type':'readonly-text'},'source_id':{'label':'source_id','type':'readonly-text'},'registry_id':{'label':'registry_id','type':'readonly-text'},'serie_id':{'label':'serie_id','type':'readonly-text'},'citation_fr':{'label':'Citation [fr]','type':'textarea'},'citation_en':{'label':'Citation [en]','type':'textarea'},'credits_fr':{'label':'Credits [fr]','type':'textarea','mce':'1'},'credits_en':{'label':'Credits [en]','type':'textarea','mce':'1'},'vedette1':{'label':'Vedette 1','type':'slug_selector','classes':['HEAPM_Atom','HEAPM_Reaction'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai','archive'],'status':0}},'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}}},'vedette2':{'label':'Vedette 2','type':'slug_selector','classes':['HEAPM_Atom','HEAPM_Reaction'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai','archive'],'status':0}},'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}}}}},'photo-essai':{'url_scheme':{'fr':'/photo-essai/%id%/%title|cleanSlug|strtolower%','en':'/photo-essay/%id%/%title|cleanSlug|strtolower%'},'meta_fields':{'source':{'label':'source','type':'readonly-text'},'source_id':{'label':'source_id','type':'readonly-text'},'registry_id':{'label':'registry_id','type':'readonly-text'},'serie_id':{'label':'serie_id','type':'readonly-text'},'citation_fr':{'label':'Citation [fr]','type':'textarea'},'citation_en':{'label':'Citation [en]','type':'textarea'},'credits_fr':{'label':'Credits [fr]','type':'textarea','mce':'1'},'credits_en':{'label':'Credits [en]','type':'textarea','mce':'1'},'vedette1':{'label':'Vedette 1','type':'slug_selector','classes':['HEAPM_Atom','HEAPM_Reaction'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai','archive'],'status':0}},'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}}},'vedette2':{'label':'Vedette 2','type':'slug_selector','classes':['HEAPM_Atom','HEAPM_Reaction'],'slug_selector_params':{'HEAPM_Atom':{'type':['episode','photo-essai','archive'],'status':0}},'slug_selector_options':{'HEAPM_Reaction':{'relations':'1'}}}}},'archive':{'meta_fields':{'source_url_fr':{'label':'Source URL [fr]','type':'text'},'source_url_en':{'label':'Source URL [en]','type':'text'}}},'blogpost':{'url_scheme':'/blogpost/%id%/%title|cleanSlug|strtolower%','meta_fields':{'source_url':{'label':'Source URL','type':'text'}}},'static':{'url_scheme':{'fr':'/projet/%id%/%title|cleanSlug|strtolower%','en':'/project/%id%/%title|cleanSlug|strtolower%'}},'intro':{'meta_fields':{'langue':{'label':'Langue','type':'select','options':[{'value':'fr','label':'FR'},{'value':'en','label':'EN'}]},'lien_fr':{'label':'Lien FR','type':'text'},'lien_en':{'label':'Lien EN','type':'text'},'video_url':{'label':'Video URL','type':'text'}}}};
heap.config['channel_types'] = {'normal':[],'story':{'url_scheme':{'fr':'/recit/%id%/%title|cleanSlug|strtolower%','en':'/story/%id%/%title|cleanSlug|strtolower%'}}};
heap.config['reaction_types'] = ['comment','vote','answer_image','answer_text','answer_video'];
heap.config['channel_meta'] = [];
heap.config['user_meta'] = [];
heap.config['reaction_meta'] = [];
heap.config['media_meta'] = [];
heap.config['static_tag_prefixes'] = ['tag','category'];
heap.config['heap_logo'] = '/heap/static/heap/images/heap.png';
heap.config['heap_module_location'] = '/pib';
heap.config['current_language'] = 'en';
heap.config['plugins_location'] = '/heap_plugins';
heap.config['languages'] = ['en','fr'];
heap.config['now_datetime'] = '2010-09-16 11:15:26';
heap.config['now_timestamp'] = 1284650126;
heap.config['now_date'] = '2010-09-16';
heap.config['now_time'] = '11:15:26';
heap.config['mce'] = '';
heap.config['slug_selector_classes'] = {'HEAPM_Atom':{'api_class':'atoms','token':'atom'},'HEAPM_Channel':{'api_class':'channels','token':'channel'},'HEAPM_Reaction':{'api_class':'reactions','token':'reaction'},'HEAPM_User':{'api_class':'users','token':'user','show_field':'username'}};
heap.config['js_libs'] = [];
heap.config['google_map_api_key'] = 'ABQIAAAAcB8Omhjci6D6ihbvrDd3hRT1oY1SzVDPeAXypJweny5mx22JIhSl0lj0hoPdIAjeO8uZFrHazW9ZLw';

heap.urlmap['root'] = "";
heap.urlmap['home'] = "/home";
heap.urlmap['app_admin'] = "/heap";
heap.urlmap['app_docs'] = "/docs";
heap.urlmap['app_reactions'] = "/reactions";
heap.urlmap['tools_jsconfig'] = "/tools/jslib.js";
heap.urlmap['api_amf'] = "/heap/amf";
heap.urlmap['api_json'] = "/api";
heap.urlmap['app_admin_static'] = "/heap/static/heap";
heap.urlmap['app_lang'] = "/heap/language";
heap.urlmap['app_lang_fr'] = "/heap/language/fr";
heap.urlmap['app_lang_en'] = "/heap/language/en";
heap.urlmap['app_doc_api'] = "/heap/apidoc";
heap.urlmap['app_admin_tagger'] = "/heap/batchTagger";
heap.urlmap['app_admin_login'] = "/heap/login";
heap.urlmap['app_admin_logout'] = "/heap/logout";
heap.urlmap['app_admin_atoms'] = "/heap/atoms";
heap.urlmap['app_admin_channels'] = "/heap/channels";
heap.urlmap['app_admin_reactions'] = "/heap/reactions";
heap.urlmap['app_admin_docs'] = "/heap/docs";
heap.urlmap['app_admin_users'] = "/heap/users";
heap.urlmap['app_admin_redirects'] = "/heap/redirects";
heap.urlmap['app_admin_tags'] = "/heap/tags";
heap.urlmap['app_admin_atoms_drafts'] = "/heap/atoms/drafts";
heap.urlmap['app_admin_atoms_edit'] = "/heap/atoms/edit";
heap.urlmap['app_admin_channels_assign'] = "/heap/channels/assign";
heap.urlmap['app_admin_channels_edit'] = "/heap/channels/edit";
heap.urlmap['app_admin_docs_edit'] = "/heap/docs/edit";
heap.urlmap['app_admin_docs_list'] = "/heap/docs/reset";
heap.urlmap['app_admin_docs_sizes'] = "/heap/docs/sizes";
heap.urlmap['app_admin_docs_modify'] = "/heap/docs/modify";
heap.urlmap['app_admin_docs_subtitles'] = "/heap/docs/subtitles";
heap.urlmap['app_admin_docs_upload'] = "/heap/docs/upload";
heap.urlmap['app_admin_docs_upload_meta'] = "/heap/docs/uploadMeta";
heap.urlmap['app_admin_docs_upload_tags'] = "/heap/docs/uploadTags";
heap.urlmap['app_admin_redirects_edit'] = "/heap/redirects/edit";
heap.urlmap['app_admin_users_edit'] = "/heap/users/edit";
heap.urlmap['static'] = "/pib/static";
heap.urlmap['amfPath'] = "/amf";
heap.urlmap['create_reaction'] = "/create_reaction";
heap.urlmap['js_heap'] = "/cache/heap.en.js";
heap.urlmap['js_pib'] = "/cache/pib.en.js";
heap.urlmap['home_preview'] = "/home_gdp_preview";
heap.urlmap['themes'] = "/themes";
heap.urlmap['stories'] = "/stories";
heap.urlmap['essais_photos'] = "/photo-essays";
heap.urlmap['map'] = "/map";
heap.urlmap['search'] = "/search";
heap.urlmap['rss'] = "/rss";
heap.urlmap['sitemap'] = "/site-map";
heap.urlmap['team'] = "/team";
heap.urlmap['blog'] = "/blog";
heap.urlmap['newsletter'] = "/newsletter";
heap.urlmap['unsubscribe'] = "/unsubscribe";
heap.urlmap['alert'] = "/alert";
heap.urlmap['oembed'] = "/oembed/episode";

heap.labels['story_scheme_en'] = "story";
heap.labels['story_scheme_fr'] = "recit";
heap.labels['photo-essai_scheme_en'] = "photo essay";
heap.labels['photo-essai_scheme_fr'] = "essai photo";
heap.labels['content_scheme_en'] = "content";
heap.labels['content_scheme_fr'] = "contenu";
heap.labels['email_from'] = "gdp@nfb.ca";
heap.labels['email_name'] = "gdp.nfb.ca";
heap.labels['email_hi'] = "Hello,";
heap.labels['email_click_link'] = "Click on the following link to follow it:";
heap.labels['email_outro'] = "If you wish to take part in this web documentary, watch, share and react to this content by following the above-mentioned link.";
heap.labels['email_thankyou'] = "Thank you!";
heap.labels['email_signature_1'] = "The GDP team";
heap.labels['email_signature_2'] = "GDP – Measuring the human side of the Canadian economic crisis | http://gdp.nfb.ca";
heap.labels['email_signature_3'] = "gdp@nfb.ca | 514-283-9443";
heap.labels['email_signature_4'] = "National Film Board of Canada";
heap.labels['email_signature_5'] = "3155, ch. de la Côte-de-Liesse, P-39";
heap.labels['email_signature_6'] = "Montreal, Quebec H4N 2N4 Canada";
heap.labels['email_quote_in'] = "“";
heap.labels['email_quote_out'] = "”";
heap.labels['follow_new_subject_theme'] = "Watch the latest episode and/or photo-essay released under the theme %s on gdp.nfb.ca";
heap.labels['follow_new_subject_story'] = "Watch the latest episode and/or photo-essay released under the story %s on gdp.nfb.ca";
heap.labels['follow_subscribe_subject_theme'] = "Confirmation of subscription to the theme %s on gdp.nfb.ca";
heap.labels['follow_subscribe_subject_story'] = "Confirmation of subscription to the story %s on gdp.nfb.ca";
heap.labels['follow_new_intro_theme'] = "An episode and/or a photo-essay has just been released under the theme ";
heap.labels['follow_new_intro_story'] = "An episode and/or a photo-essay has just been released under the story ";
heap.labels['follow_new_intro'] = " of the NFB’s webdocumentary GDP.";
heap.labels['follow_subscribe_intro_theme'] = "You are now subscribed to the theme ";
heap.labels['follow_subscribe_intro_story'] = "You are now subscribed to the story ";
heap.labels['follow_subscribe_intro'] = " of the NFB’s webdocumentary GDP.";
heap.labels['follow_unsubscribe'] = "If you wish to unsubscribe, click on the following link: ";
heap.labels['send2friend_subject_episode'] = "%s recommends a film on gdp.nfb.ca";
heap.labels['send2friend_subject_photo'] = "%s recommends a photo essay on gdp.nfb.ca";
heap.labels['send2friend_subject_story'] = "%s recommends a story on gdp.nfb.ca";
heap.labels['send2friend_subject_theme'] = "%s recommends a theme on gdp.nfb.ca";
heap.labels['send2friend_intro_episode'] = " is sharing the following episode from the GDP web documentary with you.";
heap.labels['send2friend_intro_photo'] = " is sharing a photo essay from the GDP web documentary with you.";
heap.labels['send2friend_intro_story'] = " is sharing a story from the GDP web documentary with you.";
heap.labels['send2friend_intro_theme'] = " is sharing a theme from the GDP web documentary with you.";
heap.labels['send2friend_note'] = "Personal note: ";
heap.labels['send2friend_didnt_comment_episode'] = " has not commented this film.";
heap.labels['send2friend_didnt_comment_photo'] = " has not commented this photo essay.";
heap.labels['send2friend_didnt_comment_story'] = " has not commented this story.";
heap.labels['send2friend_didnt_comment_theme'] = " has not commented this theme.";
heap.labels['colon'] = ": ";
heap.labels['onf'] = "NFB";
heap.labels['onf_url'] = "http://www.nfb.ca";
heap.labels['pib'] = "GDP";
heap.labels['reaction'] = "Comments";
heap.labels['photo'] = "Photos";
heap.labels['essai'] = "Photo essays";
heap.labels['story'] = "Story";
heap.labels['stories'] = "Stories";
heap.labels['episode'] = "Episodes";
heap.labels['episode_2'] = "Episode";
heap.labels['more'] = "More";
heap.labels['view'] = "Viewings";
heap.labels['by'] = "By";
heap.labels['your'] = "Your";
heap.labels['publish'] = "Published";
heap.labels['publish_the'] = "Date published";
heap.labels['to_this'] = "To these";
heap.labels['page'] = "Page";
heap.labels['all_theme'] = "All themes";
heap.labels['all_other_content'] = "See all comments";
heap.labels['news'] = "New";
heap.labels['thumbnail'] = "More films";
heap.labels['day'] = "Day";
heap.labels['next'] = "next";
heap.labels['previous'] = "previous";
heap.labels['in_reaction_to'] = "in reaction to";
heap.labels['date_of_publication'] = "Date published";
heap.labels['comment'] = "Comment";
heap.labels['comments'] = "Comments";
heap.labels['play'] = "Watch";
heap.labels['participate'] = "Participate";
heap.labels['article'] = "Blog post";
heap.labels['blogpost'] = "Blog post";
heap.labels['tag'] = "Tag";
heap.labels['information'] = "About";
heap.labels['folder'] = "Beyond";
heap.labels['credit'] = "Credits";
heap.labels['txt'] = "Text";
heap.labels['video'] = "Video";
heap.labels['chapo'] = "Excerpt";
heap.labels['your_reactions'] = "Your comments";
heap.labels['to_this_stories'] = "to these stories";
heap.labels['keywords_related'] = "Sharing the same tags";
heap.labels['archives_related'] = "NFB Archives";
heap.labels['user_content'] = "Comments";
heap.labels['swf_alternative'] = "The page you are viewing displays its content in a SWF component. To view the content you must have installed a recent version of the Flash plug-in. Click on the following icon to download Flash Player.";
heap.labels['swf_alternative2'] = "Click HERE to download Flash Player.";
heap.labels['of'] = "of";
heap.labels['no_description'] = "No description";
heap.labels['no_more_episode'] = "No more episodes yet";
heap.labels['include_in'] = "is part of the story:";
heap.labels['include_in_2'] = "In the story";
heap.labels['change_language'] = "Change Language";
heap.labels['infolettre'] = "Newsletter";
heap.labels['inscription_infolettre'] = "Newsletter subscription";
heap.labels['close'] = "Close";
heap.labels['follower'] = "follower";
heap.labels['equipe_PIB_GDP'] = "GDP TEAM:";
heap.labels['equipe_ONF_NFB'] = "NFB TEAM:";
heap.labels['province'] = "Province";
heap.labels['provinces'] = "Provinces";
heap.labels['facebook_group'] = "http://www.facebook.com/#/pages/GDP-project/131661123718";
heap.labels['twitter_group'] = "http://twitter.com/gdpproject";
heap.labels['delicious_group'] = "http://delicious.com/gdpib";
heap.labels['follow_theme'] = "Follow this theme";
heap.labels['follow_story'] = "Follow this story";
heap.labels['follow_email_title'] = "Enter your email address";
heap.labels['share_theme'] = "Share this theme";
heap.labels['share_story'] = "Share this story";
heap.labels['share_themes'] = "Sharing this theme";
heap.labels['invit_by_mail'] = "Send to a friend";
heap.labels['submit_social'] = "Social networks";
heap.labels['embed_code'] = "Embed code";
heap.labels['permalink'] = "Permalink";
heap.labels['rss_feed'] = "RSS feed";
heap.labels['static_story'] = "This story in numbers";
heap.labels['highlight_theme'] = "Featured in this theme";
heap.labels['highlight_personne'] = "Main characters";
heap.labels['contribution_form'] = "Comments originating from";
heap.labels['last_contribution'] = "Total user comments";
heap.labels['view_all_contribution'] = "View all comments";
heap.labels['view_all_content'] = "View all contents";
heap.labels['publish_your_content'] = "Submit a comment";
heap.labels['other_essai'] = "More photo essays";
heap.labels['other_episode'] = "Previous episodes";
heap.labels['evaluate_in_region'] = "Evaluate the crisis in your community";
heap.labels['reaction_message_title'] = "Your content is under review";
heap.labels['warning_title'] = "Warning message";
heap.labels['cookie_message'] = "GDP Cookie alert IE6";
heap.labels['blog_title'] = "GDP blog";
heap.labels['unsubscribe_title'] = "Unsubscription confirmation";
heap.labels['unsubscribe_text'] = "You have been successfully unsubscribed!<br /><br />The GDP team<br />GDP - Measuring the human side of the Canadian economic crisis | <a href=http://gdp.nfb.ca title=http://gdp.nfb.ca target=_self>http://gdp.nfb.ca</a><br /><a href=mailto:gdp@nfb.ca title=mailto:gdp@nfb.ca target=_blank>gdp@nfb.ca</a> | 514-283-9443<br /><br />National Film Board of Canada<br />3155, ch. de la Côte-de-Liesse, P-39<br />Montreal, Quebec H4N 2N4 Canada";
heap.labels['to_search'] = "Search";
heap.labels['search'] = "Search";
heap.labels['search_invite'] = "Search a film or a location";
heap.labels['subscribe'] = "Subscribe";
heap.labels['copy'] = "Copy";
heap.labels['email'] = "email";
heap.labels['name'] = "Name";
heap.labels['firstname'] = "First name";
heap.labels['lastname'] = "Last name";
heap.labels['fullname'] = "Full name";
heap.labels['sms'] = "sms";
heap.labels['browse'] = "Browse";
heap.labels['your_email'] = "Your email address";
heap.labels['send_message_label'] = "Include a personal note";
heap.labels['last_episode'] = "Latest episode";
heap.labels['pers_principaux'] = "Main characters";
heap.labels['pers_principal'] = "Main character";
heap.labels['other_pers'] = "Other characters";
heap.labels['story_title'] = "Stories";
heap.labels['essai_photo_title'] = "Photo essays";
heap.labels['story_pagelink'] = "The whole story";
heap.labels['story_episodes_num'] = "Episodes";
heap.labels['story_episodes_num_0'] = "Episode";
heap.labels['story_episodes_com'] = "comments";
heap.labels['q_share_intro'] = "Enter a valid email address to follow the characters and the story as it unfolds.";
heap.labels['tags_intro'] = "Tags, comma-separated";
heap.labels['title_label'] = "Title";
heap.labels['send'] = "Send";
heap.labels['send_copy'] = "Send me a copy";
heap.labels['send_addresses'] = "More adresses, comma-separated";
heap.labels['from'] = "from";
heap.labels['to'] = "to";
heap.labels['theme_contribution_intro'] = "By contributing your comment, you are taking part in this web documentary. Your comment in film, image or text format can even influence the storyline. Share an experience, a testimony or a creation which enriches the documentation of the human side of the Canadian economic crisis. Your comment needs to respect our Terms of use.";
heap.labels['submit_video'] = "This form allows you to upload videos you have made. Please be patient. When you click Submit, the content will be sent to us for approval. Once approved by our team, it will be published. Please ensure your video complies with our Terms of use.<br /><br />Maximum file size: 100 Mb<br />File formats accepted: flv, mov, mp4 and mpg<br />Video codecs accepted: H.264, Sorenson Spark, On2 VP6<br />Audio codecs accepted: ADPCM, MP3, HE-AAC (MPEG-4 Part 3)<br />Viewer format: 16:9 (800 x 450)";
heap.labels['submit_photo'] = "This form allows you to upload an illustration, an image or a drawing you have made. Please be patient. When you click Submit, the content will be sent to us for approval. Once approved by our team, it will be published. Your image needs to respect our Terms of use.<br /><br />Max file size: 5mb<br />Accepted file formats: jpg, gif, tiff<br />Landscape (800x450)";
heap.labels['submit_text'] = "This form allows you to upload text you have written. Please be patient. When you click Submit, the content will be sent to us for approval. Once approved by our team, it will be published. Your text needs to respect our Terms of use.";
heap.labels['search_result'] = "&nbsp;";
heap.labels['search_result_2'] = "Search results";
heap.labels['search_filtre_information'] = "Your search results are filtered by : ";
heap.labels['delete_filtre'] = "Remove filter";
heap.labels['photo-essai_filtre'] = "Photo essays";
heap.labels['photo-essai_filtre_2'] = "Photo essays";
heap.labels['episode_filtre'] = "Films";
heap.labels['episode_filtre_2'] = "Episodes";
heap.labels['article_filtre'] = "Blog posts";
heap.labels['article_filtre_2'] = "Blog posts";
heap.labels['blogpost_filtre'] = "Blog posts";
heap.labels['blogpost_filtre_2'] = "Blog posts";
heap.labels['HEAPM_Reaction_filtre'] = "Comments";
heap.labels['HEAPM_Reaction_filtre_2'] = "Comments";
heap.labels['search_no_results'] = "No search results";
heap.labels['modify'] = "change";
heap.labels['cancel'] = "cancel";
heap.labels['save'] = "save";
heap.labels['pib_localisation'] = "GDP has located you here:";
heap.labels['pib_localisation_error1'] = "Enter your city and/or province";
heap.labels['pib_localisation_error2'] = "GDP was not able to locate you";
heap.labels['pib_localisation_error3'] = "You must enter a city in Canada";
heap.labels['pib_location_loading'] = "Loading...";
heap.labels['pib_location_intro'] = "Search for a city or move the map pointer to a specific location.";
heap.labels['territoires'] = "The map";
heap.labels['themes'] = "Themes";
heap.labels['theme'] = "Theme";
heap.labels['back_home'] = "Back to homepage";
heap.labels['baseline'] = "Canadian mood index";
heap.labels['propos'] = "About";
heap.labels['partenaire'] = "Partners";
heap.labels['contact'] = "Contact us";
heap.labels['juridique'] = "Privacy policy";
heap.labels['juridique_url'] = "http://www.nfb.ca/about/important-notices/";
heap.labels['team'] = "Team";
heap.labels['blog'] = "Blog";
heap.labels['blog_url'] = "http://www.gdp.nfb.ca/blog/";
heap.labels['charte'] = "Terms of use";
heap.labels['map'] = "All content";
heap.labels['copyright'] = "";
heap.labels['editorial_date_format'] = "%B %d";
heap.labels['global_title'] = "Follow the latest developments on the GDP web documentary.";
heap.labels['global_description'] = "15 latest published contents (stories, episodes, photo essays, comments, blog posts)";
heap.labels['theme_description'] = "15 latest published contents (stories, episodes, photo essays, comments) in this theme";
heap.labels['story_description'] = "15 latest published contents (episodes, comments) in this story";
heap.labels['episode_description'] = "15 latest published comments on this episode";
heap.labels['photo-essai_description'] = "15 latest published comments on this photo essay";
heap.labels['HEAPM_Atom_episode'] = "Film episode";
heap.labels['HEAPM_Atom_photo-essai'] = "Photo essay";
heap.labels['HEAPM_PIB_Reaction_answer_video'] = "Video comment";
heap.labels['HEAPM_PIB_Reaction_answer_image'] = "Photo comment";
heap.labels['HEAPM_PIB_Reaction_answer_text'] = "Text comment";
heap.labels['HEAPM_Channel_story'] = "Story";
heap.labels['from_validator_format_required'] = "Enter your email address";
heap.labels['from_name_validator_format_text'] = "Enter your correct name";
heap.labels['to_validator_format_required'] = "Enter destination email address";
heap.labels['follow_theme_already_subscribed'] = "Your are already following this theme";
heap.labels['follow_story_already_subscribed'] = "You are already following this theme";
heap.labels['error'] = "Error";
heap.labels['error_404'] = "The content you are looking for is not available at this very moment. The server hosting the GDP project might be temporarily inaccessible. Please double-check the spelling of the web address (URL).<br /><br />To access the most recent contents on <a href=http://gdp.nfb.ca title=http://gdp.nfb.ca target=_self>gdp.nfb.ca</a>, click on the following link:<br /><a href=http://gdp.nfb.ca/rss title=http://gdp.nfb.ca/rss target=_self>http://gdp.nfb.ca/rss</a><br /><br />Thank you!<br /><br />The GDP team<br />GDP - Measuring the human side of the Canadian economic crisis | <a href=http://gdp.nfb.ca title=http://gdp.nfb.ca target=_self>http://gdp.nfb.ca</a><br /><a href=mailto:gdp@nfb.ca title=mailto:gdp@nfb.ca target=_blank>gdp@nfb.ca</a> | 514-283-9443<br /><br />National Film Board of Canada<br />3155, ch. de la Côte-de-Liesse, P-39<br />Montreal, Quebec H4N 2N4 Canada";
heap.labels['error_404_reaction'] = "This comment doesn't exist.";
heap.labels['title_validator_required_type'] = "You must enter a title";
heap.labels['title_validator_required_title'] = "You must enter a title";
heap.labels['body_validator_required_type'] = "Please, enter your comment";
heap.labels['body_validator_required_body'] = "Please, enter your comment";
heap.labels['__name_validator_required_type'] = "You must enter your name";
heap.labels['__name_validator_required_name'] = "You must enter your name";
heap.labels['__email_validator_required_type'] = "Please enter your email address";
heap.labels['__email_validator_required_email'] = "Please enter your email address";
heap.labels['__email_validator_format_email'] = "You must enter a valid email address";
heap.labels['upload_file_error_no_file_selected'] = "Please select the file to upload";
heap.labels['upload_file_error_exceed_queue_limit_file_selected'] = "You have selected too many files";
heap.labels['upload_file_error_exceed_size_file_selected'] = "The file exceeds the weight limit permitted";
heap.labels['upload_file_error_invalid_type_file_selected'] = "The type of file you uploaded or it's codec are not supported by the system. Please retry your submission with a supported file.";
heap.labels['latitude_validator_required_latitude'] = "You must specify your geographical location";
heap.labels['longitude_validator_required_longitude'] = "You must specify your geographical location";
heap.labels['ville_validator_required_ville'] = "You must specify your geographical location";
heap.labels['region_validator_required_region'] = "You must specify your geographical location";
heap.labels['validator_city_format'] = "Please enter a valid city";
heap.labels['validator_region_format'] = "Please enter a valid region";
heap.labels['ville_validator_field_format_numeric'] = "Please enter a valid city";
heap.labels['success_follow_send'] = "Subscription sccessful";
heap.labels['success_stf_send'] = "Send out successful";
heap.labels['success_reaction_send'] = "Your content will be published as soon as it is moderated.";
heap.labels['waiting_message'] = "Media uploading,";
heap.labels['waiting_message_2'] = "please wait for confirmation.";
heap.labels['website_title'] = "GDP";
heap.labels['website_default_title'] = "GDP";
heap.labels['website_default_description'] = "";
heap.labels['website_default_keywords'] = "";
heap.labels['episode_default_title'] = "Film";
heap.labels['episode_default_description'] = "";
heap.labels['episode_default_keywords'] = "";
heap.labels['photo_essai_default_title'] = "Photo essay";
heap.labels['photo_essai_default_description'] = "";
heap.labels['photo_essai_default_keywords'] = "";
heap.labels['theme_default_title'] = "Theme";
heap.labels['theme_default_description'] = "";
heap.labels['theme_default_keywords'] = "";
heap.labels['themes_title'] = "Themes";
heap.labels['themes_description'] = "";
heap.labels['themes_keywords'] = "";
heap.labels['territoires_title'] = "The Map";
heap.labels['territoires_description'] = "";
heap.labels['territoires_keywords'] = "";
heap.labels['recherche_title'] = "Search";
heap.labels['static_default_title'] = "The project";
heap.labels['static_default_description'] = "";
heap.labels['static_default_keywords'] = "";
heap.labels['site_map_default_title'] = "All contents";
heap.labels['error_default_title'] = "Error 404";
heap.labels['story_default_title'] = "Story";
heap.labels['story_default_description'] = "";
heap.labels['story_default_keywords'] = "";
heap.labels['essai_photo_default_title'] = "Photo essays";
heap.labels['essai_photo_default_description'] = "";
heap.labels['essai_photo_default_keywords'] = "";
heap.labels['attr_title_infolettre'] = "Newsletter";
heap.labels['attr_title_logo'] = "Visit NFB.ca";

heap.media.sizes['square'] = new Object();
heap.media.sizes['square']['width'] = 100;
heap.media.sizes['square']['height'] = 100;
heap.media.sizes['square']['mode'] = 'crop';
heap.media.sizes['square']['crop'] = 'center';
heap.media.sizes['147x83'] = new Object();
heap.media.sizes['147x83']['width'] = 147;
heap.media.sizes['147x83']['height'] = 83;
heap.media.sizes['147x83']['mode'] = 'resize-crop';
heap.media.sizes['147x83']['crop'] = 'min';
heap.media.sizes['pthumb'] = new Object();
heap.media.sizes['pthumb']['width'] = 202;
heap.media.sizes['pthumb']['height'] = 116;
heap.media.sizes['pthumb']['mode'] = 'resize-crop';
heap.media.sizes['pthumb']['crop'] = 'min';
heap.media.sizes['thumb'] = new Object();
heap.media.sizes['thumb']['width'] = 184;
heap.media.sizes['thumb']['height'] = 123;
heap.media.sizes['thumb']['mode'] = 'resize-crop';
heap.media.sizes['thumb']['dimension'] = 'min';
heap.media.sizes['mini'] = new Object();
heap.media.sizes['mini']['width'] = 207;
heap.media.sizes['mini']['height'] = 117;
heap.media.sizes['mini']['mode'] = 'resize-crop';
heap.media.sizes['mini']['dimension'] = 'min';
heap.media.sizes['small'] = new Object();
heap.media.sizes['small']['width'] = 304;
heap.media.sizes['small']['height'] = 172;
heap.media.sizes['small']['mode'] = 'resize-crop';
heap.media.sizes['small']['dimension'] = 'min';
heap.media.sizes['ref'] = new Object();
heap.media.sizes['ref']['width'] = 400;
heap.media.sizes['ref']['height'] = 400;
heap.media.sizes['ref']['mode'] = 'resize';
heap.media.sizes['ref']['dimension'] = 'max';
heap.media.sizes['edito'] = new Object();
heap.media.sizes['edito']['width'] = 472;
heap.media.sizes['edito']['height'] = 260;
heap.media.sizes['edito']['mode'] = 'resize-crop';
heap.media.sizes['edito']['dimension'] = 'min';
heap.media.sizes['player'] = new Object();
heap.media.sizes['player']['width'] = 800;
heap.media.sizes['player']['height'] = 450;
heap.media.sizes['player']['mode'] = 'resize-crop';
heap.media.sizes['player']['dimension'] = 'min';
heap.media.sizes['medium'] = new Object();
heap.media.sizes['medium']['width'] = 2400;
heap.media.sizes['medium']['height'] = 399;
heap.media.sizes['medium']['mode'] = 'resize';
heap.media.sizes['medium']['dimension'] = 'min';
heap.media.sizes['large'] = new Object();
heap.media.sizes['large']['width'] = 2400;
heap.media.sizes['large']['height'] = 562;
heap.media.sizes['large']['mode'] = 'resize';
heap.media.sizes['large']['dimension'] = 'min';
heap.media.sizes['xlarge'] = new Object();
heap.media.sizes['xlarge']['width'] = 1024;
heap.media.sizes['xlarge']['height'] = 1024;
heap.media.sizes['xlarge']['mode'] = 'resize';
heap.media.sizes['xlarge']['dimension'] = 'max';
heap.media.sizes['staticlarge'] = new Object();
heap.media.sizes['staticlarge']['width'] = 571;
heap.media.sizes['staticlarge']['height'] = 324;
heap.media.sizes['staticlarge']['mode'] = 'resize-crop';
heap.media.sizes['staticlarge']['dimension'] = 'min';
 



heap.translate = function (token)
{
  if (heap.labels[token])
    return heap.labels[token];
  else
    return token + '-' + heap.config['current_language'];
};

heap.api.setup = function(setupParams)
{
  var target = setupParams['object'];
  var api_url = setupParams['url'];
  var api_class = setupParams['api_class'];
  var methods = setupParams['methods'];
  
  if(!target) throw new Error("Missing target for heap.api.setup");
  if(!api_url) throw new Error("Missing api_url for heap.api.setup");
  if(!api_class) throw new Error("Missing api_class for heap.api.setup");
  if(!methods) methods = new Array();
  
  for(var m = 0; m < methods.length; m++) (function(api_method)
  {
    target[api_method] = function(callback, params)
    {
      jQuery.ajax({
        url: api_url+'/'+api_class+'/'+api_method,
        data: { parameters: JSON.stringify(params) }, 
        success: callback
      }); 
    }
  })(methods[m]);
  
  
};

/** User API **/

heap.api.users = {};
heap.api.setup({
  object: heap.api.users,
  api_class:'users',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search','isloggedin','login','logout','usernameAvailability','checkEmailAvailability']
});


heap.api.users.login = function(callback, params)
{
  params['password'] = hex_md5(params['password']);
  
  jQuery.ajax({
    url: heap.urlmap.api_json+'/'+'users'+'/'+'login',
    data: { parameters: JSON.stringify(params) }, 
    success: callback
  }); 
}

/** Atoms API **/
heap.api.atoms = {};
heap.api.setup({
  object: heap.api.atoms,
  api_class:'atoms',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search','setRating','getMetaBlock','addTags','removeTags']
});


/** Channels API **/
heap.api.channels = {};
heap.api.setup({
  object: heap.api.channels,
  api_class:'channels',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search','addTags','removeTags']
});


/** Documents API **/
heap.api.media = {};
heap.api.setup({
  object: heap.api.media,
  api_class:'media',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search','addTags','removeTags', 'resize', 'setFrame', 'rotate', 'searchAndRender']
});

/** Reactions API **/
heap.api.reactions = {};
heap.api.setup({
  object: heap.api.reactions,
  api_class:'reactions',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search','moderate']
});

/** Redirects API **/
heap.api.redirects = {};
heap.api.setup({
  object: heap.api.redirects,
  api_class:'redirects',
  url: heap.urlmap.api_json,
  methods: ['load','create','erase','edit','search', 'setRating']
});


/** Tags API **/
heap.api.tags = {};
heap.api.setup({
  object: heap.api.tags,
  api_class:'tags',
  url: heap.urlmap.api_json,
  methods: ['load', 'create', 'erase', 'rename', 'merge', 'renameDictionary', 'eraseDictionary', 'search', 'searchAndRender']
});




