function playVideo(){
    switch(document.body.id){
        case "coseal":
            var videolocation = "/img/videos/features/CoSeal_Carotid.swf";
            var flashbgcolor = "#8C7DCF";
            var noflashlocation = "applications.html#videos";
            break;
        case "floseal":
            var videolocation = "/img/videos/features/FloSeal_Porcine.swf";
            var flashbgcolor = "#C71444";
            var noflashlocation = "applications.html#videos";
            break;
        case "tisseel":
            var videolocation = "/img/videos/features/Tisseel_Spleen_sml.swf";
            var flashbgcolor = "#00A4E8";
            var noflashlocation = "../../products/floseal/applications.html#videos";
            break;
        case "home":
            var videolocation = "/img/videos/features/Tools_sml.swf";
            var flashbgcolor = "#49484E";
            var noflashlocation = "products/floseal/applications.html#videos";
            break;
        default:
            var videolocation = "/img/videos/features/Tools_sml.swf";
            var flashbgcolor = "#49484E";
            var noflashlocation = "products/floseal/applications.html#videos";
            break;
    }
    var flashfail = "noflash"; //defining a string to be passed back if no flash
    var flash = flashHTML( 5, videolocation, '160', '120', flashbgcolor, 'high', 'true', flashfail)

    if (flash != flashfail) { //if we didn't get that string passed back show the flash
        writeHTML(getElement('videolink'), "<br />"+flash);
        return false; //kill the link
    }
    else { //but if they don't have flash set the href and follow the link
        var theanchor = getElement('videolink');
        theanchor.href = noflashlocation;
        return true;
    }
}

addOnload("writeFlash();");

function writeFlash(){
    switch(document.body.id){
        case "coseal":
            var flashlocation = "/img/animations/CoSeal.swf";
            var altimage = '<img src="/img/animations/stills/coseal.jpg" width="185" height="250" alt="Preloaded, Ready When You Are" border="0" />';
            var flashbgcolor = "#8C7DCF";
            break;
        case "floseal":
            var flashlocation = "/img/animations/FloSeal.swf";
            var altimage = '<img src="/img/animations/stills/floseal.jpg" width="185" height="250" alt="Stop Bleeding Now" border="0" />';
            var flashbgcolor = "#C71444";
            break;
        case "tisseel":
            var flashlocation = "/img/animations/Tisseel.swf";
            var altimage = '<img src="/img/animations/stills/tisseel.jpg" width="185" height="250" alt="Powered by Nature" border="0" />';
            var flashbgcolor = "#00A4E8";
            break;
        case "home":
            var flashlocation = "/img/animations/Tools.swf";
            var altimage = '<img src="/img/animations/stills/tools.jpg" width="185" height="250" alt="Tools of the Trade" border="0" />';
            var flashbgcolor = "#49484E";
            break;
        default:
            var flashlocation = "/img/animations/Tools.swf";
            var altimage = '<img src="/img/animations/stills/tools.jpg" width="185" height="250" alt="Tools of the Trade" border="0" />';
            var flashbgcolor = "#49484E";
            break;
    }
    writeHTML(getElement('flash'), flashHTML( 5, flashlocation, '185', '250', flashbgcolor, 'high', 'true', altimage));
}


// ##########################################
// * Flash Sniffer * Version Date: 12/02/02 *
// ##########################################

var FLASH_MAX = 15; // the latest Flash plug-in version or higher
var FLASH_VERSION = 0;

var agent = navigator.userAgent.toLowerCase();
if(navigator.plugins != null && navigator.plugins.length > 0){
	var plugin = navigator.plugins['Shockwave Flash'];
	if(typeof plugin == 'object'){
		for(i=3; i<= FLASH_MAX; i++){
			if(plugin.description.indexOf(i+'.') != -1){
				FLASH_VERSION = i;
			}
		}
	}
}else if(document.all && agent.indexOf('win') != -1 && agent.indexOf('16bit') == -1){
	document.write('<'+'script language="VBScript"'+'> \n');
		document.write('set FlashObj = Nothing \n');
		document.write('on error resume next \n');
		document.write('For i = '+FLASH_MAX+' to 3 step -1 \n');
			document.write('set FlashObj = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n');
			document.write('If (Not(FlashObj is Nothing)) Then \n');
				document.write('FLASH_VERSION = i \n');
				document.write('Exit For \n');
			document.write('End If \n');
		document.write('Next \n');
	document.write('<'+'\/script'+'> \n');
}else if(agent.indexOf('webtv/2.5') != -1){
	FLASH_VERSION = 3;
}else if(agent.indexOf('webtv') != -1){
	FLASH_VERSION = 2;
}else{
	FLASH_VERSION = -1;
}
function flashHTML(version, name, width, height, bgcolor, quality, menu, noflash, flashvars){
	flashvars = flashvars!=null ? flashvars : '';
	if(FLASH_VERSION >= version){
		var swf = '';
		swf += '<object';
		swf += ' width="'+width+'"';
		swf += ' height="'+height+'"';
		swf += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		swf += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0">';
		swf += '<param name="movie" value="'+name+'?'+flashvars+'">';
		swf += '<param name="FlashVars" value="'+flashvars+'">'
		swf += '<param name="bgcolor" value="'+bgcolor+'">';
        swf += '<param name="wmode" value="transparent">';
		swf += '<param name="quality" value="'+quality+'">';
		swf += '<param name="menu" value="'+menu+'">';
			swf += '<embed src="'+name+'?'+flashvars+'"';
			swf += ' Flashvars="'+flashvars+'"';
			swf += ' width="'+width+'"';
			swf += ' height="'+height+'"';
			swf += ' bgcolor="'+bgcolor+'"';
            swf += ' wmode="transparent"';
			swf += ' quality="'+quality+'"';
			swf += ' menu="'+menu+'"';
			swf += ' type="application/x-shockwave-flash"';
			swf += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
			swf += '<\/embed>';
		swf += '<\/object>';
        return swf;
	}else{
        return noflash;
	}
}