function folioscroller_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function logoscroller_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

$(document).ready(function() {
	$('#folio_selector').jcarousel({
		wrap: 'circular',
		scroll: 4,
		auto: 4,
//		easing: 'linear',
		animation: 1000,
		initCallback: folioscroller_initCallback
	});
	
//	$('#customer_logoscroller').jcarousel({
//		wrap: 'circular',
//		scroll: 1,
//		auto: .01,
//		easing: 'linear',
//		animation: 5000,
//		buttonNextHTML: null,
//		buttonPrevHTML: null,
//		initCallback: logoscroller_initCallback
//	})

	$("#customer_logoscroller").carouFredSel({
	    auto    : {
	        items           : 1,
	        duration        : 5000,
	        easing          : "linear",
	        pauseDuration   : 0,
	        pauseOnHover    : true
	    },
		height: 'auto'
	});
	
	$('#banner_rotator').cycle({
		fx: 'scrollHorz',
		speed: 4000,
		timeout: 10000,
		pause: 1,
		pager: '#banner_controls'
	});
	
	$('#banner-small').cycle();
	
	$('#newsletter_subscribe').fancybox();
	
	$('#services > li').equalHeights();
	
	$('.clear').before('<div class="clear"><!-- --></div>');
});

(function(){
  // if firefox 3.5+, hide content till load (or 3 seconds) to prevent FOUT
  var d = document, e = d.documentElement, s = d.createElement('style');
  if (e.style.MozTransform === ''){ // gecko 1.9.1 inference
    s.textContent = 'body{visibility:hidden}';
    var r = document.getElementsByTagName('script')[0];
    r.parentNode.insertBefore(s, r);
    function f(){ s.parentNode && s.parentNode.removeChild(s); }
    addEventListener('load',f,false);
    setTimeout(f,3000); 
  }
})();

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
