<?php require_once 'sets.php'; ?>

<?php 
$panphoto = mysql_real_escape_string($_REQUEST['panphoto']);
?>        
  
   <?php if ($panphoto=='') { ?>     
        <?php
	    	$result = mysql_query("SELECT * FROM panoramas ORDER BY id LIMIT 1",$dbh);
			$myrow=mysql_fetch_array($result); 
			$panphoto=$myrow['id'];
			?>
          <?php } ?>  
       
          <!--Begin: Virtual tour created with Easypano Tourweaver-->
          <script type="text/javascript">
var appletTag = '<applet\n' +
 'codebase = "/panoramas/." \n ' +
 'code     = "com.easypano.tourweaver.TWViewerApplet.class"\n ' +
 'archive  = "/panoramas/pwtw2.jar"\n ' +
 'name     = "TWViewer" \n ' +
  'width    = "700"\n ' +
 'height   = "420"\n ' +
 'hspace   = "0"\n ' +
 'vspace   = "0"\n ' +
 'align    = "middle"\n ' +
 'mayscript = "true"\n ' +
 '> \n' +
'\n ' +
 '<PARAM name = lwImg value = "waiting.gif">\n ' +
 '<PARAM name = lwBgColor value = "255,255,255">\n ' +
 '<PARAM name = lwBarBgColor value = "128,128,128">\n ' +
 '<PARAM name = lwBarColor value = "0,0,255">\n  ' +
 '<PARAM name = lwBarBounds value = "-1,-1,-1,-1">\n ' +
 '<PARAM name = iniFile value = "/panoramas/<?php echo $panphoto ?>.txt">\n ' +
 '<PARAM name = skin.archive value = "images.zip">\n ' +
 '<PARAM name = isInitFullScreen value = "false">\n ' +
 '</applet>\n '

 document.write(appletTag)

 </script>
          <!--End: Virtual tour created with Easypano Tourweaver-->
        
