/**
 * @author ziyad * @date 
 */
$(document).ready(function() {

    $('.adsBig').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});


	$("a[rel=club_pics]").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
			}
		});

	$("a[rel=facility_pics]").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
			}
		});

	$("#friend").fancybox({
		'scrolling'		: 'no',
		'titleShow'		: false,
		'width'			: 700,
		'onClosed'		: function() {
		    $("#friend_error").hide();
		}
	});
	
	$("#friend_form").bind("submit", function() {
	
		if ($("#yourname").val().length < 1 || $("#youremail").val().length < 1 || $("#yourFname").val().length < 1 || $("#yourFemail").val().length < 1) {
		    $("#friend_error").show();
		    $.fancybox.resize();
		    return false;
		}
	
		$.fancybox.showActivity();
	
		$.ajax({
			type	: "POST",
			cache	: false,
			url		: "sendfriend.php",
			data	: $(this).serializeArray(),
			success: function(data) {
				$.fancybox(data);
			    $.fancybox.resize();
			}
		});
	
		return false;
	});


});


