// Valid FaceBook social plugins
/*
 *
 * @author Zsolt Takács <tzs@glaskugel.hu> ~ 2010. Glaskugel Ltd ~ glaskugel.hu
 * @licence Creative Commons - use it wisely:)
 * @version 0.1
 *
 * Fake XFBML renderer to force skip the W3C validator xfbml tags.
 * It is not an XHTML valid solution, just a trick against the standards.
 *
 * Usage: $("#your_div").fakeXFBML( fb_tag:string , params:object );
 *
 * - fb_tag: like
 * - params: href, layout:standard|button_count|box_count, show_faces, width, action, font, colorscheme, ref:fb_ref|fb_source
 *
 * - fb_tag: like-box
 * - params: href, width, height, colorscheme, stream, header
 *
 * - fb_tag: activity
 * - params: site, width, height, header, colorscheme, font, border_color, recommendations, filter, ref
 *  *
 * - fb_tag: login-button
 * - params: show-faces, width, max-rows, perms
 *
 * - fb_tag: recommendations
 * - params: site, width, height, header, colorscheme, font, border_color, filter, ref
 *
 * - fb_tag: live-stream
 * - params: event_app_id, width, height, xid, via_url, always_post_to_friends
 *
 * - fb_tag: facepile
 * - params: href, app_id, max_rows, width
 *
 * - fb_tag: comments
 * - params: numposts, width, publish_feed
 *
 *
 **/

(function($){

  $.fn.fakeXFBML = function( fb_tag , params ){

    var container = $(this);
    params = params || {};
    fb_tag = $("<fb:" + fb_tag + "></fb:" + fb_tag + ">");

    $.each(params, function( key , value ) {
    fb_tag.attr( key , value );
    });

    fb_tag.appendTo(container);

  };

})(jQuery);

/*
 * First of all, you have to embed the FB scripts and xmlns:fb to HTML tag. Attention! The <script type="text/javascript" src="http://connect.facebook.net/hu_HU/all.js#xfbml=1"></script> MUST be after the fakeXFBML script !!!
 *
 * Second: You have to make a div like this:
 * <div id="fblike"></div>
 *
 * Third: Call the script like this:
 * $("#fblike").fakeXFBML("like-box",{"width":"300"});
 *
 * w00t! that's it. The fb:like-box will appear and the w3c will not alert.
 *
 **/

