$.fn.cycle.transitions.pinch = function($cont, $slides, opts) { 
    var $el = $($slides[0]); 
    var w = $el.width(); 
    var h = $el.height(); 
    opts.cssBefore = { top: 0, left: 0, width: 0, height: 0, zIndex: 1 }; 
    opts.animIn    = { width: w, height: h }; 
    opts.animOut   = { top: h, left: w, width: 0, height: 0 }; 
    opts.cssAfter  = { zIndex: 0 }; 
};

$(document).ready(function(){
	var x;
	$('a', $('.subnav').parent()).mouseover(function(){
		$('.subnav', $(this).parent()).fadeIn(function(){
			var thisid = $(this).attr('id');
			$(this).unbind('mouseout').mouseout(function(){
				x = setTimeout("$('#" + thisid + "').fadeOut();", 500);
			});	
			$('a.parent').unbind('mouseout').mouseout(function(){
				x = setTimeout("$('#" + thisid + "').fadeOut();", 500);
			});	
		});
		$('.subnav,a', $(this).parent()).mouseover(function(){
			clearTimeout(x);
		});
	});
	$('#rotator').cycle({ 
	    fx: 'pinch', 
	    delay: 2000 
	});
});
