
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'] = '/heap/js';
heap.config['script_url'] = '/heap/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'] = '/heap';
heap.config['current_language'] = 'en';
heap.config['plugins_location'] = '/heap_plugins';
heap.config['languages'] = ['en','fr'];
heap.config['now_datetime'] = '2012-02-09 11:44:26';
heap.config['now_timestamp'] = 1328805866;
heap.config['now_date'] = '2012-02-09';
heap.config['now_time'] = '11:44: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";
heap.urlmap['home'] = "/heap";
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'] = "/heap/json";
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.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['anonymous'] = "Anonymous";
heap.labels['assign'] = "Assign";
heap.labels['at'] = "at";
heap.labels['author'] = "Author";
heap.labels['basics'] = "Basics";
heap.labels['body'] = "Body";
heap.labels['by'] = "by";
heap.labels['cancel'] = "Cancel";
heap.labels['clear'] = "Clear";
heap.labels['colon'] = ": ";
heap.labels['controls'] = "Controls";
heap.labels['date'] = "Date";
heap.labels['date_format'] = "F jS Y";
heap.labels['delete'] = "Delete";
heap.labels['delete_selected'] = "Delete selected";
heap.labels['description'] = "Description";
heap.labels['documents'] = "Documents";
heap.labels['edit'] = "Edit";
heap.labels['excerpt'] = "Excerpt";
heap.labels['_false'] = "False";
heap.labels['fields_basic'] = "Basic fields";
heap.labels['fields_localized'] = "Localized fields";
heap.labels['fields_meta'] = "Meta fields";
heap.labels['filed_in'] = "filed in";
heap.labels['filter'] = "Filter";
heap.labels['heap_platform'] = "HEAP platform";
heap.labels['importance_level'] = "Importance level";
heap.labels['jump_to'] = "Jump to";
heap.labels['last_modified'] = "Last modified";
heap.labels['list_search_tag'] = "Search with this tag";
heap.labels['list_un_negate'] = "Remove exception";
heap.labels['list_untag'] = "Untag";
heap.labels['long_datetime_format'] = "l F jS Y \a\t h:i:s A";
heap.labels['meta'] = "Meta";
heap.labels['metadata'] = "Metadata";
heap.labels['name'] = "Name";
heap.labels['next'] = "Next";
heap.labels['not_set'] = "Not set";
heap.labels['other_language'] = "Français";
heap.labels['other_language_code'] = "fr";
heap.labels['preview'] = "Preview";
heap.labels['previous'] = "Previous";
heap.labels['publish_start'] = "Publish start";
heap.labels['publish_end'] = "Publish end";
heap.labels['remove'] = "Remove";
heap.labels['revision'] = "Revision";
heap.labels['save'] = "Save";
heap.labels['search'] = "Search";
heap.labels['seo'] = "SEO";
heap.labels['sex_female'] = "Female";
heap.labels['sex_male'] = "Male";
heap.labels['status'] = "Status";
heap.labels['subtitle'] = "Subtitle";
heap.labels['tags'] = "Tags";
heap.labels['text'] = "Text";
heap.labels['thumbnail'] = "Thumbnail";
heap.labels['title'] = "Title";
heap.labels['_true'] = "True";
heap.labels['type'] = "Type";
heap.labels['color'] = "Color";
heap.labels['atom'] = "atom";
heap.labels['channel'] = "channel";
heap.labels['reaction'] = "reaction";
heap.labels['document'] = "document";
heap.labels['user'] = "user";
heap.labels['redirect'] = "redirect";
heap.labels['confirm_delete_many'] = "Are you sure you want to delete these";
heap.labels['confirm_delete_one'] = "Are you sure you want to delete this";
heap.labels['deleting'] = "Deleting";
heap.labels['deleting_one'] = "Deleting one ";
heap.labels['auth_disconnect'] = "Disconnect";
heap.labels['auth_email'] = "Email";
heap.labels['auth_login'] = "Log In";
heap.labels['auth_password'] = "Password";
heap.labels['auth_remember'] = "Remember me";
heap.labels['auth_failed'] = "Login failed";
heap.labels['auth_not_validated'] = "This account has not been validated";
heap.labels['auth_wrong_login'] = "Invalid email";
heap.labels['auth_wrong_password'] = "Invalid password or account not validated yet";
heap.labels['auth_logged'] = "Successful authentication";
heap.labels['save_successul'] = "The save was successful";
heap.labels['success_generic'] = "The operation was successful";
heap.labels['admin_menu_atoms'] = "Atoms";
heap.labels['admin_menu_atoms_drafts'] = "Drafts";
heap.labels['admin_menu_atoms_list'] = "List";
heap.labels['admin_menu_channels'] = "Channels";
heap.labels['admin_menu_channels_list'] = "List";
heap.labels['admin_menu_documents'] = "Documents";
heap.labels['admin_menu_documents_list'] = "List";
heap.labels['admin_menu_documents_pending'] = "Pending files";
heap.labels['admin_menu_documents_upload'] = "Upload";
heap.labels['admin_menu_reactions'] = "Reactions";
heap.labels['admin_menu_redirects'] = "Redirects";
heap.labels['admin_menu_tags'] = "Tags";
heap.labels['admin_menu_users'] = "Users";
heap.labels['filter_all'] = "All";
heap.labels['filter_all_channels'] = "All channels";
heap.labels['filter_all_status'] = "All status";
heap.labels['filter_all_types'] = "All types";
heap.labels['filter_media_color'] = "Color";
heap.labels['filter_media_black_and_white'] = "Black and white";
heap.labels['filter_tagged'] = "Tagged";
heap.labels['filter_untagged'] = "Untagged";
heap.labels['sortby_caption'] = "Order by caption";
heap.labels['sortby_date_created'] = "Order by date created";
heap.labels['sortby_date_modified'] = "Order by date modified";
heap.labels['sortby_date_published'] = "Order by date published";
heap.labels['sortby_date_registered'] = "Order by date registered";
heap.labels['sortby_date_taken'] = "Order by date taken";
heap.labels['sortby_date_uploaded'] = "Order by date uploaded";
heap.labels['sortby_email'] = "Order by email";
heap.labels['sortby_filename'] = "Order by filename";
heap.labels['sortby_id'] = "Order by id";
heap.labels['sortby_importance'] = "Order by importance";
heap.labels['sortby_level'] = "Order by level";
heap.labels['sortby_name'] = "Order by name";
heap.labels['sortby_status'] = "Order by status";
heap.labels['sortby_tags'] = "Order by tags";
heap.labels['sortby_title'] = "Order by title";
heap.labels['sortby_type'] = "Order by type";
heap.labels['sortby_uri'] = "Order by URI";
heap.labels['sortby_username'] = "Order by username";
heap.labels['atom_add'] = "Add atom";
heap.labels['atom_confirm_delete_many'] = "Are you sure you want to delete the selected atoms?";
heap.labels['atom_confirm_delete_one'] = "Are you sure you want to delete this atom?";
heap.labels['atom_deleting_many'] = "Deleting selected atoms";
heap.labels['atom_deleting_one'] = "Deleting atom";
heap.labels['atom_edit'] = "Edit atom";
heap.labels['atom_edit_allow_reactions'] = "Allow reactions";
heap.labels['atom_edit_atom_url'] = "Atom URL";
heap.labels['atom_manage'] = "Manage atoms";
heap.labels['atom_saved'] = "The atom has been saved.";
heap.labels['check_all'] = "Check all";
heap.labels['channel_add'] = "Add channel";
heap.labels['channel_assign_atoms'] = "Assign atoms";
heap.labels['channel_confirm_delete_many'] = "Are you sure you want to delete the selected channels?";
heap.labels['channel_confirm_delete_one'] = "Are you sure you want to delete this channel?";
heap.labels['channel_deleting_many'] = "Deleting selected channels";
heap.labels['channel_deleting_one'] = "Deleting channel";
heap.labels['channel_edit'] = "Edit channel";
heap.labels['channel_aggregate_types'] = "Aggregate types";
heap.labels['channel_aggregate_sources'] = "Aggregate channels";
heap.labels['channel_edit_aggregation_only'] = "Only";
heap.labels['channel_edit_features'] = "Features";
heap.labels['channel_feature_close'] = "Close";
heap.labels['channel_feature_none'] = "No features";
heap.labels['channel_feature_remove'] = "Remove";
heap.labels['channel_manage'] = "Manage channels";
heap.labels['assign_already_assigned'] = "This atom is already in your list";
heap.labels['latlon'] = "Latitude / Longitude";
heap.labels['cdn_source'] = "CDN Source";
heap.labels['cdn_id'] = "CDN ID";
heap.labels['cdn_akamai'] = "Akamai";
heap.labels['cdn_brightcove'] = "Brightcove";
heap.labels['cdn_static'] = "Static file (url)";
heap.labels['media_document'] = "Document";
heap.labels['media_add'] = "Add a document";
heap.labels['media_all_sources'] = "All sources";
heap.labels['media_add_tags'] = "Add tags to selected media";
heap.labels['media_all_types'] = "All types";
heap.labels['media_any_file_max'] = "Any file, Max";
heap.labels['media_archive_files'] = "Archive files";
heap.labels['media_back'] = "Back";
heap.labels['media_camera'] = "Camera";
heap.labels['media_cancel'] = "Cancel";
heap.labels['media_caption'] = "Caption";
heap.labels['media_choose_files_1'] = "Choose the files you wish to upload from your hard drive. <i>(Max ";
heap.labels['media_choose_files_2'] = " files, ";
heap.labels['media_choose_files_3'] = " max)";
heap.labels['media_color'] = "Color";
heap.labels['media_complete_basic_info'] = "Complete the basic information of your uploaded media (optional) and press ";
heap.labels['media_confirm_delete_many'] = "Are you sure you want to delete the selected documents?";
heap.labels['media_confirm_delete_one'] = "Are you sure you want to delete this document?";
heap.labels['media_confirm_reupload'] = "Are you sure you wish to replace? All current cropping data will be lost.";
heap.labels['media_confirm_rotation'] = "Are you sure you wish to rotate? All current cropping data will be lost.";
heap.labels['media_continue'] = "Continue";
heap.labels['media_controls'] = "Controls";
heap.labels['media_credits'] = "Credits";
heap.labels['media_crop'] = "Crop";
heap.labels['media_crop_image_format'] = "Crop image";
heap.labels['media_crop_preview'] = "Double-click to preview";
heap.labels['media_cropped_images_saved'] = "Your cropped images have been saved";
heap.labels['media_date_taken'] = "Date taken";
heap.labels['media_degrees'] = "Degrees";
heap.labels['media_deleting_many'] = "Deleting selected documents";
heap.labels['media_deleting_one'] = "Deleting document";
heap.labels['media_description'] = "Description";
heap.labels['media_dimensions'] = "Dimensions";
heap.labels['media_documents'] = "Documents";
heap.labels['media_edit'] = "Edit document";
heap.labels['media_edit_details'] = "Edit document details";
heap.labels['media_filename'] = "Filename";
heap.labels['media_flash_files'] = "Flash files";
heap.labels['media_frame_extracted'] = "Your frame has been extracted";
heap.labels['media_image_files'] = "Image files";
heap.labels['media_image_rotaged'] = "Your image has been rotated.";
heap.labels['media_infobox_and_more'] = "...and more.";
heap.labels['media_infobox_edit'] = "Edit";
heap.labels['media_infobox_modify'] = "Modify";
heap.labels['media_infobox_sizes'] = "Sizes";
heap.labels['media_infobox_subtitles'] = "Subtitles";
heap.labels['media_infobox_used_in'] = "Used in";
heap.labels['media_large_file'] = "Large File Upload Site";
heap.labels['media_loading'] = "Loading media";
heap.labels['media_manage'] = "Manage documents";
heap.labels['media_modify'] = "Modify document";
heap.labels['media_modify_frame'] = "Modify frame";
heap.labels['media_mp3_files'] = "MP3 files";
heap.labels['media_orientation'] = "Orientation";
heap.labels['media_preview'] = "Preview";
heap.labels['media_progress'] = "Progress";
heap.labels['media_reextracting_frame'] = "Re-extracting frame";
heap.labels['media_reupload_file'] = "Reupload file";
heap.labels['media_reuploading_image'] = "Re-uploading image";
heap.labels['media_reuploading_thumbnail'] = "Re-uploading thumbnail";
heap.labels['media_rotate'] = "Rotate";
heap.labels['media_rotate_source'] = "Rotate source";
heap.labels['media_rotating_image'] = "Rotating image";
heap.labels['media_save'] = "Save";
heap.labels['media_saving_resized_images'] = "Saving resized images";
heap.labels['media_search'] = "Search";
heap.labels['media_select_file'] = "Select file";
heap.labels['media_selector'] = "Selector";
heap.labels['media_size'] = "Size";
heap.labels['media_sizes'] = "Media sizes";
heap.labels['media_source'] = "Source";
heap.labels['media_specify_type'] = "Specify a type for this upload";
heap.labels['media_tag_selected'] = "Tag selected";
heap.labels['media_type_archive'] = "Archive";
heap.labels['media_type_audio'] = "Audio";
heap.labels['media_type_document'] = "Document";
heap.labels['media_type_cdn_video'] = "Video from a CDN";
heap.labels['media_type_flash'] = "Flash";
heap.labels['media_type_image'] = "Image";
heap.labels['media_type_video'] = "Video";
heap.labels['media_type_rawfile'] = "Raw file";
heap.labels['media_upload'] = "Upload";
heap.labels['media_upload_document'] = "Upload document";
heap.labels['media_upload_meta'] = "Upload media meta";
heap.labels['media_uploader'] = "Uploader";
heap.labels['media_uploading'] = "Uploading...";
heap.labels['media_video'] = "Video";
heap.labels['media_video_frame'] = "Video frame";
heap.labels['media_video_url'] = "Video URL";
heap.labels['media_tb_align'] = "Align";
heap.labels['media_tb_align_left'] = "float left";
heap.labels['media_tb_align_right'] = "float right";
heap.labels['media_tb_align_center'] = "center";
heap.labels['media_tb_size'] = "Size";
heap.labels['media_tb_url'] = "Url";
heap.labels['media_tb_link'] = "Create link";
heap.labels['media_tb_link_to_media'] = "To media";
heap.labels['media_tb_link_to_url'] = "To Url";
heap.labels['media_tb_pager_page'] = "Pages : ";
heap.labels['media_tb_type_all'] = "All types";
heap.labels['media_tb_insert'] = "Insert this media";
heap.labels['media_tb_non_media'] = "No media found for that selection";
heap.labels['media_subtitles'] = "Subtitles";
heap.labels['reactions_approve'] = "Approve";
heap.labels['reactions_flag'] = "Flag as abusive";
heap.labels['reactions_atom'] = "Atom";
heap.labels['reactions_confirm_delete_many'] = "Are you sure you want to delete the selected reactions?";
heap.labels['reactions_confirm_delete_one'] = "Are you sure you want to delete this reaction?";
heap.labels['reactions_deleting_many'] = "Deleting selected reactions";
heap.labels['reactions_deleting_one'] = "Deleting reaction";
heap.labels['reactions_disapprove'] = "Disapprove";
heap.labels['reactions_manage'] = "Manage reactions";
heap.labels['reactions_type_answer_image'] = "Image answer";
heap.labels['reactions_type_answer_text'] = "Text answer";
heap.labels['reactions_type_answer_video'] = "Video answer";
heap.labels['reactions_type_comment'] = "Comment";
heap.labels['reactions_type_vote'] = "Vote";
heap.labels['reactions_date'] = "Date";
heap.labels['reactions_parent'] = "In reply to";
heap.labels['reactions_ip'] = "IP";
heap.labels['reactions_browser'] = "Browser";
heap.labels['reactions_os'] = "OS";
heap.labels['reactions_edit'] = "Edit a reaction";
heap.labels['reactions_source'] = "Source";
heap.labels['reactions_lang'] = "Language";
heap.labels['reactions_lang_all'] = "All";
heap.labels['reactions_lang_fr'] = "French";
heap.labels['reactions_lang_en'] = "English";
heap.labels['redirect_add'] = "Add redirect";
heap.labels['redirect_basics'] = "Basics";
heap.labels['redirect_code'] = "Code";
heap.labels['redirect_confirm_delete_many'] = "Are you sure you want to delete the selected redirects?";
heap.labels['redirect_confirm_delete_one'] = "Are you sure you want to delete this redirect?";
heap.labels['redirect_date'] = "Date";
heap.labels['redirect_deleting_many'] = "Deleting selected redirects";
heap.labels['redirect_deleting_one'] = "Deleting redirect";
heap.labels['redirect_destination_uri'] = "Destination URI/URL";
heap.labels['redirect_edit'] = "Edit redirect";
heap.labels['redirect_example'] = "Example";
heap.labels['redirect_example_of_destination_uri'] = "http://www.mynewtarget.com OR /mynewtarget";
heap.labels['redirect_example_of_uri'] = "/mytargetname";
heap.labels['redirect_manage'] = "Manage redirects";
heap.labels['redirect_note'] = "Note";
heap.labels['redirect_redirect'] = "Redirect";
heap.labels['redirect_redirection'] = "Redirection";
heap.labels['redirect_type'] = "Type";
heap.labels['redirect_uri'] = "URI";
heap.labels['redirect_with'] = "with";
heap.labels['tag_manage'] = "Tags manager";
heap.labels['tag_new_dictionary'] = "New dictionary...";
heap.labels['tag_new_tag'] = "New tag...";
heap.labels['tag_dictionaries'] = "Tag dictionaries";
heap.labels['tag_for'] = "Tags for ";
heap.labels['tag_exist_confirm_merge'] = "Tag already exists in destination. Merge?";
heap.labels['tag_erase_tag_prompt'] = "There are %s element(s) tagged with this tag.  Do you really want to erase this tag?";
heap.labels['tag_erase_dictionary_prompt'] = "This dictionary contains %s tag(s).  Do you really want to erase this dictionary and its tags?";
heap.labels['tag_merge_prompt'] = " already exists.  Do you want to merge it with ";
heap.labels['user_add'] = "Add user";
heap.labels['user_allow_newsletter'] = "Allow newsletter";
heap.labels['user_bio'] = "Bio";
heap.labels['user_change_password'] = "Change password";
heap.labels['user_confirm_delete_many'] = "Are you sure you want to delete the selected users?";
heap.labels['user_confirm_delete_one'] = "Are you sure you want to delete this user?";
heap.labels['user_deleting_many'] = "Deleting selected users";
heap.labels['user_deleting_one'] = "Deleting user";
heap.labels['user_edit'] = "Edit user";
heap.labels['user_email'] = "Email";
heap.labels['user_first_name'] = "First name";
heap.labels['user_gender'] = "Gender";
heap.labels['user_last_name'] = "Last name";
heap.labels['user_manage'] = "Manage users";
heap.labels['user_name'] = "Name";
heap.labels['user_occupation'] = "Occupation";
heap.labels['user_password'] = "Password";
heap.labels['user_registered'] = "Registered";
heap.labels['user_username'] = "Username";
heap.labels['user_website'] = "Website";
heap.labels['user_roles'] = "Roles";
heap.labels['user_status'] = "Status";
heap.labels['status_draft'] = "Draft";
heap.labels['status_incoming'] = "Incoming";
heap.labels['status_pending'] = "Pending";
heap.labels['status_published'] = "Published";
heap.labels['status_reaction_approved'] = "Approved";
heap.labels['status_reaction_incoming'] = "Incoming";
heap.labels['status_reaction_unapproved'] = "Unapproved";
heap.labels['status_reaction_flagged'] = "Flagged as abusive";
heap.labels['status_user_active'] = "Active";
heap.labels['status_user_inactive'] = "Inactive";
heap.labels['status_user_pending'] = "Pending";
heap.labels['meta_bg_color'] = "Bg color";
heap.labels['meta_color'] = "Color";
heap.labels['tagger_action_tag'] = "Tag";
heap.labels['tagger_cancel'] = "Cancel";
heap.labels['tagger_category'] = "category";
heap.labels['tagger_free_text'] = "free text";
heap.labels['tagger_negate'] = "Negate";
heap.labels['tagger_requirements'] = "At least one tag of each of the following categories is required";
heap.labels['tagger_save'] = "Save";
heap.labels['tagger_tag'] = "tag";
heap.labels['eventmanager_actions'] = "Actions";
heap.labels['eventmanager_date'] = "Date";
heap.labels['eventmanager_delete'] = "Delete";
heap.labels['eventmanager_edit'] = "Edit";
heap.labels['eventmanager_event'] = "Event";
heap.labels['eventmanager_event_type'] = "Event type";
heap.labels['eventmanager_name'] = "Name";
heap.labels['eventmanager_new_event'] = "New event";
heap.labels['eventmanager_no_events_found'] = "No events found";
heap.labels['eventmanager_no_name'] = "(no name)";
heap.labels['eventmanager_of'] = "of";
heap.labels['eventmanager_untag'] = "Untag";
heap.labels['infobox_cancel'] = "Cancel";
heap.labels['infobox_created_on'] = "Created on";
heap.labels['infobox_delete'] = "Delete";
heap.labels['infobox_last_edited_by'] = "Last edited by";
heap.labels['infobox_on'] = "on";
heap.labels['infobox_publish_status'] = "Publish status";
heap.labels['infobox_save'] = "Save";
heap.labels['infobox_top'] = "Top";
heap.labels['infobox_user_status'] = "User status";
heap.labels['infobox_id'] = "ID : ";
heap.labels['infobox_slug'] = "Slug : ";
heap.labels['infobox_votes'] = "Votes : ";
heap.labels['infobox_comments'] = "Comments : ";
heap.labels['growl_error_occured'] = "An error has occured";
heap.labels['growl_loading'] = "Loading";
heap.labels['growl_please_wait'] = "Please wait...";
heap.labels['growl_request_completed'] = "Request completed";
heap.labels['growl_saved'] = "Saved";
heap.labels['growl_saving'] = "Saving";
heap.labels['js_email_invalid'] = "The entered email is invalid.";
heap.labels['js_errors_occured'] = "The following errors occured";
heap.labels['js_fields_invalid_values'] = "Some fields have invalid values";
heap.labels['js_password_mismatch'] = "Both password fields do not have the same value";
heap.labels['js_required_fields'] = "The following fields are required";
heap.labels['js_validation_script_not_found'] = "Validation script not found for ";
heap.labels['swfupload_toomanyfiles'] = "You have attempted to queue too many files.";
heap.labels['swfupload_uploadlimit'] = "Upload limit exceeded.";
heap.labels['swfupload_upto'] = "You may select up to %s files.";
heap.labels['swfupload_onefile'] = "You may select one file.";
heap.labels['swfupload_toobig'] = "File is too big.";
heap.labels['swfupload_zerobyte'] = "Cannot upload Zero Byte files.";
heap.labels['swfupload_invalidtype'] = "Invalid File Type.";
heap.labels['swfupload_unhandled'] = "Unhandled error.";
heap.labels['swfupload_uploading'] = "Uploading... %s%";
heap.labels['swfupload_received'] = "Received, analyzing file...";
heap.labels['swfupload_complete'] = "Complete.";
heap.labels['swfupload_error'] = "Upload Error: %s";
heap.labels['swfupload_config'] = "Configuration Error";
heap.labels['swfupload_failed'] = "Upload Failed.";
heap.labels['swfupload_servererror'] = "Server (IO) Error";
heap.labels['swfupload_security'] = "Security Error";
heap.labels['swfupload_filenotfound'] = "File not found.";
heap.labels['swfupload_validationfailed'] = "Failed Validation.  Upload skipped.";
heap.labels['swfupload_cancelled'] = "Cancelled.";
heap.labels['swfupload_stopped'] = "Stopped.";
heap.labels['api_documentation'] = "API documentation";
heap.labels['api_usage'] = "Usage";
heap.labels['api_usage_intro'] = "The HEAP API is a set of classes and methods that allow retrieval and modification of the data.  It is available in three languages: PHP (native), ActionScript3 (via AMF), and Javascript (via AJAX).";
heap.labels['api_usage_return'] = "No matter which method you use, the return is always an object of type Response.  This object has four important properties:";
heap.labels['api_usage_return_type'] = "Is equal to 1 if the operation was a success; otherwise it is 0.";
heap.labels['api_usage_return_code'] = "If the operation returned an error, this field contains the error code such as ERR_PERMISSION_DENIED or ERR_INVALID_OBJECT.";
heap.labels['api_usage_return_msg'] = "If the operation return an error, this field will contain a short error message (localized) corresponding to the code.";
heap.labels['api_usage_return_data'] = "If the operation was a success, this field contains the actual return data of the method.  Otherwise, it may contain data related to the error.";
heap.labels['api_usage_php'] = "Here is an example of an API call in PHP:";
heap.labels['api_usage_javascript'] = "Here is the same call in Javascript:";
heap.labels['api_usage_actionscript'] = "Finally, the same call in ActionScript3:";
heap.labels['api_legend'] = "Legend";
heap.labels['api_legend_method'] = "method_name";
heap.labels['api_legend_name'] = "name_of_parameter";
heap.labels['api_legend_type'] = "type_of_parameter";
heap.labels['api_legend_description'] = "Description of the parameter.";
heap.labels['api_legend_description_localized'] = "When the parameter name is in blue, the field is a localized field.  So you must pass name_of_parameter_fr, name_of_parameter_en, etc.";
heap.labels['api_common'] = "Common";
heap.labels['api_common_intro'] = "The following methods and parameters are common to all classes in the API.";
heap.labels['api_common_see_edit'] = "See the edit function for the list of parameters.";
heap.labels['api_common_autocomplete'] = "See the search function for the list of parameters.";
heap.labels['err'] = "An error occured";
heap.labels['err_msg_backhome'] = "Return to home";
heap.labels['err_needflash_msg'] = "This content requires installing Adobe Flash Player 10";
heap.labels['err_invalid_object'] = "Invalid object";
heap.labels['err_validation_failed'] = "Validation error";
heap.labels['err_not_authenticated'] = "Identification required";
heap.labels['err_permission_denied'] = "Missing permissions";
heap.labels['err_already_voted'] = "You have already voted";
heap.labels['err_object_already_exists'] = "This object already exists";
heap.labels['err_missing_parameter'] = "A required parameter is missing.";
heap.labels['user_email_not_available'] = "Ce courriel est déja pris";
heap.labels['user_username_not_available'] = "Ce surnom est déja pris";
heap.labels['validator_required_file'] = "You must supply a file";
heap.labels['validator_required_type'] = "You must supply the type.";
heap.labels['validator_required_author'] = "You must supply the author identifier.";
heap.labels['validator_required_name'] = "You must supply the name.";
heap.labels['validator_required_atom_id'] = "You must supply the atom identifier.";
heap.labels['validator_required_code'] = "You must supply the HTTP code.";
heap.labels['validator_required_uri'] = "You must supply the URI.";
heap.labels['validator_required_destination'] = "You must supply the destination URI/URL.";
heap.labels['validator_required_username'] = "You must supply the username.";
heap.labels['validator_required_email'] = "You must supply the email address.";
heap.labels['validator_required_password'] = "You must supply the password.";
heap.labels['validator_required_userslug'] = "You must supply the user identifier.";
heap.labels['validator_format_publish_start'] = "The publish start date must be of the following format : YYYY-MM-DD [HH:MM:SS]";
heap.labels['validator_format_importance'] = "The importance is a numeric value.";
heap.labels['validator_format_type'] = "Type can only include letters and/or punctuation.";
heap.labels['validator_format_author'] = "Author identifier must be numeric.";
heap.labels['validator_format_channel'] = "Channel identifier must be numeric.";
heap.labels['validator_format_name'] = "Name can only include letters and/or dashes.";
heap.labels['validator_format_atom_id'] = "Atom identifier must be numeric.";
heap.labels['validator_format_parent_id'] = "Parent identifier must be numeric.";
heap.labels['validator_format_title'] = "Title has an invalid format.";
heap.labels['validator_format_body'] = "Reaction body has an invalid format.";
heap.labels['validator_format_filename'] = "Filename can only include letters and/or punctuation.";
heap.labels['validator_format_code'] = "HTTP code must be of the following format : http-###";
heap.labels['validator_format_uri'] = "URI must be a valid relative URI (e.g. /exemple)";
heap.labels['validator_format_destination'] = "Destination URI/URL is invalid.";
heap.labels['validator_format_note'] = "Note is in invalid format.";
heap.labels['validator_format_username'] = "Username is invalid.  It must contain between 4 and 30 letters and/or numbers only.";
heap.labels['validator_format_email'] = "Email address is in incorrect format.";
heap.labels['validator_format_password'] = "Password is invalid.";
heap.labels['validator_format_firstname'] = "User's first name can only include letters and/or punctuation.";
heap.labels['validator_format_lastname'] = "User's last name can only include letters and/or punctuation.";
heap.labels['validator_format_sex'] = "User's sex must be specified as 'male' or 'female' only.";
heap.labels['validator_format_city'] = "City can only include letters and/or punctuation.";
heap.labels['validator_format_country'] = "Country can only include letters and/or punctuation.";
heap.labels['validator_format_region'] = "Region can only include letters and/or punctuation.";
heap.labels['validator_format_website'] = "Website must be a valid URL.";
heap.labels['validator_format_newsletter'] = "Newsletter choice must be numeric.";
heap.labels['validator_format_userslug'] = "User identifier is invalid.";
heap.labels['validator_match_password'] = "The passwords do not match.";
heap.labels['validator_field_required'] = "%field is required";
heap.labels['validator_field_format_date'] = "%field must be of the following format: YYYY-MM-DD [HH:MM:SS]";
heap.labels['validator_field_format_numeric'] = "%field must be numeric";
heap.labels['validator_field_format_email'] = "%field is not a valid email";
heap.labels['validator_field_format_text'] = "%field is not valid";
heap.labels['validator_username_inuse'] = "This username is already in use";

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']
});




