;
/* AGGREGATED JS FILE: http://cast.thirdage.com/misc/drupal.js */
// $Id: drupal.js,v 1.29.2.2 2008/08/13 18:12:23 drumm Exp $

var Drupal = Drupal || {};

/**
 * Set the variable that indicates if JavaScript behaviors should be applied
 */
Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;

/**
 * Extends the current object with the parameter. Works recursively.
 */
Drupal.extend = function(obj) {
  for (var i in obj) {
    if (this[i]) {
      Drupal.extend.apply(this[i], [obj[i]]);
    }
    else {
      this[i] = obj[i];
    }
  }
};

/**
 * Redirects a button's form submission to a hidden iframe and displays the result
 * in a given wrapper. The iframe should contain a call to
 * window.parent.iframeHandler() after submission.
 */
Drupal.redirectFormButton = function (uri, button, handler) {
  // Trap the button
  button.onmouseover = button.onfocus = function() {
    button.onclick = function() {
      // Create target iframe
      Drupal.createIframe();

      // Prepare variables for use in anonymous function.
      var button = this;
      var action = button.form.action;
      var target = button.form.target;

      // Redirect form submission to iframe
      this.form.action = uri;
      this.form.target = 'redirect-target';

      handler.onsubmit();

      // Set iframe handler for later
      window.iframeHandler = function () {
        var iframe = $('#redirect-target').get(0);
        // Restore form submission
        button.form.action = action;
        button.form.target = target;

        // Get response from iframe body
        try {
          response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;
          // Firefox 1.0.x hack: Remove (corrupted) control characters
          response = response.replace(/[\f\n\r\t]/g, ' ');
          if (window.opera) {
            // Opera-hack: it returns innerHTML sanitized.
            response = response.replace(/&quot;/g, '"');
          }
        }
        catch (e) {
          response = null;
        }

        response = Drupal.parseJson(response);
        // Check response code
        if (response.status == 0) {
          handler.onerror(response.data);
          return;
        }
        handler.oncomplete(response.data);

        return true;
      }

      return true;
    }
  }
  button.onmouseout = button.onblur = function() {
    button.onclick = null;
  }
};

/**
 * Retrieves the absolute position of an element on the screen
 */
Drupal.absolutePosition = function (el) {
  var sLeft = 0, sTop = 0;
  var isDiv = /^div$/i.test(el.tagName);
  if (isDiv && el.scrollLeft) {
    sLeft = el.scrollLeft;
  }
  if (isDiv && el.scrollTop) {
    sTop = el.scrollTop;
  }
  var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop };
  if (el.offsetParent) {
    var tmp = Drupal.absolutePosition(el.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
  }
  return r;
};

/**
 * Return the dimensions of an element on the screen
 */
Drupal.dimensions = function (el) {
  return { width: el.offsetWidth, height: el.offsetHeight };
};

/**
 *  Returns the position of the mouse cursor based on the event object passed
 */
Drupal.mousePosition = function(e) {
  return { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop };
};

/**
 * Parse a JSON response.
 *
 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
 */
Drupal.parseJson = function (data) {
  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
    return { status: 0, data: data.length ? data : 'Unspecified error' };
  }
  return eval('(' + data + ');');
};

/**
 * Create an invisible iframe for form submissions.
 */
Drupal.createIframe = function () {
  if ($('#redirect-holder').size()) {
    return;
  }
  // Note: some browsers require the literal name/id attributes on the tag,
  // some want them set through JS. We do both.
  window.iframeHandler = function () {};
  var div = document.createElement('div');
  div.id = 'redirect-holder';
  $(div).html('<iframe name="redirect-target" id="redirect-target" class="redirect" onload="window.iframeHandler();"></iframe>');
  var iframe = div.firstChild;
  $(iframe)
    .attr({
      name: 'redirect-target',
      id: 'redirect-target'
    })
    .css({
      position: 'absolute',
      height: '1px',
      width: '1px',
      visibility: 'hidden'
    });
  $('body').append(div);
};

/**
 * Delete the invisible iframe
 */
Drupal.deleteIframe = function () {
  $('#redirect-holder').remove();
};

/**
 * Freeze the current body height (as minimum height). Used to prevent
 * unnecessary upwards scrolling when doing DOM manipulations.
 */
Drupal.freezeHeight = function () {
  Drupal.unfreezeHeight();
  var div = document.createElement('div');
  $(div).css({
    position: 'absolute',
    top: '0px',
    left: '0px',
    width: '1px',
    height: $('body').css('height')
  }).attr('id', 'freeze-height');
  $('body').append(div);
};

/**
 * Unfreeze the body height
 */
Drupal.unfreezeHeight = function () {
  $('#freeze-height').remove();
};

/**
 * Wrapper to address the mod_rewrite url encoding bug
 * (equivalent of drupal_urlencode() in PHP).
 */
Drupal.encodeURIComponent = function (item, uri) {
  uri = uri || location.href;
  item = encodeURIComponent(item).replace(/%2F/g, '/');
  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
};

// Global Killswitch on the <html> element
if (Drupal.jsEnabled) {
  $(document.documentElement).addClass('js');
}

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/jquery_update/compat.js */
// $Id: compat.js,v 1.1.2.1 2008/05/02 21:05:06 stevemckenzie Exp $
// UPGRADE: The following attribute helpers should now be used as:
// .attr("title") or .attr("title","new title")
jQuery.each(["id","title","name","href","src","rel"], function(i,n){
  jQuery.fn[ n ] = function(h) {
    return h == undefined ?
      this.length ? this[0][n] : null :
      this.attr( n, h );
  };
});

// UPGRADE: The following css helpers should now be used as:
// .css("top") or .css("top","30px")
jQuery.each("top,left,position,float,overflow,color,background".split(","), function(i,n){
  jQuery.fn[ n ] = function(h) {
    return h == undefined ?
      ( this.length ? jQuery.css( this[0], n ) : null ) :
      this.css( n, h );
  };
});

// UPGRADE: The following event helpers should now be used as such:
// .oneblur(fn) -> .one("blur",fn)
// .unblur(fn) -> .unbind("blur",fn)
var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," +
  "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," + 
  "submit,keydown,keypress,keyup,error").split(",");

// Go through all the event names, but make sure that
// it is enclosed properly
for ( var i = 0; i < e.length; i++ ) new function(){
      
  var o = e[i];
    
  // Handle event unbinding
  jQuery.fn["un"+o] = function(f){ return this.unbind(o, f); };
    
  // Finally, handle events that only fire once
  jQuery.fn["one"+o] = function(f){
    // save cloned reference to this
    var element = jQuery(this);
    var handler = function() {
      // unbind itself when executed
      element.unbind(o, handler);
      element = null;
      // apply original handler with the same arguments
      return f.apply(this, arguments);
    };
    return this.bind(o, handler);
  };
      
};

// UPGRADE: .ancestors() was removed in favor of .parents()
jQuery.fn.ancestors = jQuery.fn.parents;

// UPGRADE: The CSS selector :nth-child() now starts at 1, instead of 0
jQuery.expr[":"]["nth-child"] = "jQuery.nth(a.parentNode.firstChild,parseInt(m[3])+1,'nextSibling')==a";

// UPGRADE: .filter(["div", "span"]) now becomes .filter("div, span")
jQuery.fn._filter = jQuery.fn.filter;
jQuery.fn.filter = function(arr){
  return this._filter( arr.constructor == Array ? arr.join(",") : arr );
};

/*
 * Compatibility Plugin for jQuery 1.1 (on top of jQuery 1.2)
 * By John Resig
 * Dual licensed under MIT and GPL.
 *
 * For XPath compatibility with 1.1, you should also include the XPath
 * compatability plugin.
 */
(function(jQuery){

	// You should now use .slice() instead of eq/lt/gt
	// And you should use .filter(":contains(text)") instead of .contains()
	jQuery.each( [ "eq", "lt", "gt", "contains" ], function(i,n){
		jQuery.fn[ n ] = function(num,fn) {
			return this.filter( ":" + n + "(" + num + ")", fn );
		};
	});

	// This is no longer necessary in 1.2
	jQuery.fn.evalScripts = function(){};

	// You should now be using $.ajax() instead
	jQuery.fn.loadIfModified = function() {
		var old = jQuery.ajaxSettings.ifModified;
		jQuery.ajaxSettings.ifModified = true;
	
		var ret = jQuery.fn.load.apply( this, arguments );
	
		jQuery.ajaxSettings.ifModified = old;

		return ret;
	};

	// You should now be using $.ajax() instead
	jQuery.getIfModified = function() {
		var old = jQuery.ajaxSettings.ifModified;
		jQuery.ajaxSettings.ifModified = true;
	
		var ret = jQuery.get.apply( jQuery, arguments );
	
		jQuery.ajaxSettings.ifModified = old;

		return ret;
	};

	jQuery.ajaxTimeout = function( timeout ) {
		jQuery.ajaxSettings.timeout = timeout;
	};

})(jQuery);

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/jstools/jstools.js */
// $Id: jstools.js,v 1.9.2.8 2007/08/08 21:26:07 nedjo Exp $

