jQuery(document).ready(function($){
// need the above line so I can use the $	
// **************************************

		
		
		
		// make the other SECTORS fade on hover
		
			$('.fade-area-1').children().hover(function() {
				$(this).siblings().stop().fadeTo(500,0.5);
			}, function() {
				$(this).siblings().stop().fadeTo(500,1);
			});
	
		
		// ye olde cycle instructions
		
			$('#introslider').cycle({ 
			    fx:     'fade', 
			    speed:   900, 
			    timeout: 8000, 
			    pager:  '#image-nav'
			});
			
		// ye olde cycle instructions for Single Machines
		
			$('#sector-slider').cycle({ 
				
			    fx:     'f', 
			    speed:   900, 
			    timeout: 8000, 
			    pager:  '#image-nav'
			});

			
$(function(){

				// Accordion
				$("#accordion").accordion({ 
					header: "h3",
					event: "click hoverintent",
					animated: 'bounceslide',
					collapsible: true,
					autoHeight: false, 
                    active: false
					
					});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
			});
			
			
	var cfg = ($.hoverintent = {
		sensitivity: 7,
		interval: 100
	});

	$.event.special.hoverintent = {
		setup: function() {
			$( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
		},
		teardown: function() {
			$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
		},
		handler: function( event ) {
			event.type = "hoverintent";
			var self = this,
				args = arguments,
				target = $( event.target ),
				cX, cY, pX, pY;
			
			function track( event ) {
				cX = event.pageX;
				cY = event.pageY;
			};
			pX = event.pageX;
			pY = event.pageY;
			function clear() {
				target
					.unbind( "mousemove", track )
					.unbind( "mouseout", arguments.callee );
				clearTimeout( timeout );
			}
			function handler() {
				if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) {
					clear();
					jQuery.event.handle.apply( self, args );
				} else {
					pX = cX;
					pY = cY;
					timeout = setTimeout( handler, cfg.interval );
				}
			}
			var timeout = setTimeout( handler, cfg.interval );
			target.mousemove( track ).mouseout( clear );
			return true;
		}
	};



$(document).ready(function()
  { $('.wpcf7-form').formly(); });

// ***************************************
// the following line closes everything up
});

