﻿$(document).ready(function() {
			//Activate FancyBox
			$("p#test1 a").fancybox({
				'hideOnContentClick': true
			});
			
			$("a#maps").fancybox({
                'frameWidth': 425, //frameWidth = Default width for iframed and inline content
                'frameHeight': 350 //frameHeight = Default height for iframed and inline content
    		});
    		
			$("a#box_gear").fancybox({
                'frameWidth': 425, //frameWidth = Default width for iframed and inline content
                'frameHeight': 400, //frameHeight = Default height for iframed and inline content
    			'hideOnContentClick': true
    		});
    		
    		$("a#box_itinerary").fancybox({
                'frameWidth': 425, //frameWidth = Default width for iframed and inline content
                'frameHeight': 400, //frameHeight = Default height for iframed and inline content
    			'hideOnContentClick': true
    		});

   	 		$("a#box_small, a#box_small1, a#box_small2, a#box_small3, a#box_small4, a#box_small5, a#box_small6, a#box_small7, a#box_small8, a#box_small9, a#box_small10,").fancybox({
                'frameWidth': 480, //frameWidth = Default width for iframed and inline content
                'frameHeight': 580 //frameHeight = Default height for iframed and inline content
    		});
    		
			$("p#test2 a").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0, 
				'overlayShow':	true
			});
			
			$("a#custom_1").fancybox({
				'itemLoadCallback': getGroupItems
			});
			
			$("a#custom_2, a#custom_3").fancybox({
				'zoomSpeedIn':	0, 
				'zoomSpeedOut':	0
			});
			
			//Some lines for this page
			$("div#donate").bind("click", function() {
				$("#donate_form").submit()
			});
			
			$("#comment_form").attr("action", "/fancy/add_comment"); $("#age").val('fancy'); //die spamers, die...
		});

		//List can contain mixed media too
		//Parameter "o" ir optional and used to override settings, example: {url: "http://www.google.com", title: false,  o: {'frameWidth': 200} }
		var imageList = [
			{url: "/img/examples/6_b.jpg", title: "First image"},
			{url: "/img/examples/7_b.jpg", title: "Second image"},
			{url: "/img/examples/8_b.jpg", title: "Third image"}
		];
		
		function getGroupItems(opts) {
			jQuery.each(imageList, function(i, val) {
		        opts.itemArray.push(val);
		    });
		}
