var hasFlash = false;

if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
	if(navigator.plugins && navigator.plugins["Shockwave Flash"])
		hasFlash = true;
} else if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows")>=0)) {
	document.write('<scr' + 'ipt language=VBScript>\n');
	document.write('on error resume next \n');
	document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('</scr' + 'ipt>');
}

if(hasFlash) {
  var prefix = "";
  if (ticker_xml_file.substring(0,1) != '/') {
    var offset = ticker_xml_file.indexOf("://");
    if (offset >= 0) {
      // Find the next slash.
      offset =  ticker_xml_file.indexOf("/", offset + 3);
      if (offset >= 0) {
	prefix = ticker_xml_file.substring(0, offset);
      } else {
	prefix = ticker_xml_file;
      }
    } else {
      prefix = "http://www.metro.se";
    }
    ticker_xml_file += "%26prefix%3d" + prefix;
  }
	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="425" height="30" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+prefix+'/templates/flash/ticker.swf?xmlLocation='+ticker_xml_file+'" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="play" value="true" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<embed src="'+prefix+'/templates/flash/ticker.swf?xmlLocation='+ticker_xml_file+'" menu="false" quality="high" bgcolor="#ffffff" width="425" height="30" name="ticker" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	document.write('<div class="break10">&nbsp;</div>');
}
