/*
 WM_imageSwap()
 Changes the source of an image.

 Source: Webmonkey Code Library
 (http://www.hotwired.com/webmonkey/javascript/code_library/)

 Author: Shvatz
 Author Email: shvatz@wired.com

 Usage: WM_imageSwap(originalImage, 'newSourceUrl');

 Requires: WM_preloadImages() (optional, but recommended)
 Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
 with variables in ie3 for the mac. 
 */
function WM_imageSwap(daImage, daSrc){
  var objStr,obj;


  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}



 /*
 WM_imageSwap()
 Changes the source of an image.

 Source: Webmonkey Code Library
 (http://www.hotwired.com/webmonkey/javascript/code_library/)

 Author: Shvatz
 Author Email: shvatz@wired.com

 Usage: WM_imageSwap(originalImage, 'newSourceUrl');

 Requires: WM_preloadImages() (optional, but recommended)
 Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
 with variables in ie3 for the mac. 
    */
function WM_imageSwap(daImage, daSrc){
  var objStr,obj;
 

  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}

function WM_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    WM_imageSwap()
    Changes the source of an image.

    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Shvatz
    Author Email: shvatz@wired.com

    Usage: WM_imageSwap(originalImage, 'newSourceUrl');

    Requires: WM_preloadImages() (optional, but recommended)
    Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
    with variables in ie3 for the mac. 
    */

  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}

function WM_checkIn(id) {
  // This function checks for DOM strategy, then 
  // returns an object reference.
  if (document.all) {
    return document.all[id].style;
  } else if(document.layers) {
    return document.layers[id];
  }
}

/*
WM_changeVisibility()
Changes whether a layer is visible or hidden.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com

usage: WM_changeVisibility('targetLayer1',[visible|hidden|toggle],'targetLayer2',[visible|hidden|toggle],...,'targetLayerN',[visible|hidden|toggle])
*/

// set hidden/visible vars for Netscape 4 compatibility
if (document.layers) {
  var hidden = "hide";
  var visible = "show";
} else {
  var hidden = "hidden";
  var visible = "visible";
}
var toggle = "toggle";


//this function identifies all layers that are available on the page
//and modifies their attributes appropriately
function WM_changeVisibility() {
  if (document.layers || document.all) {
    var inc, endInc=arguments.length;
    // run through the args (objects) and set the visibility of each
    for (inc=0; inc<endInc; inc+=2) {
      // get a good object reference
      var daObj = WM_checkIn(arguments[inc]);
      if (arguments[inc+1] == hidden) {
        // hide the object
        daObj.visibility = hidden;
      } else if (arguments[inc+1] == visible) {
        // show the object
        daObj.visibility = visible;
      } else if (arguments[inc+1] == toggle) {
        // toggle the object's visibility
        if (daObj.visibility == visible) {
          daObj.visibility = hidden;
        } else if (daObj.visibility == hidden) {
          daObj.visibility = visible;
        }
      }
    }
  }
}

// this function changes the text and picture links based on the topic 
// that is clicked by the user

function showTopic(topic)
{
	//if the assembly link is clicked the assembly text and links are displayed
	if (topic == 'assembly')
	{
		WM_changeVisibility('assembly', 'visible', 'paint', 'hidden', 'teardown', 'hidden', 'overhaul', 'hidden');
		WM_changeVisibility('assembly_link', 'visible', 'paint_link', 'hidden', 'teardown_link', 'hidden', 'overhaul_link', 'hidden');
	}
	//if the paint link is clicked the paint text and links are displayed
	if (topic == 'paint')
	{
		WM_changeVisibility('assembly', 'hidden', 'paint', 'visible', 'teardown', 'hidden', 'overhaul', 'hidden');
		WM_changeVisibility('assembly_link', 'hidden', 'paint_link', 'visible', 'teardown_link', 'hidden', 'overhaul_link', 'hidden');
	}
	//if the teardown link is clicked the teardown text and links are displayed
	if (topic == 'teardown')
	{
		WM_changeVisibility('assembly', 'hidden', 'paint', 'hidden', 'teardown', 'visible', 'overhaul', 'hidden');
		WM_changeVisibility('assembly_link', 'hidden', 'paint_link', 'hidden', 'teardown_link', 'visible', 'overhaul_link', 'hidden');
	}
	//if the overhaul link is clicked the overhaul text and links are displayed
	if (topic == 'overhaul')
	{
		WM_changeVisibility('assembly', 'hidden', 'paint', 'hidden', 'teardown', 'hidden', 'overhaul', 'visible');
		WM_changeVisibility('assembly_link', 'hidden', 'paint_link', 'hidden', 'teardown_link', 'hidden', 'overhaul_link', 'visible');
	}
}