window.insert_video = function(insert_id, video_src, options) {
    if (options === undefined) options = { };
    if (insert_id === undefined) return false;
    if (video_src === undefined) return false;

    var flashvars = {
	autoplay: (options.autoplay !== undefined) ? options.autoplay : false
	, vdo: video_src // path to video
	, sound: 50 // sound volume 0 to 100
	//, advert: "" // intro or commercial video (optional)
	//, advertdesc: "" // the intro or commercial title (optional)
	//, mylogo: "" // the path to a image file representing your logo (optional)
	//, tracker: "" // URL to track videos on play for statistics (optional)
	//, buffer: 2 // buffer size in seconds // type: number, default:2 if missing
	//, splashscreen: "" // splash image url (optional)
	//, clickTAG: "" // creates a clickable button over video. clickTAG variable should be a URL (optional)
	//, endclipaction: auto call a url or javascript function (eg: javascript:yourjsfunction();) at the end of the clip. Very useful when using playlists. (optional)
    };
    var params = {
		wmode: "transparent"
	}; // Object parameters
	if (options.params !== undefined) params = jQuery.extend(params, options.params);
    var attr = {}; // Object attributes
    var callback = null; // Callback func
	//callback = function(i) { window.f = i; console.log(i); };
    swfobject.embedSWF('/flash/gddflvplayer.swf'
		       , insert_id
		       , (options.width !== undefined) ? String(options.width) : "300"
		       , (options.height !== undefined) ? String(options.height) : "225"
		       , (options.version !== undefined) ? options.version : "7.0"
		       , null , flashvars, params, attr, callback);
};