Drupal.behaviors = Drupal.behaviors || {};

/**
 * Attach registered behaviors.
 */
Drupal.attachBehaviors = function(context) {
  context = context || document;
  if (Drupal.jsEnabled && Drupal.behaviors) {
    // Execute all of them.
    jQuery.each(Drupal.behaviors, function() {
      this(context);
    });
  }
};

Drupal.preventSelect = function (elt) {
  // IE hack to prevent selection of the text when users click.
  if (document.onselectstart) {
    elt.onselectstart = function () {
      return false;
    }
  }
  else {
    $(elt).mousedown(function () {
      return false;
    });
  }
};

/**
 * Returns an event's source element.
 */
Drupal.getTarget = function (e) {	
  if (!e) e = window.event;	
  var target = e.target ? e.target : e.srcElement;
  if (!target) return null;
  if (target.nodeType == 3) target = target.parentNode; // safari weirdness		
  if (target.tagName.toUpperCase() == 'LABEL' && e.type == 'click') { 
    // When clicking a label, firefox fires the input onclick event
    // but the label remains the source of the event. In Opera and IE 
    // the source of the event is the input element.
    if (target.getAttribute('for')) {
      target = document.getElementById(target.getAttribute('for'));
    }
  }
  return target;
};

Drupal.url = function (path, query, fragment) {
  query = query ? query : '';
  fragment = fragment ? '#' + fragment : '';
  var base = Drupal.settings.jstools.basePath;
  if (!Drupal.settings.jstools.cleanurls) {
    if (query) {
      return base + '?q=' + path + '&' + query + fragment;
    }
    else {
      return base + '?q=' + path + fragment;
    }
  }
  else {
    if (query) {
      return base + path + '?' + query + fragment;
    }
    else {
      return base + path + fragment;
    }
  }
};

/**
 * Return the Drupal path portion of an href.
 */
Drupal.getPath = function (href) {
  href = Drupal.pathPortion(href);
  // 3 is the length of the '?q=' added to the url without clean urls.
  href = href.substring(Drupal.settings.jstools.basePath.length + (Drupal.settings.jstools.cleanurls ? 0 : 3), href.length);
  var chars = ['#', '?', '&'];
  for (i in chars) {
    if (href.indexOf(chars[i]) > -1) {
      href = href.substr(0, href.indexOf(chars[i]));
    }
  }
  return href;
};

/**
 * Add a segment to the beginning of a path.
 */
Drupal.prependPath = function (href, segment) {
  href = Drupal.pathPortion(href);
  // 3 is the length of the '?q=' added to the url without clean urls.
  var baseLength = Drupal.settings.jstools.basePath.length + (Drupal.settings.jstools.cleanurls ? 0 : 3);
  var base = href.substring(0, baseLength);
  return base + segment + '/' + href.substring(baseLength, href.length);
};

/**
 * Strip off the protocol plus domain from an href.
 */
Drupal.pathPortion = function (href) {
  // Remove e.g. http://example.com if present.
  var protocol = window.location.protocol;
  if (href.substring(0, protocol.length) == protocol) {
    // 2 is the length of the '//' that normally follows the protocol
    href = href.substring(href.indexOf('/', protocol.length + 2));
  }
  return href;
};

/**
 * Redirects a form submission to a hidden iframe and displays the result
 * in a given wrapper. The iframe should contain a call to
 * window.parent.iframeHandler() after submission.
 */
Drupal.redirectFormSubmit = function (uri, form, handler) {
  $(form).submit(function() {
    // Create target iframe
    Drupal.createIframe();

    // Prepare variables for use in anonymous function.
    var form = this;

    // Redirect form submission to iframe
    this.action = uri;
    this.target = 'redirect-target';

    handler.onsubmit();

    // Set iframe handler for later
    window.iframeHandler = function () {
      var iframe = $('#redirect-target').get(0);

      // Get response from iframe body
      try {
        response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;
        // Firefox 1.0.x hack: Remove (corrupted) control characters
        response = response.replace(/[\f\n\r\t]/g, ' ');
        if (window.opera) {
          // Opera-hack: it returns innerHTML sanitized.
          response = response.replace(/&quot;/g, '"');
        }
      }
      catch (e) {
        response = null;
      }

      response = Drupal.parseJson(response);
      // Check response code
      if (response.status == 0) {
        handler.onerror(response.data);
        return;
      }
      handler.oncomplete(response.data);

      return true;
    };

    return true;
  });
};

/**
 * Scroll to a given element's vertical page position.
 */
Drupal.scrollTo = function(el) {
  var pos = Drupal.absolutePosition(el);
  window.scrollTo(0, pos.y);
};

Drupal.elementChildren = function (element) {
  var children = [];
  for (i in element) {
    if (i.substr(0, 1) != '#') {
      children[children.length] = i;
    }
  }
  return children;
};

Drupal.elementProperties = function (element) {
  var properties = [];
  for (i in element) {
    if (i.substr(0, 1) == '#') {
      properties[properties.length] = i;
    }
  }
  return properties;
};

Drupal.parseQueryString = function (href) {
  query = Drupal.getQueryString(href);
  var args = {};
  var pairs = query.split("&");
  for(var i = 0; i < pairs.length; i++) {
    var pos = pairs[i].indexOf('=');
    if (pos == -1) continue;
    var argname = pairs[i].substring(0, pos);
    var value = pairs[i].substring(pos + 1);
    args[argname] = unescape(value.replace(/\+/g, " "));
  }
  return args;
};

Drupal.getQueryString = function (href) {
  if (href) {
    var index = href.indexOf('?');
    href = (index == -1) ? '' : href.substring(index + 1);
  }
  query = href ? href : location.search.substring(1);
  if (!Drupal.settings.jstools.cleanurls) {
    var index = query.indexOf('&');
    query = (index == -1) ? '' : query.substring(index + 1);
  }
  return query;
};

Drupal.pathMatch = function (path, paths, type) {
  // Convert paths into a regular expression.
  paths = '^' + paths + '$';
  paths = paths.replace(/\n/g, '$|^');
  paths = paths.replace(/\*/g, '.*');
  var search = path.search(new RegExp(paths)) > -1 ? true : false;
  return (type == 0) ? search : !search;
};

