/* Author: 
    Jakub Derdziak
*/

$(document).ready( function(){
    $("#container img").load( function() {
        if( parseInt($(this).outerWidth()) > $(this).parent().innerWidth() )
        {
            $(this).addClass("resolution-fixed").css("width","100%").css("height","auto");
        }
    } );
} );

$(window).resize( function() {
    $("#container img").each( function() {
        if( $(this).hasClass("resolution-fixed") )
        {
            $(this).css("width","auto").removeClass("resolution-fixed");
        }

        if( parseInt($(this).outerWidth()) > $(this).parent().innerWidth() )
        {
            $(this).addClass("resolution-fixed").css("width","100%").css("height","auto");
        }
    } );
} );

