


    
    function showVideoContainerEx(flvPlayer, smallVideo, flashWidth, flashHeight, flashId, flashBgColor, flvPlayerLarge,largeVideo, startImg, autoPlay, soundOn){

		if(flvPlayer.indexOf("videoContainer_large.swf") == -1)
		{
			// append player-parameter only when rendering small video player (then this url is used to call FlashPopup.js)
			largeVideo = largeVideo + "%26player%3D" + flvPlayerLarge;
		}
		var FlashCode = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
		+ 'id="' + flashId + '" '
		+ 'width="'+flashWidth+'" '
		+ 'height="' + flashHeight + '"/>'
		+ '<param name="movie" '
		+ 'value="' + flvPlayer + '?flvPath=' + smallVideo + '&flvPathLarge=' + largeVideo + '&popUpURL=coremedia/templates/www/FlashPopup.jsp&startImagePath='+startImg+'&customer=SVDO&soundOn='+soundOn+'&autoplay='+autoPlay+'&description="/>'
		+ '<param name="bgcolor" '
		+ 'value="'+flashBgColor+'"/>'
		+ '<param name="quality" value="high"/>'
		+ '<embed '
		+ 'src="' + flvPlayer + '?flvPath=' + smallVideo + '&flvPathLarge=' + largeVideo + '&popUpURL=coremedia/templates/www/FlashPopup.jsp&startImagePath='+startImg+'&customer=SVDO&soundOn='+soundOn+'&autoplay='+autoPlay+'&description=" '
		+ 'width="' + flashWidth + '" '
		+ 'height="'+flashHeight+'" '
		+ 'name="videoContainer_small" '
		+ 'bgcolor="'+flashBgColor+'" '
		+ 'quality="high" '
		+ 'align="middle" '
		+ 'loop="false" '
		+ 'quality="high" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
		+ '<\/embed/>'
		+ '<\/object/>';

			document.write(FlashCode);
    }

function showVideoContainer(Player, VideoSmall, VideoLarge, PopUpURL, StartImage, SoundOn, AutoPlay, Description){

	var FlashCode = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
		+ 'id="videoContainer_small" ' 
		+ 'width="284" ' 
		+ 'height="229"/>'
		+ '<param name="movie" '
		+ 'value="' + Player + '?flvPath='+VideoSmall+'&flvPathLarge='+VideoLarge+'&popUpURL='+PopUpURL+'&startImagePath='+StartImage+'&customer=SVDO&soundOn='+SoundOn+'&autoplay='+AutoPlay+'&description='+Description+'"/>'
		+ '<param name="bgcolor" '
		+ 'value="#ffffff"/>'
		+ '<param name="quality" value="high"/>'
		+ '<embed '
		+ 'src="' + Player + '?flvPath='+VideoSmall+'&flvPathLarge='+VideoLarge+'&popUpURL='+PopUpURL+'&startImagePath='+StartImage+'&customer=SVDO&soundOn='+SoundOn+'&autoplay='+AutoPlay+'&description='+Description+'" '
		+ 'width="284" '
		+ 'height="229" '
		+ 'name="videoContainer_small" '
		+ 'bgcolor="#ffffff" '
		+ 'quality="high" '
		+ 'align="middle" '
		+ 'loop="false" '
		+ 'quality="high" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
		+ '<\/embed/>'
		+ '<\/object/>';
		
		//alert(FlashCode);
		
		document.write(FlashCode);
}



function showVideoContainerVDO(Player, VideoSmall, VideoLarge, PopUpURL, StartImage, SoundOn, AutoPlay, Description){

	var FlashCode = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
		+ 'id="videoContainer_small" '
		+ 'width="264" '
		+ 'height="213"/>'
		+ '<param name="movie" '
		+ 'value="' + Player + '?flvPath='+VideoSmall+'&flvPathLarge='+VideoLarge+'&popUpURL='+PopUpURL+'&startImagePath='+StartImage+'&customer=SVDO&soundOn='+SoundOn+'&autoplay='+AutoPlay+'&description='+Description+'"/>'
		+ '<param name="bgcolor" '
		+ 'value="#ffffff"/>'
		+ '<param name="quality" value="high"/>'
		+ '<embed '
		+ 'src="' + Player + '?flvPath='+VideoSmall+'&flvPathLarge='+VideoLarge+'&popUpURL='+PopUpURL+'&startImagePath='+StartImage+'&customer=SVDO&soundOn='+SoundOn+'&autoplay='+AutoPlay+'&description='+Description+'" '
		+ 'width="264" '
		+ 'height="213" '
		+ 'name="videoContainer_small" '
		+ 'bgcolor="#ffffff" '
		+ 'quality="high" '
		+ 'align="middle" '
		+ 'loop="false" '
		+ 'quality="high" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
		+ '<\/embed/>'
		+ '<\/object/>';

		//alert(FlashCode);

		document.write(FlashCode);
}

