// NAME
//      $RCSfile: makeApplet4.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.6 $
// CREATED
//      $Date: 2010/03/03 17:07:54 $
// AUTHOR
//      Birgit Arkesteijn <birgit@phonefromhere.com>
// COPYRIGHT
//      PhoneFromHere.com
// TO DO
//

function makeApplet(debug, dialno, callername, webapp, tryagain_link,
javaHelpURL, applet_parameter)
{
  var authuri = webapp + 'auth.xsql?key='+dialno;
  var tryagain_link = webapp + tryagain_link;

  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(applet_parameter);
  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 ="true"/>');
  document.write('      <param name="callerid" value ="01612884242"/>');
  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="true"/>');
  document.write('      <param name="technology" value="com.phonefromhere.softphone.iax.DigiumPhone"/>');
  // document.write('      <param name="technology" value="com.phonefromhere.proprietary.EchoPhone"/>');
  document.write('      <param name="mayscript"/>');
var textToInsert = ""
+ "<div id='oopsJ'> "
+ "    <span class='oops_text'> "
+ "        <span class='oops_red'>Oops!</span> "
+ "        <span class='oops2'> "
+ "            How embarrassing... "
+ "        </span> "
+ "        <br/> "
+ "        <span id='oops_messageJ'> "
+ "            Sorry, I can't find the Java software. "
+ "        </span> "
+ "    </span> "
+ "</div> "
+ "<div id='nottoworryJ'> "
+ "    <div class='nottoworry_header'> "
+ "        Don't worry... "
+ "    </div> "
+ "    <div id='nottoworry_messageJ'> "
+ "        It's not your fault, but please can you  "
+ "        <a target='external' href='"
              + javaHelpURL
+ "        '>install Java</a> "
+ "        on your machine so that we can get started, it only "
+ "        takes a moment. Then  "
+ "        <a href='"
              + tryagain_link 
+ "        '>try again</a>. "
+ "    </div> "
+ "</div> ";
  document.write(textToInsert);
  /*
  */
  document.write('  </applet>');
}

// http://uk.phonefromhere.com/talk/vtop4.xsql?key=01612884242

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



