var name = "#floatMenu";
var menuYloc = null;

$(document).ready(function(){

// LAVALAMP MENU

    	var query = new Object();
    	window.location.search.replace(
    	new RegExp( "([^?=&]+)(=([^&]*))?", 'g' ),
    		function( $0, $1, $2, $3 ){
    			query[ $1 ] = $3;
    		}
    	);
    	easing = query['e'] || 'Expo';

    	function loadEasing(e) {
    		location.href = location.pathname+'?e='+e;
    	}

    	function setEasing(e) {
    		loadLamps(e);
    	}

    // for dynamic easing changes
    	function loadLamps(easing) {
    		$('#nav').lavaLamp({
    			speed: 250,
    			returnDelay:100
    		});
    	}

    // jquery initialize:
    	$(function() {
    		loadLamps(easing);
    	});
    //console.log();

// JQUERY UI TABS MENU

        $("#container-tabs").tabs({event: 'mouseover'});
        $("#container-tabs").tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 5000);

// REFERENCE SLIDESHOW

          $('#slides').hover(
              function() { $('#slides').cycle('pause'); },
              function() { $('#slides').cycle('resume'); }
          );
          $('.nextBtn, .prevBtn').click(
              function() { $('#slides').cycle('pause'); }
          );
          $('#slides').cycle({
              fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
              speed: 500,
              next:   '.nextBtn',
              prev:   '.prevBtn'
          });

// FLOATING MENU TABS

  			menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
  			$(window).scroll(function () {
  				offset = menuYloc+$(document).scrollTop()+"px";
  				$(name).animate({top:offset},{duration:500,queue:false});
  			});

});
