<!--
//<![CDATA[
var selectdd_text = "-- select --";

$(document).ready( function() {
	
	$(".datatable").hide();
	$("div.dtheader h3 a").click(function() {
			$(this).parent().toggleClass("on");
			$("table[summary='"+$(this).attr("rel")+"']").parent().slideToggle("slow");
			return false;
	});
	
	$("div.dtheader h3 a:lt(1)").trigger("click");

	$(".datatable table").each(function() {
		$(this).find("tr:last th, tr:last td").addClass("noborder");
	});
	
	$("#openAll").click(function() {
								 $("div.dtheader h3").removeClass("on").addClass("on");
								 $("div.datatable").slideDown("slow");
								 });
	
	$("#closeAll").click(function() {
								 $("div.dtheader h3").removeClass("on");
								 $("div.datatable").slideUp("slow");
								 });
	
	
		var swapImages = '';
	
		// Attach swap behaviours
		$(".thumbimg a").each( function() {
			swapImages += $(this).attr("rel")+',';
		}).click( function() { 
			
			var displaySrc = $("#mainimg img").attr("src");
			var tempThumb = $("#mainimg img").attr("lowsrc");
			var tempAlt = $("#mainimg img").attr("alt");
			
			var swapSrc = $(this).attr("rel");
			var swapThumb = $(this).find("img").attr("src");
			var swapAlt = $(this).find("img").attr("alt");
			
			$("#mainimg img").attr("src", swapSrc);
			$("#mainimg img").attr("lowsrc", swapThumb);
			$("#mainimg img").attr("alt", swapAlt);
			
			$(this).attr("rel", displaySrc);
			$(this).find("img").attr("src", tempThumb);
			$(this).find("img").attr("alt", tempAlt);
			
			return false;
		});
		
		
		// Preload Images
		// ----------------------------------
		swapImages += $("#mainimg img").attr("lowsrc");
		
		var arrSwapImages = new Array();
		arrSwapImages = swapImages.split(",");
		
		//$.preloadImages(arrSwapImages);
		
		
		// Download table
		$(".attachments tr td").hover(
				function() {
					
					$(this).parent().find("td").addClass("on");
					
					$(this).parent().find("td img").each(function() {
							var replacement = $(this).attr("src").replace(/\.([^.]+)$/i,"_on.$1");
							$(this).attr("src", replacement);
					});
					
				},
				function () {
					
					$(this).parent().find("td").removeClass("on");
					
					$(this).parent().find("td img").each(function() {
							$(this).attr("src", $(this).attr("lowsrc"));
					});
					
				}).click(function() { location.href=$(this).parent().find("a").attr("href");});
		
		$(".attachments tr:last td").addClass("last");
		
	
});


//]]>
-->	
