function insert_flash( url, width, height, module_name, id, alternative ) {
	var str = "", style = "";
	
	if( width || height ) {
		style = " style=\""+(width?"width:"+width+"px;":"")+(height?"height:"+height+"px;":"")+"\"";
		if( width ) {
			width = " width=\""+width+"\"";
		}
		if( height ) {
			height = " height=\""+height+"\"";
		}
	}
	if(navigator.appName!="Microsoft Internet Explorer")
		str = "<object class=\"flash "+module_name+""+id+"\" type=\"application/x-shockwave-flash\" data=\""+ url +"\" ";
		
	else
		str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" class=\"flash "+module_name+""+id+"\" type=\"application/x-shockwave-flash\" data=\""+ url +"\" ";
	
	str += style;
	str += width;
	str += height;
	str += ">\n<param name=\"movie\" value=\""+ url +"\" />";
	str += "<param name=\"wmode\" value=\"transparent\">";
	if(document.getElementById(alternative)) str += document.getElementById(alternative).innerHTML;
	str += "\n</object>\n";
	
	document.write(str);
}

// taken from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

function measurePoint(name, module_instance) {
	var url = "/extra/measurepoint/?module_instance=" + module_instance + "name=" + name + "url=";
	if (window.XMLHttpRequest) req = new XMLHttpRequest();
	else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP");
	if(!req) return;
	req.open("GET", url, true);
	req.send(null);
}