if (Drupal.jsEnabled) {
  // 'js enabled' cookie
  document.cookie = 'has_js=1';
  // Attach all behaviors.
  $(document).ready(function(){
    Drupal.attachBehaviors(this);
  });
}
;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/jstools/tabs/jquery.tabs.pack.js */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.28.8=5(9,2){3(C 9==\'2v\')2=9;2=$.2N({9:(9&&C 9==\'2O\'&&9>0)?--9:0,x:g,j:$.G?1T:R,v:R,1H:g,1L:g,1A:g,1f:g,1G:\'2y\',2e:g,2f:g,2h:R,I:g,O:g,Q:g,P:\'8-2z\',T:\'8-x\',16:\'8-1J\',1k:\'8-2A\',Y:\'H\'},2||{});$.d.1e=$.d.1e||$.d.F&&C 2B==\'5\';5 1q(){27(0,0)}p 6.J(5(){4 f=6;4 8=$(\'>1n:o(0)>1v>a\',6);3(2.v){4 1h={};8.J(5(i){4 n=\'8-v-\'+(i+1);4 7=\'#\'+n;1h[7]=6.1W;6.1W=7;$(f).2C(\'<H n="\'+n+\'" 2W="2E"></H>\')})}3(U.7){8.J(5(i){3(6.7==U.7){2.9=i;3(($.d.F||$.d.2F)&&!2.v){4 c=$(U.7);4 13=c.L(\'n\');c.L(\'n\',\'\');w(5(){c.L(\'n\',13)},2G)}1q();p R}})}3($.d.F){1q()}$(\'>\'+2.Y,6).1E(\':o(\'+2.9+\')\').1I().11().2H(\':o(\'+2.9+\')\').z(2.16);3(!2.v){$(\'>1n:o(0)>1v:o(\'+2.9+\')\',6).z(2.P)}3(2.2h){4 15=$(\'>\'+2.Y,f);4 1D=5(1Y){4 1w=$.2I(15.14(),5(N){4 h,r=$(N);3(1Y){3($.d.1e){N.A.2K(\'20\');N.A.m=\'\';N.18=g}h=r.s({\'V-m\':\'\'}).m()}l{h=r.m()}p h}).2L(5(a,b){p b-a});3($.d.1e){15.J(5(){6.18=1w[0]+\'23\';6.A.2M(\'20\',\'6.A.m = 6.18 ? 6.18 : "2P"\')})}l{15.s({\'V-m\':1w[0]+\'23\'})}};1D();4 17=f.29;4 1g=f.12;4 1C=$(\'#8-24-25-1o\').14(0)||$(\'<1V n="8-24-25-1o">M</1V>\').s({1t:\'2Q\',2R:\'2S\',2T:\'1N\'}).2U(t.1u).14(0);4 1c=1C.12;2V(5(){4 1b=f.29;4 1F=f.12;4 1d=1C.12;3(1F>1g||1b!=17||1d!=1c){1D((1b>17||1d<1c));17=1b;1g=1F;1c=1d}},1x)}4 y={},B={},1r=2.2e||2.1G,1B=2.2f||2.1G;3(2.1L||2.1H){3(2.1L){y[\'m\']=\'1I\';B[\'m\']=\'1J\'}3(2.1H){y[\'D\']=\'1I\';B[\'D\']=\'1J\'}}l{3(2.1A){y=2.1A}l{y[\'V-1M\']=0;1r=2.j?1x:1}3(2.1f){B=2.1f}l{B[\'V-1M\']=0;1B=2.j?1x:1}}4 I=2.I,O=2.O,Q=2.Q;8.X(\'1U\',5(){4 7=6.7;3($(7).S(\':1N\')&&!$(6.K).S(\'.\'+2.T)){3($.d.F){$(6).E();3(2.j){$.G.1z(7);U.7=7.1p(\'#\',\'\')}}l 3($.d.1S){4 1Q=$(\'<1P 2j="\'+7+\'"><H><2k 2l="1R" 2m="h" /></H></1P>\').14(0);1Q.1R();$(6).E();3(2.j){$.G.1z(7)}}l{3(2.j){U.7=7.1p(\'#\',\'\')}l{$(6).E()}}}});8.X(\'1l\',5(){$(6.K).z(2.T)});3(2.x&&2.x.1y){21(4 i=0,k=2.x.1y;i<k;i++){8.o(--2.x[i]).19(\'1l\').11()}};8.X(\'1X\',5(){4 r=$(6.K);r.10(2.T);3($.d.1S){r.2o(1,1.0).s({1t:\'\',D:1});w(5(){r.s({D:\'\'})},2p)}});8.X(\'E\',5(e){4 1O=e.2s;4 1m=$(6.K);3(f.1K||1m.S(\'.\'+2.P)||1m.S(\'.\'+2.T)){6.2d();p R}f[\'1K\']=1T;4 c=$(6.7);3(c.1o()>0){3($.d.F&&2.j){4 13=6.7.1p(\'#\',\'\');c.L(\'n\',\'\');w(5(){c.L(\'n\',13)},0)}4 q=6;4 u=$(\'>\'+2.Y+\':2x\',f);3(C I==\'5\'){w(5(){I(q,c[0],u[0])},0)}5 1i(){3(2.j&&1O){$.G.1z(q.7)}u.22(B,1B,5(){$(q.K).z(2.P).2J().10(2.P);3(C O==\'5\'){O(q,c[0],u[0])}u.z(2.16).s({1t:\'\',26:\'\',m:\'\',D:\'\'});c.10(2.16).22(y,1r,5(){c.s({26:\'\',m:\'\',D:\'\'});3($.d.F){u[0].A.1E=\'\';c[0].A.1E=\'\'}3(C Q==\'5\'){Q(q,c[0],u[0])}f.1K=g})})}3(!2.v){1i()}l{4 1j=$(6);1j.z(2.1k);w(5(){$(q.7).2i(1h[q.7],5(){1i();1j.10(2.1k)})},0)}}l{2q(\'2r S 2t 2u f.\')}4 2a=1s.2w||t.1a&&t.1a.2b||t.1u.2b||0;4 2c=1s.2D||t.1a&&t.1a.1Z||t.1u.1Z||0;w(5(){1s.27(2a,2c)},0);6.2d();p 2.j});3(2.v){8.o(2.9).19(\'E\').11()}3(2.j){$.G.2n(5(){8.o(2.9).19(\'E\').11()})}})};4 Z=[\'1U\',\'1l\',\'1X\'];21(4 i=0;i<Z.1y;i++){$.28[Z[i]]=(5(2g){p 5(W){p 6.J(5(){4 i=W&&W>0&&W-1||0;$(\'>1n:o(0)>1v>a\',6).o(i).19(2g)})}})(Z[i])}})(2X);',62,184,'||settings|if|var|function|this|hash|tabs|initial|||toShow|browser||container|null|||bookmarkable||else|height|id|eq|return|clicked|jq|css|document|toHide|remote|setTimeout|disabled|showAnim|addClass|style|hideAnim|typeof|opacity|click|msie|ajaxHistory|div|onClick|each|parentNode|attr||el|onHide|selectedClass|onShow|false|is|disabledClass|location|min|tabIndex|bind|tabStruct|tabEvents|removeClass|end|offsetHeight|toShowId|get|tabsContents|hideClass|cachedWidth|minHeight|trigger|documentElement|currentWidth|cachedFontSize|currentFontSize|msie6|fxHide|cachedHeight|remoteUrls|switchTab|jqThis|loadingClass|disableTab|jqLi|ul|size|replace|unFocus|showSpeed|window|display|body|li|heights|50|length|update|fxShow|hideSpeed|watchFontSize|_setAutoHeight|filter|currentHeight|fxSpeed|fxFade|show|hide|locked|fxSlide|width|hidden|trueClick|form|tempForm|submit|safari|true|triggerTab|span|href|enableTab|reset|scrollTop|behaviour|for|animate|px|watch|font|overflow|scrollTo|fn|offsetWidth|scrollX|scrollLeft|scrollY|blur|fxShowSpeed|fxHideSpeed|tabEvent|fxAutoHeight|load|action|input|type|value|initialize|fadeTo|30|alert|There|clientX|no|such|object|pageXOffset|visible|normal|selected|loading|XMLHttpRequest|append|pageYOffset|fragment|opera|500|not|map|siblings|removeExpression|sort|setExpression|extend|number|1px|block|position|absolute|visibility|appendTo|setInterval|class|jQuery'.split('|'),0,{}))

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/jstools/tabs/tabs.js */
// $Id: tabs.js,v 1.2.2.9 2008/03/29 13:37:28 nedjo Exp $

$(document).ready(function(){

var tabArgs = { fxFade: Drupal.settings.tabs.fade,
      fxSlide: Drupal.settings.tabs.slide,
      fxSpeed: Drupal.settings.tabs.speed,
      fxAutoHeight: Drupal.settings.tabs.auto_height,
      onShow: Drupal.tabsAddClassesCallback(),
      bookmarkable: false }

  // Process custom tabs.
  $('.drupal-tabs:not(.tabs-processed)')
    .addClass('tabs-processed')
    .addClass('tabs')
    .each(function () {
      if ($(this).is('.tabs-navigation')) {
        Drupal.tabsNavigation(this);
      }
    })
    .tabs(tabArgs)
    .show()
    .find('> ul.anchors')
    .after('<span class="clear"></span>')
    .addClass('tabs')
    .each(function () {
      // Assign secondary class to nested tabsets.
      var newClass = $(this).parents('.drupal-tabs').size() > 1 ? 'secondary' : 'primary';
      $(this).addClass(newClass);
    });
  Drupal.tabsAddClasses();
});

Drupal.tabsAddClassesCallback = function() {
  return function() {
    Drupal.tabsAddClasses();
  }
};

Drupal.tabsAddClasses = function() {
  $('ul.anchors.tabs')
    .find('.active')
    .removeClass('active')
    .end()
    .find('.tabs-selected')
    .addClass('active');
};

Drupal.tabsNavigation = function(elt) {
  // Extract tabset name
  var tabsetName = $(elt).get(0).id.substring(5);
  var count = $(elt).find('> ul.anchors > li').size();
  for (i = 1; i <= count; i++) {
    var tabContent = $('#tabs-' + tabsetName + '-' + i);
    if ((i > 1) || (i < count)) {
      tabContent.append('<span class="clear"></span><div class="tabs-nav-link-sep"></div>');
    }
    if (i > 1) {
      var link = $(document.createElement('a'))
        .append(Drupal.settings.tabs.previous_text)
        .attr('id', 'tabs-' + tabsetName + '-previous-link-' + i)
        .addClass('tabs-nav-previous')
        .click(function() {
          var tabIndex = parseInt($(this).attr('id').substring($(this).attr('id').lastIndexOf('-') + 1));
          $(elt).triggerTab(tabIndex - 1);
          Drupal.scrollTo(elt);
          return false;
        });
      tabContent.append(link);
    }
    if (i < count) {
      var link = $(document.createElement('a'))
        .append(Drupal.settings.tabs.next_text)
        .attr('id', 'tabs-' + tabsetName + '-next-button-' + i)
        .addClass('tabs-nav-next')
        .click(function() {
          var tabIndex = parseInt($(this).attr('id').substring($(this).attr('id').lastIndexOf('-') + 1));
          $(elt).triggerTab(tabIndex + 1);
          Drupal.scrollTo(elt);
          return false;
        });
      tabContent.append(link);
    }
    tabContent.append('<span class="clear"></span>')
  }
}

