
$(document).ready(function($) {
			
    var frames = $("iframe");

    if( frames.size() > 0 )
    {
        $.each(frames, function(w, h) {

            w = $(this).attr("width");
            h = $(this).attr("height");

            $(this).attr("width", 298/w*w);
            $(this).attr("height", 298/w*h);
        });
    }

    var embeds = $("embed");
    if( embeds.size() > 0 )
    {
        $.each(embeds, function(w, h) {

            w = $(this).attr("width");
            h = $(this).attr("height");

            $(this).attr("width", 298/w*w);
            $(this).attr("height", 298/w*h);
        });
    }
	
	// resize all images in articleList
	var articles = $("li.article");
	var maxWidth = 298;
	
	if( articles.size() > 0 )
	{
		$.each( articles, function( w, h ){
		
			var img = $(this).find("img");
			if ( img.attr("src") )
			{
				var nextWidth = maxWidth;
				w = img.width();
				h = img.height();
				if( h > 375 )
				{
					//nextWidth = 375 / h * w;
				}
				img.attr("width", nextWidth/w*w);
          		img.attr("height", nextWidth/w*h);
			}
		
		});
	}
	

});
