/**
 * Vimeo Embed Plugin for LTB coded by H2G Internetagentur
 *
 * Short Plugin to replace on the fly all anchor elements
 * having class named 'vimeo' with an iframe and linking
 * to the vimeo player showing the movie. This is mainly
 * to support embedding vimeo movies over the wysiwyg
 * textarea editor inside the cms system.
 *
 * @author michael.kuck@h2g.ch
 * @version 1.00 02.12.20210
 */
(function($) {
	// define the vimeo plugin
	$.fn.vimeo = function(options) {
		// build main options before initial procedure
		var opts = $.extend({}, $.fn.vimeo.defaults, options);
		// initialize vimeo plugin
		return this.each(function() {
			// initialize vimeo iframe window
			var vimeo = $("<iframe></iframe>").attr({
				'class':$(this).attr('class'),
				'src':$(this).attr('href'),
				'frameborder':'0',
				'width':$(this).find('img').width(),
				'height':$(this).find('img').height()
			});
			// replace anchor with vimeo iframe
			$(this).replaceWith(vimeo);
		});
	}
	function debug($msg) {
		if (window.console && window.console.log)
			window.console.log('debug: '+$msg);
	}
	$.fn.vimeo.defaults = {
		
	}
})(jQuery);
