// $Id$
(function ($) {

/**
 * Toggles the collapsible region.
 */
Drupal.behaviors.skyAdminToggle = {
  attach: function (context, settings) {
    $('.collapsible-toggle a, context').click(function() {
      $('#section-collapsible').toggleClass('toggle-active').find('.region-collapsible').slideToggle('fast');
      return false;
    });
  }
}

/**
 * CSS Help for IE.
 * - Adds even odd striping and containers for images in posts.
 * - Adds a .first-child class to the first paragraph in each wrapper.
 * - Adds a prompt containing the link to a comment for the permalink.
 */
Drupal.behaviors.skyPosts = {
  attach: function (context, settings) {
    // Detects IE6-8.
    if (!jQuery.support.leadingWhitespace) {
      $('.content p:first-child').addClass('first-child');
      $('article .content img, context').parent(':not(.field-item, .user-picture)').each(function(index) {
        var stripe = (index/2) ? 'even' : 'odd';
        $(this).wrap('<div class="content-image-' + stripe  + '"></div>');
      });
    }
    // Comment link copy promt.
    $("header span a.permalink").click( function() {
      prompt('Link to this comment:', this.href);
      return false;
    });
  }
}

})(jQuery);
;
﻿(function(){d=document;e=d.documentElement;c="images-on";i=new Image();t=i.style;s=d.enableStateScope=function(s,o){if(o)e.className+=" "+s;else e.className=e.className.replace(new RegExp("\b"+s+"\b"),"");};if(t.MozBinding!=null){t.backgroundImage="url("+d.location.protocol+"//0)";b=window.getComputedStyle(i,'').backgroundImage;if(b!="none"&&b!="url(invalid-url:)"||d.URL.substr(0,2)=="fi")s(c,true);}else{t.cssText="-webkit-opacity:0";if(t.webkitOpacity==0){i.onload=function(){s(c,i.width>0);};i.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";}else{i.onerror=function(){s(c,true);};i.src="about:blank";}}})();
;
﻿function externalLinks() {   
 if (!document.getElementsByTagName) return;   
 var anchors = document.getElementsByTagName("a");   
 for (var i=0; i<anchors.length; i++) {   
   var anchor = anchors[i];   
   if (anchor.getAttribute("href") &&   
       anchor.getAttribute("rel") == "external")   
     anchor.target = "_blank";   
 }   
}   
window.onload = externalLinks;;

