// Implements InsertDynamicAppletControl() function. This is a generic function used to generate

// applet tags. It is used by higher level api functions.

			

function InsertDynamicAppletControl()

{  

  // Initialize variables

  var currArg = '';

  var closer = '>';

  var srcFound = false;

  var embedStr = '<applet';

  var paramStr = '';

  

  // Spin through all the argument pairs, assigning attributes and values to the object,

  // param, and embed tags as appropriate.

  for (var i=0; i < arguments.length; i=i+2)

  {

   currArg = arguments[i].toLowerCase();    



    if (currArg == "movie")

    {

        paramStr += '<param name="' + arguments[i] + '" value="' + arguments[i+1] + '"' + closer + '\n';

        srcFound = true;

    }

    else if (   currArg == "width" 

              || currArg == "height" 

              || currArg == "code" 

              || currArg == "archive" 

              || currArg == "align" 

              || currArg == "vspace" 

              || currArg == "hspace" 

              || currArg == "class" 

              || currArg == "title" 

              || currArg == "accesskey" 

              || currArg == "tabindex")

    {

      embedStr += ' ' + arguments[i] + '="' + arguments[i+1] + '"';

    }

    // This is an attribute we don't know about. Assume that we should add it to the 

    // param and embed strings.

    else

    {

      paramStr += '<param name="' + arguments[i] + '" value="' + arguments[i+1] + '"' + closer + '\n'; 

    }

  }

  

  // Tell the user that a src is required, if one was not passed in.

  if (!srcFound)

  {

    alert("The requires that a movie be passed in as one of the arguments.");

    return;

  }



  // Close off the object and embed strings

  embedStr += ' MAYSCRIPT>' + paramStr +'<a href=http://www.pengtu.cn/java/msjavx86.exe target=_blank><img src="getjava.jpg" width=170 height=170 alt="您的浏览器需要在java虚拟机的环境下运行三维互动展示，请点击下载安装。" ></a>'+'<a href=http://www.pengtu.cn/java_help.html target=_blank><img src="help.jpg" width=100 height=28 alt="点击查看安装帮助" ></a>'+ '</applet>\n'; 

  

  document.write(embedStr);

}

