$(document).ready(function(){
	
	// Initialise nav menu
	$(".nav").superfish({
		pathClass : 'current',
		animation : {opacity:'show'},
		delay : 1000
	});
	
	// initialise subnav
	$("#subnav li:first-child").addClass("current");
	$(".subnavcontent h2").hide();
	$(".subnavcontent:gt(0)").hide();
	$("#subnav a").click(function() {
		$("#subnav li").removeClass("current");
		$(".subnavcontent").hide();
		$(this).parent().addClass("current");
		$(this.hash).show();
		this.blur();
		return false;
	});
	
	// initialise section image animation
	$("#images").cycle();
		
	// Stripe tables
	$("tr:nth-child(odd)").addClass("odd");
	
	// Initialise contact form validation
	$("#contactform").validate({
		rules: {
			// first name
			name: { required: true },
			// last name
			"cm-f-105880": {required: true },
			// email
			"cm-246472-246472": { required: true, email: true },
			// organisation
			"cm-f-105719": { required: true },
			// position
                        "cm-f-105720": { required: true },
			// country
			"cm-f-105721": { required: true }
		}
	});
});
