jQuery(document).ready(function() {

	/*
	*   Examples - images
	*/




	$("#videosnow,#videosnow2,#videosky,#videosky2,#videosky3,#videokarosta,#videofriend,#videofriend2,#videohongkong,#videohongkong2,#videohomo,#videohomo2,#videoeasy,#videoreturn").click(function() {
		$.fancybox({
			'centerOnScroll': true,
			'padding'		: 0,
			'overlayColor'	: '#000',
			'overlayOpacity': '0.5',
			'transitionIn'	: 'fade',
			'transitionOut'	: 'fade',

			'autoScale'		: false,
			'title'			: this.title,
			'width'			: 640,
			'height'		: 390,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

		return false;
	});
	
	
	
	
	$("#inlinestart,#inlinesnow,#inlinesnow2,#inlinesky,#inlinesky2,#inlinesky3,#inlinekarosta,#inlinefriend,#inlinefriend2").fancybox({
		'autoScale'			: false,
		'autoDimensions'	: false,
		'width'				: '400',
		'height'			: '250',
		'centerOnScroll'	: true,
		'overlayColor'		: '#000',
		'overlayOpacity'	: '0.5',
		'padding'			: 30,
		'type'				: 'inline'
	});
	
	
	
	$("#iframefilmeasy").fancybox({

        'autoScale'     	: false,
        'padding'			: 0,
        'width'				: 640,
		'height'			: 390,
		'type'				: 'iframe',
		'overlayColor'		: '#000',
		'overlayOpacity'	: '0.5',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'centerOnScroll'	: true
	});
	
	
	/*
	*   Meins ENDE
	*/	
	
	
	
	
	$("a#example2").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack'
	});
	
	$("a#example3").fancybox({
	    'titleShow'     : false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none'
	});
	
	$("a#example4").fancybox();
	
	$("a#example5").fancybox({
		'titlePosition'  : 'inside'
	});
	
	$("a#example6").fancybox({
		'titlePosition'  : 'over'
	});
	
	$("a[rel=example_group]").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>';
		}
	});
	
	/*
	*   Examples - various
	*/
	
	$("#various1").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	

	$("#various2").fancybox({
		'type'				: 'ajax',
		'hideOnContentClick': true,
		'centerOnScroll'	: true,
		'autoScale'			: false,
		'width'				: 500,
		        'height'			: 400,
		        'autoDimensions'	: 'false'
	});

	
	
	
	
	$("#various3").fancybox({
		ajax : {
		    type	: "POST",
		    data	: 'mydata=test',
		    'autoScale'			: false,
		    'width'	: 500
		}
	});

	$("#various4").fancybox({
		ajax : {
		    type	: "POST"
		}
	});
			
			
			
			
			
			
	/*
	*   MEINS ANFANG
	*/
			
		
	$("a#bild1,a#bild2").fancybox({
		'titleShow'     	: false,
		'padding'			: 20,
		'overlayColor'		: '#000',
		'overlayOpacity'	: '0.5',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'hideOnContentClick': true,
		'centerOnScroll'	: true
	});

	
	
	$("#iframegross").fancybox({

        'autoScale'     	: false,
        'padding'			: 0,
        'height'			: 500,
        'width'				: 580,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayColor'		: '#fff',
		'overlayOpacity'	: '0.5',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'scrolling' 		: 'auto',
		'centerOnScroll'	: true
	});		
	
	$("#iframe1,#iframe2,#iframe3,#iframe4,#iframe5,#iframe6,#iframe7,#iframe8,#iframe9,").fancybox({

        'autoScale'     	: false,
        'padding'			: 0,
        'height'			: 490,
        'width'				: 580,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayColor'		: '#fff',
		'overlayOpacity'	: '0.5',
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'scrolling' 		: 'auto',
		'centerOnScroll'	: true
	});
	
		/*
	*   MEINS ENDE
	*/
	
	
	
	
	
	
	
	
	$("#various6").fancybox({
	    'padding'           : 0,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	
	$("#various7").fancybox({
		onStart		:	function() {
			return window.confirm('Continue?');
		},
		onCancel	:	function() {
			alert('Canceled!');
		},
		onComplete	:	function() {
            alert('Completed!');
		},
		onCleanup	:	function() {
            return window.confirm('Close?');
		},
		onClosed	:	function() {
            alert('Closed!');
		}
	});
	
	$("#various8, #various9").fancybox();
	
	/*
	*   Examples - manual call
	*/

	$("#manual1").click(function() {
		$.fancybox({
			//'orig'			: $(this),
			'padding'		: 0,
			'href'			: 'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
			'title'   		: 'Lorem ipsum dolor sit amet',
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic'
		});
    });
    
    $("#manual2").click(function() {
		$.fancybox([
			'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
			'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
			{
				'href'	: 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
				'title'	: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
			}
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
			'changeFade'        : 0
		});
	});
			
	/*
	*   Tips & Tricks
	*/
	
	$("#tip3").fancybox({
	    'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'titlePosition'	: 'over',
		'onComplete'	: function() {
			$("#fancybox-wrap").hover(function() {
				$("#fancybox-title").show();
			}, function() {
				$("#fancybox-title").hide();
			});
		}
	});




    $("#tip5").fancybox({
		'scrolling' : 'no',
		'titleShow'	: false,
		'onClosed'	: function() {
		    $("#login_error").hide();
		}
	});
    
	$("#login_form").bind("submit", function() {
	
	    if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) {
	        $("#login_error").show();
	        $.fancybox.resize();
	        return false;
	    }
	    
	    $.fancybox.showActivity();

		$.ajax({
			type	: "POST",
			cache	: false,
			url		: "/data/login.php",
			data	: $(this).serializeArray(),
			success: function(data) {
				$.fancybox(data);
			}
		});

		return false;
	});
	
	$("#tip6").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoScale'     	: false,
		'type'				: 'iframe',
		'width'				: 500,
		'height'			: 500,
		'scrolling'   		: 'no'
	});
	
	/*
	*   Donate link
	*/
	$("a#donate").bind("click", function() {
		$("#donate_form").submit();
		return false;
	});

	/*
	*   Zebra-stripping table
	*/
	
	$("table.options tr:nth-child(even)").addClass('even');

});
