/* * This file contains functions to generate OBJECT, EMBED, and APPLET tags. * Adapted from AC_QuickTime.js */ var gTagAttrs = null; function _FWAddAttribute(prefix, slotName, tagName) { var value; value = gTagAttrs[prefix + slotName]; if ( null == value ) value = gTagAttrs[slotName]; if ( null != value ) { if ( 0 == slotName.indexOf(prefix) && (null == tagName) ) tagName = slotName.substring(prefix.length); if ( null == tagName ) tagName = slotName; return tagName + '="' + value + '" '; } else return ""; } function _FWAddObjectAttr(slotName, tagName) { if ( 0 == slotName.indexOf("emb#") ) return ""; if ( 0 == slotName.indexOf("obj#") && (null == tagName) ) tagName = slotName.substring(4); return _FWAddAttribute("obj#", slotName, tagName); } function _FWAddEmbedAttr(slotName, tagName) { if ( 0 == slotName.indexOf("obj#") ) return ""; if ( 0 == slotName.indexOf("emb#") && (null == tagName) ) tagName = slotName.substring(4); return _FWAddAttribute("emb#", slotName, tagName); } function _FWAddAppletAttr(slotName, tagName) { if ( 0 == slotName.indexOf("obj#") ) return ""; if ( 0 == slotName.indexOf("app#") && (null == tagName) ) tagName = slotName.substring(4); return _FWAddAttribute("app#", slotName, tagName); } function _FWAddObjectParam(slotName, generateXHTML) { var paramValue; var paramStr = ""; var endTagChar = (generateXHTML) ? ' />' : '>'; if ( -1 == slotName.indexOf("emb#") ) { paramValue = gTagAttrs["obj#" + slotName]; if ( null == paramValue ) paramValue = gTagAttrs[slotName]; if ( 0 == slotName.indexOf("obj#") ) slotName = slotName.substring(4); if ( null != paramValue ) paramStr = ' \n' + _FWAddObjectParam("src", generateXHTML); var embedTag = ' \n' + ''; } function _FWGenerateApplet(args) { if ( args.length < 6 || (0 != (args.length % 2)) ) { return ""; } gTagAttrs = new Array(); gTagAttrs["code"] = args[0]; gTagAttrs["width"] = args[1]; gTagAttrs["height"] = args[2]; var generateXHTML = ("true" == args[4]); var altText = args[5]; if (altText != "") altText = altText + '\n'; var attrName, attrValue; for ( var ndx = 6; ndx < args.length; ndx += 2) { attrName = args[ndx].toLowerCase(); attrValue = args[ndx + 1]; if ( "name" == attrName || "id" == attrName ) gTagAttrs["name"] = attrValue; else gTagAttrs[attrName] = attrValue; } var appletTag = ' '; } function FW_WriteObject() { document.writeln(_FWGenerate(arguments)); } function FW_WriteApplet() { document.writeln(_FWGenerateApplet(arguments)); }