$(document).ready(
    function()
    {           
        $('#gallery-link').click(function() {
            $('#popup_modal').css('background', 'url(/images/backgrounds/gallery_bg.png) no-repeat');
            $('#popup_modal').html($('#gallery-holder').html());
            act_gallery();
            hbc_popup('popup_modal', '#?w=835&h=654', null, null, null, 60);
                
            return false;
        });
        $('#btn-read-more-cert').click(function() {
            $('#popup_modal').css('background', 'url(/images/backgrounds/cert_bg.png) no-repeat');
            $('#popup_modal') .html($('#cert-modal').html());
            hbc_popup('popup_modal', '#?w=617&h=830', true, 1, null, 15);
            return false;
        });
        $('#home-video').click(function()
        {
            var _d = '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/b7xfYLykxTY?fs=1&amp;hl=en_US&amp;autoplay=1&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/b7xfYLykxTY?fs=1&amp;hl=en_US&amp;autoplay=1&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';
			
            $('#popup_modal').html(_d);
            hbc_popup('popup_modal', '#?w=640&h=385', true, 1, true);
            return false;
        });
        $('#sox').click(function()
        {
            $('#popup_modal').css('background', 'url(/images/backgrounds/sox_bg.png) no-repeat');
            $('#popup_modal').html($('#sox-container').html());
            hbc_popup('popup_modal', '#?w=690&h=279', true, 1, null, 15);
            return false;
        });
    });
function act_gallery()
{
    $('#popup_modal a[rel^=gallery]').each(function(){
        $(this).click(function(){
                
            $('#main-image').attr('src', $(this).attr('href'));
            $('#popup_modal a[rel^=gallery]').each(function() {
                $(this).removeClass('gallery-active');
            });
            $(this).addClass('gallery-active');
            return false;
        });
    });
}
