$(document).ready(function(){
	// Display Tweet(s)					   
	$(".tweet").tweet({
		join_text: "auto",
		username: "ulladullaweb",
		avatar_size: 0,
		count: 1,
		auto_join_text_default: "we said,",
		auto_join_text_ed: "we",
		auto_join_text_ing: "we were",
		auto_join_text_reply: "we replied to",
		auto_join_text_url: "we were checking out",
		loading_text: "loading tweets..."
	});
	// Smooth Scrolling of all Anchor links
	$.localScroll();
	// Thumbnail Captions
	$('img.captify').captify({
		// all of these options are... optional
		// ---
		// speed of the mouseover effect
		speedOver: 'fast',
		// speed of the mouseout effect
		speedOut: 'fast',
		// how long to delay the hiding of the caption after mouseout (ms)
		hideDelay: 0,	
		// 'fade', 'slide', 'always-on'
		animation: 'slide',		
		// text/html to be placed at the beginning of every caption
		prefix: '',		
		// opacity of the caption on mouse over
		opacity: '0.7',					
		// the name of the CSS class to apply to the caption box
		className: 'caption-bottom',	
		// position of the caption (top or bottom)
		position: 'bottom',
		// caption span % of the image
		spanWidth: '100%'
	});
	// Fancybox lightbox Popups
	$("a.fancyBox").fancybox({
		'zoomOpacity':	true,
		'zoomSpeedIn':	500, 
		'zoomSpeedOut':	500, 
		'overlayOpacity': 0.75
	});
});
// form validation and ajax submitter.
jQuery(function() {
		// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="images/contact/loader.gif" alt="loading..." /></div>')
			.css({position: "relative", top: "0px", left: "0px"})
			.appendTo("#formConfirmation")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#contact").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#formConfirmation"
				});
			}
		});
	});