// NAME
//      $RCSfile: makeApplet.js,v $
// DESCRIPTION
//      This file inserts the code to create a PFH applet at the point in
//      the HTML where the function is called.
//
//      There are two reasons for this approach. First it makes life easier because
//      there is only one place to maintain the code. Second it works around the
//      plugin activation step required by the patent dispute between Eolas and
//      Microsoft. If the object is in the HTML it will not work on IE after
//      the middle of June 2006.
//
//      To use the object include the js in the HTML header:
//        <script src="script/makeApplet.js" type="text/javascript"></script>
//
//      And call the function from the HTML body (I recommend making it the last
//      before closing the body):
//        <script type="text/javascript">makeApplet();</script>
//
// DELTA
//      $Revision: 1.2 $
// CREATED
//      $Date: 2008/02/12 14:35:02 $
// AUTHOR
//      Ray Tran <birgit@westhawk.co.uk>
// COPYRIGHT
//      Westhawk Ltd
// TO DO
//

function makeApplet(debug, callername, booth, webapp)
{
  var authuri = webapp + "auth.txt";

  document.write('<applet');
  document.write('   code="com.phonefromhere.softphone.Phonefromhere"');
  document.write('   archive="lib/signedsoftphone.jar,lib/njiax-signed.jar" ');
  document.write('   id="phonefromhere" ');
  document.write('   name="phonefromhere" ');
  document.write('   height="1"');
  document.write('   width="1"');
  document.write('   hspace="0"');
  document.write('   vspace="0"');
  document.write('   align="middle"');
  document.write('   mayscript="true" >');
  document.write('      <param name="debug" value="' + debug + '"/>');
  document.write('      <param name="dialno" value ="' + booth + '"/>');
  document.write('      <param name="autostart" value ="true"/>');
  document.write('      <param name="callerid" value ="' + callername + '"/>');
  document.write('      <param name="callername" value ="' + callername + '"/>');
  document.write('      <param name="username" value="guest"/>');
  document.write('      <param name="password" value="dummy"/>');
  document.write('      <param name="statusCallback" value="phonefromherestatus"/>');
  document.write('      <param name="dtmfCallback" value="phonefromhereGotDtmf"/>');
  document.write('      <param name="textCallback" value="phonefromhereGotText"/>');
  document.write('      <param name="doEC" value="false"/>');
  document.write('      <param name="technology" value="com.phonefromhere.softphone.njiax.NjiaxPhone"/>');
  document.write('      <param name="mayscript"/>');
  document.write('  </applet>');
}



