/*
<input id="cf3_field_11" class="cf-box-a" type="checkbox" name="cf3_field_11"/>
<fieldset class="cf-fs3">
*/

/*
jQuery(function( $ ){
	// code here
});
*/

// Clears all check boxes
//$(document).ready(function() {$(":checkbox").uncheck();});

jQuery.fn.popFeed = function(id) {
	var $this = $(this);
	var $that = $('div#'+id+'-feed');

	$this.bind('mouseenter', function () {
		$that.css("z-index", "10");
		$('.hidenext').hide();
		$that.removeClass('hidenext');
		$that.show();
		// do some cleanup
		if($that.data('popActive')) {
			//alert($that.data('popActive'));
			window.clearTimeout(hideThat);
		}
	});
	$this.bind('mouseleave', function () {
		//$that.fadeOut(500);
		$that.addClass('hidenext');
		$that.css("z-index", "1");
		// fadeOut on set delay
		hideThat = window.setTimeout(function() {
			$that.fadeOut(500);
			$that.data('popActive', true);
		}, 1500);
	});

	// cancel delay fadeOut upon entering or leaving
	$that.bind('mouseenter mouseleave', function () {
		// do some cleanup
		if($that.data('popActive')) {
			//alert($that.data('popActive'));
			window.clearTimeout(hideThat);
		}
	});

	$that.bind('mouseleave', function () {
		// fadeOut on short delay (adds padding between mouse events)
		hideThat = window.setTimeout(function() {
			$that.fadeOut(500);
			$that.data('popActive', true);
		}, 1000);
	});
	//$this.unbind('mouseleave');
};

$(document).ready(function() {
	$("#facebook-button").popFeed('facebook');
	$("#twitter-button").popFeed('twitter');

	// call divSlideShow with parameters
	$('body.home .featured-showcase').divSlideShow( {width:961, height:389, arrow:"split", controlClass:"nav-inactive", controlActiveClass:"nav-active", leftArrowClass:"arrow-l", rightArrowClass:"arrow-r", delay:5000, loop:50} );
});