Drupal.tabsLocalTasks = function(elt) {
  var elt = elt ? elt : document;
  // Process standard Drupal local task tabs.
  // Only proceed if we have dynamicload available.
  if (Drupal.settings && Drupal.settings.tabs && Drupal.dynamicload && typeof(Drupal.dynamicload == 'function')) {

    $(elt).find('ul.tabs.primary')
      .each(function() {
        var index = 1;
        var activeIndex;
        $(this).addClass('anchors')
        .addClass('tabs-processed')
        .find('li > a')
        .each(function () {
          var div = document.createElement('div');
          $(div)
            .attr('id', 'section-' + index)
            .addClass('fragment');
          var parentDiv = $(this).parents('div').get(0);
          parentDiv.appendChild(div);
          // The active tab already has content showing.
          if ($(this).is('.active')) {
            activeIndex = parseInt(index);
          }
          // Other tabs need to load their content.
          else {
            Drupal.dynamicload(this, {
              target: document.getElementById('section-' + index),
              useClick: false,
              show: false
            });
          }
          $(this).attr('href', '#section-' + index);
          index++;
        })
        .end()
        .parent('div')
        .each(function() {
          while (this.nextSibling) {
            var oldDiv = this.parentNode.removeChild(this.nextSibling);
            document.getElementById('section-' + activeIndex).appendChild(oldDiv);
          }
        })
        .tabs({
          onShow: Drupal.tabsAddClassesCallback()
        });
    });
  }
};

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/lightbox2/js/image_nodes.js */


// Image Node Auto-Format with Auto Image Grouping.
// Original version by Steve McKenzie.
// Altered by Stella Power for jQuery version.

