-[Allow invokation of Foundation and foundationExtendEBI with data attributes](#allow-invokation-of-foundation-and-foundationextendebi-with-data-attributes)
-[foundationInvoke](#foundationinvoke)
-[foundationExtendEBI](#foundationextendebi)
-[addExternal](#addexternal)
## ebiGaIndicateLoaded
[js/foundationExtendEBI.js:12-34](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L12-L34"Source code on GitHub")
We poll the document until we find GA has loaded, or we've tried a few times.
[js/foundationExtendEBI.js:19-26](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L19-L26"Source code on GitHub")
If successful we append `.google-analytics-loaded` to the `body` tag.
## last
[js/foundationExtendEBI.js:42-46](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L42-L46"Source code on GitHub")
[js/foundationExtendEBI.js:52-52](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L52-L52"Source code on GitHub")
Track the last time an event was sent (don't double send)
[js/foundationExtendEBI.js:71-102](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L71-L102"Source code on GitHub")
## Analytics tracking
This code tracks the user's clicks in various parts of the EBI site and logs them as GA events.<br/>
Links in non-generic regions can be tracked by adding '.track-with-analytics-events' to a parent div. Careful with the scoping.
Dev note:
add class verbose-analytics to your body for a readout to console on clicks, a la: <br/>
[js/foundationExtendEBI.js:111-194](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L111-L194"Source code on GitHub")
If GA is found, we initialise the tracking of various default areas
## Note
This could be done more efficently with a general capture of links,
but we're running against the page's unload -- so speed over elegance.
## addBlankTargetToExternalLinkEBI
[js/foundationExtendEBI.js:200-207](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L200-L207"Source code on GitHub")
[js/foundationExtendEBI.js:213-218](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L213-L218"Source code on GitHub")
[js/foundationExtendEBI.js:231-260](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L231-L260"Source code on GitHub")
## Activate EMBL dropdown menu
Note: the menu content has already been added in `script.js`<br/>
If you pass options as 'reInit', it will destory any existing menu and add a new one.
[js/foundationExtendEBI.js:265-288](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L265-L288"Source code on GitHub")
Smooth scroll anchor links for jQuery users
## invokeResponsiveMenuEBI
[js/foundationExtendEBI.js:293-401](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L293-L401"Source code on GitHub")
Make the local nav menu responsive to the browser window width
## jQuery
[js/foundationExtendEBI.js:406-496](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L406-L496"Source code on GitHub")
Default invokation of foundationExtendEBI
## bodyData
[js/foundationExtendEBI.js:468-468](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L468-L468"Source code on GitHub")
## Allow invokation of Foundation and foundationExtendEBI with data attributes
This saves the need of placing the below on your page:<br/>
[js/foundationExtendEBI.js:473-477](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L473-L477"Source code on GitHub")
**Examples**
```javascript
<bodydata-foundationInvoke="document>
```
## foundationExtendEBI
[js/foundationExtendEBI.js:482-486](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L482-L486"Source code on GitHub")
**Examples**
```javascript
<bodydata-foundationExtendEBI="document">
```
## addExternal
[js/foundationExtendEBI.js:491-494](https://github.com/ebiwd/EBI-Framework/blob/fbedcb2aff06266d91cbfa8ea482fe58f7bc79a2/js/foundationExtendEBI.js#L491-L494"Source code on GitHub")