// JavaScript Document
var togglediv_height = "56px";

$(document).ready(function(){
if ( $("#mycarousel-left").length > 0 ) {
						   
	$('#mycarousel-left').jcarousel({
			vertical: true,
			animation: 'slow',
			scroll: 3,
			wrap: 'both'
		});
}

if ( $("#mycarousel-right").length > 0 ) {
	$('#mycarousel-right').jcarousel({
			vertical: true,
			animation: 'slow',
			scroll: 3,
			auto: 10,
			wrap: 'both'
		});	
}

if ( $("#form_apply").length > 0 ) {
	
	$(".contact_co").hide();
	
	$(".a_contact").click(function() { $(".contact_co").slideToggle('fast'); });
	
	//$('label.required').append('&nbsp;<strong>*</strong>&nbsp;');
	$("#form_apply").validate();
}

$('span.mailme').each(function(){
							
   // check for email address in the format info at biopages dot com dot au and replaces 
   // it with the right syntax. Must have a unique id for multiple emails per page. 
	
	var spt = "#" + $(this).attr("id");
	
	var at = / at /;
	var dot = / dot /g;
	var addr = $(spt).text().replace(at,"@").replace(dot,".");
	$(spt).after('<a href="mailto:'+addr+'" title="Send an email">'+ addr +'</a>')
	.hover(function(){window.status="Send an e-mail!";}, function(){window.status="";});
	$(spt).remove();
});

$(".togglediv").click( function() 
{	
	var toggle = $(this).attr("id"); 
	
	if ($("#" + toggle).css("height") == togglediv_height) 
	{   
		$("#" + toggle).css("height", "auto"); 
	} else { 
		$("#" + toggle).css("height", togglediv_height);
	}
								
}); 
if ( $("#image_gal").length > 0 ) {
	$("#thumbnail li a").click(function(){
		$("#large img").hide().attr({"src": $(this).attr("href"), "title": $("> img", this).attr("title")});
		//$("#large h2").html($("> img", this).attr("title"));
		return false;
	});
	$("#large>img").load(function(){$("#large>img:hidden").fadeIn("slow")});
}


//end of doc 						   

});