if (Drupal.jsEnabled) {
  $(document).ready(function lightbox2_image_nodes() {

    var settings = Drupal.settings.lightbox2;

    // Don't do it on the image assist popup selection screen.
    var img_assist = document.getElementById("img_assist_thumbs");
    if (!img_assist) {

      // Select the enabled image types.
      var classes = settings.trigger_image_classes;
      $("a["+classes+"]").each(function(i) {

        if ((!settings.disable_for_gallery_lists && !settings.disable_for_acidfree_gallery_lists) || (!$(this).parents(".galleries").length && !$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || ($(this).parents(".galleries").length && !settings.disable_for_gallery_lists) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) {

          var child = $(this).children();

          // Ensure the child has a class attribute we can work with.
          if ($(child).attr("class").length) {

            // Set the alt text.
            var alt = $(child).attr("alt");
            if (!alt) {
              alt = "";
            }

            // Set the image node link text.
            var link_text = settings.node_link_text;
            var link_target  = "";
            if (settings.node_link_target != 0) {
              link_target = 'target="'+ settings.node_link_target +'"';
            }

            // Set the rel attribute.
            var rel = "lightbox";
            if (settings.group_images) {
              rel = "lightbox[" + $(child).attr("class") + "]";
            }
            
            // Set the basic href attribute - need to ensure there's no language
            // string (e.g. /en) prepended to the URL.
            var href = $(child).attr("src");
            var orig_href = $(this).attr("href");
            var pattern = new RegExp(settings.file_path);
            if (orig_href.match(pattern)) {
              var lang_pattern = new RegExp(settings.base_path + "\\w\\w\\/");
              orig_href = orig_href.replace(lang_pattern, settings.base_path);
            }

            // Handle flickr images.
            if ($(child).attr("class").match("flickr-photo-img")
              || $(child).attr("class").match("flickr-photoset-img")) {
              href = $(child).attr("src").replace("_s", "").replace("_t", "").replace("_m", "").replace("_b", "");
              if (settings.group_images) {
                rel = "lightbox[flickr]";
                if ($(child).parents("div.block-flickr").attr("class")) {
                  var id = $(child).parents("div.block-flickr").attr("id");
                  rel = "lightbox["+ id +"]";
                }
              }
            }

            // Handle "image-img_assist_custom" images.
            else if ($(child).attr("class").match("image-img_assist_custom")) {
              // Image assist uses "+" signs for spaces which doesn't work for
              // normal links.
              orig_href = orig_href.replace(/\+/, " ");
              href = orig_href;
            }

            // Handle "inline" images.
            else if ($(child).attr("class").match("inline")) {
              href = orig_href;
            }


            // Set the href attribute.
            else if (settings.image_node_sizes != '()') {
              href = $(child).attr("src").replace(new RegExp(settings.image_node_sizes), ((settings.display_image_size == "")?settings.display_image_size:"."+ settings.display_image_size)).replace(/(image\/view\/\d+)(\/\w*)/, ((settings.display_image_size == "")?"$1/_original":"$1/"+ settings.display_image_size));
              if (settings.group_images) {
                rel = "lightbox[node_images]";
                if ($(child).parents("div.block-image").attr("class")) {
                  var id = $(child).parents("div.block-image").attr("id");
                  rel = "lightbox["+ id +"]";
                }
              }
            }

            // Modify the image url.
            $(this).attr({rel: rel,
              title: alt + "<br /><a href=\"" + orig_href + "\" id=\"node_link_text\" "+ link_target +" >"+ link_text + "</a>",
              href: href
              });
          }
        }

      });

    }
  });
}

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/lightbox2/js/lightbox.js */


/**
 * jQuery Lightbox
 * @author
 *   Stella Power (snpower), <http://drupal.org/user/66894>
 *
 * Based on Lightbox v2.03.3 by Lokesh Dhakar 
 * <http://www.huddletogether.com/projects/lightbox2/>
 * Also partially based on the jQuery Lightbox by Warren Krewenki
 *   <http://warren.mesozen.com>
 *
 * Originally written to make use of the Prototype framework, and 
 * Script.acalo.us, now altered to use jQuery.
 *
 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
 * maintainers to distribute this file via Drupal.org 
 * Under GPL license.
 *
 */

/**
 * Table of Contents
 * -----------------
 * Configuration
 * Global Variables
 * Lightbox Class Declaration
 * - initialize()
 * - updateImageList()
 * - start()
 * - changeImage()
 * - imgNodeLoadingError()
 * - imgLoadingError()
 * - resizeImageContainer()
 * - showImage()
 * - updateDetails()
 * - updateNav()
 * - enableKeyboardNav()
 * - disableKeyboardNav()
 * - keyboardAction()
 * - preloadNeighborImages()
 * - end()
 *
 * Miscellaneous Functions
 * - getPageScroll()
 * - getPageSize()
 * - pause()
 *
 * On load event
 * - initialize()
 *
 */


var Lightbox = {
  overlayOpacity : 0.6, // controls transparency of shadow overlay
  fadeInSpeed: 'normal', // controls the speed of the image appearance
  slideDownSpeed: 'slow', // controls the speed of the image resizing animations
  borderSize : 10, // if you adjust the padding in the CSS, you will need to update this variable
  infoHeight: 20,
  imageArray : new Array,
  activeImage : null,
  inprogress : false,
  rtl : false,
 


  // initialize()
  // Constructor runs on completion of the DOM loading. Calls updateImageList 
  // and then the function inserts html at the bottom of the page which is used
  //  to display the shadow overlay and the image container.
  initialize: function() {

    var settings = Drupal.settings.lightbox2;
    Lightbox.overlayOpacity = settings.overlay_opacity;
    Lightbox.rtl = settings.rtl;

    // attach lightbox to any links with rel 'lightbox'
    Lightbox.updateImageList();

    // MAKE THE LIGHTBOX DIVS
    // Code inserts html at the bottom of the page that looks similar to this:
    // (default layout)
    //
    // <div id="overlay"></div>
    // <div id="lightbox">
    //  <div id="outerImageContainer">
    //   <div id="imageContainer">
    //    <img id="lightboxImage">
    //    <div style="" id="hoverNav">
    //     <a href="#" id="prevLink"></a>
    //     <a href="#" id="nextLink"></a>
    //    </div>
    //    <div id="loading">
    //     <a href="#" id="loadingLink">
    //      <img src="images/loading.gif">
    //     </a>
    //    </div>
    //   </div>
    //  </div>
    //  <div id="imageDataContainer">
    //   <div id="imageData">
    //    <div id="imageDetails">
    //     <span id="caption"></span>
    //     <span id="numberDisplay"></span>
    //    </div>
    //    <div id="bottomNav">
    //     <a href="#" id="bottomNavClose">
    //      <img src="images/close.gif">
    //     </a>
    //    </div>
    //   </div>
    //  </div>
    // </div>

    var Body = document.getElementsByTagName("body").item(0);

    var Overlay = document.createElement("div");
    Overlay.setAttribute('id', 'overlay');
    Overlay.style.display = 'none';
    Body.appendChild(Overlay);

    var LightboxDiv = document.createElement("div");
    LightboxDiv.setAttribute('id', 'lightbox');
    LightboxDiv.style.display = 'none';
    Body.appendChild(LightboxDiv);

    var OuterImageContainer = document.createElement("div");
    OuterImageContainer.setAttribute('id', 'outerImageContainer');
    LightboxDiv.appendChild(OuterImageContainer);

    var ImageContainer = document.createElement("div");
    ImageContainer.setAttribute('id', 'imageContainer');
    OuterImageContainer.appendChild(ImageContainer);

    var LightboxImage = document.createElement("img");
    LightboxImage.setAttribute('id', 'lightboxImage');
    ImageContainer.appendChild(LightboxImage);

    if (!settings.use_alt_layout) {
      var HoverNav = document.createElement("div");
      HoverNav.setAttribute('id', 'hoverNav');
      ImageContainer.appendChild(HoverNav);

      var PrevLink = document.createElement("a");
      PrevLink.setAttribute('id', 'prevLink');
      PrevLink.setAttribute('href', '#');
      HoverNav.appendChild(PrevLink);

      var NextLink = document.createElement("a");
      NextLink.setAttribute('id', 'nextLink');
      NextLink.setAttribute('href', '#');
      HoverNav.appendChild(NextLink);

      var Loading = document.createElement("div");
      Loading.setAttribute('id', 'loading');
      ImageContainer.appendChild(Loading);

      var LoadingLink = document.createElement("a");
      LoadingLink.setAttribute('id', 'loadingLink');
      LoadingLink.setAttribute('href', '#');
      Loading.appendChild(LoadingLink);

      var ImageDataContainer = document.createElement("div");
      ImageDataContainer.setAttribute('id', 'imageDataContainer');
      ImageDataContainer.className = 'clearfix';
      LightboxDiv.appendChild(ImageDataContainer);

      var ImageData = document.createElement("div");
      ImageData.setAttribute('id', 'imageData');
      ImageDataContainer.appendChild(ImageData);

      var ImageDetails = document.createElement("div");
      ImageDetails.setAttribute('id', 'imageDetails');
      ImageData.appendChild(ImageDetails);

      var Caption = document.createElement("span");
      Caption.setAttribute('id', 'caption');
      ImageDetails.appendChild(Caption);

      var NumberDisplay = document.createElement("span");
      NumberDisplay.setAttribute('id', 'numberDisplay');
      ImageDetails.appendChild(NumberDisplay);

      var BottomNav = document.createElement("div");
      BottomNav.setAttribute('id', 'bottomNav');
      ImageData.appendChild(BottomNav);

      var BottomNavCloseLink = document.createElement("a");
      BottomNavCloseLink.setAttribute('id', 'bottomNavClose');
      BottomNavCloseLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavCloseLink);

      var BottomNavZoomLink = document.createElement("a");
      BottomNavZoomLink.setAttribute('id', 'bottomNavZoom');
      BottomNavZoomLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavZoomLink);

      var BottomNavZoomOutLink = document.createElement("a");
      BottomNavZoomOutLink.setAttribute('id', 'bottomNavZoomOut');
      BottomNavZoomOutLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavZoomOutLink);

    }

    // new layout
    else {
      var Loading = document.createElement("div");
      Loading.setAttribute('id', 'loading');
      ImageContainer.appendChild(Loading);

      var LoadingLink = document.createElement("a");
      LoadingLink.setAttribute('id', 'loadingLink');
      LoadingLink.setAttribute('href', '#');
      Loading.appendChild(LoadingLink);

      var ImageDataContainer = document.createElement("div");
      ImageDataContainer.setAttribute('id', 'imageDataContainer');
      ImageDataContainer.className = 'clearfix';
      LightboxDiv.appendChild(ImageDataContainer);

      var ImageData = document.createElement("div");
      ImageData.setAttribute('id', 'imageData');
      ImageDataContainer.appendChild(ImageData);

      var HoverNav = document.createElement("div");
      HoverNav.setAttribute('id', 'hoverNav');
      ImageData.appendChild(HoverNav);

      var PrevLink = document.createElement("a");
      PrevLink.setAttribute('id', 'prevLink');
      PrevLink.setAttribute('href', '#');
      HoverNav.appendChild(PrevLink);

      var NextLink = document.createElement("a");
      NextLink.setAttribute('id', 'nextLink');
      NextLink.setAttribute('href', '#');
      HoverNav.appendChild(NextLink);

      var ImageDetails = document.createElement("div");
      ImageDetails.setAttribute('id', 'imageDetails');
      ImageData.appendChild(ImageDetails);

      var Caption = document.createElement("span");
      Caption.setAttribute('id', 'caption');
      ImageDetails.appendChild(Caption);

      var NumberDisplay = document.createElement("span");
      NumberDisplay.setAttribute('id', 'numberDisplay');
      ImageDetails.appendChild(NumberDisplay);

      var BottomNav = document.createElement("div");
      BottomNav.setAttribute('id', 'bottomNav');
      ImageContainer.appendChild(BottomNav);

      var BottomNavCloseLink = document.createElement("a");
      BottomNavCloseLink.setAttribute('id', 'bottomNavClose');
      BottomNavCloseLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavCloseLink);

      var BottomNavZoomLink = document.createElement("a");
      BottomNavZoomLink.setAttribute('id', 'bottomNavZoom');
      BottomNavZoomLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavZoomLink);

      var BottomNavZoomOutLink = document.createElement("a");
      BottomNavZoomOutLink.setAttribute('id', 'bottomNavZoomOut');
      BottomNavZoomOutLink.setAttribute('href', '#');
      BottomNav.appendChild(BottomNavZoomOutLink);
    }



    $("#overlay").click(function() { Lightbox.end(); } ).hide();
    $("#lightbox").click(function() { Lightbox.end();} ).hide();
    $("#loadingLink").click(function() { Lightbox.end(); return false;} );
    $('#prevLink').click(function() { Lightbox.changeImage(Lightbox.activeImage - 1); return false; } );
    $('#nextLink').click(function() { Lightbox.changeImage(Lightbox.activeImage + 1); return false; } );
    $("#bottomNavClose").click(function() { Lightbox.end(); return false; } );
    $("#bottomNavZoom").click(function() { Lightbox.changeImage(Lightbox.activeImage, 'TRUE'); return false; } );
    $("#bottomNavZoomOut").click(function() { Lightbox.changeImage(Lightbox.activeImage, 'FALSE'); return false; } );

    // Fix positioning of Prev and Next links.
    $('#prevLink').css({ paddingTop: Lightbox.borderSize});
    $('#nextLink').css({ paddingTop: Lightbox.borderSize});

    // Force navigation links to always be displayed
    if (settings.force_show_nav) {
      $('#prevLink').addClass("force_show_nav");
      $('#nextLink').addClass("force_show_nav");
    }

  },
 
  // updateImageList()
  // Loops through anchor tags looking for 'lightbox' references and applies
  // onclick events to appropriate links. You can rerun after dynamically adding
  // images w/ajax.
  updateImageList : function() {

    // attach lightbox to any links with rel 'lightbox'
    var anchors = $('a');
    var areas = $('area');

    // loop through all anchor tags
    for (var i = 0; i < anchors.length; i++) {
      var anchor = anchors[i];
      var relAttribute = String(anchor.rel);

      // use the string.match() method to catch 'lightbox' references in the rel
      // attribute
      if (anchor.href && (relAttribute.toLowerCase().match('lightbox'))) {
        anchor.onclick = function() { Lightbox.start(this); return false; };
      }
    }

    // loop through all area tags
    // todo: combine anchor & area tag loops
    for (var i = 0; i < areas.length; i++) {
      var area = areas[i];
      var relAttribute = String(area.rel);

      // use the string.match() method to catch 'lightbox' references in the rel
      // attribute
      if (area.href && (relAttribute.toLowerCase().match('lightbox'))) {
        area.onclick = function() { Lightbox.start(this); return false; };
      }
    }
  },

  // start()
  // Display overlay and lightbox. If image is part of a set, add siblings to 
  // imageArray.
  start: function(imageLink) {

    // replaces hideSelectBoxes() and hideFlash() calls in original lightbox2
    $("select, embed, object").hide();
    
    // stretch overlay to fill page and fade in
    var arrayPageSize = Lightbox.getPageSize();
    $("#overlay").hide().css({
      width: '100%',
      zIndex: '10090',
      height: arrayPageSize[1] + 'px', 
      opacity : Lightbox.overlayOpacity
    }).fadeIn();

    Lightbox.imageArray = [];
    imageNum = 0;  

    var anchors = $(imageLink.tagName);
   
    // if image is NOT part of a set..
    if ((imageLink.rel == 'lightbox')) {
      // add single image to imageArray
      Lightbox.imageArray.push(new Array(imageLink.href, imageLink.title));

    }
    else {
      // if image is part of a set..

      // loop through anchors, find other images in set, and add them to imageArray
      for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.href && (anchor.rel == imageLink.rel)) {
          Lightbox.imageArray.push(new Array(anchor.href, anchor.title));
        }
      }

      // remove duplicates
      for (i = 0; i < Lightbox.imageArray.length; i++) {
        for (j = Lightbox.imageArray.length-1; j > i; j--) {        
          if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) {
            Lightbox.imageArray.splice(j,1);
          }
        }
      }
      while (Lightbox.imageArray[imageNum][0] != imageLink.href) {
        imageNum++;
      }
    }

    // calculate top and left offset for the lightbox 
    var arrayPageScroll = Lightbox.getPageScroll();
    var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10);
    var lightboxLeft = arrayPageScroll[0];
    $('#lightbox').css({
      zIndex: '10500',
      top: lightboxTop + 'px', 
      left: lightboxLeft + 'px'
    }).show();
    
    Lightbox.changeImage(imageNum);
  },

  // changeImage()
  // Hide most elements and preload image in preparation for resizing image 
  // container.
  changeImage: function(imageNum, zoom) {

    if (this.inprogress === false) {
      this.inprogress = true;

      var settings = Drupal.settings.lightbox2;
      if (settings.disable_zoom) {
        zoom = "TRUE";
      }

      Lightbox.activeImage = imageNum; // update global var

      // hide elements during transition
      $('#loading').css({zIndex: '10500'}).show();
      $('#lightboxImage').hide();
      $('#hoverNav').hide();
      $('#prevLink').hide();
      $('#nextLink').hide();
      $('#imageDataContainer').hide();
      $('#numberDisplay').hide();  
      $('#bottomNavZoom').hide();
      $('#bottomNavZoomOut').hide();
    
      imgPreloader = new Image();
      imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this) };

      // once image is preloaded, resize image container
      if (zoom == "TRUE") {
        imgPreloader.onload = function() {
          var photo = document.getElementById('lightboxImage');
          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
          photo.style.width = (imgPreloader.width) + 'px';
          Lightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height);
          // clear onLoad, IE behaves irratically with animated gifs otherwise
          imgPreloader.onload = function() {}; 
        };
        $('#bottomNavZoom').hide();
        if (!settings.disable_zoom) {
          $('#bottomNavZoomOut').css({zIndex: '10500'}).show();
        }

      }
      else {
        // image is very large, so show a smaller version of the larger image 
        // with zoom button
        imgPreloader.onload = function() {
          var photo = document.getElementById('lightboxImage');
          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];

          // resize code
          var arrayPageSize = Lightbox.getPageSize();
          var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4)- (arrayPageSize[3] / 10) };
          var orig = { w:imgPreloader.width, h:imgPreloader.height };
          var ratio = 1.0; // shrink image with the same aspect
          $('#bottomNavZoomOut').hide();
          $('#bottomNavZoom').hide();
          if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
            ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
            $('#bottomNavZoom').css({zIndex: '10500'}).show();
          }
          var new_width  = Math.floor(orig.w * ratio);
          var new_height = Math.floor(orig.h * ratio);
          photo.style.width = (new_width) + 'px';

          Lightbox.resizeImageContainer(new_width, new_height);

          // clear onLoad, IE behaves irratically with animated gifs otherwise
          imgPreloader.onload = function() {}; 
        };

      }
      imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
    }
  },

  // imgNodeLoadingError()
  imgNodeLoadingError: function(image) {
    var settings = Drupal.settings.lightbox2;
    var original_image = Lightbox.imageArray[Lightbox.activeImage][0];
    if (settings.display_image_size != "") {
      original_image = original_image.replace(new RegExp("."+settings.display_image_size), "");
    }
    Lightbox.imageArray[Lightbox.activeImage][0] = original_image;
    image.onerror = function() { Lightbox.imgLoadingError(image) };
    image.src = original_image;
  },

  // imgLoadingError()
  imgLoadingError: function(image) {
    var settings = Drupal.settings.lightbox2;
    Lightbox.imageArray[Lightbox.activeImage][0] = settings.default_image;
    image.src = settings.default_image;
  },

  // resizeImageContainer()
  resizeImageContainer: function(imgWidth, imgHeight) {

    // get current width and height
    this.widthCurrent = $('#outerImageContainer').width();
    this.heightCurrent = $('#outerImageContainer').height();

    // get new width and height
    var widthNew = (imgWidth  + (Lightbox.borderSize * 2));
    var heightNew = (imgHeight  + (Lightbox.borderSize * 2));

    // scalars based on change from old to new
    this.xScale = ( widthNew / this.widthCurrent) * 100;
    this.yScale = ( heightNew / this.heightCurrent) * 100;

    // calculate size difference between new and old image, and resize if 
    // necessary
    wDiff = this.widthCurrent - widthNew;
    hDiff = this.heightCurrent - heightNew;

    $('#outerImageContainer').animate({width: widthNew, height: heightNew}, 'linear', function() {
      Lightbox.showImage();
    });


    // if new and old image are same size and no scaling transition is necessary
    // do a quick pause to prevent image flicker.
    if ((hDiff === 0) && (wDiff === 0)) {
      if (navigator.appVersion.indexOf("MSIE") != -1) {
        Lightbox.pause(250);
      }
      else {
        Lightbox.pause(100);
      }
    }

    var settings = Drupal.settings.lightbox2;
    if (!settings.use_alt_layout) {
      $('#prevLink').css({height: imgHeight + 'px'});
      $('#nextLink').css({height: imgHeight + 'px'});
    }
    $('#imageDataContainer').css({width: widthNew + 'px'});

  },
 
  // showImage()
  // Display image and begin preloading neighbors.
  showImage: function() {
    $('#loading').hide();
    if($.browser.safari) {
      $('#lightboxImage').css({zIndex: '10500'}).show();
    }
    else {
      $('#lightboxImage').css({zIndex: '10500'}).fadeIn(Lightbox.fadeInSpeed);
    }
    Lightbox.updateDetails();
    this.preloadNeighborImages();
    this.inprogress = false;
  },

  // updateDetails()
  // Display caption, image number, and bottom nav.
  updateDetails: function() {

    $("#imageDataContainer").hide();

    // if caption is not null
    if (Lightbox.imageArray[Lightbox.activeImage][1]) {
      $('#caption').html(Lightbox.imageArray[Lightbox.activeImage][1]).css({zIndex: '10500'}).show();
    }
    else {
      $('#caption').hide();
    }
    
    // if image is part of set display 'Image x of x' 
    if (Lightbox.imageArray.length > 1) {
      var settings = Drupal.settings.lightbox2;
      var numberDisplay = settings.image_count.replace(/\!current/, eval(Lightbox.activeImage + 1)).replace(/\!total/, Lightbox.imageArray.length);
      $('#numberDisplay').html(numberDisplay).css({zIndex: '10500'}).show();
    }

    $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed);
    if (Lightbox.rtl) {
      $("#bottomNav").css({float: 'left'});
    }
    var arrayPageSize = Lightbox.getPageSize();
    $('#overLay').css({height: arrayPageSize[1] + 'px'});
    Lightbox.updateNav();
  },

  // updateNav()
  // Display appropriate previous and next hover navigation.
  updateNav: function() {

    $('#hoverNav').css({zIndex: '10500'}).show();    

    // if not first image in set, display prev image button
    if (Lightbox.activeImage !== 0) {
      $('#prevLink').css({zIndex: '10500'}).show().click(function() {
        Lightbox.changeImage(Lightbox.activeImage - 1); return false;
      });
    }
    // safari browsers need to have hide() called again
    else {
      $('#prevLink').hide();
    }

    // if not last image in set, display next image button
    if (Lightbox.activeImage != (Lightbox.imageArray.length - 1)) {
      $('#nextLink').css({zIndex: '10500'}).show().click(function() {
        Lightbox.changeImage(Lightbox.activeImage + 1); return false;
      });
    }
    // safari browsers need to have hide() called again
    else {
      $('#nextLink').hide();
    }
    
    this.enableKeyboardNav();
  },


  // enableKeyboardNav()
  enableKeyboardNav: function() {
    document.onkeydown = this.keyboardAction; 
  },

  // disableKeyboardNav()
  disableKeyboardNav: function() {
    document.onkeydown = '';
  },

  // keyboardAction()
  keyboardAction: function(e) {
    if (e === null) { // ie
      keycode = event.keyCode;
      escapeKey = 27;
    }
    else { // mozilla
      keycode = e.keyCode;
      escapeKey = e.DOM_VK_ESCAPE;
    }

    key = String.fromCharCode(keycode).toLowerCase();
    
    // close lightbox
    if (key == 'x' || key == 'o' || key == 'c' || keycode == escapeKey) {
      Lightbox.end();

    // display previous image (p, <-)
    }
    else if (key == 'p' || keycode == 37) {
      if (Lightbox.activeImage !== 0) {
        Lightbox.disableKeyboardNav();
        Lightbox.changeImage(Lightbox.activeImage - 1);
      }

    // display next image (n, ->, space)
    }
    else if (key == 'n' || keycode == 39 || keycode == 32) {
      if (Lightbox.activeImage != (Lightbox.imageArray.length - 1)) {
        Lightbox.disableKeyboardNav();
        Lightbox.changeImage(Lightbox.activeImage + 1);
      }
    }
  },

  preloadNeighborImages: function() {

    if ((Lightbox.imageArray.length - 1) > Lightbox.activeImage) {
      preloadNextImage = new Image();
      preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0];
    }
    if (Lightbox.activeImage > 0) {
      preloadPrevImage = new Image();
      preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0];
    }
   
  },

  end: function() {
    this.disableKeyboardNav();
    $('#lightbox').hide();
    $("#overlay").fadeOut();
    // replaces calls to showSelectBoxes() and showFlash() in original lightbox2
    $("select[display!='none'], object[display!='none'], embed[display!='none']").show();
  },



  // getPageScroll()
  // Returns array with x,y page scroll values.
  // Core code from - quirksmode.com
  getPageScroll : function() {
    
    var xScroll, yScroll;

    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop) {  // Explorer 6 Strict
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    }
    else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft; 
    }

    arrayPageScroll = new Array(xScroll,yScroll);
    return arrayPageScroll;
  },
 
  // getPageSize()
  // Returns array with page width, height and window width, height
  // Core code from - quirksmode.com
  // Edit for Firefox by pHaez
  getPageSize : function() {

    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) { 
      xScroll = window.innerWidth + window.scrollMaxX;
      yScroll = window.innerHeight + window.scrollMaxY;
    }
    else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
      xScroll = document.body.scrollWidth;
      yScroll = document.body.scrollHeight;
    }
    else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
      xScroll = document.body.offsetWidth;
      yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;

    if (self.innerHeight) { // all except Explorer
      if (document.documentElement.clientWidth) {
        windowWidth = document.documentElement.clientWidth; 
      }
      else {
        windowWidth = self.innerWidth;
      }
      windowHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      windowWidth = document.documentElement.clientWidth;
      windowHeight = document.documentElement.clientHeight;
    }
    else if (document.body) { // other Explorers
      windowWidth = document.body.clientWidth;
      windowHeight = document.body.clientHeight;
    }

    // for small pages with total height less then height of the viewport
    if (yScroll < windowHeight) {
      pageHeight = windowHeight;
    }
    else { 
      pageHeight = yScroll;
    }


    // for small pages with total width less then width of the viewport
    if (xScroll < windowWidth) { 
      pageWidth = xScroll;  
    }
    else {
      pageWidth = windowWidth;
    }

    arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
    return arrayPageSize;
  },


  // pause(numberMillis)
  pause : function(ms) {
    var date = new Date();
    curDate = null;
    do { var curDate = new Date(); }
    while (curDate - date < ms);
  }
};

