$(document).ready(function(){

	// $("a[rel^='prettyPhoto']").prettyPhoto({
	// 	theme: 'light_square', // light_rounded / dark_rounded / light_square / dark_square / facebook 
	// 	overlay_gallery: false,
	// 	showTitle: false,
	// 	opacity: 0.5,
	// 	animationSpeed: 'fast',
	// 	default_width: 700
	// });
	
	// $(".gallery-icon a").prettyPhoto({
	// 	theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
	// 	overlay_gallery: true,
	// 	showTitle: false,
	// 	opacity: 0.5,
	// 	animationSpeed: 'fast',
	// 	default_width: 700
	// });

	$("dt.gallery-icon>a").attr('rel','prettyPhoto[pp_gal]');
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'fast', /* fast/slow/normal */
		slideshow: 5000, /* false OR interval time in ms */
		autoplay_slideshow: false, /* true/false */
		opacity: 0.50, /* Value between 0 and 1 */
		show_title: false, /* true/false */
		allow_resize: true, /* Resize the photos bigger than viewport. true/false */
		default_width: 700,
		default_height: 450,
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
		horizontal_padding: 20, /* The padding on each side of the picture */
		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
		wmode: 'opaque', /* Set the flash wmode attribute */
		autoplay: true, /* Automatically start videos: True/False */
		modal: false, /* If set to true, only the close button will close the window */
		deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
		overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
		keyboard_shortcuts: true /* Set to false if you open forms inside prettyPhoto */
	});



	$("span.mailme").each(function(){
		   var spt = $(this);
		   var addr = $(spt).text().replace(" (at) ","@").replace(" dot ",".");
		   $(spt).after('<a href="mailto:'+addr+'">'+ addr +'</a>')
		   $(spt).remove();
	});

	$("h2.wings").wrapInner("<span>");

	$("a[rel^='blank']").attr("target","_blank");

	$(".ie7 br.clear, .ie6 br.clear").each(function(){
		$(this).after('<div class="clear"></div>');
		$(this).remove();
	});

});
