// JavaScript Document

$(document).ready(function() {

    jQuery.fn.center = function() {
        this.css("position", "fixed");
        this.css("top", (($(window).height() - this.height()) / 2) - 30 + "px");
        this.css("left", ($(window).width() - this.width()) / 2);
        return this;
    }

    $('.popuptrig1').click(function() {
        $('.popmask').fadeTo(200, 0.8);
        $('#popupbox1').center();
        $('#popupbox1').fadeIn();
        $f(0).play();
        return false;
    });
    $('.popuptrig2').click(function() {
        $('.popmask').fadeTo(200, 0.8);
        $('#popupbox2').center();
        $('#popupbox2').fadeIn();
       // $f(0).play();
        return false;
    });

    $('#popupbox1 .close').click(function() {
        $('#popupbox1, .popmask').fadeOut();
        $f().stop();
        return false;
    });
    
    $('#popupbox2 .close').click(function() {
        $('#popupbox2, .popmask').fadeOut();
       
        return false;
    });
});
