// NAME
//      $RCSfile: makeApplet.js,v $
// DESCRIPTION
//
//      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/10/21 15:35:45 $
// AUTHOR
//      Ray Tran <birgit@westhawk.co.uk>
// COPYRIGHT
//      Westhawk Ltd
// TO DO
//

function makeApplet(debug, dialno, callername, callerid, webapp)
{
  var authuri = webapp + 'auth.txt';

  var autostart = "true";
  if (dialno.length == 0) 
  {
      autostart = "false";
  }

  document.write('<applet');
  document.write('   code="com.phonefromhere.softphone.Phonefromhere"');
  document.write('   archive="lib/pfh_nosilk.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="authuri" value="' + authuri + '"/>');
  document.write('      <param name="dialno" value ="' + dialno + '"/>');
  document.write('      <param name="autostart" value ="' + autostart + '"/>');
  document.write('      <param name="callerid" value ="' + callerid + '"/>');
  document.write('      <param name="callername" value ="' + callername + '"/>');
  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.iax.DigiumPhone"/>');
  document.write('      <param name="mayscript"/>');
  document.write('  </applet>');
}


//Helper methods
function getPhoneFromHere(){
  var phone = document.getElementById('phonefromhere');
  return phone;
}




