text: ﻿/*
   * HeadJS     The only script in your <HEAD>    
   * Author     Tero Piirainen  (tipiirai)
   * Maintainer Robert Hoffmann (itechnology)
   * License    MIT / http://bit.ly/mit-license
   *
   * Version 0.99
   * http://headjs.com
   */
  (function(I,H){var d=I.document,h=[],E=[],m={},c={},q="async" in d.createElement("script")||"MozAppearance" in d.documentElement.style||I.opera,t,r,n=I.head_conf&&I.head_conf.head||"head",b=I[n]=(I[n]||function(){b.ready.apply(null,arguments)}),D=1,C=2,x=3,w=4;if(q){b.load=function(){var e=arguments,J=e[e.length-1],K={};if(!s(J)){J=null}k(e,function(M,L){if(M!==J){M=l(M);K[M.name]=M;u(M,J&&L===e.length-2?function(){if(a(K)){z(J)}}:null)}});return b}}else{b.load=function(){var e=arguments,K=[].slice.call(e,1),J=K[0];if(!t){E.push(function(){b.load.apply(null,e)});return b}if(!!J){k(K,function(L){if(!s(L)){B(l(L))}});u(l(e[0]),s(J)?J:function(){b.load.apply(null,K)})}else{u(l(e[0]))}return b}}b.js=b.load;b.test=function(N,M,J,e){var K=(typeof N==="object")?N:{test:N,success:!!M?p(M)?M:[M]:false,failure:!!J?p(J)?J:[J]:false,callback:e||y};var L=!!K.test;if(L&&!!K.success){K.success.push(K.callback);b.load.apply(null,K.success)}else{if(!L&&!!K.failure){K.failure.push(K.callback);b.load.apply(null,K.failure)}else{e()}}return b};b.ready=function(L,K){if(L===d){if(r){z(K)}else{h.push(K)}return b}if(s(L)){K=L;L="ALL"}if(typeof L!=="string"||!s(K)){return b}var J=c[L];if(J&&J.state===w||L==="ALL"&&a()&&r){z(K);return b}var e=m[L];if(!e){e=m[L]=[K]}else{e.push(K)}return b};b.ready(d,function(){if(a()){k(m.ALL,function(e){z(e)})}if(b.feature){b.feature("domloaded",true)}});function y(){}function k(e,J){if(!e){return}if(typeof e==="object"){e=[].slice.call(e)}for(var K=0,L=e.length;K<L;K++){J.call(e,e[K],K)}}function o(K,J){var e=Object.prototype.toString.call(J).slice(8,-1);return J!==H&&J!==null&&e===K}function s(e){return o("Function",e)}function p(e){return o("Array",e)}function F(L){var J=L.split("/"),K=J[J.length-1],e=K.indexOf("?");return e!==-1?K.substring(0,e):K}function z(e){e=e||y;if(e._done){return}e();e._done=1}function l(K){var e={};if(typeof K==="object"){for(var L in K){if(!!K[L]){e={name:L,url:K[L]}}}}else{e={name:F(K),url:K}}var J=c[e.name];if(J&&J.url===e.url){return J}c[e.name]=e;return e}function a(e){e=e||c;for(var J in e){if(e.hasOwnProperty(J)&&e[J].state!==w){return false}}return true}function A(e){e.state=C;k(e.onpreload,function(J){J.call()})}function B(e,J){if(e.state===H){e.state=D;e.onpreload=[];v({url:e.url,type:"cache"},function(){A(e)})}}function u(e,J){J=J||y;if(e.state===w){J();return}if(e.state===x){b.ready(e.name,J);return}if(e.state===D){e.onpreload.push(function(){u(e,J)});return}e.state=x;v(e,function(){e.state=w;J();k(m[e.name],function(K){z(K)});if(r&&a()){k(m.ALL,function(K){z(K)})}})}function v(e,J){J=J||y;var K;if(/\.css[^\.]*$/.test(e.url)){K=d.createElement("link");K.type="text/"+(e.type||"css");K.rel="stylesheet";K.href=e.url}else{K=d.createElement("script");K.type="text/"+(e.type||"javascript");K.src=e.url}K.onload=K.onreadystatechange=N;K.onerror=L;K.async=false;K.defer=false;function L(O){O=O||I.event;K.onload=K.onreadystatechange=K.onerror=null;J()}function N(O){O=O||I.event;if(O.type==="load"||(/loaded|complete/.test(K.readyState)&&(!d.documentMode||d.documentMode<9))){K.onload=K.onreadystatechange=K.onerror=null;J()}}var M=d.head||d.getElementsByTagName("head")[0];M.insertBefore(K,M.lastChild)}function g(){if(!d.body){I.clearTimeout(b.readyTimeout);b.readyTimeout=I.setTimeout(g,50);return}if(!r){r=true;k(h,function(e){z(e)})}}function f(){if(d.addEventListener){d.removeEventListener("DOMContentLoaded",f,false);g()}else{if(d.readyState==="complete"){d.detachEvent("onreadystatechange",f);g()}}}if(d.readyState==="complete"){g()}else{if(d.addEventListener){d.addEventListener("DOMContentLoaded",f,false);I.addEventListener("load",g,false)}else{d.attachEvent("onreadystatechange",f);I.attachEvent("onload",g);var G=false;try{G=I.frameElement==null&&d.documentElement}catch(j){}if(G&&G.doScroll){(function i(){if(!r){try{G.doScroll("left")}catch(e){I.clearTimeout(b.readyTimeout);b.readyTimeout=I.setTimeout(i,50);return}g()}})()}}}setTimeout(function(){t=true;k(E,function(e){e()})},300)})(window);