{"version":3,"sources":["yepnope-1.5.4.min.js"],"names":["window","doc","undef","isFileReady","readyState","injectJs","src","cb","attrs","timeout","err","internal","done","i","script","createElement","yepnope","setAttribute","executeStack","noop","onreadystatechange","onload","sTimeout","firstScript","parentNode","insertBefore","injectCss","href","link","rel","type","execStack","shift","started","preloadFile","elem","url","splicePoint","dontExec","attrObj","first","preloadElem","stackObject","insBeforeObj","removeChild","scriptCache","hasOwnProperty","firstFlag","t","s","e","a","x","data","width","height","onerror","call","this","splice","isGeckoLTE18","push","load","resource","isString","strCssElem","strJsElem","length","getYepnope","y","handler","docElement","documentElement","setTimeout","getElementsByTagName","toString","isGecko","style","createRange","compareNode","isOpera","opera","isIE","attachEvent","isArray","Array","obj","isObject","Object","isFunction","fn","globalFilters","prefixes","resourceObj","prefix_parts","needs","satisfyPrefixes","mFunc","j","parts","split","gLen","origUrl","pop","pLen","res","getExtension","loadScriptOrStyle","input","callback","chain","index","testResult","autoCallback","loadFromTestObject","testObject","handleGroup","needGroup","moreToCome","args","slice","arguments","cbRef","apply","complete","needGroupSize","count","callbackKey","innerCb","group","always","need","prefix","filter","addEventListener","removeEventListener","document"],"mappings":"CAeA,SAAaA,EAAQC,EAAKC,GA+CxB,QAASC,GAAcC,GAErB,OAAWA,GAA4B,UAAdA,GAAwC,YAAdA,GAA0C,iBAAdA,EAMjF,QAASC,GAAWC,EAAKC,EAAIC,EAAOC,EAA4BC,EAAKC,GACnE,GACIC,GAAMC,EADNC,EAASb,EAAIc,cAAe,SAGhCN,GAAUA,GAAWO,EAAsB,aAE3CF,EAAOR,IAAMA,CAGb,KAAMO,IAAKL,GACPM,EAAOG,aAAcJ,EAAGL,EAAOK,GAGnCN,GAAKI,EAAWO,EAAiBX,GAAMY,EAGvCL,EAAOM,mBAAqBN,EAAOO,OAAS,YAEnCT,GAAQT,EAAaW,EAAOV,cAGjCQ,EAAO,EACPL,IAGAO,EAAOO,OAASP,EAAOM,mBAAqB,OAKhDE,EAAS,WACAV,IACLA,EAA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f,IAAgBG,EAAiB,KACjCc,EAAajB,EAAaG,EAAgB,IAAIA,EAAiB,KAC/De,EAAaf,EAAiB,MAAKA,EAAiB,KACpDN,EAAaM,EAAqB,UAAKhG,EACvCuG,EAAab,EACbe,EAAaT,EAAqB,UAAKhG,CA2E3CiG,GAAaa,IAASC,GAItBA,GAAUd,EAAac,GAvL3B,GAAIrH,GACAsH,EAEArB,EAAQpD,KAAc,QAAU,MAwLpC,IAAKM,EAAU+B,GACbY,EAAmBZ,EAAO,EAAGe,EAAO,OAGjC,IAAK1B,EAASW,GAEjB,IAAKlF,EAAI,EAAGA,EAAIkF,EAAM5B,OAAQtD,IAC5BsH,EAAOpC,EAAOlF,GAGTmD,EAAUmE,GACbxB,EAAmBwB,EAAM,EAAGrB,EAAO,GAG3B1B,EAAS+C,GACjBnH,EAASmH,GAGD5C,EAAU4C,IAClBjB,EAAoBiB,EAAMrB,OAKtBvB,GAAUQ,IAClBmB,EAAoBnB,EAAOe,IAc/B9F,EAAmB,UAAI,SAAWoH,EAAQvB,GACxCjB,EAAUwC,GAAWvB,GAWvB7F,EAAmB,UAAI,SAAWqH,GAChC1C,EAAc9B,KAAMwE,IAItBrH,EAAsB,aAAI,IAKH,MAAlBf,EAAIG,YAAsBH,EAAIqI,mBAEjCrI,EAAIG,WAAa,UAEjBH,EAAIqI,iBAAkB,mBAAoBhE,EAAU,WAElDrE,EAAIsI,oBAAqB,mBAAoBjE,EAAS,GAEtDrE,EAAIG,WAAa,YAChB,IAKLJ,EAAgB,QAAIoE,IAGpBpE,EAAgB,QAAgB,aAAIkB,EACpClB,EAAgB,QAAY,SAAIK,EAChCL,EAAgB,QAAa,UAAI0B,GAE/BgC,KAAM8E","file":"yepnope-1.5.4.min.js","sourcesContent":["// yepnope.js\r\n// Version - 1.5.4pre\r\n//\r\n// by\r\n// Alex Sexton - @SlexAxton - AlexSexton[at]gmail.com\r\n// Ralph Holzmann - @ralphholzmann - ralphholzmann[at]gmail.com\r\n//\r\n// http://yepnopejs.com/\r\n// https://github.com/SlexAxton/yepnope.js/\r\n//\r\n// Tri-license - WTFPL | MIT | BSD\r\n//\r\n// Please minify before use.\r\n// Also available as Modernizr.load via the Modernizr Project\r\n//\r\n( function ( window, doc, undef ) {\r\n\r\nvar docElement = doc.documentElement,\r\n sTimeout = window.setTimeout,\r\n firstScript = doc.getElementsByTagName( \"script\" )[ 0 ],\r\n toString = {}.toString,\r\n execStack = [],\r\n started = 0,\r\n noop = function () {},\r\n // Before you get mad about browser sniffs, please read:\r\n // https://github.com/Modernizr/Modernizr/wiki/Undetectables\r\n // If you have a better solution, we are actively looking to solve the problem\r\n isGecko = ( \"MozAppearance\" in docElement.style ),\r\n isGeckoLTE18 = isGecko && !! doc.createRange().compareNode,\r\n insBeforeObj = isGeckoLTE18 ? docElement : firstScript.parentNode,\r\n // Thanks to @jdalton for showing us this opera detection (by way of @kangax) (and probably @miketaylr too, or whatever...)\r\n isOpera = window.opera && toString.call( window.opera ) == \"[object Opera]\",\r\n isIE = !! doc.attachEvent && !isOpera,\r\n strJsElem = isGecko ? \"object\" : isIE ? \"script\" : \"img\",\r\n strCssElem = isIE ? \"script\" : strJsElem,\r\n isArray = Array.isArray || function ( obj ) {\r\n return toString.call( obj ) == \"[object Array]\";\r\n },\r\n isObject = function ( obj ) {\r\n return Object(obj) === obj;\r\n },\r\n isString = function ( s ) {\r\n return typeof s == \"string\";\r\n },\r\n isFunction = function ( fn ) {\r\n return toString.call( fn ) == \"[object Function]\";\r\n },\r\n globalFilters = [],\r\n scriptCache = {},\r\n prefixes = {\r\n // key value pair timeout options\r\n timeout : function( resourceObj, prefix_parts ) {\r\n if ( prefix_parts.length ) {\r\n resourceObj['timeout'] = prefix_parts[ 0 ];\r\n }\r\n return resourceObj;\r\n }\r\n },\r\n handler,\r\n yepnope;\r\n\r\n /* Loader helper functions */\r\n function isFileReady ( readyState ) {\r\n // Check to see if any of the ways a file can be ready are available as properties on the file's element\r\n return ( ! readyState || readyState == \"loaded\" || readyState == \"complete\" || readyState == \"uninitialized\" );\r\n }\r\n\r\n\r\n // Takes a preloaded js obj (changes in different browsers) and injects it into the head\r\n // in the appropriate order\r\n function injectJs ( src, cb, attrs, timeout, /* internal use */ err, internal ) {\r\n var script = doc.createElement( \"script\" ),\r\n done, i;\r\n\r\n timeout = timeout || yepnope['errorTimeout'];\r\n\r\n script.src = src;\r\n\r\n // Add our extra attributes to the script element\r\n for ( i in attrs ) {\r\n script.setAttribute( i, attrs[ i ] );\r\n }\r\n\r\n cb = internal ? executeStack : ( cb || noop );\r\n\r\n // Bind to load events\r\n script.onreadystatechange = script.onload = function () {\r\n\r\n if ( ! done && isFileReady( script.readyState ) ) {\r\n\r\n // Set done to prevent this function from being called twice.\r\n done = 1;\r\n cb();\r\n\r\n // Handle memory leak in IE\r\n script.onload = script.onreadystatechange = null;\r\n }\r\n };\r\n\r\n // 404 Fallback\r\n sTimeout(function () {\r\n if ( ! done ) {\r\n done = 1;\r\n // Might as well pass in an error-state if we fire the 404 fallback\r\n cb(1);\r\n }\r\n }, timeout );\r\n\r\n // Inject script into to document\r\n // or immediately callback if we know there\r\n // was previously a timeout error\r\n err ? script.onload() : firstScript.parentNode.insertBefore( script, firstScript );\r\n }\r\n\r\n // Takes a preloaded css obj (changes in different browsers) and injects it into the head\r\n function injectCss ( href, cb, attrs, timeout, /* Internal use */ err, internal ) {\r\n\r\n // Create stylesheet link\r\n var link = doc.createElement( \"link\" ),\r\n done, i;\r\n\r\n timeout = timeout || yepnope['errorTimeout'];\r\n\r\n cb = internal ? executeStack : ( cb || noop );\r\n\r\n // Add attributes\r\n link.href = href;\r\n link.rel = \"stylesheet\";\r\n link.type = \"text/css\";\r\n\r\n // Add our extra attributes to the link element\r\n for ( i in attrs ) {\r\n link.setAttribute( i, attrs[ i ] );\r\n }\r\n\r\n if ( ! err ) {\r\n firstScript.parentNode.insertBefore( link, firstScript );\r\n sTimeout(cb, 0);\r\n }\r\n }\r\n\r\n function executeStack ( ) {\r\n // shift an element off of the stack\r\n var i = execStack.shift();\r\n started = 1;\r\n\r\n // if a is truthy and the first item in the stack has an src\r\n if ( i ) {\r\n // if it's a script, inject it into the head with no type attribute\r\n if ( i['t'] ) {\r\n // Inject after a timeout so FF has time to be a jerk about it and\r\n // not double load (ignore the cache)\r\n sTimeout( function () {\r\n (i['t'] == \"c\" ? yepnope['injectCss'] : yepnope['injectJs'])( i['s'], 0, i['a'], i['x'], i['e'], 1 );\r\n }, 0 );\r\n }\r\n // Otherwise, just call the function and potentially run the stack\r\n else {\r\n i();\r\n executeStack();\r\n }\r\n }\r\n else {\r\n // just reset out of recursive mode\r\n started = 0;\r\n }\r\n }\r\n\r\n function preloadFile ( elem, url, type, splicePoint, dontExec, attrObj, timeout ) {\r\n\r\n timeout = timeout || yepnope['errorTimeout'];\r\n\r\n // Create appropriate element for browser and type\r\n var preloadElem = doc.createElement( elem ),\r\n done = 0,\r\n firstFlag = 0,\r\n stackObject = {\r\n \"t\": type, // type\r\n \"s\": url, // src\r\n //r: 0, // ready\r\n \"e\": dontExec,// set to true if we don't want to reinject\r\n \"a\": attrObj,\r\n \"x\": timeout\r\n };\r\n\r\n // The first time (common-case)\r\n if ( scriptCache[ url ] === 1 ) {\r\n firstFlag = 1;\r\n scriptCache[ url ] = [];\r\n }\r\n\r\n function onload ( first ) {\r\n // If the script/css file is loaded\r\n if ( ! done && isFileReady( preloadElem.readyState ) ) {\r\n\r\n // Set done to prevent this function from being called twice.\r\n stackObject['r'] = done = 1;\r\n\r\n ! started && executeStack();\r\n\r\n // Handle memory leak in IE\r\n preloadElem.onload = preloadElem.onreadystatechange = null;\r\n if ( first ) {\r\n if ( elem != \"img\" ) {\r\n sTimeout(function(){ insBeforeObj.removeChild( preloadElem ) }, 50);\r\n }\r\n\r\n for ( var i in scriptCache[ url ] ) {\r\n if ( scriptCache[ url ].hasOwnProperty( i ) ) {\r\n scriptCache[ url ][ i ].onload();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n // Setting url to data for objects or src for img/scripts\r\n if ( elem == \"object\" ) {\r\n preloadElem.data = url;\r\n } else {\r\n preloadElem.src = url;\r\n\r\n // Setting bogus script type to allow the script to be cached\r\n preloadElem.type = elem;\r\n }\r\n\r\n // Don't let it show up visually\r\n preloadElem.width = preloadElem.height = \"0\";\r\n\r\n // Attach handlers for all browsers\r\n preloadElem.onerror = preloadElem.onload = preloadElem.onreadystatechange = function(){\r\n onload.call(this, firstFlag);\r\n };\r\n // inject the element into the stack depending on if it's\r\n // in the middle of other scripts or not\r\n execStack.splice( splicePoint, 0, stackObject );\r\n\r\n // The only place these can't go is in the element, since objects won't load in there\r\n // so we have two options - insert before the head element (which is hard to assume) - or\r\n // insertBefore technically takes null/undefined as a second param and it will insert the element into\r\n // the parent last. We try the head, and it automatically falls back to undefined.\r\n if ( elem != \"img\" ) {\r\n // If it's the first time, or we've already loaded it all the way through\r\n if ( firstFlag || scriptCache[ url ] === 2 ) {\r\n insBeforeObj.insertBefore( preloadElem, isGeckoLTE18 ? null : firstScript );\r\n\r\n // If something fails, and onerror doesn't fire,\r\n // continue after a timeout.\r\n sTimeout( onload, timeout );\r\n }\r\n else {\r\n // instead of injecting, just hold on to it\r\n scriptCache[ url ].push( preloadElem );\r\n }\r\n }\r\n }\r\n\r\n function load ( resource, type, dontExec, attrObj, timeout ) {\r\n // If this method gets hit multiple times, we should flag\r\n // that the execution of other threads should halt.\r\n started = 0;\r\n\r\n // We'll do 'j' for js and 'c' for css, yay for unreadable minification tactics\r\n type = type || \"j\";\r\n if ( isString( resource ) ) {\r\n // if the resource passed in here is a string, preload the file\r\n preloadFile( type == \"c\" ? strCssElem : strJsElem, resource, type, this['i']++, dontExec, attrObj, timeout );\r\n } else {\r\n // Otherwise it's a callback function and we can splice it into the stack to run\r\n execStack.splice( this['i']++, 0, resource );\r\n execStack.length == 1 && executeStack();\r\n }\r\n\r\n // OMG is this jQueries? For chaining...\r\n return this;\r\n }\r\n\r\n // return the yepnope object with a fresh loader attached\r\n function getYepnope () {\r\n var y = yepnope;\r\n y['loader'] = {\r\n \"load\": load,\r\n \"i\" : 0\r\n };\r\n return y;\r\n }\r\n\r\n /* End loader helper functions */\r\n // Yepnope Function\r\n yepnope = function ( needs ) {\r\n\r\n var i,\r\n need,\r\n // start the chain as a plain instance\r\n chain = this['yepnope']['loader'];\r\n\r\n function satisfyPrefixes ( url ) {\r\n // split all prefixes out\r\n var parts = url.split( \"!\" ),\r\n gLen = globalFilters.length,\r\n origUrl = parts.pop(),\r\n pLen = parts.length,\r\n res = {\r\n \"url\" : origUrl,\r\n // keep this one static for callback variable consistency\r\n \"origUrl\" : origUrl,\r\n \"prefixes\" : parts\r\n },\r\n mFunc,\r\n j,\r\n prefix_parts;\r\n\r\n // loop through prefixes\r\n // if there are none, this automatically gets skipped\r\n for ( j = 0; j < pLen; j++ ) {\r\n prefix_parts = parts[ j ].split( '=' );\r\n mFunc = prefixes[ prefix_parts.shift() ];\r\n if ( mFunc ) {\r\n res = mFunc( res, prefix_parts );\r\n }\r\n }\r\n\r\n // Go through our global filters\r\n for ( j = 0; j < gLen; j++ ) {\r\n res = globalFilters[ j ]( res );\r\n }\r\n\r\n // return the final url\r\n return res;\r\n }\r\n\r\n function getExtension ( url ) {\r\n return url.split(\".\").pop().split(\"?\").shift();\r\n }\r\n\r\n function loadScriptOrStyle ( input, callback, chain, index, testResult ) {\r\n // run through our set of prefixes\r\n var resource = satisfyPrefixes( input ),\r\n autoCallback = resource['autoCallback'],\r\n extension = getExtension( resource['url'] );\r\n\r\n // if no object is returned or the url is empty/0 just exit the load\r\n if ( resource['bypass'] ) {\r\n return;\r\n }\r\n\r\n // Determine callback, if any\r\n if ( callback ) {\r\n callback = isFunction( callback ) ?\r\n callback :\r\n callback[ input ] ||\r\n callback[ index ] ||\r\n callback[ ( input.split( \"/\" ).pop().split( \"?\" )[ 0 ] ) ];\r\n }\r\n\r\n // if someone is overriding all normal functionality\r\n if ( resource['instead'] ) {\r\n return resource['instead']( input, callback, chain, index, testResult );\r\n }\r\n else {\r\n // Handle if we've already had this url and it's completed loaded already\r\n if ( scriptCache[ resource['url'] ] ) {\r\n // don't let this execute again\r\n resource['noexec'] = true;\r\n }\r\n else {\r\n scriptCache[ resource['url'] ] = 1;\r\n }\r\n\r\n // Throw this into the queue\r\n chain.load( resource['url'], ( ( resource['forceCSS'] || ( ! resource['forceJS'] && \"css\" == getExtension( resource['url'] ) ) ) ) ? \"c\" : undef, resource['noexec'], resource['attrs'], resource['timeout'] );\r\n\r\n // If we have a callback, we'll start the chain over\r\n if ( isFunction( callback ) || isFunction( autoCallback ) ) {\r\n // Call getJS with our current stack of things\r\n chain['load']( function () {\r\n // Hijack yepnope and restart index counter\r\n getYepnope();\r\n // Call our callbacks with this set of data\r\n callback && callback( resource['origUrl'], testResult, index );\r\n autoCallback && autoCallback( resource['origUrl'], testResult, index );\r\n\r\n // Override this to just a boolean positive\r\n scriptCache[ resource['url'] ] = 2;\r\n } );\r\n }\r\n }\r\n }\r\n\r\n function loadFromTestObject ( testObject, chain ) {\r\n var testResult = !! testObject['test'],\r\n group = testResult ? testObject['yep'] : testObject['nope'],\r\n always = testObject['load'] || testObject['both'],\r\n callback = testObject['callback'] || noop,\r\n cbRef = callback,\r\n complete = testObject['complete'] || noop,\r\n needGroupSize,\r\n callbackKey;\r\n\r\n // Reusable function for dealing with the different input types\r\n // NOTE:: relies on closures to keep 'chain' up to date, a bit confusing, but\r\n // much smaller than the functional equivalent in this case.\r\n function handleGroup ( needGroup, moreToCome ) {\r\n if ( ! needGroup ) {\r\n // Call the complete callback when there's nothing to load.\r\n ! moreToCome && complete();\r\n }\r\n // If it's a string\r\n else if ( isString( needGroup ) ) {\r\n // if it's a string, it's the last\r\n if ( !moreToCome ) {\r\n // Add in the complete callback to go at the end\r\n callback = function () {\r\n var args = [].slice.call( arguments );\r\n cbRef.apply( this, args );\r\n complete();\r\n };\r\n }\r\n // Just load the script of style\r\n loadScriptOrStyle( needGroup, callback, chain, 0, testResult );\r\n }\r\n // See if we have an object. Doesn't matter if it's an array or a key/val hash\r\n // Note:: order cannot be guaranteed on an key value object with multiple elements\r\n // since the for-in does not preserve order. Arrays _should_ go in order though.\r\n else if ( isObject( needGroup ) ) {\r\n // I hate this, but idk another way for objects.\r\n needGroupSize = (function(){\r\n var count = 0, i\r\n for (i in needGroup ) {\r\n if ( needGroup.hasOwnProperty( i ) ) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n })();\r\n\r\n for ( callbackKey in needGroup ) {\r\n // Safari 2 does not have hasOwnProperty, but not worth the bytes for a shim\r\n // patch if needed. Kangax has a nice shim for it. Or just remove the check\r\n // and promise not to extend the object prototype.\r\n if ( needGroup.hasOwnProperty( callbackKey ) ) {\r\n // Find the last added resource, and append to it's callback.\r\n if ( ! moreToCome && ! ( --needGroupSize ) ) {\r\n // If this is an object full of callbacks\r\n if ( ! isFunction( callback ) ) {\r\n // Add in the complete callback to go at the end\r\n callback[ callbackKey ] = (function( innerCb ) {\r\n return function () {\r\n var args = [].slice.call( arguments );\r\n innerCb && innerCb.apply( this, args );\r\n complete();\r\n };\r\n })( cbRef[ callbackKey ] );\r\n }\r\n // If this is just a single callback\r\n else {\r\n callback = function () {\r\n var args = [].slice.call( arguments );\r\n cbRef.apply( this, args );\r\n complete();\r\n };\r\n }\r\n }\r\n loadScriptOrStyle( needGroup[ callbackKey ], callback, chain, callbackKey, testResult );\r\n }\r\n }\r\n }\r\n }\r\n\r\n // figure out what this group should do\r\n handleGroup( group, !!always );\r\n\r\n // Run our loader on the load/both group too\r\n // the always stuff always loads second.\r\n always && handleGroup( always );\r\n }\r\n\r\n // Someone just decides to load a single script or css file as a string\r\n if ( isString( needs ) ) {\r\n loadScriptOrStyle( needs, 0, chain, 0 );\r\n }\r\n // Normal case is likely an array of different types of loading options\r\n else if ( isArray( needs ) ) {\r\n // go through the list of needs\r\n for( i = 0; i < needs.length; i++ ) {\r\n need = needs[ i ];\r\n\r\n // if it's a string, just load it\r\n if ( isString( need ) ) {\r\n loadScriptOrStyle( need, 0, chain, 0 );\r\n }\r\n // if it's an array, call our function recursively\r\n else if ( isArray( need ) ) {\r\n yepnope( need );\r\n }\r\n // if it's an object, use our modernizr logic to win\r\n else if ( isObject( need ) ) {\r\n loadFromTestObject( need, chain );\r\n }\r\n }\r\n }\r\n // Allow a single object to be passed in\r\n else if ( isObject( needs ) ) {\r\n loadFromTestObject( needs, chain );\r\n }\r\n };\r\n\r\n // This publicly exposed function is for allowing\r\n // you to add functionality based on prefixes on the\r\n // string files you add. 'css!' is a builtin prefix\r\n //\r\n // The arguments are the prefix (not including the !) as a string\r\n // and\r\n // A callback function. This function is passed a resource object\r\n // that can be manipulated and then returned. (like middleware. har.)\r\n //\r\n // Examples of this can be seen in the officially supported ie prefix\r\n yepnope['addPrefix'] = function ( prefix, callback ) {\r\n prefixes[ prefix ] = callback;\r\n };\r\n\r\n // A filter is a global function that every resource\r\n // object that passes through yepnope will see. You can\r\n // of course conditionally choose to modify the resource objects\r\n // or just pass them along. The filter function takes the resource\r\n // object and is expected to return one.\r\n //\r\n // The best example of a filter is the 'autoprotocol' officially\r\n // supported filter\r\n yepnope['addFilter'] = function ( filter ) {\r\n globalFilters.push( filter );\r\n };\r\n\r\n // Default error timeout to 10sec - modify to alter\r\n yepnope['errorTimeout'] = 1e4;\r\n\r\n // Webreflection readystate hack\r\n // safe for jQuery 1.4+ ( i.e. don't use yepnope with jQuery 1.3.2 )\r\n // if the readyState is null and we have a listener\r\n if ( doc.readyState == null && doc.addEventListener ) {\r\n // set the ready state to loading\r\n doc.readyState = \"loading\";\r\n // call the listener\r\n doc.addEventListener( \"DOMContentLoaded\", handler = function () {\r\n // Remove the listener\r\n doc.removeEventListener( \"DOMContentLoaded\", handler, 0 );\r\n // Set it to ready\r\n doc.readyState = \"complete\";\r\n }, 0 );\r\n }\r\n\r\n // Attach loader &\r\n // Leak it\r\n window['yepnope'] = getYepnope();\r\n\r\n // Exposing executeStack to better facilitate plugins\r\n window['yepnope']['executeStack'] = executeStack;\r\n window['yepnope']['injectJs'] = injectJs;\r\n window['yepnope']['injectCss'] = injectCss;\r\n\r\n})( this, document );\r\n"]}