function createSWFbox( swfName, swfWidth, swfHeight, swfBackground, swfURL ) {
	var pageBody = document.getElementById("mainimage");

	// start creating the div structure 
	var SWFbox = document.createElement("div");
	SWFbox.setAttribute('id',swfName);
	SWFbox.className = 'swfbox';
	pageBody.appendChild(SWFbox);

	var SWFbox_container = document.createElement("div");
	SWFbox_container.className = 'swfbox-container';
	SWFbox.appendChild(SWFbox_container);

	var SWFbox_content = document.createElement("div");
	SWFbox_content.className = 'swfbox-content';
	SWFbox_container.appendChild(SWFbox_content);
	SWFbox_content.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.124" width="'+swfWidth+'" height="'+swfHeight+'" id="'+swfName+'-flash" class="swfbox-flash"><param name="wmode" value="transparent"/><param name="allowScriptAccess" value="always" /><param name="flashvars" value="libPath='+escape(libPath)+'&type='+escape(vidType)+'&buildURL='+escape(buildURL)+'" /><param name="movie" value="'+swfURL+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+swfBackground+'" /><embed wmode="transparent" src="'+swfURL+'" quality="high" bgcolor="'+swfBackground+'" width="'+swfWidth+'" height="'+swfHeight+'" name="'+swfName+'-flash" class="swfbox-flash" flashvars="libPath='+escape(libPath)+'&type='+escape(vidType)+'&buildURL='+escape(buildURL)+'" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>';
}


function hideSWFbox(swfName) {
	// hide the swfbox
	var pageBody = document.getElementById("mainimage");
	var SWFbox =document.getElementById(swfName);
	SWFbox.style.display = 'none';
	pageBody.removeChild(SWFbox);
}

function SWFbox( swfName, swfWidth, swfHeight, swfBackground, swfURL ) {
	// create the div structure
	createSWFbox( swfName, swfWidth, swfHeight, swfBackground, swfURL );
	// make the swfbox visible
	document.getElementById(swfName).style.display='block';
	//document.getElementById("flashEmbed_").style.visibility="hidden";
}