/*
	externalLinks()

	Function to open links to external sites in a new browser window
	(target attribute not allowed by XHTML 1.0 Strict)

	(c) SitePoint.com 2003
	(http://www.sitepoint.com/article/standards-compliant-world/)
	-----------------------------------------------------------------------
 */

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";
	}
}

jQuery.noConflict();

jQuery('document').ready(function() {
	externalLinks();
	
	jQuery('#background, #overlay').width(jQuery(window).width()+'px').height(jQuery(window).height()+'px');
	jQuery('#background img').width(jQuery(window).width()+'px');

	jQuery(window).resize(function() {
		jQuery('#background, #overlay').width(jQuery(window).width()+'px').height(jQuery(window).height()+'px');
		jQuery('#background img').width(jQuery(window).width()+'px');
	});

	Cufon.replace('#navigation ul a', { hover: true, fontFamily: 'Copperplate' });
	Cufon.replace('#content h2', { fontWeight: 'bold', fontFamily: 'Copperplate' });
	Cufon.replace('#content h3', { fontFamily: 'Copperplate' });
	Cufon.replace('h3.col', { fontFamily: 'Copperplate' });
	Cufon.replace('#summary h4', { fontFamily: 'Copperplate' });
	
	jQuery('ul.thumbs').loGallery();
	
	jQuery('.slides ul').smaugSlide({
		slideHeight: 400,
		//easing: 'easeOutBounce',
		pause: 3000,
		duration: 500,
		autoScroll: true
	});

	//Add the quotes to erm... the quotes
	jQuery('.quote').each(function() {
		jQuery(this).find('p:first').prepend('<span class="open">"</span>');
		jQuery(this).find('p:last').append('<span class="close">"</span>');
	}); 
});

jQuery(window).load(function () {
	if (jQuery('.gallery').length > 0) {
		jQuery('#page').scrollTo('#content', 1000, {
			axis: 'y',
			queue: true,
			easing:'swing'
		});
	}
});

