function navOver(i) {
	i.src = i.src.replace(".gif", "_o.gif");
}

function navOut(i) {
	i.src = i.src.replace("_o.gif",".gif");
}

function testSelected(rb) {
	if (rb.length==undefined)
		return rb.checked;	
	
	for (count=0;count<rb.length;count++) {
		if (rb[count].checked)
			return true;
	}
	return false;
}

// verifies that thee email address provided is correct.

var reEmail = /^.+\@.+\..+$/
var defaultEmptyOK = false


function isEmpty(s) { 
  return ((s == null) || (s.length == 0))
}


function isEmail (s){
  if (isEmpty(s)) 
    if (isEmail.arguments.length == 1) return defaultEmptyOK;
    else return (isEmail.arguments[1] == true);
    
  else {
    return reEmail.test(s)
  }
}

attachRollOverEvent = function(imageId){
	$(imageId).each( function() {
		$(this).fadeTo(1, 0.3);
		$(this).show();
	
		$(this).mouseover( function() { 
			$(this).fadeTo(300,1);
			} );

		$(this).mouseout( function() { 
			$(this).fadeTo(1,0.3);
			} );		
		
	} );
}

// page inititalisation

$(document).ready(function() {
	$('ul.sf-menu').superfish({
		speed:       'fast',
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
		autoArrows:  false,
		dropShadows: false,
		pathClass:  'current'   
	});	
	
	$('a.lightbox').fancybox();
	
	$('a.load-local').cluetip({local:true, cursor: 'pointer', tracking: true, positionBy:'mouse'});			
	
	attachRollOverEvent(".rollover");
	




	
});
