// source --> http://thefamilyleader.com/wp-content/plugins/events-manager/includes/js/events-manager.js?ver=5.6624 jQuery(document).ready( function($){ var load_ui_css = false; //load jquery ui css? /* Time Entry */ $('#start-time').each(function(i, el){ $(el).addClass('em-time-input em-time-start').next('#end-time').addClass('em-time-input em-time-end').parent().addClass('em-time-range'); }); if( $(".em-time-input").length > 0 ){ em_setup_timepicker('body'); } /* Calendar AJAX */ $('.em-calendar-wrapper a').unbind("click"); $('.em-calendar-wrapper a').undelegate("click"); $('.em-calendar-wrapper').delegate('a.em-calnav, a.em-calnav', 'click', function(e){ e.preventDefault(); $(this).closest('.em-calendar-wrapper').prepend('
'); var url = em_ajaxify($(this).attr('href')); $(this).closest('.em-calendar-wrapper').load(url, function(){$(this).trigger('em_calendar_load');}); } ); //Events Search $(document).delegate('.em-toggle', 'click change', function(e){ e.preventDefault(); //show or hide advanced tickets, hidden by default var el = $(this); var rel = el.attr('rel').split(':'); if( el.hasClass('show-search') ){ if( rel.length > 1 ){ el.closest(rel[1]).find(rel[0]).slideUp(); } else{ $(rel[0]).slideUp(); } el.find('.show, .show-advanced').show(); el.find('.hide, .hide-advanced').hide(); el.removeClass('show-search'); }else{ if( rel.length > 1 ){ el.closest(rel[1]).find(rel[0]).slideDown(); } else{ $(rel[0]).slideDown(); } el.find('.show, .show-advanced').hide(); el.find('.hide, .hide-advanced').show(); el.addClass('show-search'); } }); if( EM.search_term_placeholder ){ if( 'placeholder' in document.createElement('input') ){ $('input.em-events-search-text, input.em-search-text').attr('placeholder', EM.search_term_placeholder); }else{ $('input.em-events-search-text, input.em-search-text').blur(function(){ if( this.value=='' ) this.value = EM.search_term_placeholder; }).focus(function(){ if( this.value == EM.search_term_placeholder ) this.value=''; }).trigger('blur'); } } $('.em-search-form select[name=country]').change( function(){ var el = $(this); $('.em-search select[name=state]').html(''); $('.em-search select[name=region]').html(''); $('.em-search select[name=town]').html(''); if( el.val() != '' ){ el.closest('.em-search-location').find('.em-search-location-meta').slideDown(); var data = { action : 'search_states', country : el.val(), return_html : true }; $('.em-search select[name=state]').load( EM.ajaxurl, data ); data.action = 'search_regions'; $('.em-search select[name=region]').load( EM.ajaxurl, data ); data.action = 'search_towns'; $('.em-search select[name=town]').load( EM.ajaxurl, data ); }else{ el.closest('.em-search-location').find('.em-search-location-meta').slideUp(); } }); $('.em-search-form select[name=region]').change( function(){ $('.em-search select[name=state]').html(''); $('.em-search select[name=town]').html(''); var data = { action : 'search_states', region : $(this).val(), country : $('.em-search-form select[name=country]').val(), return_html : true }; $('.em-search select[name=state]').load( EM.ajaxurl, data ); data.action = 'search_towns'; $('.em-search select[name=town]').load( EM.ajaxurl, data ); }); $('.em-search-form select[name=state]').change( function(){ $('.em-search select[name=town]').html(''); var data = { action : 'search_towns', state : $(this).val(), region : $('.em-search-form select[name=region]').val(), country : $('.em-search-form select[name=country]').val(), return_html : true }; $('.em-search select[name=town]').load( EM.ajaxurl, data ); }); //in order for this to work, you need the above classes to be present in your templates $(document).delegate('.em-search-form, .em-events-search-form', 'submit', function(e){ var form = $(this); if( this.em_search && this.em_search.value == EM.txt_search){ this.em_search.value = ''; } var results_wrapper = form.closest('.em-search-wrapper').find('.em-search-ajax'); if( results_wrapper.length == 0 ) results_wrapper = $('.em-search-ajax'); if( results_wrapper.length > 0 ){ results_wrapper.append('
'); var submitButton = form.find('.em-search-submit'); submitButton.data('buttonText', submitButton.val()).val(EM.txt_searching); var img = submitButton.children('img'); if( img.length > 0 ) img.attr('src', img.attr('src').replace('search-mag.png', 'search-loading.gif')); var vars = form.serialize(); $.ajax( EM.ajaxurl, { type : 'POST', dataType : 'html', data : vars, success : function(responseText){ submitButton.val(submitButton.data('buttonText')); if( img.length > 0 ) img.attr('src', img.attr('src').replace('search-loading.gif', 'search-mag.png')); results_wrapper.replaceWith(responseText); if( form.find('input[name=em_search]').val() == '' ){ form.find('input[name=em_search]').val(EM.txt_search); } //reload results_wrapper results_wrapper = form.closest('.em-search-wrapper').find('.em-search-ajax'); if( results_wrapper.length == 0 ) results_wrapper = $('.em-search-ajax'); jQuery(document).triggerHandler('em_search_ajax', [vars, results_wrapper, e]); //ajax has loaded new results } }); e.preventDefault(); return false; } }); if( $('.em-search-ajax').length > 0 ){ $(document).delegate('.em-search-ajax a.page-numbers', 'click', function(e){ var a = $(this); var data = a.closest('.em-pagination').attr('data-em-ajax'); var wrapper = a.closest('.em-search-ajax'); var wrapper_parent = wrapper.parent(); var qvars = a.attr('href').split('?'); var vars = qvars[1]; //add data-em-ajax att if it exists if( data != '' ){ vars = vars != '' ? vars+'&'+data : data; } wrapper.append('
'); $.ajax( EM.ajaxurl, { type : 'POST', dataType : 'html', data : vars, success : function(responseText) { wrapper.replaceWith(responseText); wrapper = wrapper_parent.find('.em-search-ajax'); jQuery(document).triggerHandler('em_search_ajax', [vars, wrapper, e]); //ajax has loaded new results } }); e.preventDefault(); return false; }); } /* * ADMIN AREA AND PUBLIC FORMS (Still polishing this section up, note that form ids and classes may change accordingly) */ //Events List //Approve/Reject Links $('.events-table').on('click', '.em-event-delete', function(){ if( !confirm("Are you sure you want to delete?") ){ return false; } window.location.href = this.href; }); //Forms $('#event-form #event-image-delete, #location-form #location-image-delete').on('click', function(){ var el = $(this); if( el.is(':checked') ){ el.closest('.event-form-image, .location-form-image').find('#event-image-img, #location-image-img').hide(); }else{ el.closest('.event-form-image, .location-form-image').find('#event-image-img, #location-image-img').show(); } }); //Tickets & Bookings if( $("#em-tickets-form").length > 0 ){ //Enable/Disable Bookings $('#event-rsvp').click( function(event){ if( !this.checked ){ confirmation = confirm(EM.disable_bookings_warning); if( confirmation == false ){ event.preventDefault(); }else{ $('#event-rsvp-options').hide(); } }else{ $('#event-rsvp-options').fadeIn(); } }); if($('input#event-rsvp').is(":checked")) { $("div#rsvp-data").fadeIn(); } else { $("div#rsvp-data").hide(); } //Ticket(s) UI var reset_ticket_forms = function(){ $('#em-tickets-form table tbody tr.em-tickets-row').show(); $('#em-tickets-form table tbody tr.em-tickets-row-form').hide(); }; //recurrences and cut-off logic for ticket availability if( $('#em-recurrence-checkbox').length > 0 ){ $('#em-recurrence-checkbox').change(function(){ if( $('#em-recurrence-checkbox').is(':checked') ){ $('#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring').show(); $('#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal, #em-tickets-form .hidden').hide(); }else{ $('#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal').show(); $('#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring, #em-tickets-form .hidden').hide(); } }).trigger('change'); }else if( $('#em-form-recurrence').length > 0 ){ $('#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring').show(); $('#em-tickets-form .ticket-dates-from-normal, #em-tickets-form .ticket-dates-to-normal, #event-rsvp-options .em-booking-date-normal, #em-tickets-form .hidden').hide(); }else{ $('#em-tickets-form .ticket-dates-from-recurring, #em-tickets-form .ticket-dates-to-recurring, #event-rsvp-options .em-booking-date-recurring, #em-tickets-form .hidden').hide(); } //Add a new ticket $("#em-tickets-add").click(function(e){ e.preventDefault(); reset_ticket_forms(); //create copy of template slot, insert so ready for population var tickets = $('#em-tickets-form table tbody'); var rowNo = tickets.length+1; var slot = tickets.first().clone(true).attr('id','em-ticket-'+ rowNo).appendTo($('#em-tickets-form table')); //change the index of the form element names slot.find('*[name]').each( function(index,el){ el = $(el); el.attr('name', el.attr('name').replace('em_tickets[0]','em_tickets['+rowNo+']')); }); //show ticket and switch to editor slot.show().find('.ticket-actions-edit').trigger('click'); //refresh datepicker and values slot.find('.em-date-input-loc').datepicker('destroy').removeAttr('id'); //clear all datepickers slot.find('.em-time-input').unbind().each(function(index, el){ this.timePicker = false; }); //clear all timepickers - consequently, also other click/blur/change events, recreate the further down em_setup_datepicker(slot); em_setup_timepicker(slot); $('html, body').animate({ scrollTop: slot.offset().top - 30 }); //sends user to form }); //Edit a Ticket $(document).delegate('.ticket-actions-edit', 'click', function(e){ e.preventDefault(); reset_ticket_forms(); var tbody = $(this).closest('tbody'); tbody.find('tr.em-tickets-row').hide(); tbody.find('tr.em-tickets-row-form').fadeIn(); return false; }); $(document).delegate('.ticket-actions-edited', 'click', function(e){ e.preventDefault(); var tbody = $(this).closest('tbody'); var rowNo = tbody.attr('id').replace('em-ticket-',''); tbody.find('.em-tickets-row').fadeIn(); tbody.find('.em-tickets-row-form').hide(); tbody.find('*[name]').each(function(index,el){ el = $(el); if( el.attr('name') == 'ticket_start_pub'){ tbody.find('span.ticket_start').text(el.attr('value')); }else if( el.attr('name') == 'ticket_end_pub' ){ tbody.find('span.ticket_end').text(el.attr('value')); }else if( el.attr('name') == 'em_tickets['+rowNo+'][ticket_type]' ){ if( el.find(':selected').val() == 'members' ){ tbody.find('span.ticket_name').prepend('* '); } }else if( el.attr('name') == 'em_tickets['+rowNo+'][ticket_start_recurring_days]' ){ var text = tbody.find('select.ticket-dates-from-recurring-when').val() == 'before' ? '-'+el.attr('value'):el.attr('value'); if( el.attr('value') != '' ){ tbody.find('span.ticket_start_recurring_days').text(text); tbody.find('span.ticket_start_recurring_days_text, span.ticket_start_time').removeClass('hidden').show(); }else{ tbody.find('span.ticket_start_recurring_days').text(' - '); tbody.find('span.ticket_start_recurring_days_text, span.ticket_start_time').removeClass('hidden').hide(); } }else if( el.attr('name') == 'em_tickets['+rowNo+'][ticket_end_recurring_days]' ){ var text = tbody.find('select.ticket-dates-to-recurring-when').val() == 'before' ? '-'+el.attr('value'):el.attr('value'); if( el.attr('value') != '' ){ tbody.find('span.ticket_end_recurring_days').text(text); tbody.find('span.ticket_end_recurring_days_text, span.ticket_end_time').removeClass('hidden').show(); }else{ tbody.find('span.ticket_end_recurring_days').text(' - '); tbody.find('span.ticket_end_recurring_days_text, span.ticket_end_time').removeClass('hidden').hide(); } }else{ tbody.find('.'+el.attr('name').replace('em_tickets['+rowNo+'][','').replace(']','').replace('[]','')).text(el.attr('value')); } }); //allow for others to hook into this $(document).triggerHandler('em_maps_tickets_edit', [tbody, rowNo, true]); $('html, body').animate({ scrollTop: tbody.parent().offset().top - 30 }); //sends user back to top of form return false; }); $(document).delegate('.em-ticket-form select.ticket_type','change', function(e){ //check if ticket is for all users or members, if members, show roles to limit the ticket to var el = $(this); if( el.find('option:selected').val() == 'members' ){ el.closest('.em-ticket-form').find('.ticket-roles').fadeIn(); }else{ el.closest('.em-ticket-form').find('.ticket-roles').hide(); } }); $(document).delegate('.em-ticket-form .ticket-options-advanced','click', function(e){ //show or hide advanced tickets, hidden by default e.preventDefault(); var el = $(this); if( el.hasClass('show') ){ el.closest('.em-ticket-form').find('.em-ticket-form-advanced').fadeIn(); el.find('.show,.show-advanced').hide(); el.find('.hide,.hide-advanced').show(); }else{ el.closest('.em-ticket-form').find('.em-ticket-form-advanced').hide(); el.find('.show,.show-advanced').show(); el.find('.hide,.hide-advanced').hide(); } el.toggleClass('show'); }); $('.em-ticket-form').each( function(){ //check whether to show advanced options or not by default for each ticket var show_advanced = false; var el = $(this); el.find('.em-ticket-form-advanced input[type="text"]').each(function(){ if(this.value != '') show_advanced = true; }); if( el.find('.em-ticket-form-advanced input[type="checkbox"]:checked').length > 0 ){ show_advanced = true; } el.find('.em-ticket-form-advanced option:selected').each(function(){ if(this.value != '') show_advanced = true; }); if( show_advanced ) el.find('.ticket-options-advanced').trigger('click'); }); //Delete a ticket $(document).delegate('.ticket-actions-delete', 'click', function(e){ e.preventDefault(); var el = $(this); var tbody = el.closest('tbody'); if( tbody.find('input.ticket_id').val() > 0 ){ //only will happen if no bookings made el.text('Deleting...'); $.getJSON( $(this).attr('href'), {'em_ajax_action':'delete_ticket', 'id':tbody.find('input.ticket_id').val()}, function(data){ if(data.result){ tbody.remove(); }else{ el.text('Delete'); alert(data.error); } }); }else{ //not saved to db yet, so just remove tbody.remove(); } return false; }); } //Manageing Bookings if( $('#em-bookings-table').length > 0 ){ //Pagination link clicks $(document).delegate('#em-bookings-table .tablenav-pages a', 'click', function(){ var el = $(this); var form = el.parents('#em-bookings-table form.bookings-filter'); //get page no from url, change page, submit form var match = el.attr('href').match(/#[0-9]+/); if( match != null && match.length > 0){ var pno = match[0].replace('#',''); form.find('input[name=pno]').val(pno); }else{ form.find('input[name=pno]').val(1); } form.trigger('submit'); return false; }); //Overlay Options var em_bookings_settings_dialog = { modal : true, autoOpen: false, minWidth: 500, height: 'auto', buttons: [{ text: EM.bookings_settings_save, click: function(e){ e.preventDefault(); //we know we'll deal with cols, so wipe hidden value from main var match = $("#em-bookings-table form.bookings-filter [name=cols]").val(''); var booking_form_cols = $('form#em-bookings-table-settings-form input.em-bookings-col-item'); $.each( booking_form_cols, function(i,item_match){ //item_match = $(item_match); if( item_match.value == 1 ){ if( match.val() != ''){ match.val(match.val()+','+item_match.name); }else{ match.val(item_match.name); } } }); //submit main form $('#em-bookings-table-settings').trigger('submitted'); //hook into this with bind() $('#em-bookings-table form.bookings-filter').trigger('submit'); $(this).dialog('close'); } }] }; var em_bookings_export_dialog = { modal : true, autoOpen: false, minWidth: 500, height: 'auto', buttons: [{ text: EM.bookings_export_save, click: function(e){ $(this).children('form').submit(); $(this).dialog('close'); } }] }; if( $("#em-bookings-table-settings").length > 0 ){ //Settings Overlay $("#em-bookings-table-settings").dialog(em_bookings_settings_dialog); $(document).delegate('#em-bookings-table-settings-trigger','click', function(e){ e.preventDefault(); $("#em-bookings-table-settings").dialog('open'); }); //Export Overlay $("#em-bookings-table-export").dialog(em_bookings_export_dialog); $(document).delegate('#em-bookings-table-export-trigger','click', function(e){ e.preventDefault(); $("#em-bookings-table-export").dialog('open'); }); var export_overlay_show_tickets = function(){ if( $('#em-bookings-table-export-form input[name=show_tickets]').is(':checked') ){ $('#em-bookings-table-export-form .em-bookings-col-item-ticket').show(); $('#em-bookings-table-export-form #em-bookings-export-cols-active .em-bookings-col-item-ticket input').val(1); }else{ $('#em-bookings-table-export-form .em-bookings-col-item-ticket').hide().find('input').val(0); } }; //Sync export overlay with table search field changes $('#em-bookings-table form select').each(function(i, el){ $(el).change(function(e){ var select_el = $(this); var input_par = $('#em-bookings-table-export-form input[name='+select_el.attr('name')+']'); var input_par_selected = select_el.find('option:selected'); input_par.val(input_par_selected.val()); }); }); export_overlay_show_tickets(); $('#em-bookings-table-export-form input[name=show_tickets]').click(export_overlay_show_tickets); //Sortables $( ".em-bookings-cols-sortable" ).sortable({ connectWith: ".em-bookings-cols-sortable", update: function(event, ui) { if( ui.item.parents('ul#em-bookings-cols-active, ul#em-bookings-export-cols-active').length > 0 ){ ui.item.addClass('ui-state-highlight').removeClass('ui-state-default').children('input').val(1); }else{ ui.item.addClass('ui-state-default').removeClass('ui-state-highlight').children('input').val(0); } } }).disableSelection(); load_ui_css = true; } //Widgets and filter submissions $(document).delegate('#em-bookings-table form.bookings-filter', 'submit', function(e){ var el = $(this); //append loading spinner el.parents('#em-bookings-table').find('.table-wrap').first().append('
'); //ajax call $.post( EM.ajaxurl, el.serializeArray(), function(data){ var root = el.parents('#em-bookings-table').first(); root.replaceWith(data); //recreate overlays $('#em-bookings-table-export input[name=scope]').val(root.find('select[name=scope]').val()); $('#em-bookings-table-export input[name=status]').val(root.find('select[name=status]').val()); jQuery(document).triggerHandler('em_bookings_filtered', [data, root, el]); }); return false; }); //Approve/Reject Links $(document).delegate('.em-bookings-approve,.em-bookings-reject,.em-bookings-unapprove,.em-bookings-delete', 'click', function(){ var el = $(this); if( el.hasClass('em-bookings-delete') ){ if( !confirm(EM.booking_delete) ){ return false; } } var url = em_ajaxify( el.attr('href')); var td = el.parents('td').first(); td.html(EM.txt_loading); td.load( url ); return false; }); } //Old Bookings Table - depreciating soon if( $('.em_bookings_events_table').length > 0 ){ //Widgets and filter submissions $(document).delegate('.em_bookings_events_table form', 'submit', function(e){ var el = $(this); var url = em_ajaxify( el.attr('action') ); el.parents('.em_bookings_events_table').find('.table-wrap').first().append('
'); $.get( url, el.serializeArray(), function(data){ el.parents('.em_bookings_events_table').first().replaceWith(data); }); return false; }); //Pagination link clicks $(document).delegate('.em_bookings_events_table .tablenav-pages a', 'click', function(){ var el = $(this); var url = em_ajaxify( el.attr('href') ); el.parents('.em_bookings_events_table').find('.table-wrap').first().append('
'); $.get( url, function(data){ el.parents('.em_bookings_events_table').first().replaceWith(data); }); return false; }); } //Manual Booking $('a.em-booking-button').click(function(e){ e.preventDefault(); var button = $(this); if( button.text() != EM.bb_booked && $(this).text() != EM.bb_booking){ button.text(EM.bb_booking); var button_data = button.attr('id').split('_'); $.ajax({ url: EM.ajaxurl, dataType: 'jsonp', data: { event_id : button_data[1], _wpnonce : button_data[2], action : 'booking_add_one' }, success : function(response, statusText, xhr, $form) { if(response.result){ button.text(EM.bb_booked); }else{ button.text(EM.bb_error); } if(response.message != '') alert(response.message); }, error : function(){ button.text(EM.bb_error); } }); } return false; }); $('a.em-cancel-button').click(function(e){ e.preventDefault(); var button = $(this); if( button.text() != EM.bb_cancelled && button.text() != EM.bb_canceling){ button.text(EM.bb_canceling); var button_data = button.attr('id').split('_'); $.ajax({ url: EM.ajaxurl, dataType: 'jsonp', data: { booking_id : button_data[1], _wpnonce : button_data[2], action : 'booking_cancel' }, success : function(response, statusText, xhr, $form) { if(response.result){ button.text(EM.bb_cancelled); }else{ button.text(EM.bb_cancel_error); } }, error : function(){ button.text(EM.bb_cancel_error); } }); } return false; }); //Datepicker if( $('.em-date-single, .em-date-range, #em-date-start').length > 0 ){ if( EM.locale != 'en' && EM.locale_data ){ $.datepicker.setDefaults(EM.locale_data); } load_ui_css = true; em_setup_datepicker('body'); } if( load_ui_css ) em_load_jquery_css(); //previously in em-admin.php function updateIntervalDescriptor () { $(".interval-desc").hide(); var number = "-plural"; if ($('input#recurrence-interval').val() == 1 || $('input#recurrence-interval').val() == "") number = "-singular"; var descriptor = "span#interval-"+$("select#recurrence-frequency").val()+number; $(descriptor).show(); } function updateIntervalSelectors () { $('p.alternate-selector').hide(); $('p#'+ $('select#recurrence-frequency').val() + "-selector").show(); } function updateShowHideRecurrence () { if( $('input#event-recurrence').is(":checked")) { $("#event_recurrence_pattern").fadeIn(); $("#event-date-explanation").hide(); $("#recurrence-dates-explanation").show(); $("h3#recurrence-dates-title").show(); $("h3#event-date-title").hide(); } else { $("#event_recurrence_pattern").hide(); $("#recurrence-dates-explanation").hide(); $("#event-date-explanation").show(); $("h3#recurrence-dates-title").hide(); $("h3#event-date-title").show(); } } $("#recurrence-dates-explanation").hide(); $("#date-to-submit").hide(); $("#end-date-to-submit").hide(); $("#localised-date").show(); $("#localised-end-date").show(); $('#em-wrapper input.select-all').change(function(){ if($(this).is(':checked')){ $('input.row-selector').prop('checked', true); $('input.select-all').prop('checked', true); }else{ $('input.row-selector').prop('checked', false); $('input.select-all').prop('checked', false); } }); updateIntervalDescriptor(); updateIntervalSelectors(); updateShowHideRecurrence(); $('input#event-recurrence').change(updateShowHideRecurrence); // recurrency elements $('input#recurrence-interval').keyup(updateIntervalDescriptor); $('select#recurrence-frequency').change(updateIntervalDescriptor); $('select#recurrence-frequency').change(updateIntervalSelectors); /* Load any maps */ if( $('.em-location-map').length > 0 || $('.em-locations-map').length > 0 || $('#em-map').length > 0 || $('.em-search-geo').length > 0 ){ em_maps_load(); } //Finally, add autocomplete here //Autocomplete if( jQuery( "div.em-location-data input#location-name" ).length > 0 ){ jQuery( "div.em-location-data input#location-name" ).autocomplete({ source: EM.locationajaxurl, minLength: 2, focus: function( event, ui ){ jQuery("input#location-id" ).val( ui.item.value ); return false; }, select: function( event, ui ){ jQuery("input#location-id" ).val(ui.item.id).trigger('change'); jQuery("input#location-name" ).val(ui.item.value); jQuery('input#location-address').val(ui.item.address); jQuery('input#location-town').val(ui.item.town); jQuery('input#location-state').val(ui.item.state); jQuery('input#location-region').val(ui.item.region); jQuery('input#location-postcode').val(ui.item.postcode); if( ui.item.country == '' ){ jQuery('select#location-country option:selected').removeAttr('selected'); }else{ jQuery('select#location-country option[value="'+ui.item.country+'"]').attr('selected', 'selected'); } jQuery('div.em-location-data input, div.em-location-data select').css('background-color','#ccc').attr('readonly','readonly'); jQuery('#em-location-reset').show(); jQuery('#em-location-search-tip').hide(); jQuery(document).triggerHandler('em_locations_autocomplete_selected', [event, ui]); return false; } }).data( "ui-autocomplete" )._renderItem = function( ul, item ) { html_val = "" + item.label + '
'+ item.address + ', ' + item.town+"
"; return jQuery( "
  • " ).data( "item.autocomplete", item ).append(html_val).appendTo( ul ); }; jQuery('#em-location-reset a').click( function(){ jQuery('div.em-location-data input').css('background-color','#fff').val('').removeAttr('readonly'); jQuery('div.em-location-data select').css('background-color','#fff'); jQuery('div.em-location-data option:selected').removeAttr('selected'); jQuery('input#location-id').val(''); jQuery('#em-location-reset').hide(); jQuery('#em-location-search-tip').show(); jQuery('#em-map').hide(); jQuery('#em-map-404').show(); if(typeof(marker) !== 'undefined'){ marker.setPosition(new google.maps.LatLng(0, 0)); infoWindow.close(); marker.setDraggable(true); } return false; }); if( jQuery('input#location-id').val() != '0' && jQuery('input#location-id').val() != '' ){ jQuery('div.em-location-data input, div.em-location-data select').css('background-color','#ccc').attr('readonly','readonly'); jQuery('#em-location-reset').show(); jQuery('#em-location-search-tip').hide(); } } }); function em_load_jquery_css(){ if( EM.ui_css && jQuery('link#jquery-ui-css').length == 0 ){ var script = document.createElement("link"); script.id = 'jquery-ui-css'; script.rel = "stylesheet"; script.href = EM.ui_css; document.body.appendChild(script); } } function em_setup_datepicker(wrap){ wrap = jQuery(wrap); //default picker vals var datepicker_vals = { altFormat: "yy-mm-dd", changeMonth: true, changeYear: true, firstDay : EM.firstDay, yearRange:'-100:+10' }; if( EM.dateFormat ) datepicker_vals.dateFormat = EM.dateFormat; if( EM.yearRange ) datepicker_vals.yearRange = EM.yearRange; jQuery(document).triggerHandler('em_datepicker', datepicker_vals); //apply datepickers dateDivs = wrap.find('.em-date-single, .em-date-range'); if( dateDivs.length > 0 ){ //apply datepickers to elements dateDivs.find('input.em-date-input-loc').each(function(i,dateInput){ //init the datepicker var dateInput = jQuery(dateInput); var dateValue = dateInput.nextAll('input.em-date-input').first(); var dateValue_value = dateValue.val(); dateInput.datepicker(datepicker_vals); dateInput.datepicker('option', 'altField', dateValue); //now set the value if( dateValue_value ){ var this_date_formatted = jQuery.datepicker.formatDate( EM.dateFormat, jQuery.datepicker.parseDate('yy-mm-dd', dateValue_value) ); dateInput.val(this_date_formatted); dateValue.val(dateValue_value); } //add logic for texts dateInput.change(function(){ if( jQuery(this).val() == '' ){ jQuery(this).nextAll('.em-date-input').first().val(''); } }); }); //deal with date ranges dateDivs.filter('.em-date-range').find('input.em-date-input-loc').each(function(i,dateInput){ //finally, apply start/end logic to this field dateInput = jQuery(dateInput); if( dateInput.hasClass('em-date-start') ){ dateInput.datepicker('option','onSelect', function( selectedDate ) { //get corresponding end date input, we expect ranges to be contained in .em-date-range with a start/end input element var startDate = jQuery(this); var endDate = startDate.parents('.em-date-range').find('.em-date-end').first(); var startValue = startDate.nextAll('input.em-date-input').first().val(); var endValue = endDate.nextAll('input.em-date-input').first().val(); if( startValue > endValue && endValue != '' ){ endDate.datepicker( "setDate" , selectedDate ); endDate.trigger('change'); } endDate.datepicker( "option", 'minDate', selectedDate ); }); }else if( dateInput.hasClass('em-date-end') ){ var startInput = dateInput.parents('.em-date-range').find('.em-date-start').first(); if( startInput.val() != '' ){ dateInput.datepicker('option', 'minDate', startInput.val()); } } }); } } function em_setup_timepicker(wrap){ wrap = jQuery(wrap); var timepicker_options = { show24Hours: EM.show24hours == 1, step:15 } jQuery(document).triggerHandler('em_timepicker_options', timepicker_options); wrap.find(".em-time-input").timePicker(timepicker_options); // Keep the duration between the two inputs. wrap.find(".em-time-range input.em-time-start").each( function(i, el){ jQuery(el).data('oldTime', jQuery.timePicker(el).getTime()); }).change( function() { var start = jQuery(this); var end = start.nextAll('.em-time-end'); if (end.val()) { // Only update when second input has a value. // Calculate duration. var oldTime = start.data('oldTime'); var duration = (jQuery.timePicker(end).getTime() - oldTime); var time = jQuery.timePicker(start).getTime(); if( jQuery.timePicker(end).getTime() >= oldTime ){ // Calculate and update the time in the second input. jQuery.timePicker(end).setTime(new Date(new Date(time.getTime() + duration))); } start.data('oldTime', time); } }); // Validate. wrap.find(".em-time-range input.em-time-end").change(function() { var end = jQuery(this); var start = end.prevAll('.em-time-start'); if( start.val() ){ if( jQuery.timePicker(start).getTime() > jQuery.timePicker(this).getTime() && ( jQuery('.em-date-end').val().length == 0 || jQuery('.em-date-start').val() == jQuery('.em-date-end').val() ) ) { end.addClass("error"); } else { end.removeClass("error"); } } }); //Sort out all day checkbox wrap.find('.em-time-range input.em-time-all-day').change(function(){ var allday = jQuery(this); if( allday.is(':checked') ){ allday.siblings('.em-time-input').css('background-color','#ccc'); }else{ allday.siblings('.em-time-input').css('background-color','#fff'); } }).trigger('change'); } /* Useful function for adding the em_ajax flag to a url, regardless of querystring format */ var em_ajaxify = function(url){ if ( url.search('em_ajax=0') != -1){ url = url.replace('em_ajax=0','em_ajax=1'); }else if( url.search(/\?/) != -1 ){ url = url + "&em_ajax=1"; }else{ url = url + "?em_ajax=1"; } return url; }; /* * MAP FUNCTIONS */ var em_maps_loaded = false; var maps = {}; var maps_markers = {}; var infowindow; //loads maps script if not already loaded and executes EM maps script function em_maps_load(){ if( !em_maps_loaded ){ if ( jQuery('script#google-maps').length == 0 && ( typeof google !== 'object' || typeof google.maps !== 'object' ) ){ var script = document.createElement("script"); script.type = "text/javascript"; script.id = "google-maps"; var proto = (EM.is_ssl) ? 'https:' : 'http:'; if( typeof EM.google_maps_api !== 'undefined' ){ script.src = proto + '//maps.google.com/maps/api/js?v=3.24&libraries=places&callback=em_maps&key='+EM.google_maps_api; }else{ script.src = proto + '//maps.google.com/maps/api/js?v=3.24&libraries=places&callback=em_maps'; } document.body.appendChild(script); }else if( typeof google === 'object' && typeof google.maps === 'object' && !em_maps_loaded ){ em_maps(); }else if( jQuery('script#google-maps').length > 0 ){ jQuery(window).load(function(){ if( !em_maps_loaded ) em_maps(); }); //google isn't loaded so wait for page to load resources } } } //re-usable function to load global location maps function em_maps_load_locations(el){ var el = jQuery(el); var map_id = el.attr('id').replace('em-locations-map-',''); var em_data = jQuery.parseJSON( el.nextAll('.em-locations-map-coords').first().text() ); if( em_data == null ){ var em_data = jQuery.parseJSON( jQuery('#em-locations-map-coords-'+map_id).text() ); } jQuery.getJSON(document.URL, em_data , function(data){ if(data.length > 0){ //define default options and allow option for extension via event triggers var map_options = { mapTypeId: google.maps.MapTypeId.ROADMAP }; jQuery(document).triggerHandler('em_maps_locations_map_options', map_options); var marker_options = {}; jQuery(document).triggerHandler('em_maps_location_marker_options', marker_options); maps[map_id] = new google.maps.Map(el[0], map_options); maps_markers[map_id] = []; var minLatLngArr = [0,0]; var maxLatLngArr = [0,0]; for (var i = 0; i < data.length; i++) { if( !(data[i].location_latitude == 0 && data[i].location_longitude == 0) ){ var latitude = parseFloat( data[i].location_latitude ); var longitude = parseFloat( data[i].location_longitude ); var location = new google.maps.LatLng( latitude, longitude ); //extend the default marker options jQuery.extend(marker_options, { position: location, map: maps[map_id] }) var marker = new google.maps.Marker(marker_options); maps_markers[map_id].push(marker); marker.setTitle(data[i].location_name); var myContent = '
    '+ data[i].location_balloon +'
    '; em_map_infobox(marker, myContent, maps[map_id]); //Get min and max long/lats minLatLngArr[0] = (latitude < minLatLngArr[0] || i == 0) ? latitude : minLatLngArr[0]; minLatLngArr[1] = (longitude < minLatLngArr[1] || i == 0) ? longitude : minLatLngArr[1]; maxLatLngArr[0] = (latitude > maxLatLngArr[0] || i == 0) ? latitude : maxLatLngArr[0]; maxLatLngArr[1] = (longitude > maxLatLngArr[1] || i == 0) ? longitude : maxLatLngArr[1]; } } // Zoom in to the bounds var minLatLng = new google.maps.LatLng(minLatLngArr[0],minLatLngArr[1]); var maxLatLng = new google.maps.LatLng(maxLatLngArr[0],maxLatLngArr[1]); var bounds = new google.maps.LatLngBounds(minLatLng,maxLatLng); maps[map_id].fitBounds(bounds); //Call a hook if exists jQuery(document).triggerHandler('em_maps_locations_hook', [maps[map_id], data, map_id]); }else{ el.children().first().html('No locations found'); jQuery(document).triggerHandler('em_maps_locations_hook_not_found', [el]); } }); } function em_maps_load_location(el){ el = jQuery(el); var map_id = el.attr('id').replace('em-location-map-',''); em_LatLng = new google.maps.LatLng( jQuery('#em-location-map-coords-'+map_id+' .lat').text(), jQuery('#em-location-map-coords-'+map_id+' .lng').text()); //extend map and markers via event triggers var map_options = { zoom: 14, center: em_LatLng, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; jQuery(document).triggerHandler('em_maps_location_map_options', map_options); maps[map_id] = new google.maps.Map( document.getElementById('em-location-map-'+map_id), map_options); var marker_options = { position: em_LatLng, map: maps[map_id] }; jQuery(document).triggerHandler('em_maps_location_marker_options', marker_options); maps_markers[map_id] = new google.maps.Marker(marker_options); infowindow = new google.maps.InfoWindow({ content: jQuery('#em-location-map-info-'+map_id+' .em-map-balloon').get(0) }); infowindow.open(maps[map_id],maps_markers[map_id]); maps[map_id].panBy(40,-70); //JS Hook for handling map after instantiation //Example hook, which you can add elsewhere in your theme's JS - jQuery(document).bind('em_maps_location_hook', function(){ alert('hi');} ); jQuery(document).triggerHandler('em_maps_location_hook', [maps[map_id], infowindow, maps_markers[map_id], map_id]); //map resize listener jQuery(window).on('resize', function(e) { google.maps.event.trigger(maps[map_id], "resize"); maps[map_id].setCenter(maps_markers[map_id].getPosition()); maps[map_id].panBy(40,-70); }); } jQuery(document).bind('em_search_ajax', function(e, vars, wrapper){ if( em_maps_loaded ){ wrapper.find('.em-location-map').each( function(index, el){ em_maps_load_location(el); } ); wrapper.find('.em-locations-map').each( function(index, el){ em_maps_load_locations(el); }); } }); //Load single maps (each map is treated as a seperate map). function em_maps() { //Find all the maps on this page and load them jQuery('.em-location-map').each( function(index, el){ em_maps_load_location(el); } ); jQuery('.em-locations-map').each( function(index, el){ em_maps_load_locations(el); } ); //Location stuff - only needed if inputs for location exist if( jQuery('select#location-select-id, input#location-address').length > 0 ){ var map, marker; //load map info var refresh_map_location = function(){ var location_latitude = jQuery('#location-latitude').val(); var location_longitude = jQuery('#location-longitude').val(); if( !(location_latitude == 0 && location_longitude == 0) ){ var position = new google.maps.LatLng(location_latitude, location_longitude); //the location coords marker.setPosition(position); var mapTitle = (jQuery('input#location-name').length > 0) ? jQuery('input#location-name').val():jQuery('input#title').val(); marker.setTitle( jQuery('input#location-name input#title, #location-select-id').first().val() ); jQuery('#em-map').show(); jQuery('#em-map-404').hide(); google.maps.event.trigger(map, 'resize'); map.setCenter(position); map.panBy(40,-55); infoWindow.setContent( '
    ' + mapTitle + '
    ' + jQuery('#location-address').val() + '
    ' + jQuery('#location-town').val()+ '
    ' ); infoWindow.open(map, marker); jQuery(document).triggerHandler('em_maps_location_hook', [map, infowindow, marker, 0]); } else { jQuery('#em-map').hide(); jQuery('#em-map-404').show(); } }; //Add listeners for changes to address var get_map_by_id = function(id){ if(jQuery('#em-map').length > 0){ jQuery.getJSON(document.URL,{ em_ajax_action:'get_location', id:id }, function(data){ if( data.location_latitude!=0 && data.location_longitude!=0 ){ loc_latlng = new google.maps.LatLng(data.location_latitude, data.location_longitude); marker.setPosition(loc_latlng); marker.setTitle( data.location_name ); marker.setDraggable(false); jQuery('#em-map').show(); jQuery('#em-map-404').hide(); map.setCenter(loc_latlng); map.panBy(40,-55); infoWindow.setContent( '
    '+ data.location_balloon +'
    '); infoWindow.open(map, marker); google.maps.event.trigger(map, 'resize'); jQuery(document).triggerHandler('em_maps_location_hook', [map, infowindow, marker, 0]); }else{ jQuery('#em-map').hide(); jQuery('#em-map-404').show(); } }); } }; jQuery('#location-select-id, input#location-id').change( function(){get_map_by_id(jQuery(this).val());} ); jQuery('#location-name, #location-town, #location-address, #location-state, #location-postcode, #location-country').change( function(){ //build address var addresses = [ jQuery('#location-address').val(), jQuery('#location-town').val(), jQuery('#location-state').val(), jQuery('#location-postcode').val() ]; var address = ''; jQuery.each( addresses, function(i, val){ if( val != '' ){ address = ( address == '' ) ? address+val:address+', '+val; } }); if( address == '' ){ //in case only name is entered, no address jQuery('#em-map').hide(); jQuery('#em-map-404').show(); return false; } //do country last, as it's using the text version if( jQuery('#location-country option:selected').val() != 0 ){ address = ( address == '' ) ? address+jQuery('#location-country option:selected').text():address+', '+jQuery('#location-country option:selected').text(); } if( address != '' && jQuery('#em-map').length > 0 ){ geocoder.geocode( { 'address': address }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { jQuery('#location-latitude').val(results[0].geometry.location.lat()); jQuery('#location-longitude').val(results[0].geometry.location.lng()); } refresh_map_location(); }); } }); //Load map if(jQuery('#em-map').length > 0){ var em_LatLng = new google.maps.LatLng(0, 0); map = new google.maps.Map( document.getElementById('em-map'), { zoom: 14, center: em_LatLng, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }); var marker = new google.maps.Marker({ position: em_LatLng, map: map, draggable: true }); infoWindow = new google.maps.InfoWindow({ content: '' }); var geocoder = new google.maps.Geocoder(); google.maps.event.addListener(infoWindow, 'domready', function() { document.getElementById('location-balloon-content').parentNode.style.overflow=''; document.getElementById('location-balloon-content').parentNode.parentNode.style.overflow=''; }); google.maps.event.addListener(marker, 'dragend', function() { var position = marker.getPosition(); jQuery('#location-latitude').val(position.lat()); jQuery('#location-longitude').val(position.lng()); map.setCenter(position); map.panBy(40,-55); }); if( jQuery('#location-select-id').length > 0 ){ jQuery('#location-select-id').trigger('change'); }else{ refresh_map_location(); } jQuery(document).triggerHandler('em_map_loaded', [map, infowindow, marker]); } //map resize listener jQuery(window).on('resize', function(e) { google.maps.event.trigger(map, "resize"); map.setCenter(marker.getPosition()); map.panBy(40,-55); }); } em_maps_loaded = true; //maps have been loaded jQuery(document).triggerHandler('em_maps_loaded'); } function em_map_infobox(marker, message, map) { var iw = new google.maps.InfoWindow({ content: message }); google.maps.event.addListener(marker, 'click', function() { if( infowindow ) infowindow.close(); infowindow = iw; iw.open(map,marker); }); } /* jQuery timePicker - http://labs.perifer.se/timedatepicker/ @ http://github.com/perifer/timePicker commit 100644 */ (function(e){function t(t,n,r,i){t.value=e(n).text();e(t).change();if(!navigator.userAgent.match(/msie/i)){t.focus()}r.hide()}function n(e,t){var n=e.getHours();var i=t.show24Hours?n:(n+11)%12+1;var s=e.getMinutes();return r(i)+t.separator+r(s)+(t.show24Hours?"":n<12?" AM":" PM")}function r(e){return(e<10?"0":"")+e}function i(e,t){return typeof e=="object"?o(e):s(e,t)}function s(e,t){if(e){var n=e.split(t.separator);var r=parseFloat(n[0]);var i=parseFloat(n[1]);if(!t.show24Hours){if(r===12&&e.indexOf("AM")!==-1){r=0}else if(r!==12&&e.indexOf("PM")!==-1){r+=12}}var s=new Date(0,0,0,r,i,0);return o(s)}return null}function o(e){e.setFullYear(2001);e.setMonth(0);e.setDate(0);return e}e.fn.timePicker=function(t){var n=e.extend({},e.fn.timePicker.defaults,t);return this.each(function(){e.timePicker(this,n)})};e.timePicker=function(t,n){var r=e(t)[0];return r.timePicker||(r.timePicker=new jQuery._timePicker(r,n))};e.timePicker.version="0.3";e._timePicker=function(r,u){var a=false;var f=false;var l=i(u.startTime,u);var c=i(u.endTime,u);var h="selected";var p="li."+h;e(r).attr("autocomplete","OFF");var d=[];var v=new Date(l);while(v<=c){d[d.length]=n(v,u);v=new Date(v.setMinutes(v.getMinutes()+u.step))}var m=e('
    ');var g=e("
      ");for(var y=0;y"+d[y]+"")}m.append(g);m.appendTo("body").hide();m.mouseover(function(){a=true}).mouseout(function(){a=false});e("li",g).mouseover(function(){if(!f){e(p,m).removeClass(h);e(this).addClass(h)}}).mousedown(function(){a=true}).click(function(){t(r,this,m,u);a=false});var b=function(){if(m.is(":visible")){return false}e("li",m).removeClass(h);var t=e(r).offset();m.css({top:t.top+r.offsetHeight,left:t.left});m.show();var i=r.value?s(r.value,u):l;var a=l.getHours()*60+l.getMinutes();var f=i.getHours()*60+i.getMinutes()-a;var p=Math.round(f/u.step);var d=o(new Date(0,0,0,0,p*u.step+a,0));d=ls+m[0].offsetHeight){m[0].scrollTop=s+a.offsetHeight}}else{i.removeClass(h);a=e("li:first",g).addClass(h)[0];m[0].scrollTop=0}return false;break;case 13:if(m.is(":visible")){var l=e(p,g)[0];t(r,l,m,u)}return false;break;case 27:m.hide();return false;break}return true});e(r).keyup(function(e){f=false});this.getTime=function(){return s(r.value,u)};this.setTime=function(t){r.value=n(i(t,u),u);e(r).change()}};e.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:true}})(jQuery); // source --> http://thefamilyleader.com/wp-content/plugins/share-social/assets/js/tweetable.jquery.min.js?ver=2.0.0 /* * tweetable 2.0 - jQuery twitter feed plugin * * Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * With modifications from Philipp Robbel (http://www.robbel.com/) & Patrick DW (stackoverflow) * * Revision: $Id: jquery.tweetable.js 2013-06-16 $ * */ (function($){jQuery.fn.tweetable=function(opts){opts=$.extend({},$.fn.tweetable.options,opts);return this.each(function(){var act=jQuery(this),tweetList=jQuery('
        ')[opts.position.toLowerCase()+"To"](act),shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],api="http://api.getmytweets.co.uk/?screenname=",limitcount="&limit=",callback="&callback=?",twitterError,tweetMonth,tweetMonthInt,iterate,element;tweetList.append('

        '+opts.loading+ "

        ");jQuery.getJSON(api+opts.username+limitcount+opts.limit).done(function(data){jQuery("#tweet_loader").remove();twitterError=data&&data.error||null;if(twitterError){tweetList.append('
      • ");return}jQuery.each(data.tweets,function(i,tweet){if(i>=opts.limit)return;tweetList.append('
      • ");if(opts.time===true){for(iterate=0;iterate<=12;iterate++)if(shortMonths[iterate]===tweet.tweet_date.substr(4,3)){tweetMonthInt=iterate+1;tweetMonth=tweetMonthInt<10?"0"+tweetMonthInt:tweetMonthInt}var iso8601=tweet.tweet_date.substr(26,4)+"-"+tweetMonth+"-"+tweet.tweet_date.substr(8,2)+"T"+tweet.tweet_date.substr(11,8)+"Z";jQuery(".tweet_link_"+ i).append('

        <'+(opts.html5?'time datetime="'+iso8601+'"':"small")+"> "+tweet.tweet_date.substr(8,2)+"/"+tweetMonth+"/"+tweet.tweet_date.substr(26,4)+", "+tweet.tweet_date.substr(11,5)+"

        ")}});if(opts.rotate===true){var listItem=tweetList.find("li"),listLength=listItem.length||null,current=0,timeout=opts.speed;if(!listLength)return;function rotateTweets(){listItem.eq(current++).fadeOut(400,function(){current=current===listLength?0:current;listItem.eq(current).fadeIn(400)})} listItem.slice(1).hide();setInterval(rotateTweets,timeout)}opts.onComplete(tweetList)}).fail(function(jqxhr,textStatus,error){jQuery("#tweet_loader").remove();tweetList.append('
      • ");return})})};$.fn.tweetable.options={limit:5,username:"philipbeel",time:false,rotate:false,speed:5E3,replies:false,position:"append",failed:"No tweets available",loading:"Loading tweets...",html5:false,retweets:false,onComplete:function($ul){}}})(jQuery); jQuery.support.cors=true; (function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){function r(){var n=i(this);var r=t.settings;if(!isNaN(n.datetime)){if(r.cutoff==0||o(n.datetime)0&&!(t.isTime(n)&&n.attr("title"))){n.attr("title",r)}}return n.data("timeago")}function s(e){return t.inWords(o(e))}function o(e){return(new Date).getTime()-e.getTime()}e.timeago=function(t){if(t instanceof Date){return s(t)}else if(typeof t==="string"){return s(e.timeago.parse(t))}else if(typeof t==="number"){return s(new Date(t))}else{return s(e.timeago.datetime(t))}};var t=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowFuture:false,localeTitle:false,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){function l(r,i){var s=e.isFunction(r)?r(i,t):r;var o=n.numbers&&n.numbers[i]||i;return s.replace(/%d/i,o)}var n=this.settings.strings;var r=n.prefixAgo;var i=n.suffixAgo;if(this.settings.allowFuture){if(t<0){r=n.prefixFromNow;i=n.suffixFromNow}}var s=Math.abs(t)/1e3;var o=s/60;var u=o/60;var a=u/24;var f=a/365;var c=s<45&&l(n.seconds,Math.round(s))||s<90&&l(n.minute,1)||o<45&&l(n.minutes,Math.round(o))||o<90&&l(n.hour,1)||u<24&&l(n.hours,Math.round(u))||u<42&&l(n.day,1)||a<30&&l(n.days,Math.round(a))||a<45&&l(n.month,1)||a<365&&l(n.months,Math.round(a/30))||f<1.5&&l(n.year,1)||l(n.years,Math.round(f));var h=n.wordSeparator||"";if(n.wordSeparator===undefined){h=" "}return e.trim([r,c,i].join(h))},parse:function(t){var n=e.trim(t);n=n.replace(/\.\d+/,"");n=n.replace(/-/,"/").replace(/-/,"/");n=n.replace(/T/," ").replace(/Z/," UTC");n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");return new Date(n)},datetime:function(n){var r=t.isTime(n)?e(n).attr("datetime"):e(n).attr("title");return t.parse(r)},isTime:function(t){return e(t).get(0).tagName.toLowerCase()==="time"}});var n={init:function(){var n=e.proxy(r,this);n();var i=t.settings;if(i.refreshMillis>0){setInterval(n,i.refreshMillis)}},update:function(n){e(this).data("timeago",{datetime:t.parse(n)});r.apply(this)},updateFromDOM:function(){e(this).data("timeago",{datetime:t.parse(t.isTime(this)?e(this).attr("datetime"):e(this).attr("title"))});r.apply(this)}};e.fn.timeago=function(e,t){var r=e?n[e]:n.init;if(!r){throw new Error("Unknown function name '"+e+"' for timeago")}this.each(function(){r.call(this,t)});return this};document.createElement("abbr");document.createElement("time")}); // source --> http://thefamilyleader.com/wp-content/plugins/share-social/assets/js/jquery.poshytip.min.js?ver=2.0.0 /* * Poshy Tip jQuery plugin v1.2 * http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/ * Copyright 2010-2013, Vasil Dinkov, http://vadikom.com/ */ (function(e){var a=[],d=/^url\(["']?([^"'\)]*)["']?\);?$/i,c=/\.png$/i,b=!!window.createPopup&&document.documentElement.currentStyle.minWidth=="undefined";function f(){e.each(a,function(){this.refresh(true)})}e(window).resize(f);e.Poshytip=function(h,g){this.$elm=e(h);this.opts=e.extend({},e.fn.poshytip.defaults,g);this.$tip=e(['
        ','
        ','
        ',"
        "].join("")).appendTo(document.body);this.$arrow=this.$tip.find("div.tip-arrow");this.$inner=this.$tip.find("div.tip-inner");this.disabled=false;this.content=null;this.init()};e.Poshytip.prototype={init:function(){a.push(this);var g=this.$elm.attr("title");this.$elm.data("title.poshytip",g!==undefined?g:null).data("poshytip",this);if(this.opts.showOn!="none"){this.$elm.bind({"mouseenter.poshytip":e.proxy(this.mouseenter,this),"mouseleave.poshytip":e.proxy(this.mouseleave,this)});switch(this.opts.showOn){case"hover":if(this.opts.alignTo=="cursor"){this.$elm.bind("mousemove.poshytip",e.proxy(this.mousemove,this))}if(this.opts.allowTipHover){this.$tip.hover(e.proxy(this.clearTimeouts,this),e.proxy(this.mouseleave,this))}break;case"focus":this.$elm.bind({"focus.poshytip":e.proxy(this.showDelayed,this),"blur.poshytip":e.proxy(this.hideDelayed,this)});break}}},mouseenter:function(g){if(this.disabled){return true}this.$elm.attr("title","");if(this.opts.showOn=="focus"){return true}this.showDelayed()},mouseleave:function(g){if(this.disabled||this.asyncAnimating&&(this.$tip[0]===g.relatedTarget||jQuery.contains(this.$tip[0],g.relatedTarget))){return true}if(!this.$tip.data("active")){var h=this.$elm.data("title.poshytip");if(h!==null){this.$elm.attr("title",h)}}if(this.opts.showOn=="focus"){return true}this.hideDelayed()},mousemove:function(g){if(this.disabled){return true}this.eventX=g.pageX;this.eventY=g.pageY;if(this.opts.followCursor&&this.$tip.data("active")){this.calcPos();this.$tip.css({left:this.pos.l,top:this.pos.t});if(this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow}}},show:function(){if(this.disabled||this.$tip.data("active")){return}this.reset();this.update();if(!this.content){return}this.display();if(this.opts.timeOnScreen){this.hideDelayed(this.opts.timeOnScreen)}},showDelayed:function(g){this.clearTimeouts();this.showTimeout=setTimeout(e.proxy(this.show,this),typeof g=="number"?g:this.opts.showTimeout)},hide:function(){if(this.disabled||!this.$tip.data("active")){return}this.display(true)},hideDelayed:function(g){this.clearTimeouts();this.hideTimeout=setTimeout(e.proxy(this.hide,this),typeof g=="number"?g:this.opts.hideTimeout)},reset:function(){this.$tip.queue([]).detach().css("visibility","hidden").data("active",false);this.$inner.find("*").poshytip("hide");if(this.opts.fade){this.$tip.css("opacity",this.opacity)}this.$arrow[0].className="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left";this.asyncAnimating=false},update:function(j,k){if(this.disabled){return}var i=j!==undefined;if(i){if(!k){this.opts.content=j}if(!this.$tip.data("active")){return}}else{j=this.opts.content}var h=this,g=typeof j=="function"?j.call(this.$elm[0],function(l){h.update(l)}):j=="[title]"?this.$elm.data("title.poshytip"):j;if(this.content!==g){this.$inner.empty().append(g);this.content=g}this.refresh(i)},refresh:function(h){if(this.disabled){return}if(h){if(!this.$tip.data("active")){return}var k={left:this.$tip.css("left"),top:this.$tip.css("top")}}this.$tip.css({left:0,top:0}).appendTo(document.body);if(this.opacity===undefined){this.opacity=this.$tip.css("opacity")}var l=this.$tip.css("background-image").match(d),m=this.$arrow.css("background-image").match(d);if(l){var i=c.test(l[1]);if(b&&i){this.$tip.css("background-image","none");this.$inner.css({margin:0,border:0,padding:0});l=i=false}else{this.$tip.prepend('
        ').css({border:0,padding:0,"background-image":"none","background-color":"transparent"}).find(".tip-bg-image").css("background-image",'url("'+l[1]+'")').end().find("td").eq(3).append(this.$inner)}if(i&&!e.support.opacity){this.opts.fade=false}}if(m&&!e.support.opacity){if(b&&c.test(m[1])){m=false;this.$arrow.css("background-image","none")}this.opts.fade=false}var o=this.$tip.find("> table.tip-table");if(b){this.$tip[0].style.width="";o.width("auto").find("td").eq(3).width("auto");var n=this.$tip.width(),j=parseInt(this.$tip.css("min-width")),g=parseInt(this.$tip.css("max-width"));if(!isNaN(j)&&ng){n=g}}this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")}else{if(o[0]){o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView&&document.defaultView.getComputedStyle&&parseFloat(document.defaultView.getComputedStyle(this.$tip[0],null).width)||this.$tip.width()).find("td").eq(3).width("100%")}}this.tipOuterW=this.$tip.outerWidth();this.tipOuterH=this.$tip.outerHeight();this.calcPos();if(m&&this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow;this.$arrow.css("visibility","inherit")}if(h&&this.opts.refreshAniDuration){this.asyncAnimating=true;var p=this;this.$tip.css(k).animate({left:this.pos.l,top:this.pos.t},this.opts.refreshAniDuration,function(){p.asyncAnimating=false})}else{this.$tip.css({left:this.pos.l,top:this.pos.t})}},display:function(h){var i=this.$tip.data("active");if(i&&!h||!i&&h){return}this.$tip.stop();if((this.opts.slide&&this.pos.arrow||this.opts.fade)&&(h&&this.opts.hideAniDuration||!h&&this.opts.showAniDuration)){var n={},m={};if(this.opts.slide&&this.pos.arrow){var l,g;if(this.pos.arrow=="bottom"||this.pos.arrow=="top"){l="top";g="bottom"}else{l="left";g="right"}var k=parseInt(this.$tip.css(l));n[l]=k+(h?0:(this.pos.arrow==g?-this.opts.slideOffset:this.opts.slideOffset));m[l]=k+(h?(this.pos.arrow==g?this.opts.slideOffset:-this.opts.slideOffset):0)+"px"}if(this.opts.fade){n.opacity=h?this.$tip.css("opacity"):0;m.opacity=h?0:this.opacity}this.$tip.css(n).animate(m,this.opts[h?"hideAniDuration":"showAniDuration"])}h?this.$tip.queue(e.proxy(this.reset,this)):this.$tip.css("visibility","inherit");if(i){var j=this.$elm.data("title.poshytip");if(j!==null){this.$elm.attr("title",j)}}this.$tip.data("active",!i)},disable:function(){this.reset();this.disabled=true},enable:function(){this.disabled=false},destroy:function(){this.reset();this.$tip.remove();delete this.$tip;this.content=null;this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip");a.splice(e.inArray(this,a),1)},clearTimeouts:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}},calcPos:function(){var n={l:0,t:0,arrow:""},h=e(window),k={l:h.scrollLeft(),t:h.scrollTop(),w:h.width(),h:h.height()},p,j,m,i,q,g;if(this.opts.alignTo=="cursor"){p=j=m=this.eventX;i=q=g=this.eventY}else{var o=this.$elm.offset(),l={l:o.left,t:o.top,w:this.$elm.outerWidth(),h:this.$elm.outerHeight()};p=l.l+(this.opts.alignX!="inner-right"?0:l.w);j=p+Math.floor(l.w/2);m=p+(this.opts.alignX!="inner-left"?l.w:0);i=l.t+(this.opts.alignY!="inner-bottom"?0:l.h);q=i+Math.floor(l.h/2);g=i+(this.opts.alignY!="inner-top"?l.h:0)}switch(this.opts.alignX){case"right":case"inner-left":n.l=m+this.opts.offsetX;if(this.opts.keepInViewport&&n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}if(this.opts.alignX=="right"||this.opts.alignY=="center"){n.arrow="left"}break;case"center":n.l=j-Math.floor(this.tipOuterW/2);if(this.opts.keepInViewport){if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}else{if(n.lk.t+k.h){n.t=i-this.tipOuterH-this.opts.offsetY;if(n.arrow=="top"){n.arrow="bottom"}}break;case"center":n.t=q-Math.floor(this.tipOuterH/2);if(this.opts.keepInViewport){if(n.t+this.tipOuterH>k.t+k.h){n.t=k.t+k.h-this.tipOuterH}else{if(n.t',"div.",j.className,"{visibility:hidden;position:absolute;top:0;left:0;}","div.",j.className," table.tip-table, div.",j.className," table.tip-table td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;vertical-align:middle;}","div.",j.className," td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:",j.bgImageFrameSize,"px;width:",j.bgImageFrameSize,"px;overflow:hidden;}","div.",j.className," td.tip-right{background-position:100% 0;}","div.",j.className," td.tip-bottom{background-position:100% 100%;}","div.",j.className," td.tip-left{background-position:0 100%;}","div.",j.className," div.tip-inner{background-position:-",j.bgImageFrameSize,"px -",j.bgImageFrameSize,"px;}","div.",j.className," div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}",""].join("")).appendTo("head")}if(j.liveEvents&&j.showOn!="none"){var i,k=e.extend({},j,{liveEvents:false});switch(j.showOn){case"hover":i=function(){var m=e(this);if(!m.data("poshytip")){m.poshytip(k).poshytip("mouseenter")}};this.live?this.live("mouseenter.poshytip",i):e(document).delegate(this.selector,"mouseenter.poshytip",i);break;case"focus":i=function(){var m=e(this);if(!m.data("poshytip")){m.poshytip(k).poshytip("showDelayed")}};this.live?this.live("focus.poshytip",i):e(document).delegate(this.selector,"focus.poshytip",i);break}return this}return this.each(function(){new e.Poshytip(this,j)})};e.fn.poshytip.defaults={content:"[title]",className:"tip-yellow",bgImageFrameSize:10,showTimeout:500,hideTimeout:100,timeOnScreen:0,showOn:"hover",liveEvents:false,alignTo:"cursor",alignX:"right",alignY:"top",offsetX:-22,offsetY:18,keepInViewport:true,allowTipHover:true,followCursor:false,fade:true,slide:true,slideOffset:8,showAniDuration:300,hideAniDuration:300,refreshAniDuration:200}})(jQuery); // source --> http://thefamilyleader.com/wp-content/plugins/share-social/assets/js/modal_core.min.js?ver=2.0.0 (function(b){b.fn.bPopup=function(z,F){function K(){a.contentContainer=b(a.contentContainer||c);switch(a.content){case "iframe":var h=b('");h.appendTo(a.contentContainer);r=c.outerHeight(!0);s=c.outerWidth(!0);A();h.attr("src",a.loadUrl);k(a.loadCallback);break;case "image":A();b("").load(function(){k(a.loadCallback);G(b(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:A(),b('
        ').load(a.loadUrl,a.loadData,function(){k(a.loadCallback);G(b(this))}).hide().appendTo(a.contentContainer)}}function A(){a.modal&&b('
        ').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+t}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);D();c.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?g.scrollLeft()+u:-1*(v+s):l(!(!a.follow[0]&&m||f)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?g.scrollTop()+w:x+-1*r:n(!(!a.follow[1]&&p||f)),"z-index":a.zIndex+t+1}).each(function(){a.appending&&b(this).appendTo(a.appendTo)});H(!0)}function q(){a.modal&&b(".b-modal."+c.data("id")).fadeTo(a.speed,0,function(){b(this).remove()});a.scrollBar||b("html").css("overflow","auto");b(".b-modal."+e).unbind("click");g.unbind("keydown."+e);d.unbind("."+e).data("bPopup",0=c.height()&&(d.height=c.height());b>=c.width()&&(d.width=c.width());r=c.outerHeight(!0);s=c.outerWidth(!0);D();a.contentContainer.css({height:"auto",width:"auto"});d.left=l(!(!a.follow[0]&&m||f));d.top=n(!(!a.follow[1]&&p||f));c.animate(d,250,function(){h.show();B=E()})}function L(){d.data("bPopup",t);c.delegate(".bClose, ."+a.closeClass,"click."+e,q);a.modalClose&&b(".b-modal."+e).css("cursor","pointer").bind("click",q);M||!a.follow[0]&&!a.follow[1]||d.bind("scroll."+e,function(){B&&c.dequeue().animate({left:a.follow[0]?l(!f):"auto",top:a.follow[1]?n(!f):"auto"},a.followSpeed,a.followEasing)}).bind("resize."+e,function(){w=y.innerHeight||d.height();u=y.innerWidth||d.width();if(B=E())clearTimeout(I),I=setTimeout(function(){D();c.dequeue().each(function(){f?b(this).css({left:v,top:x}):b(this).animate({left:a.follow[0]?l(!0):"auto",top:a.follow[1]?n(!0):"auto"},a.followSpeed,a.followEasing)})},50)});a.escClose&&g.bind("keydown."+e,function(a){27==a.which&&q()})}function H(b){function d(e){c.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){J(b)})}switch(b?a.transition:a.transitionClose||a.transition){case "slideIn":d({left:b?l(!(!a.follow[0]&&m||f)):g.scrollLeft()-(s||c.outerWidth(!0))-C});break;case "slideBack":d({left:b?l(!(!a.follow[0]&&m||f)):g.scrollLeft()+u+C});break;case "slideDown":d({top:b?n(!(!a.follow[1]&&p||f)):g.scrollTop()-(r||c.outerHeight(!0))-C});break;case "slideUp":d({top:b?n(!(!a.follow[1]&&p||f)):g.scrollTop()+w+C});break;default:c.stop().fadeTo(a.speed,b?1:0,function(){J(b)})}}function J(b){b?(L(),k(F),a.autoClose&&setTimeout(q,a.autoClose)):(c.hide(),k(a.onClose),a.loadUrl&&(a.contentContainer.empty(),c.css({height:"auto",width:"auto"})))}function l(a){return a?v+g.scrollLeft():v}function n(a){return a?x+g.scrollTop():x}function k(a){b.isFunction(a)&&a.call(c)}function D(){x=p?a.position[1]:Math.max(0,(w-c.outerHeight(!0))/2-a.amsl);v=m?a.position[0]:(u-c.outerWidth(!0))/2;B=E()}function E(){return w>c.outerHeight(!0)&&u>c.outerWidth(!0)}b.isFunction(z)&&(F=z,z=null);var a=b.extend({},b.fn.bPopup.defaults,z);a.scrollBar||b("html").css("overflow","hidden");var c=this,g=b(document),y=window,d=b(y),w=y.innerHeight||d.height(),u=y.innerWidth||d.width(),M=/OS 6(_\d)+/i.test(navigator.userAgent),C=200,t=0,e,B,p,m,f,x,v,r,s,I;c.close=function(){a=this.data("bPopup");e="__b-popup"+d.data("bPopup")+"__";q()};return c.each(function(){b(this).data("bPopup")||(k(a.onOpen),t=(d.data("bPopup")||0)+1,e="__b-popup"+t+"__",p="auto"!==a.position[1],m="auto"!==a.position[0],f="fixed"===a.positionStyle,r=c.outerHeight(!0),s=c.outerWidth(!0),a.loadUrl?K():A())})};b.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:0.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery); // source --> http://thefamilyleader.com/wp-content/plugins/share-social/assets/js/jquery.cookie.js?ver=2.0.0 /*! * jQuery Cookie Plugin v1.3.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module. define(['jquery'], factory); } else { // Browser globals. factory(jQuery); } }(function ($) { var pluses = /\+/g; function raw(s) { return s; } function decoded(s) { return decodeURIComponent(s.replace(pluses, ' ')); } function converted(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { return config.json ? JSON.parse(s) : s; } catch(er) {} } var config = $.cookie = function (key, value, options) { // write if (value !== undefined) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } value = config.json ? JSON.stringify(value) : String(value); return (document.cookie = [ config.raw ? key : encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // read var decode = config.raw ? raw : decoded; var cookies = document.cookie.split('; '); var result = key ? undefined : {}; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = decode(parts.join('=')); if (key && key === name) { result = converted(cookie); break; } if (!key) { result[name] = converted(cookie); } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) !== undefined) { // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return true; } return false; }; })); // source --> http://thefamilyleader.com/wp-content/themes/domino/js/init.js?ver=4.6.11 /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-shiv-cssclasses-load */ ;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f