/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/
;(function($){
$.fn.superfish = function(op){
var sf = $.fn.superfish,
c = sf.c,
$arrow = $([' »'].join('')),
over = function(){
var $$ = $(this), menu = getMenu($$);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},
out = function(){
var $$ = $(this), menu = getMenu($$), o = sf.op;
clearTimeout(menu.sfTimer);
menu.sfTimer=setTimeout(function(){
o.retainPath=($.inArray($$[0],o.$path)>-1);
$$.hideSuperfishUl();
if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
},o.delay);
},
getMenu = function($menu){
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
sf.op = sf.o[menu.serial];
return menu;
},
addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
return this.each(function() {
var s = this.serial = sf.o.length;
var o = $.extend({},sf.defaults,op);
o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
$(this).addClass([o.hoverClass,c.bcClass].join(' '))
.filter('li:has(ul)').removeClass(o.pathClass);
});
sf.o[s] = sf.op = o;
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
if (o.autoArrows) addArrow( $('>a:first-child',this) );
})
.not('.'+c.bcClass)
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
});
o.onInit.call(this);
}).each(function() {
var menuClasses = [c.menuClass];
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
$(this).addClass(menuClasses.join(' '));
});
};
var sf = $.fn.superfish;
sf.o = [];
sf.op = {};
sf.IE7fix = function(){
var o = sf.op;
if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');
};
sf.c = {
bcClass : 'sf-breadcrumb',
menuClass : 'sf-js-enabled',
anchorClass : 'sf-with-ul',
arrowClass : 'sf-sub-indicator',
shadowClass : 'sf-shadow'
};
sf.defaults = {
hoverClass : 'sfHover',
pathClass : 'overideThisToUse',
pathLevels : 1,
delay : 800,
animation : {opacity:'show'},
speed : 'normal',
autoArrows : true,
dropShadows : true,
disableHI : false, // true disables hoverIntent detection
onInit : function(){}, // callback functions
onBeforeShow: function(){},
onShow : function(){},
onHide : function(){}
};
$.fn.extend({
hideSuperfishUl : function(){
var o = sf.op,
not = (o.retainPath===true) ? o.$path : '';
o.retainPath = false;
var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
.find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;
},
showSuperfishUl : function(){
var o = sf.op,
sh = sf.c.shadowClass+'-off',
$ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
return this;
}
});
})(jQuery);
;
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
* $Rev: 2111 $
*
* Version 2.1
*/
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);;
/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
*
*
* @param f onMouseOver function || An object with configuration options
* @param g onMouseOut function || Nothing (use configuration options object)
* @author Brian Cherne
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) 0) {
$('legend span.fieldset-legend', $(this)).eq(0).append(' ').append($('.form-required').eq(0).clone());
}
if ($('.error', $(this)).length) {
$('legend span.fieldset-legend', $(this)).eq(0).addClass('error');
Drupal.FieldGroup.setGroupWithfocus($(this));
}
});
}
}
}
/**
* Implements Drupal.FieldGroup.processHook().
*/
Drupal.FieldGroup.Effects.processAccordion = {
execute: function (context, settings, type) {
$('div.field-group-accordion-wrapper', context).once('fieldgroup-effects', function () {
var wrapper = $(this);
wrapper.accordion({
autoHeight: false,
active: '.field-group-accordion-active',
collapsible: true,
changestart: function(event, ui) {
if ($(this).hasClass('effect-none')) {
ui.options.animated = false;
}
else {
ui.options.animated = 'slide';
}
}
});
if (type == 'form') {
var $firstErrorItem = false;
// Add required fields mark to any element containing required fields
wrapper.find('div.field-group-accordion-item').each(function(i) {
if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) {
$('h3.ui-accordion-header a').eq(i).append(' ').append($('.form-required').eq(0).clone());
}
if ($('.error', $(this)).length) {
// Save first error item, for focussing it.
if (!$firstErrorItem) {
$firstErrorItem = $(this).parent().accordion("activate" , i);
}
$('h3.ui-accordion-header').eq(i).addClass('error');
}
});
// Save first error item, for focussing it.
if (!$firstErrorItem) {
$('.ui-accordion-content-active', $firstErrorItem).css({height: 'auto', width: 'auto', display: 'block'});
}
}
});
}
}
/**
* Implements Drupal.FieldGroup.processHook().
*/
Drupal.FieldGroup.Effects.processHtabs = {
execute: function (context, settings, type) {
if (type == 'form') {
// Add required fields mark to any element containing required fields
$('fieldset.horizontal-tabs-pane', context).once('fieldgroup-effects', function(i) {
if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) {
$(this).data('horizontalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' ');
}
if ($('.error', $(this)).length) {
$(this).data('horizontalTab').link.parent().addClass('error');
Drupal.FieldGroup.setGroupWithfocus($(this));
$(this).data('horizontalTab').focus();
}
});
}
}
}
/**
* Implements Drupal.FieldGroup.processHook().
*/
Drupal.FieldGroup.Effects.processTabs = {
execute: function (context, settings, type) {
if (type == 'form') {
// Add required fields mark to any fieldsets containing required fields
$('fieldset.vertical-tabs-pane', context).once('fieldgroup-effects', function(i) {
if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) {
$(this).data('verticalTab').link.find('strong:first').after($('.form-required').eq(0).clone()).after(' ');
}
if ($('.error', $(this)).length) {
$(this).data('verticalTab').link.parent().addClass('error');
Drupal.FieldGroup.setGroupWithfocus($(this));
$(this).data('verticalTab').focus();
}
});
}
}
}
/**
* Implements Drupal.FieldGroup.processHook().
*
* TODO clean this up meaning check if this is really
* necessary.
*/
Drupal.FieldGroup.Effects.processDiv = {
execute: function (context, settings, type) {
$('div.collapsible', context).once('fieldgroup-effects', function() {
var $wrapper = $(this);
// Turn the legend into a clickable link, but retain span.field-group-format-toggler
// for CSS positioning.
var $toggler = $('span.field-group-format-toggler:first', $wrapper);
var $link = $('');
$link.prepend($toggler.contents());
// Add required field markers if needed
if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) {
$link.append(' ').append($('.form-required').eq(0).clone());
}
$link.appendTo($toggler);
// .wrapInner() does not retain bound events.
$link.click(function () {
var wrapper = $wrapper.get(0);
// Don't animate multiple times.
if (!wrapper.animating) {
wrapper.animating = true;
var speed = $wrapper.hasClass('speed-fast') ? 300 : 1000;
if ($wrapper.hasClass('effect-none') && $wrapper.hasClass('speed-none')) {
$('> .field-group-format-wrapper', wrapper).toggle();
}
else if ($wrapper.hasClass('effect-blind')) {
$('> .field-group-format-wrapper', wrapper).toggle('blind', {}, speed);
}
else {
$('> .field-group-format-wrapper', wrapper).toggle(speed);
}
wrapper.animating = false;
}
$wrapper.toggleClass('collapsed');
return false;
});
});
}
};
/**
* Behaviors.
*/
Drupal.behaviors.fieldGroup = {
attach: function (context, settings) {
settings.field_group = settings.field_group || Drupal.settings.field_group;
if (settings.field_group == undefined) {
return;
}
// Execute all of them.
$.each(Drupal.FieldGroup.Effects, function (func) {
// We check for a wrapper function in Drupal.field_group as
// alternative for dynamic string function calls.
var type = func.toLowerCase().replace("process", "");
if (settings.field_group[type] != undefined && $.isFunction(this.execute)) {
this.execute(context, settings, settings.field_group[type]);
}
});
// Fixes css for fieldgroups under vertical tabs.
$('.fieldset-wrapper .fieldset > legend').css({display: 'block'});
$('.vertical-tabs fieldset.fieldset').addClass('default-fallback');
// Add a new ID to each fieldset.
$('.group-wrapper fieldset').each(function() {
// Tats bad, but we have to keep the actual id to prevent layouts to break.
var fieldgorupID = 'field_group-' + $(this).attr('id') + ' ' + $(this).attr('id');
$(this).attr('id', fieldgorupID);
})
// Set the hash in url to remember last userselection.
$('.group-wrapper ul li').each(function() {
var fieldGroupNavigationListIndex = $(this).index();
$(this).children('a').click(function() {
var fieldset = $('.group-wrapper fieldset').get(fieldGroupNavigationListIndex);
// Grab the first id, holding the wanted hashurl.
var hashUrl = $(fieldset).attr('id').replace(/^field_group-/, '').split(' ')[0];
window.location.hash = hashUrl;
});
});
}
};
})(jQuery);;
(function ($) {
Drupal.googleanalytics = {};
$(document).ready(function() {
// Attach mousedown, keyup, touchstart events to document only and catch
// clicks on all elements.
$(document.body).bind("mousedown keyup touchstart", function(event) {
// Catch the closest surrounding link of a clicked element.
$(event.target).closest("a,area").each(function() {
// Is the clicked URL internal?
if (Drupal.googleanalytics.isInternal(this.href)) {
// Skip 'click' tracking, if custom tracking events are bound.
if ($(this).is('.colorbox')) {
// Do nothing here. The custom event will handle all tracking.
//console.info("Click on .colorbox item has been detected.");
}
// Is download tracking activated and the file extension configured for download tracking?
else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) {
// Download link clicked.
ga("send", "event", "Downloads", Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(), Drupal.googleanalytics.getPageUrl(this.href));
}
else if (Drupal.googleanalytics.isInternalSpecial(this.href)) {
// Keep the internal URL for Google Analytics website overlay intact.
ga("send", "pageview", { page: Drupal.googleanalytics.getPageUrl(this.href) });
}
}
else {
if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
// Mailto link clicked.
ga("send", "event", "Mails", "Click", this.href.substring(7));
}
else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) {
if (Drupal.settings.googleanalytics.trackDomainMode != 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains)) {
// External link clicked / No top-level cross domain clicked.
ga("send", "event", "Outbound links", "Click", this.href);
}
}
}
});
});
// Track hash changes as unique pageviews, if this option has been enabled.
if (Drupal.settings.googleanalytics.trackUrlFragments) {
window.onhashchange = function() {
ga('send', 'pageview', location.pathname + location.search + location.hash);
}
}
// Colorbox: This event triggers when the transition has completed and the
// newly loaded content has been revealed.
$(document).bind("cbox_complete", function () {
var href = $.colorbox.element().attr("href");
if (href) {
ga("send", "pageview", { page: Drupal.googleanalytics.getPageUrl(href) });
}
});
});
/**
* Check whether the hostname is part of the cross domains or not.
*
* @param string hostname
* The hostname of the clicked URL.
* @param array crossDomains
* All cross domain hostnames as JS array.
*
* @return boolean
*/
Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) {
/**
* jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is
* `null` or `undefined`, http://bugs.jquery.com/ticket/10076,
* https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174
*
* @todo: Remove/Refactor in D8
*/
if (!crossDomains) {
return false;
}
else {
return $.inArray(hostname, crossDomains) > -1 ? true : false;
}
}
/**
* Check whether this is a download URL or not.
*
* @param string url
* The web url to check.
*
* @return boolean
*/
Drupal.googleanalytics.isDownload = function (url) {
var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
return isDownload.test(url);
}
/**
* Check whether this is an absolute internal URL or not.
*
* @param string url
* The web url to check.
*
* @return boolean
*/
Drupal.googleanalytics.isInternal = function (url) {
var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
return isInternal.test(url);
}
/**
* Check whether this is a special URL or not.
*
* URL types:
* - gotwo.module /go/* links.
*
* @param string url
* The web url to check.
*
* @return boolean
*/
Drupal.googleanalytics.isInternalSpecial = function (url) {
var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
return isInternalSpecial.test(url);
}
/**
* Extract the relative internal URL from an absolute internal URL.
*
* Examples:
* - http://mydomain.com/node/1 -> /node/1
* - http://example.com/foo/bar -> http://example.com/foo/bar
*
* @param string url
* The web url to check.
*
* @return string
* Internal website URL
*/
Drupal.googleanalytics.getPageUrl = function (url) {
var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i");
return url.replace(extractInternalUrl, '');
}
/**
* Extract the download file extension from the URL.
*
* @param string url
* The web url to check.
*
* @return string
* The file extension of the passed url. e.g. "zip", "txt"
*/
Drupal.googleanalytics.getDownloadExtension = function (url) {
var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
var extension = extractDownloadextension.exec(url);
return (extension === null) ? '' : extension[1];
}
})(jQuery);
;