	
	$(document).ready(function(){

		//Gallery lightbox
		$("a.imagelink").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'overlayColor'		: '#0b2244',
			'overlayOpacity'	: '0.5',
			'titleShow'			: false
		});		

		$("a[rel=example_group]").fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'titlePosition' 	: 'over',
			'titleShow'			: false
		});

		
		$(".inline").fancybox({
			'width'				: '75%',
			'height'			: '75%',
	        'autoScale'     	: false,
	        'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
	

		
		//zoom-map
		$("#wrap").anythingZoomer({
	    	
		      expansionSize: 100,      // How far outside the wrap edges the mouse can go
		      speedMultiplier: 1.4,   // How much faster in the inside area moves than the mouse
		      
		      smallArea: "#small",    // Overrides small area ID
		      largeArea: "#large",    // Overrides large area ID
		      zoomPort: "#overlay",   // Overrides zoom overlay area ID
		      mover: "#mover"         // Overrides mover ID
		    	
		});



		//Hide the toggle container on load
		$(".dropdown").hide(); 

		//Switch the "Open" and "Close" state per click
		$(".trigger").toggle(function(){
			$(this).addClass("active");
			}, function () {
			$(this).removeClass("active");
		});

		//Slide up and down on click
		$(".trigger").click(function(){
			$(".dropdown").slideToggle("slow");
		});
		
		//Switch the "Open" and "Close" state per click
		$(".triggeralt").toggle(function(){
			$(this).addClass("activealt");
			}, function () {
			$(this).removeClass("activealt");
		});

		//Slide up and down on click
		$(".triggeralt").click(function(){
			$(".dropdown").slideToggle("slow");
		});


		//call to scroll to top JS
			
		$().UItoTop({ easingType: 'easeOutQuart' });		


		//$(document).ready(function() {
			//$('.backtotop').click(function(){
				//$('html, body').animate({scrollTop:0}, 'slow'); return false; 
				//});
		//})
		
		$('#mainfade').innerfade({ 
			animationtype: 'fade', 
			speed: 750, 
			timeout: 4000, 
			type: 'sequence', 
			containerheight: '260px' 
			}); 
		$('#smallfade').innerfade({ 
			animationtype: 'fade', 
			speed: 750, 
			timeout: 4000, 
			type: 'sequence', 
			containerheight: '235px' 
			}); 
		$('#testfade').innerfade({ 
			animationtype: 'fade', 
			speed: 'fast', 
			timeout: 8000, 
			type: 'sequence', 
			containerheight: '250px' 
			});
		
		
		//Default Action
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
		
		//On Click Event
		$("ul.tabs li").click(function() {
			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
			var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active content
			return false;
		});
		
		// 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();
		})


		

	});
