/*
 * play_video_in_div
 * By Stephen Marcus
 * Embed code for various video types - a small div with play button is expanded
*/
function play_video_in_div (videotype, clip, targetdiv, width, height){
if (videotype.toLowerCase() == "vimeo") { // clip is just numberic ID of vimeo clip
		document.getElementById(targetdiv).innerHTML = '<span class="mceItemObject" width="' + width + '" height="' + height + '"><span  name="autoPlay" value="true" class="mceItemParam"></span><span  name="allowfullscreen" value="true" class="mceItemParam"></span><span  name="allowscriptaccess" value="always" class="mceItemParam"></span><span  name="movie" value="http://vimeo.com/moogaloop.swf?autoplay=1&amp;clip_id=' + clip + '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=&amp;fullscreen=1&amp" class="mceItemParam"></span><span class="mceItemEmbed"  src="http://vimeo.com/moogaloop.swf?autoplay=1&amp;clip_id=' + clip + '&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" autoPlay="true" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '"></span></span><br clear="all">';
	} 
else if (videotype.toLowerCase() == "youtube") { // clip is full URL of YouTube Video
		document.getElementById(targetdiv).innerHTML = '<object width="' + width + '" height="' + height + '"><param name="movie" value="' + clip + '&amp;autoplay=1&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="' + clip + '&amp;autoplay=1&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' + width + '" height="' + height + '"></embed></object><br clear="all">';
	} 
else if (videotype.toLowerCase() == "flvfile") { // clip is full URL of video file
		document.getElementById(targetdiv).innerHTML = '<embed src="http://freevideocoding.com/flvplayer.swf?file='	+ clip + '&autoStart=true" width="' + width + '" height="' + height + '" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><br clear="all">';
	} 
else {
		document.getElementById(targetdiv).innerHTML = 'Unknown type ' + type;
	}
	return false;
}
