Modified the code to handle all formats and fixed the context menu event in yui