# -*- coding: iso-8859-1 -*-

def execute(macro, text):
    if text.find('http://')> -1:
        url = text
    else:
        url = 'http://video.google.com/googleplayer.swf?docId=%s' % text
    html = '''
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="%(gvidlink)s&hl=en" flashvars=""> </embed>
    ''' % {"gvidlink": url}
    return html
