$(document).ready(function() {

    /**** make div clickable ***/
    var targetedDiv = $("div.linkbox");
    targetedDiv.each(function() {
        $(this).click(function() {
            window.location = $(this).find("a:first").attr("href");
        });

        targetedDiv.hover(
                     function() { $(this).addClass("hovering"); },
                     function() { $(this).removeClass("hovering"); }
            );
    }); // end:each
    

    /**** take link from venue and wrap it to the location ***/
    var target = $("body.pg-home div.s_singleEvent");
    if (target.length >= 1) {
        target.each(function() {
            var cloneLink = $(this).find('span.s_venue a:first').attr('href');
            $(this).find('span.location').wrap('<a class="clonedLink"></a>');
            $('a.clonedLink', this).attr('href', cloneLink);
        }); // end:each
    } // if target is there


    /* pg-discography */
    $('body.pg-discography div#thisDiscographyPage p.s_blmlist a.btn').removeClass('btn').after('<em>&nbsp;|</em>');
    $('body.pg-discography div#thisDiscographyPage p.s_blmlist').children(":last-child").hide();

    /* pg-events */
    var $detailLink = $('<em style="color:#000; font-weight:bold;" class="details">&nbsp;| Details </em>');
        $detailLink.each(function() {
            $(this).insertAfter('body.pg-events div#thisEventPage span.location');
        });

        var target = $("body.pg-events div#thisEventPage div.s_singleEvent"); 
        target.each(function() {
        var cloneLink = $(this).find('span.s_venue a:first').attr('href');
            $(this).find('em.details').wrap('<a class="clonedVenueLink"></a>');
            $('a.clonedVenueLink', this).attr('href', cloneLink);
        }); // end:each

            
        
        try {
            $("a.commentslink").show().html('Comments');
        }
        catch (e) {
            return false;
        }



    }); // end:DOM ready

