/*
 * Panel Slider
 *
 * Copyright © 2009 Leonard Chan
 * All rights reserved.
*/
$(document).ready(function(){
	$(".btn-slide").click(function(){
	
		$("#panel").slideToggle("slow");	
		$(this).toggleClass("active"); return false;
	
	});
});

/*
 * Banner Slider
 *
 * Copyright © 2009 Leonard Chan
 * All rights reserved.
*/

		var theInt = null;
		var $crosslink, $navthumb;
		var curclicked = 0;
		
		theInterval = function(cur){
			clearInterval(theInt);
			
			if( typeof cur != 'undefined' )
				curclicked = cur;
			
			$crosslink.removeClass("active-thumb");
			$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');
			
			theInt = setInterval(function(){
				$crosslink.removeClass("active-thumb");
				$navthumb.eq(curclicked).parent().addClass("active-thumb");
				$(".stripNav ul li a").eq(curclicked).trigger('click');
				curclicked++;
				if( 6 == curclicked )
					curclicked = 0;
				
			}, 5000); /* 5s */
		};
		
		$(function(){
			
			$("#main-photo-slider").codaSlider();
			
			$navthumb = $(".nav-thumb");
			$crosslink = $(".cross-link");
			
			$navthumb
			.click(function() {
				var $this = $(this);
				theInterval($this.parent().attr('href').slice(1) - 1);
				return false;
			});
			
			theInterval();
		});

/*
 * Accordian Effects
 *
 * Copyright © 2009 Leonard Chan
 * All rights reserved.
*/
		
	jQuery().ready(function(){

		// second simple accordion with special markup
		jQuery('#navigation').accordion({
	    active: ".current",
			header: '.head',
			navigation: true,
			event: 'mouseover',
			fillSpace: true,
			animated: 'bounceslide'
		});
		
	});
	
	
/*
 * Fancy Zoom
 *
 * Copyright © 2009 Leonard Chan
 * All rights reserved.
*/

			$(document).ready(function() {
			$('#flash_box_link').fancyZoom();
		});		
