// activate carousel & zoom on team page
jQuery(document).ready(function() {
	// CALL CAROUSEL
		/**
	 * We use the initCallback callback
	 * to assign functionality to the controls
	 */
	function mycarousel_initCallback(carousel) {
		jQuery('.jcarousel-control li a').bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
			return false;
		});
	
		jQuery('.jcarousel-scroll select').bind('change', function() {
			carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
			return false;
		});
	};
	
	// Ride the carousel...
	jQuery(document).ready(function() {
		jQuery("#theteam").jcarousel({
			scroll: 1,
			initCallback: mycarousel_initCallback
			// This tells jCarousel NOT to autobuild prev/next buttons
		});
	});
	
    //jQuery('#theteam').jcarousel();
	// ADD IMAGE RESIZE
	/* $("#theteam li").hover(function() {
		$(this).css({'z-index' : '10'});
		$(this).find('img').addClass("hover").stop() 
			.animate({
				marginTop: '0', 
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '200px',
				height: '224px'
			}, 200);
	
		} , function() {
		$(this).css({'z-index' : '0'}); 
		$(this).find('img').removeClass("hover").stop() 
			.delay(1000).animate({
				marginTop: '0',
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '175px',
				height: '196px'
			}, 400);
	}); */
	// ON CLICK SHOW HIDDEN
	$('.memberHide').hide(); 
	$('.teamcmem1').show(); 
	$('#theteam li a').click(function() { 
	        var id = $(this).attr('id'); 
		 $('.memberHide').hide(); 
	     $('.teamc' + id).fadeIn(500); 
	     
		 $('.jcarousel-item a .itemimg').animate({
				marginTop: '0', /* Set alignment back to default */
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '175px', /* Set width back to default */
				height: '176px' /* Set height back to default */
			}, 400);
	
		 var newid = '.jcarousel-item #' + id;
		 
		 $(newid + '  .itemimg').animate({
				marginTop: '0', /* The next 4 lines will vertically align this image */ 
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '199px', /* Set new width */
				height: '200px' /* Set new height */
			}, 200);
	     return false; 
     }); 
	// ON MENU CLICK SHOW HIDDEN
	$('.jcarousel-control li a').click(function() { 
	        var id = $(this).attr('id'); 
		 $('.memberHide').hide(); 
	     $('.teamc' + id).fadeIn(500); 
	     
		$('.jcarousel-item a  .itemimg').animate({
				marginTop: '0', /* Set alignment back to default */
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '175px', /* Set width back to default */
				height: '176px' /* Set height back to default */
			}, 400);
	
		 var newid = '.jcarousel-item #' + id;
		 $(newid + '  .itemimg').animate({
				marginTop: '0', /* The next 4 lines will vertically align this image */ 
				marginLeft: '0',
				top: '0',
				left: '0',
				width: '199px', /* Set new width */
				height: '200px' /* Set new height */
			}, 200);
	
	     return false; 
     }); 
	
	$('.jcarousel-item a').click(function() { 
	     var id = $(this).attr('id'); 
		$('#secnav li a ').css("background","#fdb827").css("color","black");
		$('#secnav li #' + id).css("background","black").css("color","white");
	     return false; 
     });
	/* 
	$('#expnav li a').click(function() { 
	        var id = $(this).attr('id'); 
		 $('.memberHide').hide(); 
	     $('.teamc' + id).fadeIn(500); 
	        // alert(id); 
	     return false; 
     });
	*/
});

/* -------------- DISABLE TEXT HIGHLIGHT ------------- */
function disableSelection(target){
if (typeof target.onselectstart!="undefined")
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined")
	target.style.MozUserSelect="none"
else
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}

var jcarodiv=document.getElementByClass("jcarousel-clip")
disableSelection(jcarodiv)


