/* This is a dead simple Javascript file which inserts HTML
 * into the LETS GO page when a user requests help on zooming or saving the sim.
 *
 * The help HTML is by default put in the page and then turned off by javascript
 * so people without javascript can still see it 
 * BB_ September 2005
 */

var saveHTML = "";

        <!-- START  save instructions table-->
saveHTML+='        <table width="300" border="0" cellpadding="0" cellspacing="0">';
saveHTML+='          <tr>';
saveHTML+='            <td>&nbsp;</td>';
saveHTML+='            <td>';
              <!-- START point 1 table -->
saveHTML+='              <table width="100%" border="0" cellspacing="0" cellpadding="3">';
saveHTML+='                <tr>'; 
saveHTML+='                  <td><img src="../../../images/lets/lets_go/lets_bullet_number1.gif" width="20" height="20"></td>';
saveHTML+='                  <td bgcolor="#FFFFCC"><p class="letsText"><strong>Save this'; 
saveHTML+='                      webpage</strong></p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr>'; 
saveHTML+='                  <td>&nbsp;</td>';
saveHTML+='                  <td><p class="letsText">Go to <em>File -> Save As</em>, and'; 
saveHTML+='                      save this webpage as anything you like. </p>';
saveHTML+='                    <p class="letsText">Make sure the <em>Save As Type</em> box'; 
saveHTML+='                      says &quot;Web Page, complete&quot;.</p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr>';
saveHTML+='                  <td colspan="2"><img src="../../../images/spacer.gif" width="1" height="5"></td>';
saveHTML+='                </tr>';
saveHTML+='              </table>';
              <!-- END point 1 table-->
              <!-- START point 2 table -->
saveHTML+='              <table width="100%" border="0" cellspacing="0" cellpadding="3">';
saveHTML+='                <tr>'; 
saveHTML+='                  <td><img src="../../../images/lets/lets_go/lets_bullet_number2.gif" width="20" height="20"></td>';
saveHTML+='                  <td bgcolor="#FFFFCC"><p class="letsText"><strong>Save the Simulator'; 
saveHTML+='                      Flash Movie</strong></p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr>'; 
saveHTML+='                  <td>&nbsp;</td>';
saveHTML+='                  <td><p class="letsTextGreen"><strong>If you have done this step'; 
saveHTML+='                      before, then you don\'t need to do it again.</strong></p>';
saveHTML+='                    <p class="letsText">Right click <a href="'+BB_swfName+'" class="letsSWFFile">here</a>'; 
saveHTML+='                      and select <em>Save Target As..</em> from the pop-up menu.'; 
saveHTML+='                      Save the '+BB_swfName+' file in the same place you saved the'; 
saveHTML+='                      web page in part 1.</p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr>';
saveHTML+='                  <td colspan="2"><img src="../../../images/spacer.gif" width="1" height="5"></td>';
saveHTML+='                </tr>';
saveHTML+='              </table>';
              <!-- END point 2 table -->
              <!-- START point 3 table -->
saveHTML+='              <table width="100%" border="0" cellspacing="0" cellpadding="3">';
saveHTML+='                <tr>'; 
saveHTML+='                  <td><img src="../../../images/lets/lets_go/lets_bullet_number3.gif" width="20" height="20"></td>';
saveHTML+='                  <td bgcolor="#FFFFCC"><p class="letsText"><strong>Watch your'; 
saveHTML+='                      saved simulation</strong></p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr>'; 
saveHTML+='                  <td>&nbsp;</td>';
saveHTML+='                  <td><p class="letsText">Now the simulation you can see on this'; 
saveHTML+='                      page is saved on your computer forever! To watch it, double'; 
saveHTML+='                      click the web page file you created in part 1, and it will'; 
saveHTML+='                      open in your web browser. You don\'t need to be online.</p></td>';
saveHTML+='                </tr>';
saveHTML+='                <tr><td colspan="2" align="right"><a class="letsClose" href="javascript:window.toggleSaveContent(); void 0;">Close</a></td></tr>';
saveHTML+='              </table>';
              <!-- END point 3 table -->
saveHTML+='            </td>';
saveHTML+='          </tr>';
saveHTML+='        </table>';
        <!-- END save instructions table -->




var zoomHTML = '<table width="300" border="0" cellpadding="0" cellspacing="0">';
zoomHTML+='<tr><td>';
            <!-- START zoom table -->
zoomHTML+='<table width="100%" border="0" cellspacing="0" cellpadding="3">';
zoomHTML+='<tr><td bgcolor="#FFFFCC"><p align="right" class="letsText"><strong>Spot ';
zoomHTML+='the sprint finishes!</strong></p></td>';
zoomHTML+='<td width="20"><img src="../../../images/lets/lets_go/lets_magglass.gif" width="18" height="20"></td>';
zoomHTML+='</tr><tr>';
zoomHTML+='<td><p class="letsText">To zoom, right-click the mouse whilst over the ';
zoomHTML+='race circuit above, and select &quot;Zoom In&quot; from ';
zoomHTML+='the pop-up menu. You can do it multiple times to get really ';
zoomHTML+='close! </p>';
zoomHTML+='</td><td width="20">&nbsp;</td>';
zoomHTML+='</tr>';
zoomHTML+='<tr><td colspan="2" align="left"><a class="letsClose" href="javascript:window.toggleZoomContent(); void 0;">Close</a></td></tr></table>';
      <!-- END zoom table-->
zoomHTML+='</td></tr>';
zoomHTML+='</table>';

var imgsrc = new Array;

//preloads the header graphics
function preloadImages() {
  imgsrc['zoom'] = new Array; imgsrc['save'] = new Array;
  imgsrc['zoom']['link'] = new Image; imgsrc['zoom']['link'].src = "../../../images/lets/lets_go/lets_zoomin_link.gif";
  imgsrc['zoom']['hover'] = new Image; imgsrc['zoom']['hover'].src = "../../../images/lets/lets_go/lets_zoomin_hover.gif";
  imgsrc['save']['link'] = new Image; imgsrc['save']['link'].src = "../../../images/lets/lets_go/lets_savesim_link.gif";
  imgsrc['save']['hover'] = new Image; imgsrc['save']['hover'].src = "../../../images/lets/lets_go/lets_savesim_hover.gif";
}

var saveContentOn = true;
var zoomContentOn = true;

function showSaveContent(show) {
  document.getElementById('SaveContent').innerHTML = ((show==true)?saveHTML:'&nbsp;');
  saveContentOn = show;
}

function showZoomContent(show) {
  document.getElementById('ZoomContent').innerHTML = ((show==true)?zoomHTML:'&nbsp;');
  zoomContentOn = show;
}

function toggleZoomContent() {
  showZoomContent(!zoomContentOn);
  document.images['zoomImg'].src = imgsrc['zoom'][((zoomContentOn==true)?'hover':'link')].src;
}

function toggleSaveContent() {
  showSaveContent(!saveContentOn);
  document.images['saveImg'].src = imgsrc['save'][((saveContentOn==true)?'hover':'link')].src;
}