// initialize the lightbox
if (Drupal.jsEnabled) {
  $(document).ready(function(){
    Lightbox.initialize();
  });
}

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/thickbox/thickbox.js */
// $Id: thickbox.js,v 1.2.4.2 2007/06/21 02:19:44 frjo Exp $

/*
 * Thickbox 3 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/


if (Drupal.jsEnabled) {
	//on page load call tb_init
	$(document).ready(function(){
		tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
		imgLoader = new Image();// preload image
	});
}

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	return false;
	});
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

	var settings = Drupal.settings.thickbox;

	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
				$("#TB_overlay").click(tb_remove);
			}
		}

		if(caption===null){caption="";}
		$("body").append("<div id='TB_load'></div>");//add loader to the page
		$('#TB_load').show();//show loader

		var baseURL;
	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
			baseURL = url.substr(0, url.indexOf("?"));
	   }else{
	   		baseURL = url;
	   }

	   var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
	   var urlType = baseURL.toLowerCase().match(urlString);

		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images

			TB_PrevCaption = "";
			TB_PrevURL = "";
			TB_PrevHTML = "";
			TB_NextCaption = "";
			TB_NextURL = "";
			TB_NextHTML = "";
			TB_imageCount = "";
			TB_FoundURL = false;
			if(imageGroup){
				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
						if (!(TB_TempArray[TB_Counter].href == url)) {
							if (TB_FoundURL) {
								TB_NextCaption = TB_TempArray[TB_Counter].title;
								TB_NextURL = TB_TempArray[TB_Counter].href;
								TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>" + settings.next + "</a></span>";
							} else {
								TB_PrevCaption = TB_TempArray[TB_Counter].title;
								TB_PrevURL = TB_TempArray[TB_Counter].href;
								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>" + settings.prev + "</a></span>";
							}
						} else {
							TB_FoundURL = true;
							TB_imageCount = settings.image_count.replace(/\!current/, (TB_Counter + 1)).replace(/\!total/, TB_TempArray.length);
						}
				}
			}

			imgPreloader = new Image();
			imgPreloader.onload = function(){
			imgPreloader.onload = null;

			// Resizing large images - orginal by Christian Montoya edited by me.
			var pagesize = tb_getPageSize();
			var x = pagesize[0] - 100;
			var y = pagesize[1] - 100;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth);
				imageWidth = x;
				if (imageHeight > y) {
					imageWidth = imageWidth * (y / imageHeight);
					imageHeight = y;
				}
			} else if (imageHeight > y) {
				imageWidth = imageWidth * (y / imageHeight);
				imageHeight = y;
				if (imageWidth > x) {
					imageHeight = imageHeight * (x / imageWidth);
					imageWidth = x;
				}
			}
			// End Resizing

			TB_WIDTH = imageWidth + 30;
			TB_HEIGHT = imageHeight + 60;
			$("#TB_window").append("<a href='' id='TB_ImageOff' title='" + settings.next_close + "'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='" + settings.close + "'>" + settings.close + "</a> " + settings.esc_key + "</div>");

			$("#TB_closeWindowButton").click(tb_remove);

			if (!(TB_PrevHTML === "")) {
				function goPrev(){
					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
					return false;
				}
				$("#TB_prev").click(goPrev);
			}

			if (!(TB_NextHTML === "")) {
				function goNext(){
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_NextCaption, TB_NextURL, imageGroup);
					return false;
				}
				$("#TB_next").click(goNext);
				$("#TB_ImageOff").click(goNext);
			} else {
				$("#TB_ImageOff").click(tb_remove);
			}

			document.onkeydown = function(e){
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				} else if(keycode == 190){ // display previous image
					if(!(TB_NextHTML == "")){
						document.onkeydown = "";
						goNext();
					}
				} else if(keycode == 188){ // display next image
					if(!(TB_PrevHTML == "")){
						document.onkeydown = "";
						goPrev();
					}
				}
			};

			tb_position();
			$("#TB_load").remove();
			$("#TB_window").css({display:"block"}); //for safari using css instead of show
			};

			imgPreloader.src = url;
		}else{//code to show html pages

			var queryString = url.replace(/^[^\?]+\??/,'');
			var params = tb_parseQuery( queryString );

			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
			ajaxContentW = TB_WIDTH - 30;
			ajaxContentH = TB_HEIGHT - 45;

			if(url.indexOf('TB_iframe') != -1){
					urlNoQuery = url.split('TB_');
					$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='" + settings.close + "'>" + settings.close + "</a> " + settings.esc_key + "</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' onload='tb_showIframe()'> </iframe>");
				}else{
					if($("#TB_window").css("display") != "block"){
						if(params['modal'] != "true"){
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>" + settings.close + "</a> " + settings.esc_key + "</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
						}else{
						$("#TB_overlay").unbind();
						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
						}
					}else{
						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
						$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
						$("#TB_ajaxContent")[0].scrollTop = 0;
						$("#TB_ajaxWindowTitle").html(caption);
					}
			}

			$("#TB_closeWindowButton").click(tb_remove);

				if(url.indexOf('TB_inline') != -1){
					$("#TB_ajaxContent").html($('#' + params['inlineId']).html());
					tb_position();
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"});
				}else if(url.indexOf('TB_iframe') != -1){
					tb_position();
					if(frames['TB_iframeContent'] === undefined){//be nice to safari
						$("#TB_load").remove();
						$("#TB_window").css({display:"block"});
						$(document).keyup( function(e){ var key = e.keyCode; if(key == 27){tb_remove();}});
					}
				}else{
					$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
						tb_position();
						$("#TB_load").remove();
						tb_init("#TB_ajaxContent a.thickbox");
						$("#TB_window").css({display:"block"});
					});
				}

		}

		if(!params['modal']){
			document.onkeyup = function(e){
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}
			};
		}

	} catch(e) {
		//nothing here
	}
}

//helper functions below
function tb_showIframe(){
	$("#TB_load").remove();
	$("#TB_window").css({display:"block"});
}

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_overlay").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	return false;
}

function tb_position() {
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
	if ( !(jQuery.browser.msie && typeof XMLHttpRequest == 'function')) { // take away IE6
		$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
	}
}

function tb_parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/thirdage/thirdage_search/thirdage_search.js */
$(document).ready(function() {
  $("#search-theme-form #edit-submit")
    .click( function() {
      $(this)
        .attr("disabled", true);
      var t=setTimeout('$("#edit-search-theme-form-keys").val("Searching...").attr("readonly", true)', 100);
    });
});
;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/panels/js/panels.js */
// $Id: panels.js,v 1.1.2.9 2008/05/27 19:25:57 sdboyer Exp $

