
jQuery.ajaxSetup({ type:"POST", dataType:'json' });

var rbci = {
  SUCCESS: 1,
  FAILURE: 0
};

rbci.form = {};
rbci.submit = {};

rbci.api = {};
rbci.config = {};
rbci.labels = {};
rbci.urlmap = {};
rbci.api.registration = {};
rbci.api.newsletter = {};

/**
 * Perform login
 * credentials:
 * username
 * password
 * @param {Object} callback
 * @param {Object} credentials
 */
rbci.api.registration.submit = function(callback, credentials)
{
	jQuery.ajax({
		url: rbci.urlmap.api_json+'/registration/submit',
		data: { parameters: JSON.stringify(credentials) }, 
		success: callback
	}); 
}

rbci.api.registration.validate = function(callback, credentials)
{
	jQuery.ajax({
		url: rbci.urlmap.api_json+'/registration/validate',
		data: { parameters: JSON.stringify(credentials) }, 
		success: callback
	}); 
}

rbci.api.newsletter.submit = function(callback, credentials)
{
	jQuery.ajax({
		url: rbci.urlmap.api_json+'/newsletter/submit',
		data: { parameters: JSON.stringify(credentials) }, 
		success: callback
	}); 
}

rbci.api.newsletter.validate = function(callback, credentials)
{
	jQuery.ajax({
		url: rbci.urlmap.api_json+'/newsletter/validate',
		data: { parameters: JSON.stringify(credentials) }, 
		success: callback
	}); 
}


rbci.config['relative_root'] = "";
rbci.config['http_root'] = "http://redbullcrashedice.com";
rbci.config['request_uri'] = "/registration/js";
rbci.config['upload_maxfiles'] = "5";
rbci.config['upload_maxsize'] = "5MB";
rbci.config['version'] = "0.1";
rbci.config['last_build'] = "Tuesday January 06 2009 15:32:48  ";

rbci.urlmap['root'] = "";
rbci.urlmap['home'] = "/home";
rbci.urlmap['app_lang'] = "/";
rbci.urlmap['app_lang_en'] = "/";
rbci.urlmap['app_lang_fr'] = "/fr";
rbci.urlmap['app_admin'] = "/admin";
rbci.urlmap['app_admin_login'] = "/admin/login";
rbci.urlmap['app_admin_logout'] = "/admin/logout";
rbci.urlmap['app_admin_feature'] = "/admin/features";
rbci.urlmap['app_admin_users'] = "/admin/users";
rbci.urlmap['app_admin_registration_list'] = "/admin/registration/users";
rbci.urlmap['app_admin_registration_lottery'] = "/admin/registration/lottery";
rbci.urlmap['app_admin_registration_qualificationtimes'] = "/admin/registration/qualificationtimes";
rbci.urlmap['intro'] = "/intro";
rbci.urlmap['video'] = "/video";
rbci.urlmap['evite'] = "/invite-event";
rbci.urlmap['event'] = "Array";
rbci.urlmap['registration'] = "/registration";
rbci.urlmap['register'] = "Array";
rbci.urlmap['blog'] = "/blog";
rbci.urlmap['gallery'] = "/media";
rbci.urlmap['press'] = "/press/info";
rbci.urlmap['stuff'] = "Array";
rbci.urlmap['tools_jsconfig'] = "/tools/jslib.js";
rbci.urlmap['api_json'] = "/json";

