jQuery(document).ready(function() {

	 jQuery('.member:last').css({borderBottom:'none'});

	jQuery('.fadeThis').append('<span class="hover"></span>').each(function () {
	  var $span = jQuery('> span.hover', this).css('opacity', 0);
	  jQuery(this).hover(function () {
	    $span.stop().fadeTo(300, 1);
	  }, function () {
	    $span.stop().fadeTo(300, 0);
	  });
});

	jQuery('.sociable a, a.vstst_lnk, a.mnu_itm, span.mnu_itm, .contact_info dd,.flt_rt_tags a').append('<span class="hover"></span>').each(function () {
	  var $span = jQuery('> span.hover', this).css('opacity', 0);
	  jQuery(this).hover(function () {
	    $span.stop().fadeTo(300, 1);
	  }, function () {
	    $span.stop().fadeTo(300, 0);
	  });
});

	var baseUrl = "http://rollingorange.com";
	// You need to target your sidebar here, change #secondaryContent to your sidebar identifier (id)
	jQuery("#recent-work td a,#tag-work li a").each(function(){
		var href = jQuery(this).attr('href').replace(baseUrl,'');
		if (href == document.location.pathname) {
			jQuery(this).addClass('current').removeClass('fadeMe');
		}
	});


	jQuery('.fadeMe,#recent-work table.market_tags td a').each(function () {
	 	  jQuery(this).hover(function () {
	  jQuery(this).animate({ color: "#e66817" }, 300);
	    	  }, function () {
	   jQuery(this).animate({ color: "#6a5e48" }, 300);
	  });
});
jQuery('#port_image').fadeTo(0,0);

jQuery(window).load(function () {
jQuery('#port_image').css('opacity',0).fadeTo(3800,1);
});

jQuery("#people").tabs({ fx: { opacity: 'toggle' } });
jQuery(function() {
		jQuery( "#process-tabs,#process-tabs-a,#process-tabs-b,#process-tabs-c" ).tabs();
		jQuery( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" )
			.removeClass( "ui-corner-all ui-corner-top" )
			.addClass( "ui-corner-bottom" );
	});
jQuery("#slideshow_home").easySlider({
		auto: true,
		continuous: true,
		numeric: true,
		vertical:false,
		pause:5000,
		controlsShow:true	
	});
jQuery('.accordion').liteAccordion({
    slideSpeed : 600
});
                jQuery('ol li:has(ul, div) > h2').click(function(event, silent) {
                    if (silent === undefined) {
                       jQuery.address.value('/');
                        jQuery('ol li[class*=selected]:has(ul, div) > h2').each(function() {
                            jQuery.address.parameter('h2', jQuery(this).attr('id').replace(/^#/, ''), true);
                        });
                        jQuery.address.update();
                        return false;
                    }
                });
            });
            
            jQuery.address.autoUpdate(false).change(function(event) {
                var params = event.parameters['h2'];
                jQuery('ol li:has(ul, div) > h2').each(function() {
                    var active = jQuery(this).parent('li').attr('class').indexOf('selected') != -1;
                    if (jQuery.inArray(
                            jQuery(this).attr('id').replace(/^#/, ''), 
                            [].concat(params ? params : [])) != -1) {
                        if (!active) jQuery(this).trigger('click', [true]);
                    } else if (active) {
                        jQuery(this).trigger('click', [true]);
                    }
                });

});