function CreateControl(CLSID, ObjectID, WIDTH, HEIGHT, URL, AUTOSTART, BGCOLORFLASH)
	{
		var FlashCode = '<object classid="' + CLSID  + '" '
		+ 'id="' +		ObjectID + '" ' 
		+ 'width="' +	WIDTH + '" ' 
		+ 'height="' +	HEIGHT + '"/>'
		+ '<param name="movie" '
		+ 'value="' +	URL + '"/>'
		+ '<param name="autoStart" '
		+ 'value="' +	AUTOSTART + '"/>'
		+ '<param name="bgcolor" '
		+ 'value="' +	BGCOLORFLASH + '"/>'
		+ '<param name="quality" value="high"/>'
		+ '<embed '
		+ 'src="' +		URL + '" '
		+ 'width="' +	WIDTH + '" '
		+ 'height="' +	HEIGHT + '" '
		+ 'name="' +	ObjectID + '" '
		+ 'play="' +	AUTOSTART + '" '
		+ 'bgcolor="' + BGCOLORFLASH + '" '
		+ 'quality="high" '
		+ 'aligh="middle" '
		+ 'loop="false" '
		+ 'quality="high" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
		+ '<\/embed/>'
		+ '<\/object/>';
		//alert(FlashCode);
		
		document.write(FlashCode);
	}
	

