/**
 * @author jaymz
 */
(function($) {
	$.fn.vfcembed = function() {
		return this.each(function() {
		/* get base object to work with */
			var obj = $(this);
			var targetURL = obj.attr("title");
			obj.attr("title", "Embed "+targetURL); //make title attr something more useful
			var embedSTR = '<div class="embedbox">';
			embedSTR += '<textarea><object width="425" height="344"><param name="movie" value="'+targetURL+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="'+targetURL+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></textarea>';
			embedSTR += '</div>';
		/* plugin code here */
			obj.append(embedSTR);
			obj.wrapInner('<span class="embedbox-container"></span>');
			$(".embedbox").hide();
			obj.click(function() {
				$(this).find("div.embedbox").toggle();
			});
		/* end plugin */
		});
	};
}) (jQuery);

