window.addEvent('domready', function(){
	
	//initialise datepicker input fields
	$$('input.DatePicker').each(function(el){
		new DatePicker(el);
	});


	//shadowbox initialisation
	var options = {
		assetURL: '/global/shadowbox-1.0-code/',
		flvPlayer: 'mediaplayer.swf',
		resizeLgImages: true
	};
	Shadowbox.init(options);


	//these enables the hover effects not normally supported in earlier IE
	$$('#header .nav li').each(function(el){
		el.addEvents({
			'mouseover':function() {
				el.addClass('hover');
			},
			'mouseout':function() {
				el.removeClass('hover');
			}
		});
	});
	
	//Activate sIFR throughout the page
	//sIFR.activate(hermes,hermesthin);
	
	
	//Help with nicer alignment of checkboxes - move this into CSS instead of JS
	//$$('input[type="checkbox"]').setStyle('vertical-align','text-bottom');
	//$$('input[type="radio"]').setStyle('vertical-align','text-bottom');


	//handle image rollovers
	$$('img.rollover').each(function(img) {
		var src = img.getProperty('src');
		var extension = src.substring(src.lastIndexOf('.'),src.length)
		img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_o' + extension)); });
		img.addEvent('mouseleave', function() { img.setProperty('src',src); });
	});
	$$('input.rollover').each(function(img) {
		var src = img.getProperty('src');
		var extension = src.substring(src.lastIndexOf('.'),src.length)
		img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_o' + extension)); });
		img.addEvent('mouseleave', function() { img.setProperty('src',src); });
	});


});



function openWindow(pageURL) {
	dlg = window.open (pageURL ,"_blank", "width=820,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	if (window.focus) { dlg.focus() }
	return false;
}

