(function($){			// -------------------------------------------------------------------------------------------------------	// Form Validation script - used by the Contact Form script	// -------------------------------------------------------------------------------------------------------		function validateMyAjaxInputs() {		$.validity.start();		// Validator methods go here:		$("#name").require();		$("#email").require().match("email");		$("#subject").require();			// End the validation session:		var result = $.validity.end();		return result.valid;	}		// -------------------------------------------------------------------------------------------------------	// Form Clear	// -------------------------------------------------------------------------------------------------------		$.fn.clearForm = function() {		return this.each(function() {		var type = this.type, tag = this.tagName.toLowerCase();		if (tag == 'form')		return $(':input',this).clearForm();		if (type == 'text' || type == 'password' || tag == 'textarea')		this.value = '';		else if (type == 'checkbox' || type == 'radio')		this.checked = false;		else if (tag == 'select')		this.selectedIndex = -1;		});	};	$(document).ready(function(){	//////////////////////////////////////////////////////////////////////////////////////////////////////////////						   				// -------------------------------------------------------------------------------------------------------		// Dropdown Menu		// -------------------------------------------------------------------------------------------------------				$("ul#dropdown-menu li").hover(function () {							 			$(this).addClass("hover");			$('ul:first', this).css({visibility: "visible",display: "none"}).slideDown(200);		}, function () {			$(this).removeClass("hover");			$('ul:first', this).css({visibility: "hidden"});		});				if ( ! ( $.browser.msie && ($.browser.version == 6) ) ){			$("ul#dropdown-menu li ul li:has(ul)").find("a:first").addClass("arrow");		}										// -------------------------------------------------------------------------------------------------------		// Contact Form 		// -------------------------------------------------------------------------------------------------------				$("#contact-form").submit(function () {														if (validateMyAjaxInputs()) { //  procced only if form has been validated ok with validity				var str = $(this).serialize();				$.ajax({					type: "POST",					url: "_layout/php/send.php",					data: str,					success: function (msg) {						$("#formstatus").ajaxComplete(function (event, request, settings) {							if (msg == 'OK') { // Message Sent? Show the 'Thank You' message								result = '<div class="successmsg">Message envoyé, merci!</div>';								$('#contact-form').clearForm();							} else {								result = msg;							}							$(this).html(result);						});					}						});				return false;			}		});				// -------------------------------------------------------------------------------------------------------		// Portfolio options fade 		// -------------------------------------------------------------------------------------------------------				$('.preview-options').css('opacity', '0');		$('.portfolio-item-preview').hover(			function () {				$(this).find('.preview-options').stop().fadeTo(400, 0.7);			}, function () {				$(this).find('.preview-options').stop().fadeTo(200, 0);			}		);				// -------------------------------------------------------------------------------------------------------		// Slider navigation fade 		// -------------------------------------------------------------------------------------------------------				$('#slideshow-index, #slideshow-portfolio').hover(		function () {			$(this).find('.slider-nav').stop().fadeTo(300, 1);		}, function () {			$(this).find('.slider-nav').stop().fadeTo(300, 0);		});		// -------------------------------------------------------------------------------------------------------		// Animate social media links		// -------------------------------------------------------------------------------------------------------				$("#social-media li").hover(function () {			$(this).stop().animate({				paddingTop: "0px"			}, 100);		}, function () {			$(this).stop().animate({				paddingTop: "3px"			}, 100);		});	//////////////////////////////////////////////////////////////////////////////////////////////////////////////		});	})(window.jQuery);	// non jQuery scripts below
