<!--
/* SVN FILE: $Id: external.js 3 2010-02-09 10:55:28Z Chris $ */
/**
 * A few initialisations
 *
 * Adds support opening absolute links in a new window with valid XHTML.
 * XHTML STRICT does not permit the target attribute in markup.
 * To allow markup to be valid yet open remote links in a new window or tab,
 * links specifying a protocol have their target attribute set to "_blank".
 * Works for http, https, and ftp protocols.
 * Tip: specify internal links as relative to have this behaviour for external
 * links only
 * 
 * Makes any element with the class "print" print the current page on click.
 * 
 * Adds the class "js" to the html element. This can be used in CSS/JavSCript to
 * prevent Flash Of Unstyled Content
 *
 * @copyright    Copyright 2008 PBM Web Development - All Rights Reserved
 * @package      js
 * @since        V1.0.0
 * @version      $Revision: 3 $
 */
 
// Support opening absolute links in a new window
jQuery(document).ready(function(){
	externals = jQuery('a[href^="http"],a[href^="ftp"]');
	externals.attr('target', "_blank");
	externals.attr('title', function(){return (this.title?this.title + ": ":"") + "Opens in a new tab or window";});

// Add printing to elements with class="print"	
	jQuery('.print').click(function(){window.print(); return false;});

// Add class="js" to html element; used to stop FOUC
	jQuery('html').addClass('js');
});
// -->
