//Start doc ready stuff
$(function() {

// Tool Tip
$('.projectPopup').qtip({
	position: 'topRight', // Set its position
	show: 'mouseover',
 	hide: 'mouseout'
});

//Body Content fadeIn
$("#site-wrapper").fadeIn(2000);

// jSroll Pane (Stylised Scroll Bar)
//$('#body-text').jScrollPane({scrollbarWidth: 5, showArrows:false});

// Gallery Popup (ColourBox)
$(".galleryPopup").colorbox({
iframe:true, 
width:640, 
height:510,
opacity:0.70
});

// Project Popup (ColourBox)
$(".projectPopup").colorbox({
iframe:true, 
width:860, 
height:540,
opacity:0.70
});

// Film Popup (ColourBox)
$(".filmPopup").colorbox({
iframe:true, 
width:800, 
height:420,
opacity:0.70
});

// Contact Popup (ColourBox)
$("#nav-contact a").colorbox({
iframe:true, 
width:404, 
height:390,
opacity:0.70
});

// AD Gallery
var galleries = $('.ad-gallery').adGallery();


// BG Slideshow

$('#bg-slideshow').cycle({ 
fx:     'scrollHorz',
speed:  1500, 
timeout: 2000,
pause: 1,
prev: '#left-arrow',
next: '#right-arrow',
fit: 'true'
});

// Arrows fadeIn

$("#left img").fadeTo("slow", 0);
$("#right img").fadeTo("slow", 0);
$("#left-arrow").hover(function(){$("#left img").fadeTo("slow", 1.0);
},function(){$("#left img").fadeTo("slow", 0);
});
$("#right-arrow").hover(function(){$("#right img").fadeTo("slow", 1.0);
},function(){$("#right img").fadeTo("slow", 0);
});

// Gallery Thumb Strip Hover
$("#gallery-thumbStrip").fadeTo("slow", 0);
$("#nav-gallery").hover(function(){$("#gallery-thumbStrip").fadeTo("fast", 1.0);
});
$("#bg-slideshow, #nav-clients, #nav-about, #nav-on-off, #nav-film, #nav-blog").hover(function(){$("#gallery-thumbStrip").fadeTo("fast", 0.0);
});

// Film Thumb Strip Hover
$("#film-thumbStrip").fadeTo("slow", 0);
$("#nav-film").hover(function(){$("#film-thumbStrip").fadeTo("fast", 1.0);
});
$("#bg-slideshow, #nav-clients, #nav-about, #nav-on-off, #nav-blog").hover(function(){$("#film-thumbStrip").fadeTo("fast", 0.0);
});

// # Replace
//$("#nav-gallery a").attr("href", "#");
//$("#nav-film a").attr("href", "#");			

//PNG FIX
$(document).pngFix(); 

// Fancybox Popups
$("a.popup").fancybox({
	'width': 500,
	'height': 350,
	'padding': 0,
	'autoScale': false,
	'transitionIn':'elastic',
	'transitionOut':'elastic',
	'overlayShow': true,
	'overlayOpacity': 0.8,
	'type': 'iframe',
	'onClosed': onFancyBoxClose
});	

	
});//end doc ready stuff
		
