// Dropdowns
function menu(){
$("#nav a").removeAttr('title');
$("#nav ul ").css({display: "none"}); // Opera Fix
$("#nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

$(document).ready(function(){
	
	// Activate jCycle		
	$('#slides').cycle({ 
		fx:     'fade', // the transition effect, a complete effects list can be found at http://malsup.com/jquery/cycle/begin.html
		speed:  '300', // defines the number of milliseconds it will take to transition from one slide to the next
		timeout: 8000, // specifies how many milliseconds will elapse between the start of each transition
    	delay:  -2000, // lets you set the number of milliseconds to add to the timeout value for the first slide
		next:   '#nextarrow', // used to identify the element which should be the trigger next transition
		prev:   '#prevarrow' // used to identify the element which should be the trigger previous transition
	});
	
	// Activate PrettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', // fast/slow/normal
		padding: 40, // padding for each side of the picture
		opacity: 0.35, // Value betwee 0 and 1
		showTitle: true, // true/false
		counter_separator_label: '/', // The separator for the gallery counter 1 "of" 2
		theme: 'light_rounded', // light_rounded / dark_rounded / light_square / dark_square
		callback: function(){}
	});
	
	// Activate Curabitur gravida
	$("#twitter").tweet({
		join_text: "auto",
		username: "contempoinc", //Enter your twitter username here
		count: 1, //amount of tweets to display, one tweet is recommended
		loading_text: "loading tweets..."
	});
	
	// Ajax Submit
	// Full documentation on this can be found at http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
	$("#contactform").validationEngine({
		ajaxSubmit: true,
			ajaxSubmitFile: "../includes/ajaxSubmit.php", // form processing file
			ajaxSubmitMessage: "Thank you, we received your information!", // success message
		success :  false,
		failure : function() {}
	})
	
});