/********************************************************************
* Rodrigo San Martin: External embedding for QuikTime in IE 7.0
**********************************************************************
*/

function writeQuickTimeObject(MediaFileUrl, width, height, autoplay)
{
	document.write(getQuickTimeObject(MediaFileUrl, width, height, autoplay));
}

function getQuickTimeObject(MediaFileUrl, width, height, autoplay)
{
	var v = "";
	v += "<style type='text/css'>embed { margin: 2px; padding: 0px; background: transparent;</style>";
	if ( width == null || height == null ) 
		v +="<embed id='movieObject' src='" + MediaFileUrl +"'";
	else {
		height = height + 25;
		v +="<embed id='movieObject' style='height: " + height + "px; width: " + width + "px;' src='" + MediaFileUrl +"'";
	}
	if ( autoplay != "no" )
		v +="autoplay='true' ";
	else
		v +="autoplay='false' ";
		
	v +="controller='true' ";
	v +="loop='false' ";
	v +="pluginspage='http://www.apple.com/quicktime/download/'>";
	v +="</embed>";
	
	var quickTimeIsInstalled = detectQuickTime();
	if(!quickTimeIsInstalled)
		v +="<br>For å se video blogg trykk linken <a href=\"http://www.apple.com/quicktime/download/\">quicktime</a> for videoblogg.";
  		//alert('You have the QuickTime plug-in.');
	// 
	
	return v;
}
