Drupal.locale = { 'pluralFormula': function ($n) { return Number(($n!=1)); }, 'strings': {"":{"An AJAX HTTP error occurred.":"AJAX HTTP errorea gertatu da.","Loading":"Kargatzen","(active tab)":"(atal gaitua)","Hide":"Ezkutatu","Show":"Erakutsi","Select all rows in this table":"Aukeratu taula honetako lerro guztiak","Deselect all rows in this table":"Desaukeratu taula honetako lerro guztiak","Restricted to certain pages":"Orri konkretuetan murriztua","Searching for matches...":"Emaitzak bilatzen...","Show row weights":"Lerro bakoitzaren pisua erakutsi.","Hide row weights":"Ezkutatu lerro bakoitzaren pisua","Drag to re-order":"Arrastatu birantolatzeko","Changes made in this table will not be saved until the form is submitted.":"Taula honetan egindako aldaketak ez dira gordeko formularioa bidaltzen ez den artean.","Show shortcuts":"Erakutsi lasterbideak","Hide shortcuts":"Ezkutatu lasterbideak","Not restricted":"Murrizketarik gabe","Not customizable":"Ezin du egokitu","The changes to these blocks will not be saved until the \u003Cem\u003ESave blocks\u003C\/em\u003E button is clicked.":"Bloke hauetan egindako aldaketak ez dira gordeko \u003Cem\u003EBlokeak gorde\u003C\/em\u003E botoia sakatu arte.","Please wait...":"Itxaron mesedez...","Add":"Gehitu","Edit":"Editatu","Not published":"Argitaratu gabea","Hide summary":"Laburpena ezkutatu","Edit summary":"Laburpena editatu","By @name on @date":"@date-an @name-k egina","By @name":"@name-k egina","Alias: @alias":"Alias: @alias","No alias":"Alias-ik ez","Enabled":"Gaituta","Disabled":"Ezgaituta","Done":"Eginda","Prev":"Aur","Next":"Hurrengoa","Today":"Gaur","January":"Urtarrila","February":"Otsaila","March":"Martxoa","April":"Apirila","May":"Mai","June":"Ekaina","July":"Uztaila","August":"Abuztua","September":"Iraila","October":"Urria","November":"Azaroa","December":"Abendua","Jan":"Urt","Feb":"Ots","Mar":"Mar","Apr":"Api","Jun":"Eka","Jul":"Uzt","Aug":"Abu","Sep":"Ira","Oct":"Urr","Nov":"Aza","Dec":"Abe","Sunday":"Igandea","Monday":"Astelehena","Tuesday":"Asteartea","Wednesday":"Asteazkena","Thursday":"Osteguna","Friday":"Ostirala","Saturday":"Larunbata","Sun":"Ig","Mon":"Al","Tue":"Ar","Wed":"Az","Thu":"Og","Fri":"Or","Sat":"La","Su":"Ig","Mo":"Al","Tu":"Ar","We":"Az","Th":"Og","Fr":"Or","Sa":"Lr","Not in menu":"Ez dago estekarik menuan","Filename":"Fitxategi izena","Status":"Egoera","Size":"Tamaina","N\/A":"N\/A","Close":"Itxi","Ok":"Ados","This field is required.":"Eremu hau beharrezkoa da.","None":"Bat ere ez","Select":"Aukeratu","none":"bat ere ez","OK":"Ados","@number comments per page":"@number iruzkin orrialde bakoitzean","all":"denak","Available tokens":"Gaituriko aldagaiak (tokens)","Automatic alias":"Ezizen automatikoak"}} };;
/*!
Colorbox 1.6.0
license: MIT
http://www.jacklmoore.com/colorbox
*/
(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in y[0]&&!y[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),y.focus())}function c(t){c.str!==t&&(y.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),y.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-z-D,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-N-j,I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(S).hide(),y.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("
").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),U=_.get("createImg"),t(U).addClass(Z+"Photo").bind("error",function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var t;_.get("retinaImage")&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){U.height-=U.height*t,U.width-=U.width*t},_.mw&&U.width>_.mw&&(t=(U.width-_.mw)/U.width,o()),_.mh&&U.height>_.mh&&(t=(U.height-_.mh)/U.height,o())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",h(U)},1)}),U.src=e):e&&L.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,y,x,b,T,C,H,k,W,E,I,L,M,S,F,R,K,P,B,O,_,j,D,N,z,A,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullScreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t(""),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){R.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),y.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),R.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),y.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,R.hide(),t(),ae.unbind(ne,e).unbind(ie,t),y.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),R.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t(""),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(y[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(y[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=y.offset();if(E.unbind("resize."+Z),y.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,y.css({position:"fixed"})):(l=h,d=s,y.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),y.css({top:c.top,left:c.left,visibility:"visible"}),x[0].style.width=x[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||y.css(r),y.dequeue().animate(r,{duration:e||0,complete:function(){n(),q=!1,x[0].style.width=_.w+z+D+"px",x[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(L.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),L.hide(),t(U).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&y[0].style.removeAttribute("filter")}var n,o,a=W.length;$&&(o=function(){clearTimeout(Q),M.hide(),u(ne),_.get("onComplete")},S.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&F.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?y.fadeTo(g,1,i):i())},"fade"===_.get("transition")?y.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!q&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!q&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){$&&!G&&(G=!0,$=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),y.stop().fadeTo(_.get("fadeOut")||0,0,function(){y.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){y&&(y.stop(),t[Y].close(),y.stop(!1,!0).remove(),v.remove(),G=!1,y=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);;
(function ($) {
Drupal.behaviors.initColorbox = {
attach: function (context, settings) {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
if (settings.colorbox.mobiledetect && window.matchMedia) {
// Disable Colorbox for small screens.
var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
if (mq.matches) {
return;
}
}
$('.colorbox', context)
.once('init-colorbox')
.colorbox(settings.colorbox);
$(context).bind('cbox_complete', function () {
Drupal.attachBehaviors('#cboxLoadedContent');
});
}
};
})(jQuery);
;
(function ($) {
Drupal.behaviors.initColorboxStockholmsyndromeStyle = {
attach: function (context, settings) {
$(context).bind('cbox_open', function () {
// Hide close button initially.
$('#cboxClose', context).css('opacity', 0);
});
$(context).bind('cbox_load', function () {
// Hide close button. (It doesn't handle the load animation well.)
$('#cboxClose', context).css('opacity', 0);
});
$(context).bind('cbox_complete', function () {
// Show close button with a delay.
$('#cboxClose', context).fadeTo('fast', 0, function () {$(this).css('opacity', 1)});
});
}
};
})(jQuery);
;
(function ($) {
Drupal.behaviors.initColorboxLoad = {
attach: function (context, settings) {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
$.urlParams = function (url) {
var p = {},
e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, ' ')); },
q = url.split('?');
while (e = r.exec(q[1])) {
e[1] = d(e[1]);
e[2] = d(e[2]);
switch (e[2].toLowerCase()) {
case 'true':
case 'yes':
e[2] = true;
break;
case 'false':
case 'no':
e[2] = false;
break;
}
if (e[1] == 'width') { e[1] = 'innerWidth'; }
if (e[1] == 'height') { e[1] = 'innerHeight'; }
p[e[1]] = e[2];
}
return p;
};
$('.colorbox-load', context)
.once('init-colorbox-load', function () {
var params = $.urlParams($(this).attr('href'));
$(this).colorbox($.extend({}, settings.colorbox, params));
});
}
};
})(jQuery);
;
(function ($) {
Drupal.behaviors.initColorboxInline = {
attach: function (context, settings) {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
$.urlParam = function(name, url){
if (name == 'fragment') {
var results = new RegExp('(#[^]*)').exec(url);
}
else {
var results = new RegExp('[\\?&]' + name + '=([^]*)').exec(url);
}
if (!results) { return ''; }
return results[1] || '';
};
$('.colorbox-inline', context).once('init-colorbox-inline').colorbox({
transition:settings.colorbox.transition,
speed:settings.colorbox.speed,
opacity:settings.colorbox.opacity,
slideshow:settings.colorbox.slideshow,
slideshowAuto:settings.colorbox.slideshowAuto,
slideshowSpeed:settings.colorbox.slideshowSpeed,
slideshowStart:settings.colorbox.slideshowStart,
slideshowStop:settings.colorbox.slideshowStop,
current:settings.colorbox.current,
previous:settings.colorbox.previous,
next:settings.colorbox.next,
close:settings.colorbox.close,
overlayClose:settings.colorbox.overlayClose,
maxWidth:settings.colorbox.maxWidth,
maxHeight:settings.colorbox.maxHeight,
innerWidth:function(){
return $.urlParam('width', $(this).attr('href'));
},
innerHeight:function(){
return $.urlParam('height', $(this).attr('href'));
},
title:function(){
return decodeURIComponent($.urlParam('title', $(this).attr('href')));
},
iframe:function(){
return $.urlParam('iframe', $(this).attr('href'));
},
inline:function(){
return $.urlParam('inline', $(this).attr('href'));
},
href:function(){
return $.urlParam('fragment', $(this).attr('href'));
}
});
}
};
})(jQuery);
;
/*! SWFObject v2.2
is released under the MIT License
*/
var audioplayer_swfobject = function() {
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
ON_READY_STATE_CHANGE = "onreadystatechange",
win = window,
doc = document,
nav = navigator,
plugin = false,
domLoadFnArr = [main],
regObjArr = [],
objIdArr = [],
listenersArr = [],
storedAltContent,
storedAltContentId,
storedCallbackFn,
storedCallbackObj,
isDomLoaded = false,
isExpressInstallActive = false,
dynamicStylesheet,
dynamicStylesheetMedia,
autoHideShow = true,
/* Centralized function for browser feature detection
- User agent string detection is only used when no good alternative is possible
- Is executed directly for optimal performance
*/
ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
u = nav.userAgent.toLowerCase(),
p = nav.platform.toLowerCase(),
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
d = nav.plugins[SHOCKWAVE_FLASH].description;
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
plugin = true;
ie = false; // cascaded feature detection for Internet Explorer
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof win.ActiveXObject != UNDEF) {
try {
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
if (a) { // a will return null when ActiveX is disabled
d = a.GetVariable("$version");
if (d) {
ie = true; // cascaded feature detection for Internet Explorer
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
}
catch(e) {}
}
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
}(),
/* Cross-browser onDomLoad
- Will fire an event as soon as the DOM of a web page is loaded
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- Regular onload serves as fallback
*/
onDomLoad = function() {
if (!ua.w3) { return; }
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
callDomLoadFunctions();
}
if (!isDomLoaded) {
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
}
if (ua.ie && ua.win) {
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
if (doc.readyState == "complete") {
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
callDomLoadFunctions();
}
});
if (win == top) { // if not inside an iframe
(function(){
if (isDomLoaded) { return; }
try {
doc.documentElement.doScroll("left");
}
catch(e) {
setTimeout(arguments.callee, 0);
return;
}
callDomLoadFunctions();
})();
}
}
if (ua.wk) {
(function(){
if (isDomLoaded) { return; }
if (!/loaded|complete/.test(doc.readyState)) {
setTimeout(arguments.callee, 0);
return;
}
callDomLoadFunctions();
})();
}
addLoadEvent(callDomLoadFunctions);
}
}();
function callDomLoadFunctions() {
if (isDomLoaded) { return; }
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
t.parentNode.removeChild(t);
}
catch (e) { return; }
isDomLoaded = true;
var dl = domLoadFnArr.length;
for (var i = 0; i < dl; i++) {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Cross-browser onload
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- Will fire an event as soon as a web page including all of its assets are loaded
*/
function addLoadEvent(fn) {
if (typeof win.addEventListener != UNDEF) {
win.addEventListener("load", fn, false);
}
else if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("load", fn, false);
}
else if (typeof win.attachEvent != UNDEF) {
addListener(win, "onload", fn);
}
else if (typeof win.onload == "function") {
var fnOld = win.onload;
win.onload = function() {
fnOld();
fn();
};
}
else {
win.onload = fn;
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() {
if (plugin) {
testPlayerVersion();
}
else {
matchVersions();
}
}
/* Detect the Flash Player version for non-Internet Explorer browsers
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
a. Both release and build numbers can be detected
b. Avoid wrong descriptions by corrupt installers provided by Adobe
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
*/
function testPlayerVersion() {
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
var t = b.appendChild(o);
if (t) {
var counter = 0;
(function(){
if (typeof t.GetVariable != UNDEF) {
var d = t.GetVariable("$version");
if (d) {
d = d.split(" ")[1].split(",");
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
else if (counter < 10) {
counter++;
setTimeout(arguments.callee, 10);
return;
}
b.removeChild(o);
t = null;
matchVersions();
})();
}
else {
matchVersions();
}
}
/* Perform Flash Player and SWF version matching; static publishing only
*/
function matchVersions() {
var rl = regObjArr.length;
if (rl > 0) {
for (var i = 0; i < rl; i++) { // for each registered object element
var id = regObjArr[i].id;
var cb = regObjArr[i].callbackFn;
var cbObj = {success:false, id:id};
if (ua.pv[0] > 0) {
var obj = getElementById(id);
if (obj) {
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
setVisibility(id, true);
if (cb) {
cbObj.success = true;
cbObj.ref = getObjectById(id);
cb(cbObj);
}
}
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
var att = {};
att.data = regObjArr[i].expressInstall;
att.width = obj.getAttribute("width") || "0";
att.height = obj.getAttribute("height") || "0";
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
// parse HTML object param element's name-value pairs
var par = {};
var p = obj.getElementsByTagName("param");
var pl = p.length;
for (var j = 0; j < pl; j++) {
if (p[j].getAttribute("name").toLowerCase() != "movie") {
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
}
}
showExpressInstall(att, par, id, cb);
}
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
displayAltContent(obj);
if (cb) { cb(cbObj); }
}
}
}
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
setVisibility(id, true);
if (cb) {
var o = getObjectById(id); // test whether there is an HTML object element or not
if (o && typeof o.SetVariable != UNDEF) {
cbObj.success = true;
cbObj.ref = o;
}
cb(cbObj);
}
}
}
}
}
function getObjectById(objectIdStr) {
var r = null;
var o = getElementById(objectIdStr);
if (o && o.nodeName == "OBJECT") {
if (typeof o.SetVariable != UNDEF) {
r = o;
}
else {
var n = o.getElementsByTagName(OBJECT)[0];
if (n) {
r = n;
}
}
}
return r;
}
/* Requirements for Adobe Express Install
- only one instance can be active at a time
- fp 6.0.65 or higher
- Win/Mac OS only
- no Webkit engines older than version 312
*/
function canExpressInstall() {
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
}
/* Show the Adobe Express Install dialog
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
*/
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
isExpressInstallActive = true;
storedCallbackFn = callbackFn || null;
storedCallbackObj = {success:false, id:replaceElemIdStr};
var obj = getElementById(replaceElemIdStr);
if (obj) {
if (obj.nodeName == "OBJECT") { // static publishing
storedAltContent = abstractAltContent(obj);
storedAltContentId = null;
}
else { // dynamic publishing
storedAltContent = obj;
storedAltContentId = replaceElemIdStr;
}
att.id = EXPRESS_INSTALL_ID;
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + fv;
}
else {
par.flashvars = fv;
}
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
if (ua.ie && ua.win && obj.readyState != 4) {
var newObj = createElement("div");
replaceElemIdStr += "SWFObjectNew";
newObj.setAttribute("id", replaceElemIdStr);
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
obj.parentNode.removeChild(obj);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
createSWF(att, par, replaceElemIdStr);
}
}
/* Functions to abstract and display alternative content
*/
function displayAltContent(obj) {
if (ua.ie && ua.win && obj.readyState != 4) {
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
var el = createElement("div");
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
el.parentNode.replaceChild(abstractAltContent(obj), el);
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
obj.parentNode.removeChild(obj);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
}
function abstractAltContent(obj) {
var ac = createElement("div");
if (ua.win && ua.ie) {
ac.innerHTML = obj.innerHTML;
}
else {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var i = 0; i < cl; i++) {
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
ac.appendChild(c[i].cloneNode(true));
}
}
}
}
}
return ac;
}
/* Cross-browser dynamic SWF creation
*/
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (ua.wk && ua.wk < 312) { return r; }
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
par += '';
}
}
el.outerHTML = '';
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
}
else { // well-behaving browsers
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
for (var m in attObj) {
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
o.setAttribute("class", attObj[m]);
}
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
o.setAttribute(m, attObj[m]);
}
}
}
for (var n in parObj) {
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
createObjParam(o, n, parObj[n]);
}
}
el.parentNode.replaceChild(o, el);
r = o;
}
}
return r;
}
function createObjParam(el, pName, pValue) {
var p = createElement("param");
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
function removeSWF(id) {
var obj = getElementById(id);
if (obj && obj.nodeName == "OBJECT") {
if (ua.ie && ua.win) {
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
removeObjectInIE(id);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
else {
obj.parentNode.removeChild(obj);
}
}
}
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
/* Functions to optimize JavaScript compression
*/
function getElementById(id) {
var el = null;
try {
el = doc.getElementById(id);
}
catch (e) {}
return el;
}
function createElement(el) {
return doc.createElement(el);
}
/* Updated attachEvent function for Internet Explorer
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
*/
function addListener(target, eventType, fn) {
target.attachEvent(eventType, fn);
listenersArr[listenersArr.length] = [target, eventType, fn];
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
var pv = ua.pv, v = rv.split(".");
v[0] = parseInt(v[0], 10);
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
/* Cross-browser dynamic CSS creation
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
*/
function createCSS(sel, decl, media, newStyle) {
if (ua.ie && ua.mac) { return; }
var h = doc.getElementsByTagName("head")[0];
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
var m = (media && typeof media == "string") ? media : "screen";
if (newStyle) {
dynamicStylesheet = null;
dynamicStylesheetMedia = null;
}
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
// create dynamic stylesheet + get a global reference to it
var s = createElement("style");
s.setAttribute("type", "text/css");
s.setAttribute("media", m);
dynamicStylesheet = h.appendChild(s);
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
}
dynamicStylesheetMedia = m;
}
// add style rule
if (ua.ie && ua.win) {
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
dynamicStylesheet.addRule(sel, decl);
}
}
else {
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
}
}
}
function setVisibility(id, isVisible) {
if (!autoHideShow) { return; }
var v = isVisible ? "visible" : "hidden";
if (isDomLoaded && getElementById(id)) {
getElementById(id).style.visibility = v;
}
else {
createCSS("#" + id, "visibility:" + v);
}
}
/* Filter to avoid XSS attacks
*/
function urlEncodeIfNecessary(s) {
var regex = /[\\\"<>\.;]/;
var hasBadChars = regex.exec(s) != null;
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
}
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
*/
var cleanup = function() {
if (ua.ie && ua.win) {
window.attachEvent("onunload", function() {
// remove listeners to avoid memory leaks
var ll = listenersArr.length;
for (var i = 0; i < ll; i++) {
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
}
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
var il = objIdArr.length;
for (var j = 0; j < il; j++) {
removeSWF(objIdArr[j]);
}
// cleanup library's main closures to avoid memory leaks
for (var k in ua) {
ua[k] = null;
}
ua = null;
for (var l in audioplayer_swfobject) {
audioplayer_swfobject[l] = null;
}
audioplayer_swfobject = null;
});
}
}();
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/documentation
*/
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
if (ua.w3 && objectIdStr && swfVersionStr) {
var regObj = {};
regObj.id = objectIdStr;
regObj.swfVersion = swfVersionStr;
regObj.expressInstall = xiSwfUrlStr;
regObj.callbackFn = callbackFn;
regObjArr[regObjArr.length] = regObj;
setVisibility(objectIdStr, false);
}
else if (callbackFn) {
callbackFn({success:false, id:objectIdStr});
}
},
getObjectById: function(objectIdStr) {
if (ua.w3) {
return getObjectById(objectIdStr);
}
},
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
var callbackObj = {success:false, id:replaceElemIdStr};
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
setVisibility(replaceElemIdStr, false);
addDomLoadEvent(function() {
widthStr += ""; // auto-convert to string
heightStr += "";
var att = {};
if (attObj && typeof attObj === OBJECT) {
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
att[i] = attObj[i];
}
}
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
if (parObj && typeof parObj === OBJECT) {
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
par[j] = parObj[j];
}
}
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + k + "=" + flashvarsObj[k];
}
else {
par.flashvars = k + "=" + flashvarsObj[k];
}
}
}
if (hasPlayerVersion(swfVersionStr)) { // create SWF
var obj = createSWF(att, par, replaceElemIdStr);
if (att.id == replaceElemIdStr) {
setVisibility(replaceElemIdStr, true);
}
callbackObj.success = true;
callbackObj.ref = obj;
}
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
att.data = xiSwfUrlStr;
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
return;
}
else { // show alternative content
setVisibility(replaceElemIdStr, true);
}
if (callbackFn) { callbackFn(callbackObj); }
});
}
else if (callbackFn) { callbackFn(callbackObj); }
},
switchOffAutoHideShow: function() {
autoHideShow = false;
},
ua: ua,
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3) {
return createSWF(attObj, parObj, replaceElemIdStr);
}
else {
return undefined;
}
},
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
if (ua.w3 && canExpressInstall()) {
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
}
},
removeSWF: function(objElemIdStr) {
if (ua.w3) {
removeSWF(objElemIdStr);
}
},
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
if (ua.w3) {
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
}
},
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: addLoadEvent,
getQueryParamValue: function(param) {
var q = doc.location.search || doc.location.hash;
if (q) {
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
if (param == null) {
return urlEncodeIfNecessary(q);
}
var pairs = q.split("&");
for (var i = 0; i < pairs.length; i++) {
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
}
}
}
return "";
},
// For internal usage only
expressInstallCallback: function() {
if (isExpressInstallActive) {
var obj = getElementById(EXPRESS_INSTALL_ID);
if (obj && storedAltContent) {
obj.parentNode.replaceChild(storedAltContent, obj);
if (storedAltContentId) {
setVisibility(storedAltContentId, true);
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
}
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
}
isExpressInstallActive = false;
}
}
};
}();
var AudioPlayer = function () {
var instances = [];
var groups = {};
var activePlayers = {};
var playerURL = "";
var defaultOptions = {};
var currentVolume = -1;
var requiredFlashVersion = "9";
function getPlayer(playerID) {
if (document.all && !window[playerID]) {
for (var i = 0; i < document.forms.length; i++) {
if (document.forms[i][playerID]) {
return document.forms[i][playerID];
break;
}
}
}
return document.all ? window[playerID] : document[playerID];
}
function addListener (playerID, type, func) {
getPlayer(playerID).addListener(type, func);
}
return {
setup: function (url, options) {
playerURL = url;
defaultOptions = options;
if (audioplayer_swfobject.hasFlashPlayerVersion(requiredFlashVersion)) {
audioplayer_swfobject.switchOffAutoHideShow();
audioplayer_swfobject.createCSS("p.audioplayer_container span", "visibility:hidden;height:24px;overflow:hidden;padding:0;border:none;");
}
},
getPlayer: function (playerID) {
return getPlayer(playerID);
},
addListener: function (playerID, type, func) {
addListener(playerID, type, func);
},
embed: function (elementID, options) {
var instanceOptions = {};
var key;
var flashParams = {};
var flashVars = {};
var flashAttributes = {};
// Merge default options and instance options
for (key in defaultOptions) {
instanceOptions[key] = defaultOptions[key];
}
for (key in options) {
instanceOptions[key] = options[key];
}
if (instanceOptions.transparentpagebg == "yes") {
flashParams.bgcolor = "#FFFFFF";
flashParams.wmode = "transparent";
} else {
if (instanceOptions.pagebg) {
flashParams.bgcolor = "#" + instanceOptions.pagebg;
}
flashParams.wmode = "opaque";
}
flashParams.menu = "false";
for (key in instanceOptions) {
if (key == "pagebg" || key == "width" || key == "transparentpagebg") {
continue;
}
flashVars[key] = instanceOptions[key];
}
flashAttributes.name = elementID;
flashAttributes.style = "outline: none";
flashVars.playerID = elementID;
audioplayer_swfobject.embedSWF(playerURL, elementID, instanceOptions.width.toString(), "24", requiredFlashVersion, false, flashVars, flashParams, flashAttributes);
instances.push(elementID);
if (options.group) {
groups[elementID] = options.group;
}
},
syncVolumes: function (playerID, volume) {
if (groups[playerID]) return;
currentVolume = volume;
for (var i = 0; i < instances.length; i++) {
if (!groups[instances[i]] && instances[i] != playerID) {
getPlayer(instances[i]).setVolume(currentVolume);
}
}
},
activate: function (playerID, info) {
for (var activePlayerID in activePlayers) {
if (activePlayerID == playerID) {
continue;
}
if (groups[playerID] != groups[activePlayerID]) {
this.close(activePlayerID);
continue;
}
if (!(groups[playerID] || groups[activePlayerID])) {
this.close(activePlayerID);
}
}
activePlayers[playerID] = 1;
},
load: function (playerID, soundFile, titles, artists) {
getPlayer(playerID).load(soundFile, titles, artists);
},
close: function (playerID) {
getPlayer(playerID).close();
if (playerID in activePlayers) {
delete activePlayers[playerID];
}
},
open: function (playerID, index) {
if (index == undefined) {
index = 1;
}
getPlayer(playerID).open(index == undefined ? 0 : index-1);
},
getVolume: function (playerID) {
return currentVolume;
}
}
}();
;
/**
* @file
* Adds some show/hide to the admin form to make the UXP easier.
*/
(function($){
Drupal.behaviors.video = {
attach: function (context, settings) {
//lets see if we have any jmedia movies
if($.fn.media) {
$('.jmedia').media();
}
if(settings.video) {
$.fn.media.defaults.flvPlayer = settings.video.flvplayer;
}
//lets setup our colorbox videos
$('.video-box').each(function() {
var url = $(this).attr('href');
var data = $(this).metadata();
var width = data.width;
var height= data.height;
var player = settings.video.player; //player can be either jwplayer or flowplayer.
$(this).colorbox({
html: '',
onComplete:function() {
if(player == 'flowplayer') {
flowplayer("video-overlay", settings.video.flvplayer, {
clip: {
autoPlay: settings.video.autoplay,
autoBuffering: settings.video.autobuffer
}
});
} else {
$('#video-overlay').media({
flashvars: {
autostart: settings.video.autoplay
},
width:width,
height:height
});
}
}
});
});
}
};
// On change of the thumbnails when edit.
Drupal.behaviors.videoEdit = {
attach : function(context, settings) {
function setThumbnail(widget, type) {
var thumbnails = widget.find('.video-thumbnails input');
var defaultthumbnail = widget.find('.video-use-default-video-thumb');
var largeimage = widget.find('.video-preview img');
var activeThumbnail = thumbnails.filter(':checked');
if (activeThumbnail.length > 0 && type != 'default') {
var smallimage = activeThumbnail.next('label.option').find('img');
largeimage.attr('src', smallimage.attr('src'));
defaultthumbnail.attr('checked', false);
}
else if(defaultthumbnail.is(':checked')) {
thumbnails.attr('checked', false);
largeimage.attr('src', defaultthumbnail.data('defaultimage'));
}
else {
// try to select the first thumbnail.
if (thumbnails.length > 0) {
thumbnails.first().attr('checked', 'checked');
setThumbnail(widget, 'thumb');
}
}
}
$('.video-thumbnails input', context).change(function() {
setThumbnail($(this).parents('.video-widget'), 'thumb');
});
$('.video-use-default-video-thumb', context).change(function() {
setThumbnail($(this).parents('.video-widget'), 'default');
});
$('.video-widget', context).each(function() {
setThumbnail($(this), 'both');
});
}
}
})(jQuery);
;
Drupal.TBMegaMenu = Drupal.TBMegaMenu || {};
(function ($) {
Drupal.TBMegaMenu.oldWindowWidth = 0;
Drupal.TBMegaMenu.displayedMenuMobile = false;
Drupal.TBMegaMenu.supportedScreens = [980];
Drupal.TBMegaMenu.menuResponsive = function () {
var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
var navCollapse = $('.tb-megamenu').children('.nav-collapse');
if (windowWidth < Drupal.TBMegaMenu.supportedScreens[0]) {
navCollapse.addClass('collapse');
if (Drupal.TBMegaMenu.displayedMenuMobile) {
navCollapse.css({height: 'auto', overflow: 'visible'});
} else {
navCollapse.css({height: 0, overflow: 'hidden'});
}
} else {
// If width of window is greater than 980 (supported screen).
navCollapse.removeClass('collapse');
if (navCollapse.height() <= 0) {
navCollapse.css({height: 'auto', overflow: 'visible'});
}
}
};
Drupal.behaviors.tbMegaMenuAction = {
attach: function(context) {
$('.tb-megamenu-button', context).once('menuIstance', function () {
var This = this;
$(This).click(function() {
if(parseInt($(this).parent().children('.nav-collapse').height())) {
$(this).parent().children('.nav-collapse').css({height: 0, overflow: 'hidden'});
Drupal.TBMegaMenu.displayedMenuMobile = false;
}
else {
$(this).parent().children('.nav-collapse').css({height: 'auto', overflow: 'visible'});
Drupal.TBMegaMenu.displayedMenuMobile = true;
}
});
});
// var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion);
var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion) && !(/Windows NT(.*)Chrome/gi).test(navigator.appVersion);
if(!isTouch){
$(document).ready(function($){
var mm_duration = 0;
$('.tb-megamenu').each (function(){
if ($(this).data('duration')) {
mm_duration = $(this).data('duration');
}
});
var mm_timeout = mm_duration ? 100 + mm_duration : 500;
$('.nav > li, li.mega').hover(function(event) {
var $this = $(this);
if ($this.hasClass ('mega')) {
$this.addClass ('animating');
clearTimeout ($this.data('animatingTimeout'));
$this.data('animatingTimeout', setTimeout(function(){$this.removeClass ('animating')}, mm_timeout));
clearTimeout ($this.data('hoverTimeout'));
$this.data('hoverTimeout', setTimeout(function(){$this.addClass ('open')}, 100));
} else {
clearTimeout ($this.data('hoverTimeout'));
$this.data('hoverTimeout',
setTimeout(function(){$this.addClass ('open')}, 100));
}
},
function(event) {
var $this = $(this);
if ($this.hasClass ('mega')) {
$this.addClass ('animating');
clearTimeout ($this.data('animatingTimeout'));
$this.data('animatingTimeout',
setTimeout(function(){$this.removeClass ('animating')}, mm_timeout));
clearTimeout ($this.data('hoverTimeout'));
$this.data('hoverTimeout', setTimeout(function(){$this.removeClass ('open')}, 100));
} else {
clearTimeout ($this.data('hoverTimeout'));
$this.data('hoverTimeout',
setTimeout(function(){$this.removeClass ('open')}, 100));
}
});
});
}
$(window).resize(function() {
var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
if(windowWidth != Drupal.TBMegaMenu.oldWindowWidth){
Drupal.TBMegaMenu.oldWindowWidth = windowWidth;
Drupal.TBMegaMenu.menuResponsive();
}
});
},
}
})(jQuery);
;
Drupal.TBMegaMenu = Drupal.TBMegaMenu || {};
(function ($) {
Drupal.TBMegaMenu.createTouchMenu = function(items) {
items.children('a').each( function() {
var $item = $(this);
var tbitem = $(this).parent();
$item.click( function(event){
if ($item.hasClass('tb-megamenu-clicked')) {
var $uri = $item.attr('href');
window.location.href = $uri;
}
else {
event.preventDefault();
$item.addClass('tb-megamenu-clicked');
if(!tbitem.hasClass('open')){
tbitem.addClass('open');
}
}
}).closest('li').mouseleave( function(){
$item.removeClass('tb-megamenu-clicked');
tbitem.removeClass('open');
});
});
/*
items.children('a').children('span.caret').each( function() {
var $item = $(this).parent();
$item.click(function(event){
tbitem = $item.parent();
if ($item.hasClass('tb-megamenu-clicked')) {
Drupal.TBMegaMenu.eventStopPropagation(event);
if(tbitem.hasClass('open')){
tbitem.removeClass('open');
$item.removeClass('tb-megamenu-clicked');
}
}
else {
Drupal.TBMegaMenu.eventStopPropagation(event);
$item.addClass('tb-megamenu-clicked');
if(!tbitem.hasClass('open')){
tbitem.addClass('open');
$item.removeClass('tb-megamenu-clicked');
}
}
});
});
*/
}
Drupal.TBMegaMenu.eventStopPropagation = function(event) {
if (event.stopPropagation) {
event.stopPropagation();
}
else if (window.event) {
window.event.cancelBubble = true;
}
}
Drupal.behaviors.tbMegaMenuTouchAction = {
attach: function(context) {
// var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion);
var isTouch = 'ontouchstart' in window && !(/hp-tablet/gi).test(navigator.appVersion) && !(/Windows NT(.*)Chrome/gi).test(navigator.appVersion);
if(isTouch){
$('html').addClass('touch');
Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu'));
}
}
}
})(jQuery);
;
(function ($) {
Drupal.behaviors.captcha = {
attach: function (context) {
// Turn off autocompletion for the CAPTCHA response field.
// We do it here with JavaScript (instead of directly in the markup)
// because this autocomplete attribute is not standard and
// it would break (X)HTML compliance.
$("#edit-captcha-response").attr("autocomplete", "off");
}
};
Drupal.behaviors.captchaAdmin = {
attach: function (context) {
// Add onclick handler to checkbox for adding a CAPTCHA description
// so that the textfields for the CAPTCHA description are hidden
// when no description should be added.
// @todo: div.form-item-captcha-description depends on theming, maybe
// it's better to add our own wrapper with id (instead of a class).
$("#edit-captcha-add-captcha-description").click(function() {
if ($("#edit-captcha-add-captcha-description").is(":checked")) {
// Show the CAPTCHA description textfield(s).
$("div.form-item-captcha-description").show('slow');
}
else {
// Hide the CAPTCHA description textfield(s).
$("div.form-item-captcha-description").hide('slow');
}
});
// Hide the CAPTCHA description textfields if option is disabled on page load.
if (!$("#edit-captcha-add-captcha-description").is(":checked")) {
$("div.form-item-captcha-description").hide();
}
}
};
})(jQuery);
;
(function ($) {
/**
* Toggle the visibility of a fieldset using smooth animations.
*/
Drupal.toggleFieldset = function (fieldset) {
var $fieldset = $(fieldset);
if ($fieldset.is('.collapsed')) {
var $content = $('> .fieldset-wrapper', fieldset).hide();
$fieldset
.removeClass('collapsed')
.trigger({ type: 'collapsed', value: false })
.find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide'));
$content.slideDown({
duration: 'fast',
easing: 'linear',
complete: function () {
Drupal.collapseScrollIntoView(fieldset);
fieldset.animating = false;
},
step: function () {
// Scroll the fieldset into view.
Drupal.collapseScrollIntoView(fieldset);
}
});
}
else {
$fieldset.trigger({ type: 'collapsed', value: true });
$('> .fieldset-wrapper', fieldset).slideUp('fast', function () {
$fieldset
.addClass('collapsed')
.find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show'));
fieldset.animating = false;
});
}
};
/**
* Scroll a given fieldset into view as much as possible.
*/
Drupal.collapseScrollIntoView = function (node) {
var h = document.documentElement.clientHeight || document.body.clientHeight || 0;
var offset = document.documentElement.scrollTop || document.body.scrollTop || 0;
var posY = $(node).offset().top;
var fudge = 55;
if (posY + node.offsetHeight + fudge > h + offset) {
if (node.offsetHeight > h) {
window.scrollTo(0, posY);
}
else {
window.scrollTo(0, posY + node.offsetHeight - h + fudge);
}
}
};
Drupal.behaviors.collapse = {
attach: function (context, settings) {
$('fieldset.collapsible', context).once('collapse', function () {
var $fieldset = $(this);
// Expand fieldset if there are errors inside, or if it contains an
// element that is targeted by the URI fragment identifier.
var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : '';
if ($fieldset.find('.error' + anchor).length) {
$fieldset.removeClass('collapsed');
}
var summary = $('');
$fieldset.
bind('summaryUpdated', function () {
var text = $.trim($fieldset.drupalGetSummary());
summary.html(text ? ' (' + text + ')' : '');
})
.trigger('summaryUpdated');
// Turn the legend into a clickable link, but retain span.fieldset-legend
// for CSS positioning.
var $legend = $('> legend .fieldset-legend', this);
$('')
.append($fieldset.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide'))
.prependTo($legend)
.after(' ');
// .wrapInner() does not retain bound events.
var $link = $('')
.prepend($legend.contents())
.appendTo($legend)
.click(function () {
var fieldset = $fieldset.get(0);
// Don't animate multiple times.
if (!fieldset.animating) {
fieldset.animating = true;
Drupal.toggleFieldset(fieldset);
}
return false;
});
$legend.append(summary);
});
}
};
})(jQuery);
;
(function ($) {
Drupal.behaviors.lang_dropdown = {
attach: function (context, settings) {
var settings = settings || Drupal.settings;
if (settings.lang_dropdown) {
var flags, msddSettings;
for (key in settings.lang_dropdown) {
msddSettings = settings.lang_dropdown[key].jsWidget;
flags = msddSettings.languageicons;
if (flags) {
$.each(flags, function(index, value) {
if (msddSettings.widget == "msdropdown") {
$('select#lang-dropdown-select-' + key + ' option[value="' + index + '"]').attr('data-image', value);
}
else if (msddSettings.widget == "ddslick" && Boolean(msddSettings.showSelectedHTML)) {
$('select#lang-dropdown-select-' + key + ' option[value="' + index + '"]').attr('data-imagesrc', value);
}
});
}
if (msddSettings.widget == "msdropdown") {
try {
$('select#lang-dropdown-select-' + key).msDropDown({
visibleRows: msddSettings.visibleRows,
roundedCorner: Boolean(msddSettings.roundedCorner),
animStyle: msddSettings.animStyle,
event: msddSettings.event,
mainCSS: msddSettings.mainCSS
});
}
catch (e) {
if (console) { console.log(e); }
}
}
else if (msddSettings.widget == "chosen") {
$('select#lang-dropdown-select-' + key).chosen({
disable_search: msddSettings.disable_search,
no_results_text: msddSettings.no_results_text
});
}
else if (msddSettings.widget == "ddslick") {
$.data(document.body, 'ddslick'+key+'flag', 0);
$('select#lang-dropdown-select-' + key).ddslick({
width: msddSettings.width,
height: (msddSettings.height == 0) ? null : msddSettings.height,
showSelectedHTML: Boolean(msddSettings.showSelectedHTML),
imagePosition: msddSettings.imagePosition,
onSelected: function(data) {
var i = $.data(document.body, 'ddslick'+key+'flag');
if (i) {
$.data(document.body, 'ddslick'+key+'flag', 0);
var lang = data.selectedData.value;
var href = $('#lang-dropdown-select-'+key).parents('form').find('input[name="' + lang + '"]').val();
window.location.href = href;
}
$.data(document.body, 'ddslick'+key+'flag', 1);
}
});
}
}
}
$('select.lang-dropdown-select-element').change(function() {
var lang = this.options[this.selectedIndex].value;
var href = $(this).parents('form').find('input[name="' + lang + '"]').val();
window.location.href = href;
});
$('form.lang-dropdown-form').after('');
}
};
})(jQuery);
;
(function ($) {
Drupal.behaviors.textarea = {
attach: function (context, settings) {
$('.form-textarea-wrapper.resizable', context).once('textarea', function () {
var staticOffset = null;
var textarea = $(this).addClass('resizable-textarea').find('textarea');
var grippie = $('').mousedown(startDrag);
grippie.insertAfter(textarea);
function startDrag(e) {
staticOffset = textarea.height() - e.pageY;
textarea.css('opacity', 0.25);
$(document).mousemove(performDrag).mouseup(endDrag);
return false;
}
function performDrag(e) {
textarea.height(Math.max(32, staticOffset + e.pageY) + 'px');
return false;
}
function endDrag(e) {
$(document).unbind('mousemove', performDrag).unbind('mouseup', endDrag);
textarea.css('opacity', 1);
}
});
}
};
})(jQuery);
;
(function ($) {
/**
* A progressbar object. Initialized with the given id. Must be inserted into
* the DOM afterwards through progressBar.element.
*
* method is the function which will perform the HTTP request to get the
* progress bar state. Either "GET" or "POST".
*
* e.g. pb = new progressBar('myProgressBar');
* some_element.appendChild(pb.element);
*/
Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
var pb = this;
this.id = id;
this.method = method || 'GET';
this.updateCallback = updateCallback;
this.errorCallback = errorCallback;
// The WAI-ARIA setting aria-live="polite" will announce changes after users
// have completed their current activity and not interrupt the screen reader.
this.element = $('').attr('id', id);
this.element.html('