document.write('<scr'+'ipt language="javascript1.1">\n');
document.write('<!--\n');

// Site name, used for tracking
document.write('var srp_siteName = \'Tear-off\';\n');

// URL for the Flash, settings file and default image
document.write('var srp_swfPath = \'iplayer-launcher.swf\';\n');
document.write('var srp_setPath = \'settings.xml\';\n');
document.write('var srp_defaultPath = \'http://extdev.bbc.co.uk/radio/iplayer-launcher/default.jpg\';\n');

// Flash version required
document.write('var srp_flashVersion = 8;\n');

// Full embed code (do not edit)
document.write('var srp_flashPlay = false;\n');
document.write('var srp_pluginVersion = 0;\n');
document.write('window.name="main";\n');
document.write('function aodpopup(URL){\n');
document.write('window.opendocument.write(\'URL\',\'aod\',\'width=693,height=525,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,resizable=yes,left=60,screenX=60,top=100,screenY=100\');');
document.write('}\n');
document.write('if(location.search.substring(1)=="focuswin") {\n');
document.write('	window.focus();\n');
document.write('}\n');
document.write('	function flashDetect() {\n');
document.write('		var flashinstalled = 0;\n');
document.write('		var flashversion = 0;\n');
document.write('		if (navigator.plugins && navigator.plugins.length) {\n');
document.write('			x = navigator.plugins["Shockwave Flash"];\n');
document.write('			if (x) {\n');
document.write('				flashinstalled = 2;\n');
document.write('				if (x.description) {\n');
document.write('					y = x.description;\n');
document.write('					flashversion = y.charAt(y.indexOf(\'.\')-1);\n');
document.write('				}\n');
document.write('			} else {\n');
document.write('				flashinstalled = 1;\n');
document.write('			}\n');
document.write('			if (navigator.plugins["Shockwave Flash 2.0"]) {\n');
document.write('				flashinstalled = 2;\n');
document.write('				flashversion = 2;\n');
document.write('			}\n');
document.write('		} else if (navigator.mimeTypes && navigator.mimeTypes.length) {\n');
document.write('			x = navigator.mimeTypes[\'application/x-shockwave-flash\'];\n');
document.write('			if (x && x.enabledPlugin) {\n');
document.write('				flashinstalled = 2;\n');
document.write('			} else {\n');
document.write('				flashinstalled = 1;\n');
document.write('			}\n');
document.write('		} else {\n');
document.write('			for(var i=9; i>0; i--) {\n');
document.write('				flashVersion = 0;\n');
document.write('				try {\n');
document.write('					var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);\n');
document.write('					flashVersion = i;\n');
document.write('					//alert(\'Hmm:\'+flashVersion);\n');
document.write('					var returnValue = new Array()\n');
document.write('					returnValue[\'installed\'] = 1;\n');
document.write('					returnValue[\'version\'] = flashversion;\n');
document.write('					return returnValue;\n');
document.write('					continue;\n');
document.write('				}\n');
document.write('				catch(e) {\n');
document.write('					//alert(\'Hmm:\'+flashVersion);\n');
document.write('				}\n');
document.write('			}\n');
document.write('		}\n');
document.write('		var returnValue = new Array()\n');
document.write('		returnValue[\'installed\'] = flashinstalled;\n');
document.write('		returnValue[\'version\'] = flashversion;\n');
document.write('		return returnValue;\n');
document.write('	}\n');
document.write('var flVersion = flashDetect();');
document.write('srp_flashPlay = flVersion[\'installed\'];\n');
document.write('srp_pluginVersion = flVersion[\'version\'];\n');
//document.write('alert(srp_flashPlay+" = "+srp_pluginVersion+" >= "+srp_flashVersion+" | MSIE "+navigator.userAgent.indexOf("MSIE"));');
document.write('if ( srp_flashPlay ) {');
document.write('	document.write(\'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="300" height="160" id="bbcradioplayer">\');');
document.write('	document.write(\'<param name="allowScriptAccess" value="always" />\');');
document.write('	document.write(\'<param name="movie" value="\'+srp_swfPath+\'?path=\'+srp_setPath+\'&src=\'+srp_swfPath+\'" />\');');
document.write('	document.write(\'<param name="quality" value="high" />\');');
document.write('	document.write(\'<param name="bgcolor" value="#000000" />\');');
document.write('	document.write(\'<embed src="\'+srp_swfPath+\'?path=\'+srp_setPath+\'&src=bbcradio.swf&srp_siteName=\'+srp_siteName+\'" quality="high" bgcolor="#000000" width="300" height="160" name="bbcradioplayer" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\');');
document.write('	document.write(\'</object>\');');
document.write('} else{');
document.write('	document.write(\'<a href="http://www.bbc.co.uk/radio/" title="Listen to BBC radio" target="_blank"><img src="\'+srp_defaultPath+\'" alt="Listen to BBC Radio" width="300" height="160" /></a>\');');
document.write('}');
document.write('//-->');
document.write('</script>');