function MediaExpress(){
	var __flowplayer__ = "/flash/flowplayer-3.1.3.swf";
    var __flowplayer_controls__ = "/flash/flowplayer.controls-3.1.3.swf";
    var __flowplayer_settings__ = {
        
        canvas:{ backgroundGradient: 'none' },
        clip: { autoPlay: false, scaling: 'fit' },
        plugins: {      // load one or more plugins 
                controls: { 
                        url: __flowplayer_controls__, 

                        // display properties 
                        backgroundColor: '#000000', 
                        backgroundGradient: [0.3, 0.1,0], 
                        height:20, 
                        
                        // controlbar-specific configuration 
                        progressColor: '#4d4d4d',
                        bufferColor: '#2d2d2d',
                        fontColor: '#ffffff',
                        timeFontColor: '#333333', 
                        autoHide: 'never', 
                        buttonColor: '#000000',
                        buttonOverColor: '#4d4d4d',
                        
                        // which buttons are visible and which are not? 
                        play:true, 
                        volume:true, 
                        mute:true, 
                        time:false, 
                        stop:false, 
                        playlist:false, 
                        fullscreen:true, 

                        // scrubber is a well-known nickname for the timeline/playhead combination 
                        scrubber: true 

                        // you can also use the "all" flag to disable/enable all controls 
                    }
            }
    };

	var photoContent = $('#photo-tab-content');
	var videoContent = $('#video-tab-content');
	
	$('#media-express a.tab').bind("click", function(e){
        $('#media-express a.tab').removeClass('selected');
        $(e.currentTarget).addClass('selected');
        $('#media-express div.tab-content').removeClass('selected');
        $('#'+e.currentTarget.id+'-content').addClass('selected');
        return false;
    });
	
	$(photoContent).find('div.small-thumb').bind("mouseenter", function(e){
        var small_img = $(e.currentTarget).find("img")[0];
        if($(photoContent).find('div.large-thumb').length > 0) {
            var large_img = $('#photo-tab-content div.large-thumb img')[0];
			large_img.src = small_img.src;
        }									   
		if (small_img.alt.indexOf("|") == -1) { small_img.alt+= "|"; }
        var details = small_img.alt.split('|');
        $(photoContent).find('.large-thumb-details .title').text(" "+details[0]+" ");
        $(photoContent).find('.large-thumb-details .location').text(" "+details[1]+" ");
        if($(photoContent).find('div.large-thumb').length == 0) {
            $(photoContent).find('div.options div.small-thumb').stop();
            if(e.currentTarget.id == "" || e.currentTarget.id == undefined) {
                var d = new Date();
                e.currentTarget.id = "id_"+d.getTime();
            }
            $(photoContent).find('div.options div.small-thumb:not(#'+e.currentTarget.id+')').fadeTo(100,0.5);
            $(e.currentTarget).fadeTo(100,1);
        }
    });
    $(photoContent).find('div.small-thumb img').bind("mouseleave", function(e){
        if($(photoContent).find('div.large-thumb').length == 0) {
            $(photoContent).find('div.options div.small-thumb').stop();  
            $(photoContent).find('div.options div.small-thumb').fadeTo(100,1);
        }
    });
	
	if (($(photoContent).find('div.large-thumb').length > 0) & ($(photoContent).find('div.small-thumb').length > 0)) {
		var small_img = $(photoContent).find('div.small-thumb img:first')[0];
		if (small_img.alt.indexOf('|') == -1) { small_img.alt+= '|'; }
		var details = small_img.alt.split('|');
		$(photoContent).find('div.large-thumb img')[0].src = small_img.src;
        $(photoContent).find('.large-thumb-details .title').text(" "+details[0]+" ");
        $(photoContent).find('.large-thumb-details .location').text(" "+details[1]+" ");
	}
	
	$('#more-videos-list a').bind("mouseenter", function(e){
       $('#more-videos-list a').stop();
       $('#more-videos-list a').not(this).fadeTo("slow", 0.5);
       $(e.currentTarget).stop();
       $(e.currentTarget).fadeTo("slow",1);
    });
    $('#more-videos-list a').bind("mouseleave", function(e){
        $('#more-videos-list a').stop();
        $('#more-videos-list a').fadeTo("slow", 1);
    });

    if ($.browser.msie && $.browser.version < 7){
        // don't do cool stuf here
    }else{        
       $('#video-tab-content .video-list a').bind("mouseenter", function(e){
          $('#video-tab-content .video-list a').stop();
          $('#video-tab-content .video-list a').not(this).fadeTo("slow", 0.5);
          $(e.currentTarget).stop();
          $(e.currentTarget).fadeTo("slow",1);
          $(e.currentTarget).children('span').stop();
          $(e.currentTarget).children('span').fadeTo("slow",1);
       });
       $('#video-tab-content .video-list a').bind("mouseleave", function(e){
           $('#video-tab-content .video-list a').stop();
           $('#video-tab-content .video-list a').fadeTo("slow", 1);
           $('#video-tab-content .video-list span').stop();
           $('#video-tab-content .video-list span').fadeTo("slow", 0);
       });
    }
	
	var more_videos_list_width = (105+5) * 5;
    var more_videos_list_slider_width = $('#more-videos-list .slider a').length * (105+5);

    if (more_videos_list_slider_width > more_videos_list_width){
        $('#more-videos-list').width( more_videos_list_width );
        $('#more-videos-list .slider').width( more_videos_list_slider_width );
        
    
        $('#more-videos-next').bind("click", function(e){
            $('#more-videos-list .slider').stop();
            var offset = parseInt($('#more-videos-list .slider').css('margin-left'), 10);      
          
            console.debug(offset);
            // reset the slide to the begining if we have reached the end
            if (more_videos_list_width - offset ==  more_videos_list_slider_width)
            {
                 $('#more-videos-list .slider').animate({
                          "marginLeft": "0px"
                        }, { duration: "slow" }
                        );

            }           
            // stop the slider if we are going to go past the last slide
            else if ((offset - more_videos_list_width) + more_videos_list_slider_width <  more_videos_list_width) {
                 $('#more-videos-list .slider').animate({
                          "marginLeft": ( more_videos_list_width - more_videos_list_slider_width ) + "px"
                        }, { duration: "slow" }
                        );
            }
            // move slider left by the width of the view area "more_videos_list_width"
            else {
            
                $('#more-videos-list .slider').animate({
                      "marginLeft": (offset - more_videos_list_width)
                    }, { duration: "slow" }
                    );

            }
            return false;
        });
    }else{
        $('#more-videos-next').hide();
    }
	
	if ($("#player").length){
        var player = $f("player", __flowplayer__, __flowplayer_settings__ ).playlist("div.fp-videos-list", {loop:false, autoPlay: false});
    }
}
