(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 = $('<div class="progress" aria-live="polite"></div>').attr('id', id);
  this.element.html('<div class="bar"><div class="filled"></div></div>' +
                    '<div class="percentage"></div>' +
                    '<div class="message">&nbsp;</div>');
};

/**
 * Set the percentage and status message for the progressbar.
 */
Drupal.progressBar.prototype.setProgress = function (percentage, message) {
  if (percentage >= 0 && percentage <= 100) {
    $('div.filled', this.element).css('width', percentage + '%');
    $('div.percentage', this.element).html(percentage + '%');
  }
  $('div.message', this.element).html(message);
  if (this.updateCallback) {
    this.updateCallback(percentage, message, this);
  }
};

/**
 * Start monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
  this.delay = delay;
  this.uri = uri;
  this.sendPing();
};

/**
 * Stop monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.stopMonitoring = function () {
  clearTimeout(this.timer);
  // This allows monitoring to be stopped from within the callback.
  this.uri = null;
};

/**
 * Request progress data from server.
 */
Drupal.progressBar.prototype.sendPing = function () {
  if (this.timer) {
    clearTimeout(this.timer);
  }
  if (this.uri) {
    var pb = this;
    // When doing a post request, you need non-null data. Otherwise a
    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
    $.ajax({
      type: this.method,
      url: this.uri,
      data: '',
      dataType: 'json',
      success: function (progress) {
        // Display errors.
        if (progress.status == 0) {
          pb.displayError(progress.data);
          return;
        }
        // Update display.
        pb.setProgress(progress.percentage, progress.message);
        // Schedule next timer.
        pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
      },
      error: function (xmlhttp) {
        pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
      }
    });
  }
};

/**
 * Display errors on the page.
 */
