$(document).ready(function() {
    if($(".flash_opener").length > 0){
        var resolution = window.screen;
        var showFlash = (resolution.width > 1024 && resolution.height > 768);
        var openers = showFlash ? ".flash_opener" : ".toSmallResolution .flash_opener";
        
        $.each($(openers), function(){                    
            $(this).fancybox({
                'padding'        : 0,
                'autoScale'        : true,
                'transitionIn'    : 'none',
                'transitionOut'    : 'none',
                'type' : 'iframe',
                'width' : '100%',
                'height' : '100%'            
            });
        });
        
        if(!showFlash){
            $.each($(".flash_opener"), function(){
                if($(this).find("img").size()){
                    $(this).attr("href","#");
                }
                else if(!$(this).parent().hasClass("toSmallResolution")){
                    $(this).remove();
                }
                if($(this).parents("dl").size()){
                    $(this).parents("dl").find("dd").css("display","inline");
                    $(this).parents("dl").find("dt").css("display","inline");
                }
            });
            $(".toSmallResolution").show();
        }
    }
});
