
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'] = 'dev';
heap.config['relative_root'] = '/heap';
heap.config['http_root'] = 'http://www.xoopla.com';
heap.config['request_uri'] = '/heap/js/heap.core.js';
heap.config['script_url'] = '/heap/js/heap.core.js';
heap.config['upload_maxfiles'] = 50;
heap.config['upload_maxsize'] = '300MB';
heap.config['version'] = '1x $Rev: 40712 $';
heap.config['last_build'] = '$Date:: 2009-06-26$:';
heap.config['thread_max_depth'] = '3';
heap.config['atom_types'] = {'type1':[],'type2':{'meta_fields':{'field1':{'label':'MyCustomField1','type':'text'},'field2':{'label':'MyCustomField2','type':'date'}}},'type3':{'meta_fields':{'field1':{'label':'MyCustomField1','type':'colorpicker'}}}};
heap.config['channel_types'] = [];
heap.config['reaction_types'] = ['comment','vote','answer_image','answer_text','answer_video'];
heap.config['channel_meta'] = [];
heap.config['user_meta'] = {'dob':{'label':'Date of birth','type':'date'},'first_visit':{'label':'First visit','type':'toggle'},'computed_nb_friends':{'label':'Nb friends','type':'hidden'},'computed_nb_connections':{'label':'Nb connections','type':'hidden'}};
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'];
heap.config['now_datetime'] = '2012-02-22 14:54:08';
heap.config['now_timestamp'] = 1329940448;
heap.config['now_date'] = '2012-02-22';
heap.config['now_time'] = '14:54:08';
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.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.urlmap['xoopla_validate_user'] = "/user/validate";

