A social business merging environmental awareness with poverty alleviation. |
var my_code_1 = { make_accordions: function(){ //////////////// // LEVEL 1 //////////////// menu_select_1('nomenuselected', '', 1); var toggles = $$('.toggler_1_1'); var expands = $$('.expander_1_1'); // CREATE ACCORDION // keep global for access later, make unique if there are multiple navigations accordion_1_1 = new Fx.Accordion(toggles, expands, { alwaysHide: true, show: -1, transition: Fx.Transitions.Quint.easeInOut, duration: 500, display: false, opacity: false, onActive: function(toggle, expand) { // REMOVE GENERIC ACTIVE CLASS FROM ALL $$('.links_toggle_1').removeClass('links_main_active_1'); // ADD GENERIC ACTIVE CLASS toggle.addClass('links_main_active_1'); // GET ID NAME AND USE THAT AS UNIQUE ACTIVE CLASS var unique_class=toggle.id+'_active'; toggle.addClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.addClass('sublink_marker_active'); } // make expand visible if selected expand.setStyle('display', 'block'); }, onBackground: function(toggle, expand) { toggle.removeClass('links_main_active_1'); var unique_class=toggle.id+'_active'; toggle.removeClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.removeClass('sublink_marker_active'); } }, onComplete: function(toggle, expand) { var el = $(this.elements[this.previous]); if (el != null && el.offsetHeight > 0) { el.setStyle('height', ''); $$('.links_expand_1').each(function(ex){ if(ex.getStyle('height') == '0px'){//not 0 ex.setStyle('display', 'none'); } }); } } }); // CHECK IF THIS LEVEL WAS LAST SELECTED var found = this.check_selected(1); }, // ONLY EXECUTES WHEN FIRST LOADED check_selected: function(level) { var found = false; var mv = Cookie.read('menu_current_1_'+level); // ACCORDION TOGGLERS var toggle = $$('.toggler_1_'+level); if(toggle != null && toggle != undefined) { toggle.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { found = true; // display the accordion element eval('accordion_1_'+level).display(i); // if active, add class element.addClass('links_main_active_'+level); // add unique active class element.addClass(unique_class); } else { found = false; // if inactive, remove class element.removeClass('links_main_active_'+level); // remove unique active class element.removeClass(unique_class); // manually set expander to dissappear if it isn't selected var expand = element.getNext(); expand.setStyles({ display: 'none' }); } }); } // SUB NON-ACCORDION ELEMENTS var sub_elements = $$('.links_main_toggle_'+level); if(sub_elements == null || sub_elements == undefined) { return found; } // NOTE WHICH LINKS ARE ACTIVE sub_elements.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { element.addClass('links_main_active_'+level); // add unique active class element.addClass(unique_class); } else { element.removeClass('links_main_active_'+level); // remove unique active class element.removeClass(unique_class); } }); return found; }, init: function(){ this.make_accordions(); } } function menu_select_1(nav_id, mid, level, url) { Cookie.write('menu_current_1_'+level, nav_id, {path: '/'}); if(mid != '') { Cookie.write('mid_1', mid, {path: '/'}); } if( typeof drawer !== 'undefined' && typeof drawer.close === 'function' && typeof url === 'string' && ( url.startsWith('#') || url.startsWith('/#') ) ){ drawer.close(); } } var my_code_2 = { make_accordions: function(){ //////////////// // LEVEL 1 //////////////// menu_select_2('Glass_nav2', '', 1); var toggles = $$('.toggler_2_1'); var expands = $$('.expander_2_1'); // CREATE ACCORDION // keep global for access later, make unique if there are multiple navigations accordion_2_1 = new Fx.Accordion(toggles, expands, { alwaysHide: true, show: -1, transition: Fx.Transitions.Quint.easeInOut, duration: 500, display: false, opacity: false, onActive: function(toggle, expand) { // REMOVE GENERIC ACTIVE CLASS FROM ALL $$('.links_toggle_1').removeClass('links_active_1'); // ADD GENERIC ACTIVE CLASS toggle.addClass('links_active_1'); // GET ID NAME AND USE THAT AS UNIQUE ACTIVE CLASS var unique_class=toggle.id+'_active'; toggle.addClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.addClass('sublink_marker_active'); } // make expand visible if selected expand.setStyle('display', 'block'); }, onBackground: function(toggle, expand) { toggle.removeClass('links_active_1'); var unique_class=toggle.id+'_active'; toggle.removeClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.removeClass('sublink_marker_active'); } }, onComplete: function(toggle, expand) { var el = $(this.elements[this.previous]); if (el != null && el.offsetHeight > 0) { el.setStyle('height', ''); $$('.links_expand_1').each(function(ex){ if(ex.getStyle('height') == '0px'){//not 0 ex.setStyle('display', 'none'); } }); } } }); // CHECK IF THIS LEVEL WAS LAST SELECTED var found = this.check_selected(1); }, // ONLY EXECUTES WHEN FIRST LOADED check_selected: function(level) { var found = false; var mv = Cookie.read('menu_current_2_'+level); // ACCORDION TOGGLERS var toggle = $$('.toggler_2_'+level); if(toggle != null && toggle != undefined) { toggle.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { found = true; // display the accordion element eval('accordion_2_'+level).display(i); // if active, add class element.addClass('links_active_'+level); // add unique active class element.addClass(unique_class); } else { found = false; // if inactive, remove class element.removeClass('links_active_'+level); // remove unique active class element.removeClass(unique_class); // manually set expander to dissappear if it isn't selected var expand = element.getNext(); expand.setStyles({ display: 'none' }); } }); } // SUB NON-ACCORDION ELEMENTS var sub_elements = $$('.links_toggle_'+level); if(sub_elements == null || sub_elements == undefined) { return found; } // NOTE WHICH LINKS ARE ACTIVE sub_elements.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { element.addClass('links_active_'+level); // add unique active class element.addClass(unique_class); } else { element.removeClass('links_active_'+level); // remove unique active class element.removeClass(unique_class); } }); return found; }, init: function(){ this.make_accordions(); } } function menu_select_2(nav_id, mid, level, url) { Cookie.write('menu_current_2_'+level, nav_id, {path: '/'}); if(mid != '') { Cookie.write('mid_2', mid, {path: '/'}); } if( typeof drawer !== 'undefined' && typeof drawer.close === 'function' && typeof url === 'string' && ( url.startsWith('#') || url.startsWith('/#') ) ){ drawer.close(); } } var my_code_3 = { make_accordions: function(){ //////////////// // LEVEL 1 //////////////// menu_select_3('nomenuselected', '', 1); var toggles = $$('.toggler_3_1'); var expands = $$('.expander_3_1'); // CREATE ACCORDION // keep global for access later, make unique if there are multiple navigations accordion_3_1 = new Fx.Accordion(toggles, expands, { alwaysHide: true, show: -1, transition: Fx.Transitions.Quint.easeInOut, duration: 500, display: false, opacity: false, onActive: function(toggle, expand) { // REMOVE GENERIC ACTIVE CLASS FROM ALL $$('.links_toggle_1').removeClass('links_drawer_active_1'); // ADD GENERIC ACTIVE CLASS toggle.addClass('links_drawer_active_1'); // GET ID NAME AND USE THAT AS UNIQUE ACTIVE CLASS var unique_class=toggle.id+'_active'; toggle.addClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.addClass('sublink_marker_active'); } // make expand visible if selected expand.setStyle('display', 'block'); }, onBackground: function(toggle, expand) { toggle.removeClass('links_drawer_active_1'); var unique_class=toggle.id+'_active'; toggle.removeClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.removeClass('sublink_marker_active'); } }, onComplete: function(toggle, expand) { var el = $(this.elements[this.previous]); if (el != null && el.offsetHeight > 0) { el.setStyle('height', ''); $$('.links_expand_1').each(function(ex){ if(ex.getStyle('height') == '0px'){//not 0 ex.setStyle('display', 'none'); } }); } } }); // CHECK IF THIS LEVEL WAS LAST SELECTED var found = this.check_selected(1); //////////////// // LEVEL 2 //////////////// menu_select_3('nomenuselected', '', 2); var toggles = $$('.toggler_3_2'); var expands = $$('.expander_3_2'); // CREATE ACCORDION // keep global for access later, make unique if there are multiple navigations accordion_3_2 = new Fx.Accordion(toggles, expands, { alwaysHide: true, show: -1, transition: Fx.Transitions.Quint.easeInOut, duration: 500, display: false, opacity: false, onActive: function(toggle, expand) { // REMOVE GENERIC ACTIVE CLASS FROM ALL $$('.links_toggle_2').removeClass('links_drawer_active_2'); // ADD GENERIC ACTIVE CLASS toggle.addClass('links_drawer_active_2'); // GET ID NAME AND USE THAT AS UNIQUE ACTIVE CLASS var unique_class=toggle.id+'_active'; toggle.addClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.addClass('sublink_marker_active'); } // make expand visible if selected expand.setStyle('display', 'block'); }, onBackground: function(toggle, expand) { toggle.removeClass('links_drawer_active_2'); var unique_class=toggle.id+'_active'; toggle.removeClass(unique_class); if (toggle.hasClass('sublink_marker')) { toggle.removeClass('sublink_marker_active'); } }, onComplete: function(toggle, expand) { var el = $(this.elements[this.previous]); if (el != null && el.offsetHeight > 0) { el.setStyle('height', ''); $$('.links_expand_2').each(function(ex){ if(ex.getStyle('height') == '0px'){//not 0 ex.setStyle('display', 'none'); } }); } } }); // CHECK IF THIS LEVEL WAS LAST SELECTED var found = this.check_selected(2); }, // ONLY EXECUTES WHEN FIRST LOADED check_selected: function(level) { var found = false; var mv = Cookie.read('menu_current_3_'+level); // ACCORDION TOGGLERS var toggle = $$('.toggler_3_'+level); if(toggle != null && toggle != undefined) { toggle.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { found = true; // display the accordion element eval('accordion_3_'+level).display(i); // if active, add class element.addClass('links_drawer_active_'+level); // add unique active class element.addClass(unique_class); } else { found = false; // if inactive, remove class element.removeClass('links_drawer_active_'+level); // remove unique active class element.removeClass(unique_class); // manually set expander to dissappear if it isn't selected var expand = element.getNext(); expand.setStyles({ display: 'none' }); } }); } // SUB NON-ACCORDION ELEMENTS var sub_elements = $$('.links_drawer_toggle_'+level); if(sub_elements == null || sub_elements == undefined) { return found; } // NOTE WHICH LINKS ARE ACTIVE sub_elements.each(function(element, i){ var unique_class=element.id+'_active'; if (mv == element.id) { element.addClass('links_drawer_active_'+level); // add unique active class element.addClass(unique_class); } else { element.removeClass('links_drawer_active_'+level); // remove unique active class element.removeClass(unique_class); } }); return found; }, init: function(){ this.make_accordions(); } } function menu_select_3(nav_id, mid, level, url) { Cookie.write('menu_current_3_'+level, nav_id, {path: '/'}); if(mid != '') { Cookie.write('mid_3', mid, {path: '/'}); } if( typeof drawer !== 'undefined' && typeof drawer.close === 'function' && typeof url === 'string' && ( url.startsWith('#') || url.startsWith('/#') ) ){ drawer.close(); } } var center_title = {}; var page_image_crop = { 'base' : 'shell', 'container': { 'el' : null, 'height': 0 }, 'single' : { 'el' : null, 'height': 0, 'offset': 0 } }; var squeezebox = {}; ///------> window.addEvent('domready', function() { my_code_1.init(); my_code_2.init(); my_code_3.init(); site_resize_text = new resize_text({ 'target': 'site_name_element', 'max_width': 500, 'max_height': 200, 'max_font': 45, 'min_font': 15, 'timestamp': 1492536019 }); if ($('slideshow_welcome')) { center_title = new center_element({ 'el': 'slideshow_welcome', 'parent': 'home_slideshow_mask' }); center_title.setup.periodical(250, center_title, true); } function loadDrawer (fn) { (document.readyState === 'complete') ? fn() : window.addEventListener('load', fn); } loadDrawer(function() { try{ drawer.init(768); }catch(err){ console.log("Mobile Drawer did not Load"); } }); var lightbox_els = $$('a').filter(function(el) { return el.rel && el.rel.test(/^lightbox/i); }); var default_lightbox = new SqueezeBox({'handler': 'image'}); default_lightbox.assign(lightbox_els); // HTML Lightbox Initialization squeezebox = new SqueezeBox({ handler: 'iframe' }); squeezebox.assign($$('a[rel=html_lightbox]'), { parse: 'rel=html_lightbox' }); // Menu Lightbox Initialization setTimeout(function() { var menu_squeezebox = new SqueezeBox({ handler: 'iframe' }); menu_squeezebox.assign($$('a[rel=menu_lightbox]'), { parse: 'rel=menu_lightbox' }); }, 500); }); /// END DOMREADY ------> ///------> window.addEvent('load', function() { page_image_crop.container.el = $(page_image_crop.base+'_image_mask'); if (page_image_crop.container.el) { page_image_crop.container.height = page_image_crop.container.el.getDimensions().y; page_image_crop.container.el.getElements('img').each(function(el) { page_image_crop.single.el = el; page_image_crop.single.height = page_image_crop.single.el.getDimensions().y; page_image_crop.single.offset = Math.round((page_image_crop.container.height - page_image_crop.single.height) / 2); if (page_image_crop.single.offset) { if(page_image_crop.single.offset > 0) { page_image_crop.container.el.tween('height', page_image_crop.single.height); } else { page_image_crop.single.el.setStyle('position', 'relative'); page_image_crop.single.el.tween('top', page_image_crop.single.offset); } } }); } var pi_module_slideshow_1 = new content_rotator({ id: 'image_rotator_module_slideshow_1', cur_item: 0, transition: 1, speed: 4, duration: 400, title_text: 1, link_text: 0, type: 'image', scaling: '3', tracker: '0', tracker_digits: '1', tracker_template: ' ', item_titles: ["Fabric Headband"], item_title: 1, item_links: [''], item_targets: [''], item_link: 1, thumbs: 0, static: 1, // deprecated item_width: 0, item_height: 0 }); }); /// END LOAD ------> //]]>