/* 2010 by Mark de Jong @ Eggplant Digital */
jQuery(document).ready(function(){
	var delay=5000;
});

var curr_no=1;
var timer_no=1;
var rotate_timer="";
var timer=5000;
var sh;

function showItem(no){
	if(curr_no!=no){
		resetItems();
		jQuery("#slide-"+no).fadeIn(3000);
		curr_no=no;
	}
}

function resetItems(){
	jQuery("#slide-"+curr_no).fadeOut(3000);
}

function autoRotate(){
	showItem(timer_no);
	timer_no++;
	if(timer_no > jQuery("#caroussel div.slide").length){
		timer_no=1;
	}
}

sh = setInterval(autoRotate, timer);


/* Main Nav Dropdown Menu */
/* Add the following in the header:
<script type="text/javascript">
	jQuery(document).ready(function($){
		egg_wp_menu(".menu-item");
	})
</script>

 */
function egg_wp_menu(ban_id) {
	jQuery(ban_id).hover(
		function () {
			this_id = jQuery(this).attr("id");
			if (1 == jQuery("#"+this_id+" ul").length)
			{
				jQuery("#"+this_id+" ul").show();
			}
		},
		function () {
			this_id = jQuery(this).attr("id");
			if (1 == jQuery("#"+this_id+" ul").length)
			{
				jQuery("#"+this_id+" ul").hide();
			}
		}
	); 		
}
