/* jYoutube 1.0 - YouTube video image getter plugin for jQuery
 * Copyright (c) 2009 jQuery Howto
 * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.html
 * URL: http://jquery-howto.blogspot.com
 * Author URL: http://me.boo.uz
 * modied by Kumar

<img src="http://www.youtube.com/watch?v=H8v3UnMDC5M" movie="large"/>
<img src="http://www.youtube.com/watch?v=NIbCF-rxTu8" />

ONLY essential smarthomepage admin requirements here, all the others to each domain

 */

(function($){
        $.extend({
                jYoutubeSmall: function(){

                $('img').each(function(index) {
                        url = $(this).attr("src");
                        results = url.match("youtube\.com([^&#]*)");


                        if( results != null && $(this).attr("movie") != "large")
                        {
                                results = url.match("[\\?&]v=([^&#]*)");
                                vid = ( results === null ) ? url : results[1];
                                $(this).attr("src","http://img.youtube.com/vi/"+vid+"/2.jpg");

                }

                  });

                }


        })
})(jQuery);

(function($){
        $.extend({
                jYoutubeLarge: function(){



                $('img').each(function(index) {
                        url = $(this).attr("src");
                        results = url.match("youtube\.com([^&#]*)");


                        if( results != null && $(this).attr("movie") == "large")
                        {
                                results = url.match("[\\?&]v=([^&#]*)");
                                vid = ( results === null ) ? url : results[1];
                                $(this).attr("src","http://img.youtube.com/vi/"+vid+"/0.jpg");
                        }

                  });

                }


        })
})(jQuery);



$(document).ready(function() {
        $.jYoutubeSmall();
        $.jYoutubeLarge();
});
/* end of jyoutube */




