// JavaScript Document
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'fast', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.35, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});
	$('.portfolio-thumb').hover(function(){
		$(this).children('img').stop().fadeTo("fast", 0.5); 
	}, function(){
		$(this).children('img').stop().fadeTo("fast", 1); 		
	});
	$('.sixtymins').hover(function(){
		$(this).children('img').stop().fadeTo("fast", 0.85); 
	}, function(){
		$(this).children('img').stop().fadeTo("fast", 1); 		
	});
	// this highlights the current page in the nav menu using a class.
	// the class should be inside the div that wraps the H2.pagetitle
	if ( $('.research-page').length ) {
		$('#topMenu li a.research').toggleClass('research-selected');
	}
	if ( $('.media-outreach-page').length ) {
		$('#topMenu li a.media-outreach').toggleClass('media-outreach-selected');
	}
	if ( $('.advertising-page').length ) {
		$('#topMenu li a.advertising').toggleClass('advertising-selected');
	}
	if ( $('.awards-page').length ) {
		$('#topMenu li a.awards').toggleClass('awards-selected');
	}
	if ( $('.case-studies-page').length ) {
		$('#topMenu li a.case-studies').toggleClass('case-studies-selected');
	}
	if ( $('.media-training-page').length ) {
		$('#topMenu li a.media-training').toggleClass('media-training-selected');
	}
	if ( $('.contact-us-page').length ) {
		$('#topMenu li a.contact').toggleClass('contact-selected');
	}
	if ( $('.home-page').length ) {
		$('#topMenu li a.home').toggleClass('home-selected');
	}
});