﻿
$(function() {

    // setup overlay actions to buttons
    $("a[rel],area[rel]").overlay({

        // use the Apple effect for overlay
        effect: 'apple',

        onLoad: function(content) {
            // find the player contained inside this overlay and load it
            this.getOverlay().find("a.player").flowplayer(0).load();
        },

        onClose: function(content) {
            $f().unload();
        }
    });

    // install flowplayers
    $("a.player").flowplayer("/flash/flowplayer/flowplayer-3.1.3.swf");
});

/*
 * This is a sample usage if this javascript

 * <a rel="#overlay_dumpsters" href="#"><img src="/images/commercial/dumpsters.gif" alt="Exterior Waste" /></a>
 * <a rel="#overlay_dumpsters" href="#">Exterior Waste</a>
 * <a rel="#overlay_exteriorholes" href="#"><img src="/images/commercial/exteriorholes.gif" alt="Utility Penetrations" /></a>
 * <a rel="#overlay_exteriorholes" href="#">Utility Penetrations</a>

 * <div id="overlay_dumpsters" class="overlay"><a class="player" href="/videos/commercial/garbage256K_Stream001.flv"></a></div>
 * <div id="overlay_exteriorholes" class="overlay"><a class="player" href="/videos/commercial/utilitypenetrations256K_Stream001.flv"></a></div>
 */