Drupal.progressBar.prototype.displayError = function (string) {
  var error = $('<div class="messages error"></div>').html(string);
  $(this.element).before(error).hide();

  if (this.errorCallback) {
    this.errorCallback(this);
  }
};

})(jQuery);
;
Drupal.locale = { 'strings': {"":{"Cancel":"Prekli\u010di","Remove":"Odstrani","Disabled":"Onemogo\u010deno","Enabled":"Omogo\u010deno","Edit":"Uredi","none":"ni\u010d","Settings":"Nastavitve","Default":"Privzeto","Add":"Dodaj","Configure":"Nastavi","Show":"Prika\u017ei","Key":"Klju\u010d","Select all rows in this table":"Ozna\u010di vse vrstice v tej tabeli","Deselect all rows in this table":"Odzna\u010di vse vrstice v tej tabeli","Not published":"Ni objavljeno","Please wait...":"Prosimo po\u010dakajte...","Hide":"Skrij","Expand":"Raz\u0161iri","Drag to re-order":"Preuredi z vle\u010denjem","Changes made in this table will not be saved until the form is submitted.":"Spremembe narejene v tej tabeli ne bodo shranjenem dokler ne shranite obrazca.","The changes to these blocks will not be saved until the \u003cem\u003eSave blocks\u003c\/em\u003e button is clicked.":"Spremembe na blokih ne bodo shranjene, dokler ne kliknete\u003cem\u003eShrani bloke\u003c\/em\u003e","Submit":"Po\u0161lji","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"Izbrane datoteke ni mogo\u010de prenesti. Dovoljene kon\u010dnice so: %extensions.","Characters left: ":"Znakov na voljo:"}} };;
// ColorBox v1.3.18 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(a,b,c){function Y(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function Z(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function $(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function _(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function ba(){var b;K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function bb(b,c){a.event.trigger(b),c&&c.call(P)}function bc(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function bd(b){if(!U){P=b,ba(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=$(K.initialWidth,"x"),K.h=$(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),bb(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}W.load(!0)}}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div";W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},W.init();if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}return c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bd(f[0]),f},W.init=function(){if(!r){if(!a("body")[0]){a(W.init);return}z=a(c),r=Y(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y(X,"Overlay",o?"position:absolute":"").hide(),s=Y(X,"Wrapper"),t=Y(X,"Content").append(A=Y(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Y(X,"LoadingOverlay").add(Y(X,"LoadingGraphic")),D=Y(X,"Title"),E=Y(X,"Current"),G=Y(X,"Next"),H=Y(X,"Previous"),F=Y(X,"Slideshow").bind(h,bc),I=Y(X,"Close")),s.append(Y(X).append(Y(X,"TopLeft"),u=Y(X,"TopCenter"),Y(X,"TopRight")),Y(X,!1,"clear:left").append(v=Y(X,"MiddleLeft"),t,w=Y(X,"MiddleRight")),Y(X,!1,"clear:left").append(Y(X,"BottomLeft"),x=Y(X,"BottomCenter"),Y(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Y(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),J=G.add(H).add(E).add(F),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})}},W.remove=function(){r.add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g)},W.position=function(a,b){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset();z.unbind("resize."+f),r.css({top:-99999,left:-99999}),K.fixed&&!o?r.css({position:"fixed"}):(c=z.scrollTop(),d=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-$(K.right,"x"),0):K.left!==!1?d+=$(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-$(K.bottom,"y"),0):K.top!==!1?c+=$(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",b&&b(),setTimeout(function(){z.bind("resize."+f,W.position)},1)},step:function(){g(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=$(a.width,"x")-O-M),a.innerWidth&&(K.w=$(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=$(a.height,"y")-N-L),a.innerHeight&&(K.h=$(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function q(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p;if(!S)return;l=function(){clearTimeout(V),C.hide(),bb(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[Z(-1),Z(1)];while(c=y[b.pop()])o=a.data(c,e).href||c.href,a.isFunction(o)&&(o=o.call(c)),_(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Y("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,q):q()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||ba(),bb(m),bb(i,K.onLoad),K.h=K.height?$(K.height,"y")-N-L:K.innerHeight&&$(K.innerHeight,"y"),K.w=K.width?$(K.width,"x")-O-M:K.innerWidth&&$(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=$(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=$(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Y(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):_(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y(X,"Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y(X,"Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Z(1),W.load())},W.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Z(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,bb(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),bb(m),A.remove(),setTimeout(function(){U=!1,bb(l,K.onClosed)},1)}))},W.element=function(){return a(P)},W.settings=d,a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),bd(this))}),W.init()})(jQuery,document,this);;
(function ($) {

Drupal.behaviors.initColorbox = {
  attach: function (context, settings) {
    if (!$.isFunction($.colorbox)) {
      return;
    }
    $('a, area, input', context)
      .filter('.colorbox')
      .once('init-colorbox-processed')
      .colorbox(settings.colorbox);
  }
};

{
  $(document).bind('cbox_complete', function () {
    Drupal.attachBehaviors('#cboxLoadedContent');
  });
}

})(jQuery);
;
(function ($) {

Drupal.behaviors.initColorboxDefaultStyle = {
  attach: function (context, settings) {
    $(document).bind('cbox_complete', function () {
      // Only run if there is a title.
      if ($('#cboxTitle:empty', context).length == false) {
        setTimeout(function () { $('#cboxTitle', context).slideUp() }, 1500);
        $('#cboxLoadedContent img', context).bind('mouseover', function () {
          $('#cboxTitle', context).slideDown();
        });
        $('#cboxOverlay', context).bind('mouseover', function () {
          $('#cboxTitle', context).slideUp();
        });
      }
      else {
        $('#cboxTitle', context).hide();
      }
    });
  }
};

})(jQuery);
;
(function ($) {

/**
 * @file
 */

/**
 * Behavior to add AJAX voting support to polls.
 */
Drupal.behaviors.delo_sexpoll = {};
Drupal.behaviors.delo_sexpoll.attach = function(context) {
  $('.sexpoll-results', context).once().click(function() {
    // Find the form and poll wrapper items that will be affected.
    var $form = $('form.ajax-poll');

    // Find all the settings for this form.
    var url = $(this).attr('href');
    var disabledText = $form.find('input[name=ajax_text]').val();
    var enabledText = $form.find('input.form-submit').val();
    var $pollWrapper = $form.parents('.ajax-poll-wrapper:first');

    // Set up the options for the AJAX voting mechanism.
    var options = {
      url: url,
      success: function(response, status) {
        // On success, replace the poll content with the new content.
        if (response.status) {
          $pollWrapper.replaceWith(response.output);
          // The action attribute will be the path of the AJAX Poll menu
          // callback. We fix this here for consistency, even though this will
          // be replaced by the AJAX Poll beforeSubmit() function above.
          $pollWrapper.find('form').attr('action', window.location.pathname);
          Drupal.attachBehaviors($pollWrapper.parent().get(0));
        }

        // Display any new messages.
        if (response.messages) {
          $('.poll .poll-inner').prepend(response.messages);
        }
      },
      complete: function(response, status) {
        if (status == 'error' || status == 'parsererror') {
          $form.prepend(Drupal.theme('ajaxPollError'));
        }
      },
      dataType: 'json',
      type: 'GET'
    };
    // Add the handlers to the Poll form through the jquery.form.js library.
    $.ajax(options);
    return false;
  });
};

})(jQuery);
;
var service_links_cite_shown = false;

function service_links_cite(){
  service_links_toggle_cite();

  return false;
}

function service_links_toggle_cite(){
  var over = jQuery('#service-links .service-links-cite-overlay');
  if (service_links_cite_shown) {
    over.fadeOut('fast');
    service_links_cite_shown = false;
  }
  else {
    over.fadeIn('fast');
    over.select();
    over.focus();
    service_links_cite_shown = true;
  }
}

function service_links_remove_cite() {
  var over = jQuery('#service-links .service-links-cite-overlay');
  if (service_links_cite_shown) {
    over.fadeOut('fast');
    service_links_cite_shown = false;
  }
}


(function ($) {
  /* Scroll from comments button to comments list */
  Drupal.behaviors.delo_sf = {};
  Drupal.behaviors.delo_sf.attach = function(context) {
    $(".scroll-to-link").once().click(function() {
      var id = $(this).attr('rel');
      if (id != ""  && $('#'+id).length) {
        $('html, body').animate({
          scrollTop: $('#'+id).offset().top
        }, 1000);
      }
      return false;
    });
  }
})(jQuery);;
(function(e){var l=/^<([-A-Za-z0-9_]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,c=/^<\/([-A-Za-z0-9_]+)[^>]*>/,h=/([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;var g=b("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");var a=b("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");var k=b("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");var d=b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var j=b("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");var i=b("script,style");var f=this.HTMLParser=function(o,w,x){var n={validate:false};if(x){e.extend(n,x)}var r,s,p,t=[],u=o;t.last=function(){return this[this.length-1]};while(o){s=true;if(!t.last()||!i[t.last()]){if(o.indexOf("<!--")==0){r=o.indexOf("-->");if(r>=0){if(w.comment){w.comment(o.substring(4,r))}o=o.substring(r+3);s=false}else{if(n.validate){throw new Error("HTMLValidationError")}}}else{if(o.indexOf("</")==0){p=o.match(c);if(p){o=o.substring(p[0].length);p[0].replace(c,q);s=false}else{if(n.validate){throw new Error("HTMLValidationError")}}}else{if(o.indexOf("<")==0){p=o.match(l);if(p){o=o.substring(p[0].length);p[0].replace(l,m);s=false}else{if(n.validate){throw new Error("HTMLValidationError")}}}}}if(s){r=o.indexOf("<");var v=r<0?o:o.substring(0,r);o=r<0?"":o.substring(r);if(w.chars){w.chars(v)}}}else{o=o.replace(new RegExp("(.*)</"+t.last()+"[^>]*>"),function(y,z){z=z.replace(/<!--(.*?)-->/g,"$1").replace(/<!\[CDATA\[(.*?)]]>/g,"$1");if(w.chars){w.chars(z)}return""});q("",t.last())}if(o==u){throw new Error("Parse Error: "+o)}u=o}q();function m(y,B,C,z){if(a[B]){while(t.last()&&k[t.last()]){q("",t.last())}}if(d[B]&&t.last()==B){q("",B)}z=g[B]||!!z;if(!z){t.push(B)}if(w.start){var A=[];C.replace(h,function(E,D){var F=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:j[D]?D:"";A.push({name:D,value:F,escaped:F.replace(/(^|[^\\])"/g,'$1\\"')})});if(w.start){w.start(B,A,z)}}}function q(y,A){if(!A){var B=0}else{for(var B=t.length-1;B>=0;B--){if(t[B]==A){break}}}if(B>=0){for(var z=t.length-1;z>=B;z--){if(!A&&n.validate==true){throw new Error("HTMLValidationError")}if(w.end){w.end(t[z])}}t.length=B}}};this.HTMLtoXML=function(n){var m="";f(n,{start:function(o,q,p){m+="<"+o;for(var r=0;r<q.length;r++){m+=" "+q[r].name+'="'+q[r].escaped+'"'}m+=(p?"/":"")+">"},end:function(o){m+="</"+o+">"},chars:function(o){m+=o},comment:function(o){m+="<!--"+o+"-->"}});return m};this.HTMLtoDOM=function(q,t){var p=b("html,head,body,title");var m={link:"head",base:"head"};if(!t){if(typeof DOMDocument!="undefined"){t=new DOMDocument()}else{if(typeof document!="undefined"&&document.implementation&&document.implementation.createDocument){t=document.implementation.createDocument("","",null)}else{if(typeof ActiveX!="undefined"){t=new ActiveXObject("Msxml.DOMDocument")}}}}else{t=t.ownerDocument||t.getOwnerDocument&&t.getOwnerDocument()||t}var n=[],s=t.documentElement||t.getDocumentElement&&t.getDocumentElement();if(!s&&t.createElement){(function(){var v=t.createElement("html");var u=t.createElement("head");u.appendChild(t.createElement("title"));v.appendChild(u);v.appendChild(t.createElement("body"));t.appendChild(v)})()}if(t.getElementsByTagName){for(var o in p){p[o]=t.getElementsByTagName(o)[0]}}var r=p.body;f(q,{start:function(x,w,v){if(p[x]){r=p[x];return}var y=t.createElement(x);for(var u in w){y.setAttribute(w[u].name,w[u].value)}if(m[x]&&typeof p[m[x]]!="boolean"){p[m[x]].appendChild(y)}else{if(r&&r.appendChild){r.appendChild(y)}}if(!v){n.push(y);r=y}},end:function(u){n.length-=1;r=n[n.length-1]},chars:function(u){r.appendChild(t.createTextNode(u))},comment:function(u){}});return t};function b(p){var o={},m=p.split(",");for(var n=0;n<m.length;n++){o[m[n]]=true}return o}})(jQuery);;
var LazyLoader={};LazyLoader.timer={};LazyLoader.scripts=[];LazyLoader.load=function(a,c,j,b){d("[LazyLoader]","Starting to load URL ::",a);jQuery.lazyLoadAdGlobalWrap++;function d(){if(typeof console!="undefined"&&(typeof b=="undefined"||b)){var k=[];for(var l=0;l<arguments.length;l++){k.push(arguments[l])}try{console.log("LazyLoadAD |",k)}catch(m){}}}var f=null;var h=null;try{if(jQuery.inArray(a,LazyLoader.scripts)==-1){LazyLoader.scripts.push(a)}else{return}var i=document.createElement("script");i.src=a;i.type="text/javascript";i.defer="defer";c.get(0).appendChild(i);d("[LazyLoader]","Loading script: ",i);if(j){i.onreadystatechange=function(){if(i.readyState=="loaded"||i.readyState=="complete"){jQuery.lazyLoadAdGlobalWrap--;j();jQuery(i).remove();return}};i.onload=function(){d("[LazyLoader]","Stopped loading URL ::",a);jQuery.lazyLoadAdGlobalWrap--;j();jQuery(i).remove();return};try{if(($.browser.webkit&&!navigator.userAgent.match(/Version\/3/))||$.browser.opera){LazyLoader.timer[a]=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(LazyLoader.timer[a]);j()}},10)}}catch(g){}}}catch(g){alert(g)}};var xrayAd={div:null,viewport:null,thresold:200,elements:[],adBlockCount:0,w:160,h:200,init:function(){this.div=jQuery("#xrayAd");if(!this.div){this.div=jQuery("<div>",{id:"xrayAd",css:{position:"fixed",top:10,left:10,width:this.w,height:this.h,zIndex:10000,background:"rgba(0,0,0, 0.5)"}});this.div.appendTo(jQuery("body"))}},viewportUpdate:function(){if(!this.viewport){this.viewport=jQuery("<div>",{id:"xrayAdViewport",css:{position:"absolute",width:this.w,height:10,zIndex:10001,background:"rgba(255,255,255, 0.3)"}});this.viewport.appendTo(this.div)}if(!this.viewThresoldTop){this.viewThresoldTop=jQuery("<div>",{id:"xrayAdThresold",css:{position:"absolute",width:this.w,height:1,zIndex:10002,background:"rgba(255,0,0, 0.5)"}});this.viewThresoldTop.appendTo(this.div);this.viewThresoldBottom=this.viewThresoldTop.clone().appendTo(this.div)}this.bodyHeight=jQuery(document).height();this.bodyWidth=jQuery(window).width();var c=(jQuery(window).height()/this.bodyHeight)*xrayAd.h,a=(jQuery(window).scrollTop()/this.bodyHeight)*xrayAd.h;this.viewport.css({height:c,top:a});this.viewThresoldTop.css({top:((jQuery(window).scrollTop()-xrayAd.thresold)/this.bodyHeight)*xrayAd.h});this.viewThresoldBottom.css({top:((jQuery(window).scrollTop()+xrayAd.thresold)/this.bodyHeight)*xrayAd.h+c-1});if(this.div&&this.div.length){var b=this.div.find(".xrayAdBlock");jQuery.each(b,function(g,i){var d=jQuery(this);var f=jQuery(xrayAd.elements[g]);if(d.length&&f.length){var e={};e.off=f.offset();if(e.off){e.top=(e.off.top/xrayAd.bodyHeight)*xrayAd.h;e.left=(e.off.left/xrayAd.bodyWidth)*xrayAd.w;e.w=(Math.max(f.width(),10)/xrayAd.bodyWidth)*xrayAd.w;e.h=(Math.max(f.height(),10)/xrayAd.bodyHeight)*xrayAd.h;var h="#FF0071";h=(f.data("loading")=="true"?"orange":h);h=(f.data("loaded")=="true"?"#00FF00":h);d.css({top:e.top,left:e.left,width:e.w,height:e.h,borderColor:h})}}})}},load:function(c,b){this.thresold=b||0;this.init();var a=jQuery("<div>",{"class":"xrayAdBlock",css:{position:"absolute",background:"#ffffff",border:"1px solid #FF0071",top:0,left:0,width:0,height:0,zIndex:10003}});jQuery.each(c,function(){a.clone().attr("xrayblock","xrayAdBlock_"+(xrayAd.adBlockCount++)).appendTo(xrayAd.div);jQuery(this).bind("onCompleteXray",function(){xrayAd.viewportUpdate()});jQuery(this).bind("onLoadXray",function(){xrayAd.viewportUpdate()});xrayAd.elements.push(this)});xrayAd.viewportUpdate();jQuery(window).bind("scroll",function(d){xrayAd.viewportUpdate()})}};function parseHTML(b){try{HTMLParser(b,{},{validate:true})}catch(a){if(a instanceof Error&&a.message=="HTMLValidationError"){return false}else{return false}}return true}(function($){$.lazyLoadAdRunning=false;$.lazyLoadAdTimers=[];$.lazyLoadAdGlobalWrap=0;$.fn.lazyLoadAd=function(options){var settings={threshold:0,failurelimit:1,forceLoad:false,event:"scroll",viewport:window,placeholder:false,onLoad:false,onComplete:false,timeout:1500,debug:false,xray:false,syncAds:false,directWrite:true,immediate:false};if(options){$.extend(settings,options)}function _debug(){if(typeof console!="undefined"&&settings.debug){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}try{console.log("LazyLoadAD |",args)}catch(e){}}}if(settings.xray&&(typeof xrayAd=="object")){xrayAd.load(this,settings.threshold)}var elements=this;$(settings.viewport).bind("checkLazyLoadAd",function(){var counter=0;elements.each(function(){if($.lazyLoadAdRunning){if($.lazyLoadAdTimers.runTimeOut){clearTimeout($.lazyLoadAdTimers.runTimeOut)}$.lazyLoadAdTimers.runTimeOut=setTimeout(function(){$(settings.viewport).trigger("checkLazyLoadAd")},300);return false}else{if(settings.forceLoad==true){if(settings.syncAds&&$.lazyLoadAdGlobalWrap>0){if($.lazyLoadAdTimers.runTimeOut){clearTimeout($.lazyLoadAdTimers.runTimeOut)}$.lazyLoadAdTimers.runTimeOut=setTimeout(function(){$(settings.viewport).trigger("checkLazyLoadAd")},300);return false}else{_debug("[checkLazyLoadAd before load]","GlobalWrap:","["+$.lazyLoadAdGlobalWrap+"]");$(this).trigger("load")}}else{if(!$.belowthefold(this,settings)&&!$.abovethetop(this,settings)){if(settings.syncAds&&$.lazyLoadAdGlobalWrap>0){if($.lazyLoadAdTimers.runTimeOut){clearTimeout($.lazyLoadAdTimers.runTimeOut)}$.lazyLoadAdTimers.runTimeOut=setTimeout(function(){$(settings.viewport).trigger("checkLazyLoadAd")},300);return false}else{_debug("[checkLazyLoadAd before load]","GlobalWrap:","["+$.lazyLoadAdGlobalWrap+"]");$(this).trigger("load")}}else{if(counter++>settings.failurelimit){return false}}}}});var temp=$.grep(elements,function(element){return !(($(element).data("loaded")=="true")?true:false)});elements=$(temp)});if("scroll"==settings.event){$(settings.viewport).bind("scroll",function(event){if(elements.length==0){return false}$(settings.viewport).trigger("checkLazyLoadAd")})}this.each(function(_index,_value){var self=$(this);if(undefined==self.attr("original")){self.attr("original",self.attr("src"))}self.isLoaded=function(){return((self.data("loaded")=="true")?true:false)};self.bind("debug",function(e,status){status=status||"start";if(settings.xray){if(status=="start"){self.trigger("onLoadXray")}else{if(status=="error"){self.trigger("onErrorXray")}else{if(status=="complete"){self.trigger("onCompleteXray")}}}}if(settings.debug){if(status=="start"){self.css({border:"3px solid orange"})}else{if(status=="error"){self.css({border:"3px solid red"})}else{if(status=="complete"){self.css({border:"3px solid green"})}}}}});self.one("onComplete",function(){_debug("[onComplete]","---> lazyLoadComplete");$(self).removeAttr("original");$.lazyLoadAdRunning=false;self.data("loaded","true");self.trigger("debug","complete");if(typeof settings.onComplete=="function"){try{settings.onComplete()}catch(e){}}});self.stack=[];self.makinaBlock=false;self.bind("makina_go",function(){if(self.makinaBlock){return false}if(self.stack.length>0){var el=self.stack.shift();var wrapAd=self.find(".wrapAd");if(!wrapAd.length){wrapAd=$('<div class="wrapAd"></div>').clone();wrapAd.appendTo(self)}var wrap=$("<div>").clone().appendTo(wrapAd);if(typeof el=="string"){wrap.replaceWith(el);$.lazyLoadAdGlobalWrap--}else{if(typeof el=="object"){if(el.is("script")){if(el.attr("src")){_debug("[Makina]","Loading JS --> ",el.attr("src"));LazyLoader.load(el.attr("src"),self,function(){self.makinaBlock=false;_debug("[Makina]","Loading JS ++> ",el.attr("src"));self.trigger("makina_go")},settings.debug)}else{wrap.replaceWith(el)}}else{wrap.replaceWith(el)}$.lazyLoadAdGlobalWrap--}}self.trigger("makina_go")}else{if($.lazyLoadAdTimers.loadJS){clearTimeout($.lazyLoadAdTimers.loadJS)}$.lazyLoadAdTimers.loadJS=setTimeout(function(){self.trigger("onComplete")},settings.timeout)}});self.bind("docWrite_direct",function(e,html){self.numWrappers--;_debug("[docWrite_direct]","Fragment Write : ",self.numWrappers,html);var el=$(html);$.lazyLoadAdGlobalWrap+=el.length;$.lazyLoadAdGlobalWrap--;_debug("[docWrite_direct]","Fragment Write : ",el,el.length);$.each(el,function(){self.stack.push($(this))});self.trigger("makina_go")});function docWrite_direct_immediate(html){self.numWrappers--;_debug("[docWrite_direct immediate]","Fragment Write : ",self.numWrappers,html);var el=$(html);$.lazyLoadAdGlobalWrap+=el.length;$.lazyLoadAdGlobalWrap--;_debug("[docWrite_direct immediate]","Fragment Write : ",el,el.length);var wrapAd=self.find(".wrapAd");if(!wrapAd.length){wrapAd=$('<div class="wrapAd"></div>').clone();wrapAd.appendTo(self)}$.each(el,function(){var wrap=$("<div>").clone().appendTo(wrapAd);wrap.replaceWith($(this));$.lazyLoadAdGlobalWrap--})}self.bind("docWrite_delayed",function(e,html){self.numWrappers--;if(self.numWrappers==0){$.lazyLoadAdGlobalWrap++}$.lazyLoadAdGlobalWrap--;_debug("[docWrite_delayed]","Fragment Write append : ",self.numWrappers,html);self.docHtmlCurrent+=html;if(self.numWrappers==0){html=self.docHtmlCurrent;self.docHtmlCurrent="";setTimeout(function(){var el=$(html);$.lazyLoadAdGlobalWrap+=el.length;$.lazyLoadAdGlobalWrap--;_debug("[docWrite_delayed]","Fragment append :",el,el.length);$.each(el,function(){self.stack.push($(this))});self.docHtmlCurrent="";self.trigger("makina_go")},0)}});function docWrite_delayed_immediate(html){self.numWrappers--;$.lazyLoadAdGlobalWrap--;self.docHtmlCurrent+=html;_debug("[docWrite_delayed immediate]","Fragment Write append : ",self.numWrappers,html);if(self.numWrappers==0&&parseHTML(self.docHtmlCurrent)){html=self.docHtmlCurrent;self.docHtmlCurrent="";var el=$(html);$.lazyLoadAdGlobalWrap+=el.length;_debug("[docWrite_delayed immediate]","Fragment append :",el);var wrapAd=self.find(".wrapAd");if(!wrapAd.length){wrapAd=$('<div class="wrapAd"></div>').clone();wrapAd.appendTo(self)}$.each(el,function(){if(typeof $(this)=="object"&&$(this).is("script")&&this.src){_debug("[docWrite_delayed immediate]","Loading URL",this.src);var script=document.createElement("script");script.src=this.src;script.type="text/javascript";script.defer="defer";self.get(0).appendChild(script);script.onload=function(){setTimeout(function(){_debug("[docWrite_delayed immediate]","Stopped loading URLLLL ::",this.src);$.lazyLoadAdGlobalWrap--;if(settings.callback){settings.callback()}return},0);return};script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){setTimeout(function(){_debug("[docWrite_delayed immediate]","Stopped loading URLL ::",this.src);$.lazyLoadAdGlobalWrap--;_debug("GW:",$.lazyLoadAdGlobalWrap);if(settings.callback){settings.callback()}return},0)}return}}else{if(typeof $(this)=="object"&&$(this).is("script")&&!this.src){_debug("[docWrite_delayed immediate]","Loading Inner Script");var script=document.createElement("script");if(this.language){script.language=this.language}if(this.type){script.type=this.type}script.defer="defer";script.text=$(this).html();document.getElementsByTagName("head")[0].appendChild(script);$.lazyLoadAdGlobalWrap--}else{var wrap=$("<div>").clone().appendTo(wrapAd);wrap.replaceWith($(this));$.lazyLoadAdGlobalWrap--}}})}}self.numWrappers=0;self.docHtmlCurrent="";self.bind("docWrite_overload",function(){_debug("[docWrite_overload]","Overloading document.write ... : ");document._writeOriginal=document.write;document.write=document.writeln=function(){var args=arguments,id=null;var html="";for(var i=0;i<args.length;i++){html+=args[i]}_debug("[docWrite_overload]","Triggered on ::",html);$.lazyLoadAdGlobalWrap++;var testHTML="",directWrite=false;try{testHTML=$(html);directWrite=((testHTML.is("div")||testHTML.is("script"))?true:false)}catch(e){}self.history[self.fragmentId]=self.history[self.fragmentId]||{};if(self.history[self.fragmentId][html]==undefined){self.history[self.fragmentId][html]=true;if(settings.directWrite&&directWrite){self.numWrappers++;if(settings.immediate==true){docWrite_direct_immediate(html)}else{self.trigger("docWrite_direct",html)}}else{self.numWrappers++;if(settings.immediate==true){docWrite_delayed_immediate(html)}else{setTimeout(function(){self.trigger("docWrite_delayed",html)},0)}}}}});self.bind("evalCode",function(){var scripts=[],script,regexp=/<code[^>]*>([\s\S]*?)<\/code>/gi;while((script=regexp.exec(self.html()))){var _s=script[1];_s=_s.replace("<!--//<![CDATA[","").replace("//]]>-->","").replace("<!--","").replace("//-->","");_s=_s.replace(/\&gt\;/g,">").replace(/\&lt\;/g,"<");scripts.push($.trim(_s))}try{scripts=(scripts.length?scripts.join("\n"):"");_debug("[evalCode]","Script to eval : ",scripts);if(scripts!=""){eval(scripts)}}catch(e){}});self.bind("loadJS",function(e,js2load){var callback=null,script=null;if(js2load.src){callback=js2load.callback||null;js2load=js2load.src}if(js2load.indexOf("?")==-1){js2load+="?_="+(new Date().getTime())}else{js2load+="&_="+(new Date().getTime())}_debug("[loadJS]","start URL :: ",js2load);LazyLoader.load(js2load,self,function(){_debug("[loadJS]","close URL :: ",js2load);if(callback){callback()}else{$.lazyLoadAdTimers.loadJS=setTimeout(function(){self.trigger("onComplete")},settings.timeout)}},settings.debug)});self.one("load",function(){if(!self.isLoaded()){$.lazyLoadAdRunning=true;self.data("loading","true");self.trigger("debug","start");var srcOriginal=$(self).attr("original");self.history={};_debug("[load]","===================  Lazy Load Ad CALL ===================");_debug("[load]","Context : ",self);self.trigger("docWrite_overload");self.trigger("evalCode");if(srcOriginal){_debug("[load]","GlobalWrap:","["+$.lazyLoadAdGlobalWrap+"]");self.trigger("loadJS",srcOriginal)}}});if("scroll"!=settings.event){self.bind(settings.event,function(event){if(!self.isLoaded()){self.trigger("load")}})}});$(settings.viewport).trigger("checkLazyLoadAd");return this};$.belowthefold=function(element,settings){if(settings.viewport===undefined||settings.viewport===window){var fold=$(window).height()+$(window).scrollTop()}else{var fold=$(settings.viewport).offset().top+$(settings.viewport).height()}return fold<=$(element).offset().top-settings.threshold};$.abovethetop=function(element,settings){if(settings.viewport===undefined||settings.viewport===window){var fold=$(window).scrollTop()}else{var fold=$(settings.viewport).offset().top}return fold>=$(element).offset().top+settings.threshold+$(element).height()}})(jQuery);;
// Run LazyLoad Ad when document loaded.
(function($) { 
  $(document).ready(function() {
    $(Drupal.settings.lazyloadad.selectors).lazyLoadAd({
      forceLoad : true,
      timeout : 0,
      syncAds : true,
      directWrite : false,
      immediate : true,
      debug : false
    });  
  });
})(jQuery); ;
(function($, Drupal, undefined){
  /**
   * When set to enable mediaelement for all audio/video files add it to the page.
   */
  Drupal.behaviors.mediaelement = {
    attach: function(context, settings) {
      if (settings.mediaelement !== undefined) {
        // @todo Remove anonymous function.
        $.each(settings.mediaelement, function(selector, options) {
          var opts;
          $(selector, context).once('mediaelement', function() {
            if (options.controls) {
              $(this).mediaelementplayer(options.opts);
            }
            else {
              $(this).mediaelement();
            }
          });
        });
      }
      // The global option is seperate from the other selectors as it should be
      // run after any other selectors.
      if (settings.mediaelementAll !== undefined) {
        $('video,audio', context).once('mediaelement', function() {
          $(this).mediaelementplayer();
        });
      }
    }
  };
})(jQuery, Drupal);;

