// all scripts for okdinghy.co.nz used on most pages, some scripts only applying to indiviual pages are still inline on the pages

/*
<!-- #bbinclude "filestatps.pl" -->
                        Filename:     nzokda.js
                        Filesize:     3397 Byte
                        Last update:  05-Dec-2011 16:15 +1300
                        By:           Peter Scheuerl peter@scheuerl.net
<!-- end bbinclude -->
*/

// Script library: jQuery
  
$(document).ready(function(){

    // slide boxes open/close  
    // foldingcontainer shall be parent of foldingblock (element to fold/slide); foldingicon shall be descendant of foldingcontainer and is the trigger 

    $('.foldingicon').click(function(){ 
        $(this).closest('.foldingcontainer').children('.foldingblock').slideToggle('slow');
    });


// fancybox for image galleries
    $("a.gallery").fancybox({
      //  'autoScale'			: false, This would display the full image size, even if bigger than viewport
        'transitionIn'		: 'elastic',
        'transitionOut'		: 'elastic',
        'titlePosition' 	: 'inside',
        'opacity'           : 'true',
        'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-inside">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });

/* This is for any single image with class 'overlayimage' */
	
	$("a.overlayimage").fancybox({
     //   'autoScale'			: false, 
        'transitionIn'		: 'elastic',
        'transitionOut'		: 'elastic',
        'titlePosition' 	: 'inside',
        'opacity'           : 'true',
        'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
        return '<span id="fancybox-title-inside">' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });
	


}); // End jQuery(document).ready(function($)



