/*
* This file contains functions to generate OBJECT and EMBED tags for QuickTime content.
*/
/************** LOCALIZABLE GLOBAL VARIABLES ****************/
var gArgCountErr = 'The "%%" function requires an even number of arguments.'
+ '\nArguments should be in the form "atttributeName", "attributeValue", ...';
/******************** END LOCALIZABLE **********************/
var gTagAttrs = null;
var gQTGeneratorVersion = 1.0;
function AC_QuickTimeVersion() { return gQTGeneratorVersion; }
function _QTComplain(callingFcnName, errMsg)
{
errMsg = errMsg.replace("%%", callingFcnName);
alert(errMsg);
}
function _QTAddAttribute(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 _QTAddObjectAttr(slotName, tagName)
{
// don't bother if it is only for the embed tag
if ( 0 == slotName.indexOf("emb#") )
return "";
if ( 0 == slotName.indexOf("obj#") && (null == tagName) )
tagName = slotName.substring(4);
return _QTAddAttribute("obj#", slotName, tagName);
}
function _QTAddEmbedAttr(slotName, tagName)
{
// don't bother if it is only for the object tag
if ( 0 == slotName.indexOf("obj#") )
return "";
if ( 0 == slotName.indexOf("emb#") && (null == tagName) )
tagName = slotName.substring(4);
return _QTAddAttribute("emb#", slotName, tagName);
}
function _QTAddObjectParam(slotName, generateXHTML)
{
var paramValue;
var paramStr = "";
var endTagChar = (generateXHTML) ? ' />' : '>';
if ( -1 == slotName.indexOf("emb#") )
{
// look for the OBJECT-only param first. if there is none, look for a generic one
paramValue = gTagAttrs["obj#" + slotName];
if ( null == paramValue )
paramValue = gTagAttrs[slotName];
if ( 0 == slotName.indexOf("obj#") )
slotName = slotName.substring(4);
if ( null != paramValue )
paramStr = ' \n'
+ _QTAddObjectParam("src", generateXHTML);
var embedTag = '