// Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.

//---------------   GLOBAL VARIABLES   ---------------

var helpDoc = MM.HELP_objScript;

//---------------     API FUNCTIONS    ---------------

function isDOMRequired() { 
	// Return false, indicating that this object is available in code view.
	return false;
}

function isAsset() {
	return true;
}

function objectTag(assetArgs) {
	var rtnStr="";
// If we're an asset tag, then just set the src of the script tag
// to the parameter passed in and return
  if (assetArgs)
    return '<script src="' + assetArgs + '"><\/script>';

// Return the html tag that should be inserted
  var scriptVal = document.forms[0].script.value;
  var noScriptVal = document.forms[0].noscript.value;
  var selInd = document.forms[0].Language.selectedIndex;
  var scriptLang = document.forms[0].Language.options[selInd].text;
  
  rtnStr = '<script language="' + scriptLang + '" type="text/' + scriptLang + '"></script>';

  if (scriptVal.length > 0){
    if (scriptVal.charAt(scriptVal.length - 1) != '\n'){
		  scriptVal = scriptVal + '\n';
    }
		rtnStr = '<script language="' + scriptLang + '" type="text/' + scriptLang + '">\n' + scriptVal + '<\/script>';
  }

  if (noScriptVal.length > 0){
    if (noScriptVal.charAt(noScriptVal.length - 1) != '\n'){
      noScriptVal = noScriptVal + '\n';
    }
   	rtnStr = rtnStr + '\n'+ '<noscript>' + '\n' + noScriptVal + '<\/noscript>';
  }
  
  return rtnStr;
}
