function resizeplayer(w,h) {
	var divname = "mediaspot";
	if(isNaN(w)) { w = 320; }
	if(isNaN(h)) { h = 300; }
	if(document.getElementById) {
		document.getElementById(divname).style.width = w + "px";
		document.getElementById(divname).style.height = h + "px";
	} else if (document.all) {
		document.all[divname].style.pixelWidth = w;
		document.all[divname].style.pixelHeight = h;
	}
}
/*
// ----- FLASH DETECTION BEGIN
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
// ----- FLASH DETECTION END
*/
var randnum = Math.random();
var vidnum;
var xmlfile;
var lang;
var cmsvid;
var duration;
if(vidnum=="undefined") { vidnum=""; }
if(xmlfile=="undefined") { xmlfile=""; }
if(lang=="undefined") { lang="en"; }
if(cmsvid=="undefined") { cmsvid=""; }
if(duration=="undefined") { duration=""; }

// Check to see if the version meets the requirements for playback
if (hasReqestedVersion) {

	// ADTECH CODE
	//alert("before: " + typeof flashSWFURL_postroll );
	if ((typeof flashSWFURL_preroll == "undefined") || (typeof flashSWFURL_preroll != "string")) { flashSWFURL_preroll = ""; }
	if ((typeof flashCLICKURL_preroll == "undefined") || (typeof flashCLICKURL_preroll != "string")) { flashCLICKURL_preroll = ""; }
	if ((typeof flashDURATION_preroll == "undefined") || (typeof flashDURATION_preroll != "string")) { flashDURATION_preroll = ""; }
	if ((typeof flashSWFURL_postroll == "undefined") || (typeof flashSWFURL_postroll != "string")) { flashSWFURL_postroll = ""; }
	if ((typeof flashCLICKURL_postroll == "undefined") || (typeof flashCLICKURL_postroll != "string")) { flashCLICKURL_postroll = ""; }
	if ((typeof flashDURATION_postroll == "undefined") || (typeof flashDURATION_postroll != "string")) { flashDURATION_postroll = ""; }
	//alert("after: " + flashSWFURL_postroll);
	var so = new SWFObject("/common/flash/twnvideoplayer_generic_v3b_autoplay.swf?randnum="+randnum+"&clickTAG="+flashCLICKURL_preroll+"&clickTAG2="+flashCLICKURL_postroll, "twnflv", "100%", "100%", "8", "#000000");
	so.addVariable("flashSWFURL_pre", flashSWFURL_preroll);
	so.addVariable("flashCLICKURL_pre", flashCLICKURL_preroll);
	so.addVariable("flashDURATION_pre", flashDURATION_preroll);
	so.addVariable("flashSWFURL_post", flashSWFURL_postroll);
	so.addVariable("flashCLICKURL_post", flashCLICKURL_postroll);
	so.addVariable("flashDURATION_post", flashDURATION_postroll);
	
	so.addParam("loop","false");
	so.addParam("menu","false");
	so.addParam("wmode","opaque");
	so.addVariable("fv_vidnum", vidnum);
	so.addVariable("fv_xmlfile", xmlfile);
	so.addVariable("fv_lang", lang);
	//alert(flashSWFURL_preroll);
	//so.addVariable("fv_cmsvid", cmsvid);
	so.write("mediaspot");
} else {
	document.write(noFlashMsg[lang]);
//	document.write("<br /><a href=http://www.adobe.com/go/getflash/ target=_blank><img src=http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif width=112 height=33 border=0></a>");
}

