// JavaScript Document

// hover fix for IE 6

sfHover = function(){
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for(var i=0; i<sfEls.length; i++){
		sfEls[i].onmouseover=function(){
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function(){
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

$(document).ready(function(){
	// Hide all records except the first
	$(".record").not(':first').hide();

	// Setup handler to fade in each record when the recordlink is clicked.
	$(".recordlink").click(
		function(e){
			var idField = $(this).attr('id');
			var idNum = 0;
			if (idField.match(/(\d+)$/))
			{
				idNum = RegExp.$1;
			}
				
			$('.record').hide();
			$('#record_'+idNum).fadeIn("slow");
			e.stopPropagation();
			return false;
		}
	);

	// Apply date picker if loaded
	if (typeof jQuery.fn.datepicker == 'function')
		$('input.selectdate').datepicker({dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '/skin/images/icon-calendar.gif', buttonImageOnly: true});
});

function RunMainFlash() // Main
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="970" height="200">\n');
	document.write('<param name="movie" value="/skin/flash/main.swf" />\n');
	document.write('<PARAM NAME="wmode" VALUE="transparent">\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="/skin/flash/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="970" height="200" wmode="transparent"></embed>\n');
	document.write('</object>\n');
}
