function vimeo_embed(video_id, swf_id) {
	// Run the javascript when the page is ready
	var flashvars = {
	  clip_id: video_id,
	  show_portrait: 1,
	  show_byline: 1,
	  show_title: 1,
		js_api: 1, // required in order to use the Javascript API
		js_onLoad: 'vimeo_player_loaded', // moogaloop will call this JS function when it's done loading (optional)
		js_swf_id: swf_id // this will be passed into all event methods so you can keep track of multiple moogaloops (optional)
  };
  var params = {
		allowscriptaccess: 'always',
		allowfullscreen: 'true'
	};
	var attributes = {};
	
	// For more SWFObject documentation visit: http://code.google.com/p/swfobject/wiki/documentation
	return swfobject.embedSWF("http://vimeo.com/moogaloop.swf", swf_id, "504", "340", "9.0.0","expressInstall.swf", flashvars, params, attributes);
}

function vimeo_player_loaded(swf_id) {
	video = document.getElementById(swf_id);
	video.api_addEventListener('onPlay', 'vimeo_on_play');
	video.api_addEventListener('onPause', 'vimeo_on_pause');
	video.api_addEventListener('onFinish','vimeo_on_finish');		
}
		
function vimeo_on_play(swf_id) {
	$('img#wimpy-button').attr({src: wimpyButtonImagePlay});	// Change the button to a play button...
	wimpyButtonPause();	// Pause the Wimpy player...
}
		
function vimeo_on_finish(swf_id) {
	$('img#wimpy-button').attr({src: wimpyButtonImagePause});	// Change the button to a pause button...
	wimpyButtonPlay(wimpyButtonCurrentFile);	// Restart the Wimpy player with the current file - wimpyButtonCurrentFile is taken from wimpy_button_bridge.js...
}
