;(function($) {
	$.fn.slideshow = function(settings) {
	var config = {
	timeout: 8000,
	speed: 1500
};
this.each(function() {
	var $elem = $(this);
	$elem.children().eq(0).appendTo($elem).show();
	setInterval(function() {
	$elem.children().eq(0)
	.hide().appendTo($elem)
	.fadeIn(config.speed)
	}, config.timeout);
});
	return this;
	};
})(jQuery);

$(function() {
	$('.slideshow').slideshow({ timeout: 7000, speed: 1500 });
});

$(function() {          
  $(".portfolio img").lazyload({
     effect      : "fadeIn"
  });
});

$(function() {          
	$("a[href^='http']").attr('target','_blank');
});

$(document).ready(function() {
	$("article aside div a").fancybox();
});


jQuery(function() { 
	var options = { 
		target: '#alert'
	}; 
	$('#contactForm').ajaxForm(options);
}); 
	
$.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;
	});
};	