jQuery(function($) {
    $('#s').focus(function() {if (this.value == this.defaultValue) this.value = '';});
    $('#s').blur(function() {if (this.value == '') this.value = (this.defaultValue ? this.defaultValue : '');});

    $("a[rel=gallery]").fancybox({
     'titlePosition' : 'over',
     'titleShow' : true
    });

    //Zebra striping and hover effects for tables
    $('table tr:even').addClass('alt');

	var presenterFadeDuration = 200;
	
	//Fix for the IE7 z-index bug.
	if($.browser.msie){
		$('div,li').each(function(i) {
			if($(this).css('position')!='absolute') $(this).css('zIndex', 1000 - (i * 10));
		});
		
		presenterFadeDuration = 0;
	}

    $('#presenters .presenter').mouseover(function(){
        hidePresenterPopups();
		if($.browser.msie){
			$('.info', $(this).parent()).css({backgroundColor:'#fff'});
		}
		
        $('.info', $(this).parent()).show(presenterFadeDuration, function(){
			$(this).css({backgroundColor:'transparent'});
        });
        $('.shadow', $(this).parent()).addClass('hover');
        $(this).addClass('hover');
    }).mouseout(function(){
		if($.browser.msie){
			$('.info', $(this).parent()).css({backgroundColor:'#fff'});
		}

        $('.info', $(this).parent()).hide(presenterFadeDuration);
        $('.shadow', $(this).parent()).removeClass('hover');
        $(this).removeClass('hover');
    });
});

function hidePresenterPopups()
{
    $('#presenters .info').hide();
    $('#presenters .shadow').removeClass('hover');
}

