// builds and displays embed tags in the embed advanced text box
function showEmbedTags(videoID, videoThreadID, blogEnabled) {
	var lw_embedAdvanced = jQuery('#lw-embedAdvanced-' + videoThreadID);
	var lw_videoEmbedAdvanced = jQuery('#lw-video-embed-advanced-' + videoThreadID);
	jQuery('#lw-video-embed-advanced-' + videoThreadID).dialog("open");

	var videoTags = '<embed width="400" height="250" ';
	videoTags += 'flashvars="baseURL=' + window.location.host + '&basePort=&VideoID=' + videoID + '&videoThreadID=' + videoThreadID + '&blogEnabled=' + blogEnabled + '&blogURL=/thread.jspa?threadID='+ videoThreadID + '&lw_showBlog=1#lw-video-post-blog&langCode=' + flashLocale + '" ';
	videoTags += 'wmode="opaque" salign="tl" quality="high" bgcolor="#000000" name="FLVPlayer" id="FLVPlayer" ';
	videoTags += 'src="http://' + window.location.host + '/standard/flvPlayer.swf" type="application/x-shockwave-flash"><\/embed>';
	
	videoTags += '<p class="embed-overlay" style="height: 1px;">';
	// blog button link
	videoTags += '<p style="border: 0px; width: 130px; height: 32px; position: relative; top: -170px; left: 135px;">';
	videoTags += '<a href="http://' + window.location.host + '/thread.jspa?threadID='+videoThreadID+'&lw_showBlog=1#lw-video-post-blog"><img width="130" height="32" style="border: none; padding: 0px;" border="0" src="http://' + window.location.host + '/images/spacer.gif" /><\/a><\/p>';
	// share link
	videoTags += '<p style="border: 0px; width: 130px; height: 32px; position: relative; top: -165px; left: 135px;">';
	videoTags += '<a href="http://' + window.location.host + '/refer.jspa?threadID='+videoThreadID+'"><img width="130" height="32" style="border: none; padding: 0px;" border="0" src="http://' + window.location.host + '/images/spacer.gif" /><\/a><\/p>';
	// full screen button
	videoTags += '<p style="border: 0px; width: 15px; height: 15px; position: relative; top: -130px; left: 378px;">';
	videoTags += '<a href="http://' + window.location.host + '/standard/viewFullScreen.html?videoID='+videoID+'&videoThreadID='+videoThreadID+'&blogFlashURL=' + window.location.host + '&blogEnabled=' + blogEnabled + '&lang=' + flashLocale + '" target="_blank"><img width="15" height="15" style="border: none; padding: 0px;" border="0" src="http://' + window.location.host + '/images/spacer.gif" /><\/a><\/p>';
	videoTags += '<\/p>';
	// display tags in embed advanced text box
	lw_embedAdvanced.val(videoTags);
}

// scrolls browser window to the top of the blog or comment form
function scrollToPostForm(formID) {
	var theForm = document.getElementById(formID);
	var offTop = theForm.offsetTop;
	scrollTo(0,offTop);
}

function embedVideoTag() {
	var lw_videoBlogBody = null;
	lw_videoBlogBody = document.postform.body;
	if (lw_videoBlogBody == null) {
		lw_videoBlogBody = document.getElementById("lw-video-blog-body");
	}
	lw_videoBlogBody.value += videoTags;
}

