var currentPan = "";
function swapPan(panSrc) {
  var imgSrc = 'http://floorplanhost.com/' + tourDir + 'pans/' + panSrc + '.jpg';
  var width = imgSrc.width;
  var height = imgSrc.height;
  var ratio = width/height;
  if(.6<=ratio<=1.5){
    var appletHTML = '<applet name=pano id=pano codebase="" archive="http://floorplanhost.com/ptviewer.jar" code=ptviewer.class width=320 height=240 mayscript=true>\n'
                   + '<param name=file value=' + imgSrc + '>\n'
                   + '<PARAM name="fov" value="95">\n'
                   + '<PARAM name="pfov" value="180">\n'
                   + '<PARAM name="frame" value="http://floorplanhost.com/img/toolbar.gif">\n'
                   + '<PARAM name="auto" value="0.125">\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 {
    var appletHTML = '<applet name=pano id=pano codebase="http://floorplanhost.com/" archive="http://floorplanhost.com/ptviewer.jar" code=ptviewer.class width=320 height=240 mayscript=true>\n'
                   + '<param name=file value=' + imgSrc + '>\n'
                   + '<PARAM name="fov" value="95">\n'
                   + '<PARAM name="frame" value="http://floorplanhost.com/img/toolbar.gif">\n'
                   + '<PARAM name="auto" value="0.125">\n'
                   + '<PARAM name=shotspot0 value=" x0 y223 a17 b240 u\'ptviewer:ZoomIn()\' ">\n'
                   + '<PARAM name=shotspot1 value=" x22 y223 a39 b240 u\'ptviewer:ZoomOut()\' ">\n'
                   + '<PARAM name=shotspot2 value=" x44 y223 a61 b240 u\'ptviewer:startAutoPan(-0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot3 value=" x66 y223 a83 b240 u\'ptviewer:stopAutoPan()\' ">\n'
                   + '<PARAM name=shotspot4 value=" x88 y223 a105 b240 u\'ptviewer:startAutoPan(0.125,0,1)\' ">\n'
                   + '<PARAM name=shotspot5 value=" x110 y223 a127 b240 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 = panSrc;
  hide('imgCell');
  show('panCell');
}

