// Title:	C & M Productions - javascript
// Author:	Kalon Edser, http://www.kalonedser.com/
// Updated:	10 December 2008

jQuery(document).ready(function() {
	
	$('body').addClass('js');
	
	// global
	var animationSpeed = 2500;
	
	// hide elements initially
	var loadElements = $('.hide');
	$(loadElements).hide();
	
	// fix png images with alpha channels
	$.ifixpng('../img/pixel.gif');
	$('.png').ifixpng();
	
	// open new window for external links
	$('A[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
    
    // window scroll effect for anchor links
	$.localScroll({hash:true});

	// preload images
	// $.preloadImages('../img/prettyPhoto/loader.gif');

	// inline photo viewer
	$("a[rel^='prettyOverlay'],a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/' /* The separator for the gallery counter 1 "of" 2 */
	});

	// run events after all resources are loaded
	$(window).load(function() {

		// show hidden elements
		$(loadElements).fadeIn(animationSpeed);

	});

});
