$(document).ready(function(){

    $('a[rel^=colorbox]').colorbox();
    $('a[rel^=lightbox]').colorbox();
    $('.ngg-gallery-thumbnail a').colorbox();       
    $('.wp-caption a').colorbox({rel:'lightbox'})  
    $("a[rel=external]").attr('target', '_blank');

    $("embed").attr("wmode", "opaque");
    var embedTag;
    $("embed").each(function(i) {
        embedTag = $(this).attr("outerHTML");
        if ((embedTag != null) && (embedTag.length > 0)) {
            embedTag = embedTag.replace(/embed /gi, "embed wmode=\"opaque\" ");
            $(this).attr("outerHTML", embedTag);
        }
    });
    
    $('.advert').hover(function() {
        $(this).addClass("hover");
    },function() {
        $(this).removeClass("hover");
    });
    
    $('.countdown').countdown({
        since: new Date(2011, 12-1, 5, 14, 0),
        compact: true, 
        format: 'DHMS',
        timezone: 0,
        layout: '<ul class="clock"><li class=,"day">{d10}{d1}</li><li class="hour">{h10}{h1}</li><li class="min">{m10}{m1}</li><li class="sec">{s10}{s1}</li></ul>',
        compactLabels: ['', '', '', ''],
        serverSync: function() {
            var time = $('#clockTimestamp').html()*1000;
            time = new Date(time); 
            return time;            
        }
    });
});


