// Javascript functions for HAWHAW-Skype interworking

function disableEnterKey(e)
{
    // check for enter key

    var key;

    if(window.event)
      key = window.event.keyCode; //IE
    else
      key = e.which; //Firefox

    if(key == 13)
      return false;
    else
      return true;
}

function makeSkypeCall(loc,urltype) {

  // we use a (blank) image instead of a popup window

  // the request for the image takes the URL info to the HAWHAW server

  var now = new Date();
  //var img = new Image();


/*
  img.src='http://skype.hawhaw.de/skype.php?loc='+encodeURIComponent(loc)+'&urltype='+urltype+'&nocache='+now.getTime();

  // without this instruction the GET request will be cancelled by the browser
  // and the call will be directed to the wrong URL!
  document.haw_response_img.src=img.src;

  this.location.href='skype:+990009369991250655';
  return true;
*/

  // trigger Skype application
  this.location.href='skype:+990009369991250655';

  // reload image (normally blank.gif, but can be replaced by error image as well
  document.haw_response_img.src='http://skype.hawhaw.de/skype.php?loc='+encodeURIComponent(loc)+'&urltype='+urltype+'&nocache='+now.getTime();

  return true;

}
