	function mycarousel_initCallback(carousel){
		val = jQuery("#lead-carousel li").size();
		str = '';

		for (var i=1; i<=val;i++) {
			jQuery('.jcarousel-control').append('<a href="#">' + i + '</a>');
		}
		

		
		jQuery('.jcarousel-control a').bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
			return false;
		});
		// Disable autoscrolling if the user clicks the prev or next button.
		carousel.buttonNext.bind('click', function() {
			carousel.startAuto();
		});
		carousel.buttonPrev.bind('click', function() {
			carousel.startAuto();
		});
		// Pause autoscrolling if the user moves with the cursor over the clip.
		carousel.clip.hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
	};
	function highlight(carousel, obejctli,liindex,listate){	jQuery('.jcarousel-control a:nth-child('+ liindex +')').attr("class","selected");};
	function removehighlight(carousel, obejctli,liindex,listate){	jQuery('.jcarousel-control a:nth-child('+ liindex +')').removeAttr("class","selected");};
	jQuery(document).ready(function() {
		jQuery('#lead-carousel').jcarousel({
    			auto: 2,
			wrap: 'both',
			scroll:1,
		animation: 1600,
		auto:5,

			visible:1,
			wrap: 'both',
			initCallback: mycarousel_initCallback,
			buttonNextHTML: null,
			buttonPrevHTML:null,
			itemVisibleInCallback:  highlight,
			itemVisibleOutCallback: removehighlight          
		});

		jQuery('#vertical-carousel').jcarousel({
			  vertical: true,
				scroll: 2
		});	
		
		
		jQuery("ul li.menu1").mouseout(function(){
			jQuery(this).removeClass('active')
		}).mouseover(function(){
			jQuery(this).addClass('active').css('cursor','hand');
		});		
		// tabs
		var tabContainers = jQuery('div.tabs > div');
		tabContainers.hide().filter(':first').show();
		jQuery('div.tabs ul.tabNavigation a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			jQuery('div.tabs ul.tabNavigation a').removeClass('selected');
			jQuery(this).addClass('selected');
			tabContainers.removeClass('selected');
			tabContainers.filter(this.hash).addClass('selected');
			return false;
		}).filter(':first').click();
		jQuery('.icon_print a').click(function () {
			window.print();
		});
		jQuery('a[href=#]').click(function () {
			return false;	
		});			
		jQuery('input[type=submit]').hover(function() {
			$(this).css('cursor','pointer');								
		});		
		jQuery('body').supersleight();

		jQuery('a.info[href*=#]').livequery('click', function() { 
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$('a[href='+ this.hash +']').addClass('selected'); 
			tabContainers.removeClass('selected');
			tabContainers.filter(this.hash).addClass('selected');
			var $target = $(this.hash);

			$target = $target.length && $target
			|| $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
			var targetOffset = $target.offset().top - 30;
			$('html,body')
			.animate({scrollTop: targetOffset}, 1000);
			return false;
			}			

		  });
		if(location.hash){	
			tabContainers.hide();
			tabContainers.filter(location.hash).show();
			$('div.tabs ul.tabNavigation a').removeClass('selected');
			$('a[href='+ location.hash +']').addClass('selected'); 
			tabContainers.removeClass('selected');
			tabContainers.filter(location.hash).addClass('selected');
			var $target = $(location.hash);

			$target = $target.length && $target
			|| $('[name=' + location.hash.slice(1) +']');
			if ($target.length) {
			var targetOffset = $target.offset().top - 30;
			$('html,body')
			.animate({scrollTop: targetOffset}, 1000);
			return false;
			}

		}	
		tallest = 600;
		thisHeight = jQuery('body').height();		
		if(thisHeight > tallest) {
			
		}

		if( jQuery('.downloads').length != 0){
			$('<div class="icon_download"><a class="info" href="#downloads" title="Scroll to download section.">Downloads</a></div>').insertBefore('.icon_facebook');
		}
	});
