// JavaScript Document

$(document).ready(function(){

	/* BEGIN IMAGE ROTATOR */
    $('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed: 3000,
		timeout:6000
	});
	/* END IMAGE ROTATOR */
	/*BEGIN ROLLOVER FUNCTIONALITY*/
	var cur;
	var prev = '-1';

	$(".buttons").mouseenter(function(){
		
		attr = $(this).attr('id');
		ele = $("#dd_" + attr);

		if( typeof(cur) != "undefined" && (prev != attr) ){
			if( !cur.is(":hidden") ){
				cur.stop(false, true).hide();
			}
		}

		if( ele.is(":hidden") ){
			position = $(this).position();
			ele.css( "top", 297 + position.top );
			ele.css( "left", 232 );
			ele.css( "z-index", 1000 );
			ele.fadeIn(400);
		}
	
		cur = ele;
		prev = attr;			

	});
	
	$(".nav").mouseleave(function(){

		if( typeof(cur) != "undefined" ){
			if( !cur.is(":hidden") ){
				cur.hide();
			}
		}
		
	});
	/* END ROLL OVER FUNCTIONALITY */

});
