/*
 * function init audio/video for portlet_media
 * requires: jquery.overlay, swfobject.js and mediaplayer.js
 */
function portlet_media_init()
{
        // console.log("portlet-media, #portlet-media:",jq('#portlet-media').length); 
        // console.log("portlet-media, found audio anchors:",jq('a.audio').length); 
        jq('#portlet-media a.audio').audio(); // writing all the div.audio

        jq("#portlet-media a.audio").click(function () {
             jq(this).next().jOverlay();
             return false;
        });


        // console.log("portlet-media, found video anchors:",jq('a.video').length);
        jq('#portlet-media a.video').video(); // writing all the div.video      

        jq("#portlet-media a.video").click(function () {
             jq(this).next().jOverlay();
             return false;
        });
}

if (window.jQuery)
{
        jq(document).ready(portlet_media_init);
}