//Flash
function showFlash(classname, flashID, flashSrc, flashWidth, flashHeight, flashParameter1, flashParameter2, flashParameter3, flashParameter4, flashParameter5) {
	
	if (!DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision) || flashSrc == "") {
	
		setTimeout("visiblePicture('" + flashID + "')", 50);
		return;
	}

	var sTmp = "";
	sTmp += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	sTmp += '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"';
	sTmp += '	class="' + classname + '"';
	sTmp += '	WIDTH="' + flashWidth + '"';
	sTmp += '	HEIGHT="' + flashHeight + '"';
	sTmp += '	id="flashid' + flashID + '"';
	sTmp += '	ALIGN="">';
	sTmp += '	<param name="movie" value="' + flashSrc + '" />';
	sTmp += '	<param name="play" value="true">';
	sTmp += '	<param name="loop" value="true">';
	sTmp += '	<param name="quality" value="high">';
	sTmp += '	<param name="menu" value="false">';  					
	if (flashParameter1)
		sTmp += '	<param name="FlashVars" value="' + flashParameter1.replace('"', '\\"') + '">';
	if (flashParameter2)
		sTmp += '	<param name="FlashVars" value="' + flashParameter2.replace('"', '\\"') + '">';
	if (flashParameter3)
		sTmp += '	<param name="FlashVars" value="' + flashParameter3.replace('"', '\\"') + '">';
	if (flashParameter4)
		sTmp += '	<param name="FlashVars" value="' + flashParameter4.replace('"', '\\"') + '">';
	if (flashParameter5)
		sTmp += '	<param name="FlashVars" value="' + flashParameter5.replace('"', '\\"') + '">';
	
	sTmp += '	<EMBED src="' + flashSrc + '"';
	sTmp += '		class="' + classname + '"';
	sTmp += '		quality="high" play="true" loop="true" menu="false"';
	sTmp += '		swLiveConnect="true"';
	sTmp += '		WIDTH="' + flashWidth + '"';
	sTmp += '		HEIGHT="' + flashHeight + '"';
	sTmp += '		NAME="' + flashID + '"';
	sTmp += '		TYPE="application/x-shockwave-flash" ';
	sTmp += '		PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
	if (flashParameter1)
		sTmp += '	FlashVars="' + flashParameter1.replace('"', '\\"') + '"';
	if (flashParameter2)
		sTmp += '	FlashVars="' + flashParameter2.replace('"', '\\"') + '"';
	if (flashParameter3)
		sTmp += '	FlashVars="' + flashParameter3.replace('"', '\\"') + '"';
	if (flashParameter4)
		sTmp += '	FlashVars="' + flashParameter4.replace('"', '\\"') + '"';
	if (flashParameter5)
		sTmp += '	FlashVars="' + flashParameter5.replace('"', '\\"') + '"';
	sTmp += '		>';
	sTmp += '	</EMBED> ';
	sTmp += '</object>';
	
	document.write(sTmp);
}
function visiblePicture(flashID)
{
	var oPicElm = document.getElementById("imgid" + flashID);
	if (!oPicElm)
		return;
	oPicElm.style.display = "inline";
}
// -------------------------------------- FLASHDETECTION
function flashVersion(version)
{
	var myBrowser = new Browser(version);
	if (myBrowser.isFlashed) return true;
	else return false;	
	//return false;
}
function Browser(requiredFlashVersion)
{ 
	this.isIE=false;
	this.isNS=false;
	this.isOpera=false;
	this.isMozilla=false;
	
	this.isWin=false;								
	this.isMac=false;
	this.isLinux=false;					
	
	this.version=0;	
	this.isFlashed=false;
	
	var maxFlashVersion=7;
	var agent=navigator.userAgent.toLowerCase();									
	
	this.isIE = agent.indexOf("msie") != -1 && agent.indexOf("opera") == -1; 
	this.isNS = (agent.indexOf("netscape") != -1 || navigator.appName == "Netscape") && agent.indexOf("opera") == -1; // in netscape4 "netscape" doesn't appear in navigator.userAgent
	
	this.isOpera = agent.indexOf("opera") != -1;
	this.isMozilla = agent.indexOf("mozilla") != -1;
	this.isKonqueror = agent.indexOf("konqueror") != -1;					
	
	this.isWin = agent.indexOf("win") != -1;		
	this.isMac = agent.indexOf("mac") != -1;
	this.isLinux = agent.indexOf("linux") != -1;
						
	var minor = parseFloat(navigator.appVersion);
	
	if (this.isNS)
	{
		if (minor >= 5)
		{
			this.version=6;
		} else
		{
			this.version=minor;
		}
		
	}else if(this.isKonqueror)
	{
		this.version=minor;

	}else if(this.isIE)
	{
		if (agent.indexOf("msie 5") != -1 && minor == 4)
		{
			this.version = 5;
		} else
		{
			this.version = minor;
		}

	}else if (this.isOpera)
	{
		if (agent.indexOf("opera 2") != -1 || agent.indexOf("opera/2") != -1) 
		this.version=2;
		if (agent.indexOf("opera 3") != -1 || agent.indexOf("opera/3") != -1) 
		this.version=3;						
		if (agent.indexOf("opera 4") != -1 || agent.indexOf("opera/4") != -1) 
		this.version=4;						
		if (agent.indexOf("opera 5") != -1 || agent.indexOf("opera/5") != -1) 
		this.version=5;
		if (agent.indexOf("opera 6") != -1 || agent.indexOf("opera/6") != -1) 
		this.version=6;			    					
	}
	
	// -------------------------------------- WIN/IE FLASH VERSION CHECK
	
	if (this.isIE && this.isWin)
	{
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');		
		for (i = requiredFlashVersion; i<maxFlashVersion+1; i++)
		{
			document.write('flash' + i + 'Installed = false \n');
			document.write('flash' + i + 'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + i + '"))) \n');			
		}			
		document.write('</SCR' + 'IPT\> \n');		
	
		for (i = requiredFlashVersion; i<maxFlashVersion+1; i++)
		{
			if (eval("flash" + i + "Installed"))
			{
				this.isFlashed=true;
				break;
			}
		}
			
	// -------------------------------------- REST FLASH VERSION CHECK
	
	} else if (navigator.plugins && navigator.plugins["Shockwave Flash"])
	{
		var plugin = navigator.plugins["Shockwave Flash"];							
		this.isFlashed = (plugin.description.charAt(plugin.description.indexOf(".")-1) >= requiredFlashVersion);
	}
}



// ------------------------------------- FLASH VERSION CHECK CODE

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------

// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
				var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
				versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
			} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
		reqVer = parseFloat(reqMajorVer + "." + reqRevision);
		// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
			// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
}


