$(document).ready(function() {

	/* 
	* attach a function to open all links with a class of "external" in a new window 
	* this avoids the use of target="_blank" and allows us to validate as XHTML strict
	*/
	$("a[rel^='external']").click( function() {
		window.open(this.href);
		return false;
	});

	/*
	* prevent ie from flickering with css backgrounds
	*/
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} catch(e) {} 

	/*
	* index slideshow
	*/
	if($("#indexSlideBlock > div").size() == 1 ){
		$('#indexSlideBlock div').show();
	} else {
		$('#indexSlideBlock').cycle({
			fx:         'fade',
			timeout:    10000, 
			speed:      400,
			pager:      '.slideNav'
		});
	}
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		overlay_gallery: false,
		social_tools: false,
		slideshow: false
	});
	
});
