/*
============================================================================
run these jQuery functions after page has fully loaded
============================================================================
*/


$(document).ready(function(){	
						   
	//apply PNG fix for IE6, uses 'jquery.pngFix.pack.js'
	$(document).pngFix(); 
	
	//random image as a background?
	//set images that can be chosen below
	//var randomImages = ['tileable-wood','tileable-brick','photo-a','photo-b'];
	//var randomImages = ['tileable-wood','tileable-brick'];
	//var rndNum = Math.floor(Math.random() * randomImages.length);
	//$("body").css({ backgroundImage: "url(/images/backgrounds-browser/" + randomImages[rndNum] + ".jpg)" });
	
	//homepage and picture frame (logo) fading images, uses 'jquery.innerfade.js'
	//waits 5 seconds for the first image and then 3 seconds for each one thereafter
	setTimeout(function(){
							$('.home-backgrounds').innerfade({
								speed: 1000,
								timeout: 3000,
								type: 'sequence', 
								containerheight: '508px'
							});
						},2000);
		
	$('#mini-frame-slide-show').innerfade({
		speed: 1000,
		timeout: 4000,
		type: 'sequence', 
		containerheight: '160px'
	});
	
	
	
	//gallery popups (lightbox style) for viewing larger images, uses 'jquery.fancybox-1.0.0.js'
	$(".thumbnail a, ul#thumbs li a").fancybox({
		'hideOnContentClick': true,
		'overlayShow': true,
		'overlayOpacity': 0.7,
		'imageScale': true,
		'zoomSpeedIn': 500,
		'zoomSpeedOut': 500,
		'padding':30
	});
	
	$("ul#videoList li a").fancybox({
		'hideOnContentClick': true,
		'frameWidth': 560,
		'frameHeight': 340,
		'overlayShow': true,
		'overlayOpacity': 0.7
	});
	
	//tooltips for the gallery page, uses 'jquery.tooltip.pack.js'		   
	$('.gallery-page li').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		fade: 250
	}); 

	$('#mini-frame a img').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		fade: 250
	});
	
	$('#newsletter-signup-button').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		fade: 250
	});
	
	
	
		
});