/**
 *  --------------------------------------------------------------------------------------
 *  Navigator Scripts
 *  ----------------------------------------------------
 *  Modified	June 1st, 2009 by Chris
 *  @version	1.0
 *  @author	Chris Satterthwaite <Chris@navigatormm.com>
 *  ----------------------------------------------------
 *  1.DETECT NAVIGATION ON STATE SCRIPT	
 *  --------------------------------------------------------------------------------------
 */
 
/* DETECT NAVIGATION ON STATE SCRIPT
--------------------------------------------------------------------------------------- */
$(document).ready(function(){
	var url = location.pathname.substring(1);
	var path = url.split("/");
	path.shift();
	if(path.length>1){
		path.pop();
		path='/'+path.join('/')+'/';
	}
	else path=path[0];

	if ( path ) {
		$('#navigation li a[href*="' + path + '"]').addClass('selected');
	} else if (url) {
		$('#navigation li a[href*="' + url + '"]').addClass('selected');
	} else {
		$('.home a').addClass('selected');
	}

/* Fancybox
--------------------------------------------------------------------------------------- */

	$(".video_cta").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
	});

});