Drupal.Panels = {};

Drupal.Panels.autoAttach = function() {
  if ($.browser.msie) {
    // If IE, attach a hover event so we can see our admin links.
    $("div.panel-pane").hover(
      function() {
        $('div.panel-hide', this).addClass("panel-hide-hover"); return true;
      },
      function() {
        $('div.panel-hide', this).removeClass("panel-hide-hover"); return true;
      }
    );
    $("div.admin-links").hover(
      function() {
        $(this).addClass("admin-links-hover"); return true;
      },
      function(){
        $(this).removeClass("admin-links-hover"); return true;
      }
    );
  }
};

$(Drupal.Panels.autoAttach);

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/contrib/devel/devel.js */
// $Id: devel.js,v 1.1.2.2 2007/10/21 01:06:35 weitzman Exp $

/**
  *  @name    jQuery Logging plugin
  *  @author  Dominic Mitchell
  *  @url     http://happygiraffe.net/blog/archives/2007/09/26/jquery-logging
  */
jQuery.fn.log = function (msg) {
    console.log("%s: %o", msg, this);
    return this;
};

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/modules/thirdage/thirdage_registration/thirdage_registration.js */
$(document).ready(function(){
  // Make the thickbox close button
  if (Drupal.settings.thickbox) {
    Drupal.settings.thickbox.esc_key = '';
    Drupal.settings.thickbox.close = '<img src="'+Drupal.settings.basePath+'sites/all/themes/denali/images/Xbutton.gif" alt="close" width="23" height="21" />';
  }

  // Add some fanciness to the registration form
  $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/register]').bind("ajaxComplete", function () {
    Custom.init("#TB_ajaxContent");
    $('#user-register #edit-name').parent().append('<img alt="Check Availabiltiy" id="user-register-check-availability" src="'+Drupal.settings.basePath+'sites/all/themes/denali/images/button-check-availability.gif" />');
    $('#user-register-check-availability').click(function() {
      if ($('#edit-name').val()) {
        $.get(Drupal.settings.basePath+"user/register/check_availability", { name: $('#edit-name').val() }, function(data){ alert(data);} );
      }
    });
    $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/register]').unbind("ajaxComplete"); // don't recurse
  });

  $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/register]').click(function() {
    // Add some fanciness to the registration form
    $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/register]').bind("ajaxComplete", function () {
      Custom.init("#TB_ajaxContent");
      $('#user-register #edit-name').parent().append('<img alt="Check Availabiltiy" id="user-register-check-availability" src="'+Drupal.settings.basePath+'sites/all/themes/denali/images/button-check-availability.gif" />');
      $('#user-register-check-availability').click(function() {
      if ($('#edit-name').val()) {
        $.get(Drupal.settings.basePath+"user/register/check_availability", { name: $('#edit-name').val() }, function(data){ alert(data);} );
      }
   });
   $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/register]').unbind("ajaxComplete"); // don't recurse
   });
 });

  // Append the Input Field to Check the Username Availability
  $('#user-register #edit-name').parent().append('<img alt="Check Availabiltiy" id="user-register-check-availability" src="'+Drupal.settings.basePath+'sites/all/themes/denali/images/button-check-availability.gif" />');

  // Apply some Actions to the Forms to Show and Hide the Descriptions
  $('.user-register-has-tip input.form-text').focus(function() {
    $(this).parent().parent().children('.user-register-element-description').slideToggle("fast");
  });
  $('.user-register-has-tip select.form-select').focus(function() {
    $(this).parent().parent().children('.user-register-element-description').slideToggle("fast");
  });
  $('.user-register-has-tip input.form-text').blur(function() {
    $(this).parent().parent().children('.user-register-element-description').slideToggle("fast");
  });
  $('.user-register-has-tip select.form-select').blur(function() {
    $(this).parent().parent().children('.user-register-element-description').slideToggle("fast");
  });
  
  $('.user-register-element input').focus(function() {
    $(this).addClass('selected');
  });
  $('.user-register-element input').blur(function() {
    $(this).removeClass('selected');
  });

 // Bind the Check Availability AJAX Request
 $('#user-register-check-availability').click(function() {
   if ($('#edit-name').val()) {
     $.get(Drupal.settings.basePath+"user/register/check_availability", 
       { name: $('#edit-name').val() },
         function(data){
           alert(data);
         }
     );
   }
 });

  ////////////////////
  // Login popup stuff
  ////////////////////
  $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/login]').click(function() {
    $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/login]').bind("ajaxComplete", function () {
      $('.sign-in-popup-register-button').click( function() {
        return false;
      });
      $('.sign-in-popup-register-button').click( function() {
        $('#TB_closeWindowButton').click();
        setTimeout("$('#register-link').click()", 250);
      });
      $('a.thickbox[href^='+Drupal.settings.basePath+'thickbox/login]').unbind("ajaxComplete"); // don't recurse
    });
  });
  

});

