	
	$(document).ready(function(){

		//Gallery lightbox
		$("a.imagelink").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'overlayColor'		: '#541800;',
			'overlayOpacity'	: '0.5',
			'titleShow'			: false
		});		
		
		$(".inline").fancybox({
			'width'				: '85%',
			'height'			: '85%',
	        'autoScale'     	: false,
			'titleShow'			: false,
	        'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'overlayColor'		: '#541800;',
			'overlayOpacity'	: '0.5',
			'type'				: 'iframe'
		});
		
		$(".iframe2").fancybox({
			'width'				: 970,
			'height'			: 510,
			'autoScale'     	: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'type'				: 'iframe',
			'titlePosition' 	: 'inside',
			'overlayOpacity'	: 0.7,
			'overlayColor'		: '#000'
		});


			
		$('#mainfade').innerfade({ 
			animationtype: 'fade', 
			speed: 750, 
			timeout: 4000, 
			type: 'sequence', 
			containerheight: '258px' 
			}); 
		$('#smallfade').innerfade({ 
			animationtype: 'fade', 
			speed: 750, 
			timeout: 4000, 
			type: 'sequence', 
			containerheight: '235px' 
			}); 
		$('#testfade').innerfade({ 
			animationtype: 'fade', 
			speed: 'fast', 
			timeout: 8000, 
			type: 'sequence', 
			containerheight: '250px' 
			});
		
		
		
		// rel external js
		
		function externalLinks() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") &&
		   anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
		}
		}
		//window.onload = externalLinks;	
		
		$(document).ready(function() {
			externalLinks();
		})


		

	});
