function createPlayer(target, media){
  obj1 = '<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" type="application/x-oleobject" width="100%" height="285px; style="opacity:0.45; filter:alpha(opacity=45)">'
        + '<param name="showControls" value="true">'
        + '<param name="fileName" value="'+media+'">'
        + '<embed type="application/x-mplayer2" width="100%" height="285px" showcontrols="false" src="'+media+'"><\/embed>'
      + '<\/object>';
  document.getElementById(target).innerHTML = obj1;
}
function createPanoPlayer(target, media, w, h){
  obj1 = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" type="application/x-oleobject" width="' + w + '" height="' + h + '" codebse="http://www.apple.com/qtactivex/qtplugin.cab">'
        + '<param name="src" value="'+media+'">'
        + '<param name="autoplay" value="true">'
        + '<param name="controler" value="false">'
        + '<embed width="' + w + '" height="' + h + '" controler="false" autoplay="true" src="'+media+'" pluginspage="http://www.apple.com/quicktime/download/"><\/embed>'
      + '<\/object>';
  document.getElementById(target).innerHTML = obj1;
}

function createFlashPlayer(target, media, submedia, w, h){
  var obj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '" codebse="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=9,0,0,0">'
           + '<param name="movie" value="'+media+'"/>'
           + '<param name="allowScriptAccess" value="sameDomain"/>'
           + '<param name="allowFullScreen" value="true"/>'
           + '<param name="flashvars" value="panorama=' + submedia + '" />'
           + '<embed width="' + w + '" height="' + h + '" src="' + media + '" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" allowFullScreen="true" flashvars="panorama=' + submedia + '" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"><\/embed>'
           + '<\/object>'; 
  document.getElementById(target).innerHTML = obj;
}

function destroyObject(target){
  obj1 = '';
  document.getElementById(target).innerHTML = obj1;
}
    
function getWindowHeight() {
  if(window.self && self.innerHeight){
    return self.innerHeight;
  }
  if(document.documentElement && document.documentElement.clientHeight){
    return document.documentElement.clientHeight;
  }
  return 0;
}   

function keybordHandler(e, code, callbackFunction){
  var keycode;
  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;

  if (keycode == code){
    callbackFunction();
    return true;
  }
  else{
     return false;
  }
}   