;
/* AGGREGATED JS FILE: http://cast.thirdage.com/sites/all/themes/denali/js-global.js */
$(document).ready(function(){ 
  $("#secondary").hide(); // hide secondary, because we have drop-downs now
    //Primary drop-downs
    $('#primary ul li').hover(function(){
      //over
      var id = $(this).attr('id');
      var idNum = id.replace('primary-','');
      if(idNum != '1' && $('#tip-hover-storage #secondary-drop-'+idNum).get() != '') {
        $(this).addClass('dropped primary-'+idNum+'-dropped');
        var position_x = parseInt($(this).css('left'));
        position_x = (position_x + ($('#primary').offset()['left'] - $('#page').offset()['left'])) + parseInt($('.primary-'+idNum+'-dropped').css('margin-left'));
        position_x = position_x - 1;
        var position_y = $('#'+id).offset()['top'] - $('#page').offset()['top'] + parseInt($('#'+id).height());
        //get width
        var width = ($(this).width()) - parseInt($('.primary-'+idNum+'-dropped').css('margin-left'));
        $('#tip-hover-storage #secondary-drop-'+idNum).css({ position: "absolute", top: position_y + 'px', left: position_x + 'px', width: width + 'px' });
        $('#tip-hover-storage #secondary-drop-'+idNum).show();
        //prepare the height of the ie iframe
        if(($.browser['msie'] == true) && ($.browser['version'] < 6.5)) {
          var height = parseInt($('#tip-hover-storage #secondary-drop-'+idNum).height());
          height = height +  parseInt($('#tip-hover-storage #secondary-drop-'+idNum).css('padding-bottom')) + parseInt($('#tip-hover-storage #secondary-drop-'+idNum).css('padding-top'));
          $('#tip-hover-storage #secondary-drop-'+idNum +' IFRAME').css({ height: height + 'px' });
        }
      //if id != 1 (not home)
      } else {
        //make sure the link wasn't active to start, if it was, make sure it stays active after the mouseoff
        if($(this).children('a').hasClass('active')){
          if ($(this).hasClass('active')){
            $(this).addClass('active was-active');
          } else {
            $(this).addClass('active');
          }
          $(this).children('a').addClass('active was-active');
        } else {
          $(this).addClass('active');
          $(this).children('a').addClass('active');
        }
      } //if home or has no drop
    },function(){
      //out
      var idNum = ($(this).attr('id')).replace('primary-','');
      if(idNum != '1' && $('#tip-hover-storage #secondary-drop-'+idNum).get() != '') {
        $('#tip-hover-storage #secondary-drop-'+idNum).hide();
        $('#primary ul li#primary-'+idNum).removeClass('dropped primary-'+idNum+'-dropped');
      //if id != 1 (not home)
      } else {
        //make sure the link wasn't active to start, if it was, make sure it stays active after the mouseoff
        if($(this).children('a').hasClass('was-active')){
          if ($(this).hasClass('was-active')){
            $(this).removeClass('was-active');
          } else {
            $(this).removeClass('active');
          }
          $(this).children('a').removeClass('was-active');
        } else {
          $(this).removeClass('active');
          $(this).children('a').removeClass('active');
        }
      } //if home or has no drop
    });
    $('.secondary-drop-container').hover(function(){
      //over
      $(this).show();
      var id = $(this).attr('id');
      var idNum = id.replace('secondary-drop-','');
      $('#primary ul li#primary-'+idNum).addClass('dropped primary-'+idNum+'-dropped');
    },function(){
      //out
      $(this).hide();
      //remove the dropped class
      var id = $(this).attr('id');
      var idNum = id.replace('secondary-drop-','');
      $('#primary ul li#primary-'+idNum).removeClass('dropped primary-'+idNum+'-dropped');
    });
// General force-login class for forms
    // bit below from thickbox.js
    jQuery("form.force-login .form-submit, form.force-login textarea").click( function() {
      window.scrollTo(0,0);
      $("#login-l a.thickbox").click();
      return false;
    });
    // add scrollTop for thickbox
    jQuery("a.thickbox")
      .click( function() {
        window.scrollTo(0,0);
      });
   // external click tracking to google analytics
   jQuery("a[href^='http://']")
     .click( function() {
       var href = jQuery(this).attr("href");
       if (href.indexOf("thirdage.com/") == -1) {
         pageTracker._trackPageview("/outgoing/"+jQuery(this).attr("href"));
       }
     });
   
   $('li.newsletter-more a').click(function() {
    $('div.item-list li.hidden').show();
   });
});

