var currentPan = "";
var ratio;
var width;
var height;
var imgSrc;
function getWidthAndHeight(){//this function is part of the test code
  width = pano.width;
  height = pano.height;
  ratio = width/height;
  //if ((ratio === null) || (ratio == undefined) || (ratio == 0) || (isNaN(ratio))) {
  if (isNaN(ratio)) {
    getWidthAndHeight();
  }
  else {
  if((3.6 < ratio) && (ratio < 4.6)){//end test code
    //this applet is for a full 360-degree
    var appletHTML = '<applet name=pano id=pano codebase="" archive="http://www.floorplanhost.com/ptviewer.jar" code=ptviewer.class width=500 height=375 mayscript=true>\n'
                   + '<param name=file value=' + imgSrc + '>\n'
                   + '<PARAM name="fov" value="95">\n'
                   + '<PARAM name="quality" value="6">\n'
                   + '<PARAM name="frame" value="http://www.floorplanhost.com/img/toolbar_basic.gif">\n'
                   + '<PARAM name="auto" value="0.15">\n'
                   + '<PARAM name="autoTime" value="15">\n'
                   + '<PARAM name=shotspot0 value=" x0 y358 a17 b375 u\'ptviewer:ZoomIn()\' ">\n'
                   + '<PARAM name=shotspot1 value=" x22 y358 a39 b375 u\'ptviewer:ZoomOut()\' ">\n'
                   + '<PARAM name=shotspot2 value=" x44 y358 a61 b375 u\'ptviewer:startAutoPan(-0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot3 value=" x66 y358 a83 b375 u\'ptviewer:stopAutoPan()\' ">\n'
                   + '<PARAM name=shotspot4 value=" x88 y358 a105 b375 u\'ptviewer:startAutoPan(0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot5 value=" x110 y358 a127 b375 u\'ptviewer:gotoView(0,0,95.48)\' ">\n'
                   + '</applet>';
  }
  else {//this is for partial - note pfov param - that is the only difference
    var appletHTML = '<applet name=pano id=pano codebase="" archive="http://www.floorplanhost.com/ptviewer.jar" code=ptviewer.class width=500 height=375 mayscript=true>\n'
                   + '<param name=file value=' + imgSrc + '>\n'
                   + '<PARAM name="fov" value="95">\n'
                   + '<PARAM name="pfov" value="180">\n'
                   + '<PARAM name="quality" value="6">\n'
                   + '<PARAM name="frame" value="http://www.floorplanhost.com/img/toolbar_basic.gif">\n'
                   + '<PARAM name="auto" value="0.15">\n'
                   + '<PARAM name="autoTime" value="10">\n'
                   + '<PARAM name=shotspot0 value=" x0 y358 a17 b375 u\'ptviewer:ZoomIn()\' ">\n'
                   + '<PARAM name=shotspot1 value=" x22 y358 a39 b375 u\'ptviewer:ZoomOut()\' ">\n'
                   + '<PARAM name=shotspot2 value=" x44 y358 a61 b375 u\'ptviewer:startAutoPan(-0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot3 value=" x66 y358 a83 b375 u\'ptviewer:stopAutoPan()\' ">\n'
                   + '<PARAM name=shotspot4 value=" x88 y358 a105 b375 u\'ptviewer:startAutoPan(0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot5 value=" x110 y358 a127 b375 u\'ptviewer:gotoView(0,0,95.48)\' ">\n'
                   + '</applet>';
  }
    if(document.all)
    { 
      panCell.innerHTML = appletHTML;
    }
    if(!document.all && document.getElementById)
    {
      panObj = document.getElementById("panCell");
      panObj.innerHTML = appletHTML;
    } 
  currentPan = imgSrc;
  hide('imgCell');
  show('panCell');   
  }
}
function swapPan(panSrc) {
  slideshow_on = false;
  imgSrc = 'http://www.floorplanhost.com/' + tourDir + '/pans/' + panSrc + '.jpg';
  //code I have been testing
  pano = new Image();
  pano.onload = getWidthAndHeight;
  pano.src = imgSrc;

}
