$(document).ready(function (){
    var clientWidth = $(window).width();
    var clientHeight = $(window).height();
    
    $('#fader').css('width',clientWidth);
    $('#fader').css('height',clientHeight);

    var popTop = Math.round((clientHeight-450)/2);
    var popLeft = Math.round((clientWidth-600)/2);
    
    $('.galeryLayer').css('top',popTop);
    $('.galeryLayer').css('left',popLeft);
    
    $('.videoLayer').css('top',popTop);
    $('.videoLayer').css('left',popLeft);
});


$(document).resize(function (){
    var clientWidth = $(document).width();
    var clientHeight = $(document).height();
    
    $('#fader').css('width',clientWidth);
    $('#fader').css('height',clientHeight);
});


$(document).keypress(function (event){
    if (event.which == '0') {
        $('#fader').attr('class','fader_hide');
        $('.galeryLayer').css('display','none');
        $('.videoLayer').css('display','none');
        $('.vframe').attr('src','');
        $('.gframe').attr('src','');
    }
});


$('#close').click(function (){
    $('#fader').attr('class','fader_hide');
    $('.galeryLayer').css('display','none');
    $('.videoLayer').css('display','none');
    $('.vframe').attr('src','');
    $('.gframe').attr('src','');
});


$('#close2').click(function (){
    $('.fader').attr('class','fader_hide');
    $('.galeryLayer').css('display','none');
    $('.videoLayer').css('display','none');
    $('.vframe').attr('src','');
    $('.gframe').attr('src','');
});


$('#fader').click(function (){
    $('#fader').attr('class','fader_hide');
    $('.galeryLayer').css('display','none');
    $('.videoLayer').css('display','none');
    $('.vframe').attr('src','');
    $('.gframe').attr('src','');
});


function openGaleryPopup(id) {
}


function openVideoPopup(url,id) {
}