heap.labels['xoopla_menu_title'] = "Xoopla";
heap.labels['xoopla_business_menu_title'] = "Businesses";
heap.labels['xoopla_city_menu_title'] = "Cities";
heap.labels['xoopla_plan_menu_title'] = "Plans";
heap.labels['xoopla_user_menu_title'] = "Users";
heap.labels['business_manage'] = "Manage businesses";
heap.labels['business_name'] = "Name";
heap.labels['business_address'] = "Address";
heap.labels['business_phones'] = "Phones";
heap.labels['business_add'] = "Add a business";
heap.labels['business_edit'] = "Edit a business";
heap.labels['business_street_number'] = "#";
heap.labels['business_street_name'] = "Street name";
heap.labels['business_suite'] = "Suite";
heap.labels['business_city'] = "City";
heap.labels['business_region'] = "State/Province";
heap.labels['business_postal_code'] = "Postal code";
heap.labels['business_country'] = "Country";
heap.labels['business_phone'] = "Phone";
heap.labels['business_phone_2'] = "Phone 2";
heap.labels['business_cell_phone'] = "Cell phone";
heap.labels['business_fax'] = "Fax";
heap.labels['business_caption'] = "Caption";
heap.labels['business_plan'] = "Plan";
heap.labels['business_choose_plan'] = "Choose a plan";
heap.labels['business_location'] = "Location";
heap.labels['business_website'] = "Website";
heap.labels['business_longitude'] = "Longitude";
heap.labels['business_latitude'] = "Latitude";
heap.labels['business_email'] = "Email";
heap.labels['city_manage'] = "Manage cities";
heap.labels['city_add'] = "Add a city";
heap.labels['city_edit'] = "Edit a city";
heap.labels['city_info'] = "Information";
heap.labels['city_city'] = "City";
heap.labels['city_region'] = "State/Province";
heap.labels['city_country'] = "Country";
heap.labels['city_coordinates'] = "Coordinates";
heap.labels['city_longitude'] = "Longitude";
heap.labels['city_latitude'] = "Latitude";
heap.labels['sortby_city'] = "Order by city";
heap.labels['sortby_region'] = "Order by region";
heap.labels['sortby_country'] = "Order by country";
heap.labels['city_country_US'] = "United States";
heap.labels['city_region_CA_QC'] = "Quebec";
heap.labels['city_region_US_CA'] = "California";
heap.labels['city_region_select_country'] = "Please select a country";
heap.labels['city_region_select_region_CA'] = "Please select a province";
heap.labels['city_region_select_region_US'] = "Please select a state";
heap.labels['plan_manage'] = "Manage plans";
heap.labels['plan_add'] = "Add a plan";
heap.labels['plan_edit'] = "Edit a plan";
heap.labels['plan_info'] = "Information";
heap.labels['plan_name'] = "Name";
heap.labels['plan_cost'] = "Cost";
heap.labels['plan_features'] = "Features";
heap.labels['sortby_cost'] = "Order by cost";
heap.labels['page_not_found'] = "Page not found";
heap.labels['conf_email_subject'] = "Welcome to Xoopla";
heap.labels['conf_email1'] = "Dear ";
heap.labels['conf_email2'] = ",<br />Thanks for joining the Xoopla community. We are here to help you find local information faster. <br />Please confirm your email address by clicking on the following link, you will then be able to login using your email address as your username:<br />";
heap.labels['conf_email3'] = "<br /><br /><b><u>What to do on Xoopla</u></b><br />We all spend too much time trying to find the best accountant, a great yoga studio or whatever else you are looking for. On Xoopla you build your own Go-To community – the people, businesses, clubs and communities you Go-To for their experience and expertise. <br />Let’s not all reinvent the wheel over and over again. Somebody knows or can point you to the right places. We help you find that Go-To person.<br /><br /><b><u>Get Started</u></b><br />Here are some ways to get started:<br /><ul><li>Fill in your profile to let people know what you are a Go-To person for (gardening, apple products, wine, yoga, etc)</li><li>Invite your Go-To people so you can start sharing experiences and refer businesses</li><li>Go to the communities we are developing on Xoopla and start sharing your stories or build your own Go-To community for a topic you are passionate and knowledgeable about </li><li>Start reviewing businesses you know</li></ul><b><u>About Privacy on Xoopla</u></b><br />We respect your privacy and do not share any of your personal information with third parties. It’s against our principles of respecting your need for privacy. Besides, Xoopla does not need your personal information to make a living. Our revenue model is based on business membership, not on the typical advertising model. <br /><br /><b><u>Questions</u></b><br />If you have any questions, please feel free to contact me at <a href='mailto:joost@xoopla.com'>joost@xoopla.com</a>.<br /><br />Joost Wentink and the Xoopla Team<br />";
heap.labels['notification_subject_message'] = "[from] sent [to] a message on Xoopla.com";
heap.labels['notification_subject_review'] = "[from] has reviewed [to] on Xoopla.com";
heap.labels['notification_subject_connection'] = "[from] has requested to connect with [to] on Xoopla.com";
heap.labels['notification_subject_answer'] = "[from] has posted a reply to your question on Xoopla.com";
heap.labels['notification_subject_blog'] = "[from] has posted a comment to your blog on Xoopla.com";
heap.labels['notification_message'] = "[from] sent [to] a message<br /><br />[attach]<br /><br />To reply to this message please log in at: <a href='http://www.xoopla.com'>www.xoopla.com</a>";
heap.labels['notification_review'] = "[from] has reviewed [to]<br /><br />[attach]<br /><br />To view the review please log in at: <a href='http://www.xoopla.com'>www.xoopla.com</a>";
heap.labels['notification_connection'] = "[from] has requested to connect with [to]<br /><br />To respond to the connection request please log in at: <a href='http://www.xoopla.com'>www.xoopla.com</a>";
heap.labels['notification_answer'] = "[from] has posted an answer to your question [to]<br /><br />To read and respond to the reply please log in at: <a href='http://www.xoopla.com'>www.xoopla.com</a>";
heap.labels['notification_blog'] = "[from] has posted a comment to your blog<br /><br />To read and respond to the comment please log in at: <a href='http://www.xoopla.com'>www.xoopla.com</a>";
heap.labels['password_change_subject'] = "Xoopla reset password request";
heap.labels['password_change'] = "Hello!<br /><br />You've requested to reset the password to your Xoopla account. <br /><br /><a href='[link]'>Click to create a new password</a>";
heap.labels['invitation_subject'] = "Check out Xoopla.com";
heap.labels['invitation'] = "Hello [name]!<br /><br />[user] has invited u to join the Xoopla community. We are here to help you find local information faster. . <br />Please fill in the signup from by clicking on the following link, you will then be able to login using your email address as your username:<br />[link]<br /><br />[message]<br /><br /><b><u>What to do on Xoopla</u></b><br />We all spend too much time trying to find the best accountant, a great yoga studio or whatever else you are looking for. On Xoopla you build your own Go-To community – the people, businesses, clubs and communities you Go-To for their experience and expertise. <br />Let’s not all reinvent the wheel over and over again. Somebody knows or can point you to the right places. We help you find that Go-To person.<br /><br /><b><u>Get Started</u></b><br />Here are some ways to get started:<br /><ul><li>Fill in your profile to let people know what you are a Go-To person for (gardening, apple products, wine, yoga, etc)</li><li>Invite your Go-To people so you can start sharing experiences and refer businesses</li><li>Go to the communities we are developing on Xoopla and start sharing your stories or build your own Go-To community for a topic you are passionate and knowledgeable about </li><li>Start reviewing businesses you know</li></ul><b><u>About Privacy on Xoopla</u></b><br />We respect your privacy and do not share any of your personal information with third parties. It’s against our principles of respecting your need for privacy. Besides, Xoopla does not need your personal information to make a living. Our revenue model is based on business membership, not on the typical advertising model. <br /><br /><b><u>Questions</u></b><br />If you have any questions, please feel free to contact me at <a href='mailto:joost@xoopla.com'>joost@xoopla.com</a>.<br /><br />Joost Wentink and the Xoopla Team<br />";
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'] = "Add";
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'] = "The email address is already in use!";
heap.labels['user_username_not_available'] = "This username is already used";
heap.labels['user_username_invalid_characters'] = "The username you have chosen contains invalid characters: '@' can not be used.";
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_match_email'] = "The emails do not match.";
heap.labels['validator_format_color'] = "The color defined is invalid in length or format.";
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.media.sizes['thumb'] = new Object();
heap.media.sizes['thumb']['width'] = 74;
heap.media.sizes['thumb']['height'] = 83;
heap.media.sizes['thumb']['mode'] = 'resize-crop';
heap.media.sizes['thumb']['dimension'] = 'min';
heap.media.sizes['small'] = new Object();
heap.media.sizes['small']['width'] = 80;
heap.media.sizes['small']['height'] = 80;
heap.media.sizes['small']['mode'] = 'resize';
heap.media.sizes['small']['dimension'] = 'max';
heap.media.sizes['square'] = new Object();
heap.media.sizes['square']['width'] = 100;
heap.media.sizes['square']['height'] = 100;
heap.media.sizes['square']['mode'] = 'resize';
heap.media.sizes['square']['dimension'] = 'max';
heap.media.sizes['mini'] = new Object();
heap.media.sizes['mini']['width'] = 37;
heap.media.sizes['mini']['height'] = 34;
heap.media.sizes['mini']['mode'] = 'resize-crop';
heap.media.sizes['mini']['dimension'] = 'min';
heap.media.sizes['50x50'] = new Object();
heap.media.sizes['50x50']['width'] = 50;
heap.media.sizes['50x50']['height'] = 50;
heap.media.sizes['50x50']['mode'] = 'resize';
heap.media.sizes['50x50']['dimension'] = 'max';
heap.media.sizes['70x70'] = new Object();
heap.media.sizes['70x70']['width'] = 70;
heap.media.sizes['70x70']['height'] = 70;
heap.media.sizes['70x70']['mode'] = 'resize';
heap.media.sizes['70x70']['dimension'] = 'max';
heap.media.sizes['list'] = new Object();
heap.media.sizes['list']['width'] = 147;
heap.media.sizes['list']['height'] = 94;
heap.media.sizes['list']['mode'] = 'resize-crop';
heap.media.sizes['list']['dimension'] = 'min';
heap.media.sizes['pb_205'] = new Object();
heap.media.sizes['pb_205']['width'] = 205;
heap.media.sizes['pb_205']['height'] = 205;
heap.media.sizes['pb_205']['mode'] = 'resize';
heap.media.sizes['pb_205']['dimension'] = 'max';
heap.media.sizes['pb_400'] = new Object();
heap.media.sizes['pb_400']['width'] = 400;
heap.media.sizes['pb_400']['height'] = 400;
heap.media.sizes['pb_400']['mode'] = 'resize';
heap.media.sizes['pb_400']['dimension'] = 'max';
heap.media.sizes['pb_620'] = new Object();
heap.media.sizes['pb_620']['width'] = 620;
heap.media.sizes['pb_620']['height'] = 620;
heap.media.sizes['pb_620']['mode'] = 'resize';
heap.media.sizes['pb_620']['dimension'] = 'max';
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['medium'] = new Object();
heap.media.sizes['medium']['width'] = 299;
heap.media.sizes['medium']['height'] = 226;
heap.media.sizes['medium']['mode'] = 'resize-crop';
heap.media.sizes['medium']['dimension'] = 'min';
heap.media.sizes['large'] = new Object();
heap.media.sizes['large']['width'] = 612;
heap.media.sizes['large']['height'] = 395;
heap.media.sizes['large']['mode'] = 'resize-crop';
heap.media.sizes['large']['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']
});




