
// FancyBox Functions

jQuery(document).ready(function() {
	
var preventClick=false;

	$("a.image").fancybox({
	        'type'				: 'image',
	        'transitionIn'		: 'fade',
			'transitionOut'		: 'elastic',
			'autoScale'			: false,
			'titleShow'			: true,
			'titlePosition'		: 'over',
			'centerOnScroll'	: false,
			'speedIn' 			: 150,
			'speedOut'			: 150,
			'zoomSpeedIn'		: 300,
			'zoomSpeedOut'		: 300,
			'overlayShow'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: "#000000"
	});
	
	$("a.iframe").each(function(){  
		var dWidth  = parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=',''));  
		var dHeight     =  parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=',''));  
	$(this).fancybox({  
			'type'				: 'iframe',
	        'transitionIn'		: 'fade',
			'transitionOut'		: 'elastic',
			'autoScale'			: false,
			'titleShow'			: false,
			'centerOnScroll'	: false,
			'speedIn' 			: 150,
			'speedOut'			: 150,
			'zoomSpeedIn'		: 300,
			'zoomSpeedOut'		: 300,
			'overlayShow'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: "#000000",
			'width'				: dWidth,  
			'height'			: dHeight,
		});  
	});

	$("a.youtube").click(function() {
		$.fancybox({
			'type'				: 'swf',
			'transitionIn'		: 'fade',
			'transitionOut'		: 'elastic',
			'autoScale'			: false,
			'titleShow'			: false,
		   	'centerOnScroll'	: false,
			'speedIn' 			: 150,
			'speedOut'			: 150,
			'zoomSpeedIn'		: 300,
			'zoomSpeedOut'		: 300,
			'overlayShow'		: true,
			'overlayOpacity'	: 0.8,
			'overlayColor'		: "#000000",
			'autoScale'			: false,
			'width'				: 680,
			'height'			: 407,
			'href'				: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'swf'				: {
			    'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

		return false;
	});

// Force FancyBox on hash

if(location.hash.indexOf('#popup-')!=-1)

{
	$(location.hash+' a.image').click();
	$(location.hash+' a.iframe').click();
	$(location.hash+' a.youtube').click();
}

});
	
// Drop Down Site Switcher

	function loadPage(list) {
		location.href=list.options[list.selectedIndex].value
	}

// Generic Window Pop

	function PopWin(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}

// Clickable News List

$(document).ready(function(){
						   
	$(".news-list li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});

}); 
