function AddFlash(location,container,width,height,flashvars,params,callback)
{
	var response={success:false,id:container};
	s(container).visibility='hidden';
	var obj=createObject(location,container,width,height,flashvars,params);
	s(container).visibility='visible';
	response.success = true;
	response.ref = obj;
	if(callback)
		obj.onload=callback;
}
function RemoveFlash(id)
{
	var obj=d(id);
	var temp=create('div');
	temp.id=id;
	obj.parentNode.replaceChild(temp,obj);
}
function createParameter(object,name,value)
{
	var p=create('param');
	p.setAttribute('name', name);	
	p.setAttribute('value', value);
	object.appendChild(p);
}
function createObject(location,container,width,height,flashvars,params)
{
	var o=create('object');
	o.id=container;
	o.width=width;
	o.height=height;
	o.setAttribute('data',location);
	o.setAttribute('type','application/x-shockwave-flash');
	createParameter(o,'movie',location);
	for(var i in params)
	{
		createParameter(o,i,params[i]);
	}
	createParameter(o,'flashvars',flashvars);
	d(container).parentNode.replaceChild(o,d(container));
	return o;
}
