/*
	===========================================================
	Custom Wordpress Theme - UI Effects - "Crunch.js"
	Author: Anchor Wave Internet Solutions, Anchorwave.com
	===========================================================
	Description: jQuery function initialization.
	===========================================================
*/

jQuery(function( $ ){	

	// Logo fade on mouseover
 	$('#logo')
    .append('<span class="hover" />').each(function () {
     	var $span = $('> span.hover', this).css('opacity', 0);
      	$(this).hover(function () {
        	$span.stop().fadeTo(150, 1);
      	}, function () {
        	$span.stop().fadeTo(500, 0);
      	});
    });
	
	// Rapid Response - map overlay
	$('.rapid-map #map-overlay a').animate({'opacity':0}, 0);
	
	$('.rapid-map #map-overlay a').hover(function() {	
		// Stuff that happens when you hover
		$(this).stop().animate({
			'opacity': 1
			}, 200, 'easeOutSine')
	},function() {
		// Stuff that happens when you unhover
		$(this).stop().animate({
			'opacity': 0
			}, 1000, 'easeOutExpo')
	});
	
	// Colorbox init
			$("#map-overlay a").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 730
			});
			$("#map-overlay a.selector-nam").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 690
			});
			$("#map-overlay a.selector-afr").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 600
			});
			$("#map-overlay a.selector-sam").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 690
			});
			$("#map-overlay a.selector-eur").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 520,
				height: 600
			});
			$("#map-overlay a.selector-aus").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 530
			});
			$("#map-overlay a.selector-asi").colorbox({
				transition: 'elastic',
				speed: 350,
				initialWidth: 300,
				initialHeight: 100,
				iframe: true,
				width: 600,
				height: 580
			});
			
			// Header Image Rotator

			

    $('#headerrotator').crossSlide({
  fade: 1
}, [
  {
    src:  '/wp-content/themes/consolidated-v2/lib/img/rotator/rotator-1.jpg',
    from: '100% 100% 1x',
    to:   '100% 100% 1x',
    time: 3
  }, {
    src:  '/wp-content/themes/consolidated-v2/lib/img/rotator/rotator-2.jpg',
    from: '100% 100% 1x',
    to:   '100% 100% 1x',
    time: 3
  }, {
    src:  '/wp-content/themes/consolidated-v2/lib/img/rotator/rotator-3.jpg',
    from: '100% 100% 1x',
    to:   '100% 100% 1x',
    time: 3
  }, {
    src:  '/wp-content/themes/consolidated-v2/lib/img/rotator/rotator-4.jpg',
    from: '100% 100% 1x',
    to:   '100% 100% 1x',
    time: 5
  }
]);

});