rbci.labels['email_contact'] = "info@gestev.com";
rbci.labels['AUTH_WRONG_LOGIN'] = "Email is invalid.";
rbci.labels['AUTH_WRONG_PASSWORD'] = "Password is incorrect.";
rbci.labels['MISSING_FIELDS'] = "Missing fields";
rbci.labels['label_download'] = "Download";
rbci.labels['prev'] = "Previous";
rbci.labels['next'] = "Next";
rbci.labels['description'] = "Description: ";
rbci.labels['date'] = "Date: ";
rbci.labels['close'] = "Close";
rbci.labels['soon'] = "soon";
rbci.labels['langue'] = "Fran&ccedil;ais";
rbci.labels['age'] = "Age: ";
rbci.labels['weight'] = "Weight: ";
rbci.labels['height'] = "Height: ";
rbci.labels['oops'] = "Oops!";
rbci.labels['back'] = "Back";
rbci.labels['cancel'] = "Cancel";
rbci.labels['requireFields'] = "required fields";
rbci.labels['dd'] = "dd";
rbci.labels['mm'] = "mm";
rbci.labels['yyyy'] = "yyyy";
rbci.labels['SignUpCancel'] = "Cancel";
rbci.labels['fanFaceBook'] = "Become a fan on Facebook";
rbci.labels['partner1'] = "City Of Quebec";
rbci.labels['partner2'] = "Bonjour Qu&eacute;bec";
rbci.labels['partner3'] = "Quebec City Tourism";
rbci.labels['champion'] = "Champion:";
rbci.labels['contact'] = "Contact";
rbci.labels['location'] = "View location";
rbci.labels['eventSurTitle'] = "Event";
rbci.labels['eventTitle'] = "Events";
rbci.labels['eventRaceTitle'] = "The Race";
rbci.labels['eventRacePrizes'] = "Prizes";
rbci.labels['eventRaceTrack'] = "The Track";
rbci.labels['eventRaceInfo'] = "Event Info";
rbci.labels['eventRaceHistory'] = "History";
rbci.labels['bio'] = "Bio";
rbci.labels['eventSubTitle'] = "Red Bull Crashed Ice is free to spectators.";
rbci.labels['rbci_permalink'] = "Permanent Link to";
rbci.labels['rbci_read_more'] = "Read the rest of this entry";
rbci.labels['rbci_comments'] = "Comments: ";
rbci.labels['rbci_comments_text'] = "Comments";
rbci.labels['rbci_comments_title'] = "Responses to";
rbci.labels['rbci_comment_title'] = "Responses to";
rbci.labels['rbci_says_label'] = "Says: ";
rbci.labels['rbci_form_title'] = "Leave a Reply";
rbci.labels['rbci_form_name'] = "Name";
rbci.labels['rbci_form_require'] = "require";
rbci.labels['rbci_form_mail'] = "Mail";
rbci.labels['rbci_form_not_publish'] = "will not be published";
rbci.labels['rbci_form_send'] = "Send";
rbci.labels['rbci_comment_approve'] = "Pas approuve...";
rbci.labels['blogTitle'] = "Blog";
rbci.labels['blogSurTitle'] = "Blog";
rbci.labels['waitModeration'] = "Your comment is awaiting moderation";
rbci.labels['errorComment'] = "Error, empty require form fields or duplicate comment detected.<br />Check your information and try again.";
rbci.labels['rbci_write_label'] = "Write a comment: ";
rbci.labels['registration'] = "Registration";
rbci.labels['registration_title'] = "Registration Lottery Form";
rbci.labels['confirmation_title'] = "Lottery Confirmation";
rbci.labels['register_form_title'] = "Please fill out all the fields below for a chance to qualify for Red Bull Crashed Ice 2009.";
rbci.labels['label_qualification_city'] = "Qualification city: ";
rbci.labels['select_qualification_city'] = "Select the city where you want to qualify";
rbci.labels['select_province'] = "Select a province";
rbci.labels['label_gender'] = "Gender: ";
rbci.labels['label_gender_male'] = "Male";
rbci.labels['label_gender_female'] = "Female";
rbci.labels['label_firstname'] = "First name: ";
rbci.labels['label_lastname'] = "Last name: ";
rbci.labels['label_address'] = "Address: ";
rbci.labels['label_city'] = "City: ";
rbci.labels['label_province'] = "Province: ";
rbci.labels['label_cp'] = "Postal code: ";
rbci.labels['label_phone'] = "Phone number: ";
rbci.labels['label_cell'] = "Cell number: ";
rbci.labels['label_email'] = "Email: ";
rbci.labels['label_birth'] = "Date of birth: ";
rbci.labels['label_birth_short'] = "Date of birth: ";
rbci.labels['register_terms'] = "Yes I want to know all about events, contests and promotions of Red Bull";
rbci.labels['register_error_title'] = "Please fill out the fields below";
rbci.labels['error_qualification_city'] = "select your qualifier city";
rbci.labels['error_gender'] = "select your gender";
rbci.labels['error_fname'] = "enter your first name";
rbci.labels['error_lname'] = "enter your last name";
rbci.labels['error_city'] = "enter your city";
rbci.labels['error_province'] = "select your province";
rbci.labels['error_cp'] = "enter your postal code or a valid postal code";
rbci.labels['error_phone'] = "enter your phone number or a valid phone number";
rbci.labels['error_email'] = "enter your email address or a valid email address";
rbci.labels['error_date'] = "please enter your date of birth";
rbci.labels['error_date_limit'] = "unfortunately Red Bull does not accept registrations under 18 year old";
rbci.labels['error_doublon_email'] = "this email is already used. You can't register more than one time for the qualification";
rbci.labels['error_cell'] = "enter a valid cell number";
rbci.labels['error_address'] = "Enter your address";
rbci.labels['registrantSurTitle'] = "Qualifiers";
rbci.labels['registrantTitle'] = "2009 Athletes";
rbci.labels['registrantSelectCity'] = "Select a city";
rbci.labels['registrantLastName'] = "Last Name";
rbci.labels['registrantFirstName'] = "First Name";
rbci.labels['registrantGender'] = "Gender";
rbci.labels['registrantHometown'] = "Hometown";
rbci.labels['registrantDateOfBirth'] = "Date of birth";
rbci.labels['registrantGenderDisplayM'] = "Male";
rbci.labels['registrantGenderDisplayF'] = "Female";
rbci.labels['qualification_information_title'] = "Qualifier location";
rbci.labels['qualification_location_title'] = "Check out below to find details on your local qualifier.";
rbci.labels['qualifiersSurTitle'] = "Athletes";
rbci.labels['qualifiersTitle'] = "The Athletes";
rbci.labels['qualifiers_select_label'] = "Athletes by qualifier city";
rbci.labels['qualifiers_invited_title'] = "International Athletes";
rbci.labels['qualification_time'] = "Qualification time";
rbci.labels['invited_liste_label'] = "List of international Athletes";
rbci.labels['signUpTitle'] = "Sign up for the e-newsletter";
rbci.labels['signUpLabel_email'] = "Email address:";
rbci.labels['signUpRedbull_newsletter'] = "Send me the Red Bull e-newsletter!";
rbci.labels['signUpCrashedIce_newsletter'] = "Send me the Red Bull Crashed Ice e-newsletter!";
rbci.labels['SignUpInvite'] = "Sign up for the e-newsletter";
rbci.labels['signUpValue'] = "Your email here";
rbci.labels['SignUpError1'] = "Oops! You missed something.";
rbci.labels['SignUpError2'] = "Please fill out all the fields.";
rbci.labels['galleryTitle'] = "Gallery";
rbci.labels['back_gallery'] = "Back to the gallery";
rbci.labels['mediaTitle'] = "Media";
rbci.labels['mediaContact'] = "Media contacts";
rbci.labels['mediaLabelName'] = "Name: ";
rbci.labels['mediaLabelPhone'] = "Phone: ";
rbci.labels['mediaLabelEmail'] = "Email: ";
rbci.labels['mediaCityMedia'] = "Quebec City Media";
rbci.labels['mediaOutsideQuebec'] = "Media Outside Quebec";
rbci.labels['mediaMontreal'] = "Montreal Media";
rbci.labels['mediaPressRelease'] = "Press Release";
rbci.labels['sticker'] = "Sticker";
rbci.labels['poster'] = "Posters";
rbci.labels['banner'] = "Web banners";
rbci.labels['wallpapersTitle'] = "Wallpapers";
rbci.labels['crashedIceGame'] = "Redbull Crashed Ice Game";
rbci.labels['playNow'] = "Play Now";
rbci.labels['gamesTitle'] = "Games";
rbci.labels['stuff'] = "Stuff";
rbci.labels['downloadTitle'] = "Downloads";
rbci.labels['logo'] = "Logo";
rbci.labels['footer_terms'] = "Terms of use";
rbci.labels['footer_policy'] = "Privacy policy";
rbci.labels['footer_contact'] = "Contact Us";
rbci.labels['prov_alberta'] = "Alberta";
rbci.labels['prov_cbrit'] = "British Columbia";
rbci.labels['prov_manitoba'] = "Manitoba";
rbci.labels['prov_newB'] = "New Brunswick";
rbci.labels['prov_labrador'] = "Newfoundland and Labrador";
rbci.labels['prov_newE'] = "Nova Scotia";
rbci.labels['prov_territoire'] = "Northwest Territories";
rbci.labels['prov_nunavut'] = "Nunavut";
rbci.labels['prov_ontario'] = "Ontario";
rbci.labels['prov_prince'] = "Prince Edward Island";
rbci.labels['prov_quebec'] = "Quebec";
rbci.labels['prov_saskatchewan'] = "Saskatchewan";
rbci.labels['prov_yukon'] = "Yukon";
rbci.labels['city_QUE'] = "Quebec City";
rbci.labels['city_TOR'] = "Toronto";
rbci.labels['city_LON'] = "London";
rbci.labels['city_SAS'] = "Saskatoon";
rbci.labels['city_WIN'] = "Winnipeg";
rbci.labels['city_MTL'] = "Montreal";
rbci.labels['city_OTT'] = "Ottawa";
rbci.labels['city_HAL'] = "Halifax";
rbci.labels['city_CAL'] = "Calgary";
rbci.labels['city_VAN'] = "Vancouver";
rbci.labels['city_EDM'] = "Edmonton";
rbci.labels['page_title_race-format'] = "Red Bull Crashed Ice-The Race";
rbci.labels['page_kw_race-format'] = "Red bull Crashed Ice Race, Crashed Ice Race, Race, Downhill race, Red Bull race, skating race, ice race, race format, Red Bull Crashed Ice race format, Crashed Ice race format";
rbci.labels['page_description_race-format'] = "All the details you need to know to be crowned Red Bull Crashed Ice champion, from the qualifiers to the final heat and everything in between.";
rbci.labels['page_title_prizes'] = " Red Bull Crashed Ice- Prizes";
rbci.labels['page_kw_prizes'] = "Prizes, Prize, Race, Crashed Ice prize, Prize purse, champion, Red Bull Crashed Ice prize, Red Bull Crashed Ice champion, bragging rights, crowned champion, winning Crashed Ice, win skating race, win Red Bull Crashed Ice";
rbci.labels['page_description_prizes'] = " In addition to bragging rights, Red Bull offers a prize purse for the top for finishers in both the men's and women's divisions.";
rbci.labels['page_title_course-layout'] = " Red Bull Crashed Ice-The Track";
rbci.labels['page_kw_course-layout'] = "Red Bull Crashed Ice track, Crashed Ice track, vertical drops, Red Bull Crashed Ice course, Crashed Ice course, Red Bull Crashed Ice course layout, Crashed Ice course layout, Quebec City course, Quebec City track, Red Bull course, Red Bull track, Ice track, Ice course, course layout, track layout";
rbci.labels['page_description_course-layout'] = "With its massive vertical drops, highway speeds, jumps, berms and gaps, the Red Bull Crashed Ice course has carved its place in frozen water history, settling right between the first pond hockey game and slushies.";
rbci.labels['page_title_event-info'] = " Red Bull Crashed Ice-Spectator Info";
rbci.labels['page_kw_event-info'] = "Red Bull Crashed Ice event, Crashed Ice event, Red Bull Crashed Ice spectators, Crashed Ice spectators, Red Bull Crashed Ice map, Crashed Ice map, map, Red Bull Crashed Ice activities, Crashed Ice activities, Red Bull Crashed Ice transportation, Crashed Ice transportation, transportation, Crashed Ice weekend, spectator info";
rbci.labels['page_description_event-info'] = "Red Bull Crashed Ice is back in Quebec City on January 24, 2009. Wanna come watch? Get the full scoop here.";
rbci.labels['page_title_history'] = " Red Bull Crashed Ice-Legends";
rbci.labels['page_kw_history'] = "Red Bull Crashed Ice legends, Crashed Ice legends, Red Bull Crashed Ice past winners, Crashed Ice past winners, Red Bull Crashed Ice winners, Crashed Ice winners, Red Bull Crashed Ice history, Crashed Ice history, Skating race history, Skating race legends, Helsinki, Finland, history, past winners, legendary";
rbci.labels['page_description_history'] = "Since 2000, Red Bull Crashed Ice has made the journey around the world.  As hundreds of competitors attempt to brave the elements of each course, only a few have made it through and taken home the title. ";
rbci.labels['page_title_form'] = " Red Bull Crashed Ice-Registration";
rbci.labels['page_kw_form'] = "Red Bull Crashed Ice registration, Crashed Ice registration, Red Bull Crashed Ice registration form, Crashed Ice registration form, registration, compete, qualify, qualifiers, Red Bull Crashed Ice qualifiers, Crashed Ice qualifiers, drafting athletes, qualifying cities, tryouts";
rbci.labels['page_description_form'] = "Red Bull Crashed Ice is now drafting athletes. Think you have what it takes? Prove it - Register now.";
rbci.labels['page_title_gallery'] = " Red Bull Crashed Ice-Gallery";
rbci.labels['page_kw_gallery'] = "Red Bull Crashed Ice gallery, Crashed Ice gallery, Red Bull crashed ice photos, Crashed Ice photos, Red Bull Crashed Ice videos, Crashed Ice videos, Quebec City, Helsinki, Finland, gallery, Crashed Ice images, Red Bull Crashed Ice images, images";
rbci.labels['page_description_gallery'] = "Red Bull Crashed Ice photos, videos and more from Quebec City, Canada, and Helsinki, Finland. ";
rbci.labels['page_title_media'] = " Red Bull Crashed Ice-Media";
rbci.labels['page_kw_media'] = "Red Bull Crashed Ice media, Crashed Ice media, Red Bull Crashed Ice press, Crashed Ice press, media contact, Red Bull Crashed Ice press release, Crashed Ice press release, press release, media pass, press contact ";
rbci.labels['page_description_media'] = "For media, find everything you need: contacts, press releases and the legendary stories from Red Bull Crashed Ice.";
rbci.labels['page_title_games'] = " Red Bull Crashed Ice-Games";
rbci.labels['page_kw_games'] = "Red Bull Crashed Ice game, Crashed Ice game, video game, player, play, skating game, online game";
rbci.labels['page_description_games'] = "Wanna play The Red Bull Crashed Ice game? Practice your skills before you hit the real track!";
rbci.labels['page_title_wallpapers'] = " Red Bull Crashed Ice-Wallpapers";
rbci.labels['page_kw_wallpapers'] = "Red Bull Crashed Ice wallpaper, Crashed Ice wallpaper, Red Bull Crashed Ice screen saver, Red Bull Crashed Ice desktop, Crashed Ice desktop";
rbci.labels['page_description_wallpapers'] = "Get awesome Red Bull Crashed Ice wallpapers for your desktop.";
rbci.labels['page_title_downloads'] = " Red Bull Crashed Ice-Downloads";
rbci.labels['page_kw_downloads'] = "Red Bull Crashed Ice logo, Crashed Ice logo, Red Bull Crashed Ice poster, Crashed Ice poster, Red Bull Crashed Ice banner, Crashed Ice banner, Red Bull Crashed Ice sticker, Crashed Ice sticker, logo, poster, sticker, banner, Red Bull Crashed Ice download, Crashed Ice download, download ";
rbci.labels['page_description_downloads'] = "Download Red Bull Crashed Ice logos, posters, stickers and more.";
rbci.labels['page_title_default'] = "Red Bull Crashed Ice 2009";
rbci.labels['page_kw_default'] = "Red Bull Crashed Ice, Crashed Ice, Red Bull events, Red Bull extreme sports, Skating, boardercross, downhill skiing, hockey, Quebec City, winter, extreme sports, winter sports, women’s division, competition, race";
rbci.labels['page_description_default'] = " Sharpen your blades, Red Bull Crashed Ice is back! A combination of hockey, downhill skiing and boardercross, Red Bull Crashed Ice will return to the historic district of Old Quebec on January 24, 2009.";
