function insertFlash(id, width, height, bgcolor, alt, transparent) {

  var DEBUG_flashoff = false;

  transparent = (transparent != null && transparent == 'true') ? true : false;
  
  plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

  if ( plugin ) {
    plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 7;
  } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
             && (navigator.userAgent.indexOf("Windows 95")>=0 
                 || navigator.userAgent.indexOf("Windows 98")>=0 
                 || navigator.userAgent.indexOf("Windows NT")>=0)) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
    document.write('</SCR' + 'IPT\>');
  }
  if ((!DEBUG_flashoff) && (plugin) && ((navigator.userAgent.indexOf("MSIE")>=0) || (document.getElementById) || (document.layers))) {
    document.write('<object id="flashMovie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width='+ width +' height='+ height +((transparent) ? ' wmode="Transparent"' : '')+'>');
    document.write('<param name="MOVIE" value="'+id+'">');
    document.write('<param name="QUALITY" value="HIGH">');
    document.write('<param name="BGCOLOR" value="'+bgcolor+'">');
    document.write('<param name="MENU" value="TRUE">');
    if (transparent) { document.write('<param name="WMODE" value="transparent">'); }
    document.write('<embed name="flashMovie" src="'+id+'" menu="TRUE" '+((transparent) ? 'wmode="Transparent" ' : '')+'quality="HIGH" bgcolor="'+ bgcolor +'" WIDTH="'+ width +'" HEIGHT="'+ height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');    
    document.write('</object>');
    
  } else {
    document.write(alt);
  }
}

function photoScroll (dir) {
 document.getElementById("photos").scrollLeft += dir*237;
 return false;
}


var countires_on = false;
function toggleCountries() {

  countires_on = !countires_on;
  document.getElementById('country-area').className = (countires_on) ? 'show-countries' : '';
    
  toggleFlash();
    
  return false;
}



/* toggle flash */
function toggleFlash() {
  document.getElementById("flash-area").className = (document.getElementById("flash-area").className != "flash-off") ? "flash-off" : "flash-on";
}





var aSubnav = new Array('subnav-home', 'subnav-products', 'subnav-ourhome', 'subnav-technology', 'subnav-history', 'subnav-newsandmedia', 'subnav-distributors', 'subnav-contact');
    
function displaySubNav(id) {

  var classNames = document.getElementById('nav-sub').className.split(' ');
  document.getElementById('nav-sub').className = classNames[0]+' '+classNames[1]+' on-'+id;
  
  return true;
}

/* navigation timeout function */

var timing = 0;

function navOut() {
  doTimer();
}

function navOver() {
  cancelTimer();
}

function doTimer() { 
  clearTimeout(timing);
  timing = setTimeout('displaySubNav(pageID);', 1000);
}

function cancelTimer() {
  clearTimeout(timing);
}



function searchToggle(id) {

  document.forms['search'].action = (id == 'boots') ? 'product_info.cgi' : 'search.cgi';
  document.getElementById('search-form').className = 'search-form on-'+id;
  
  return false;
}

    
// ------------------------------------------------------------------------

function newWindow(url, name, width, height) {
  photoWindow = window.open(url, name,"location=no,directories=no,menubar=no,status=no,toolbar=no,scrollbars=no,height=" +height+ ",width=" +width+ ",resizable=yes");
  photoWindow.resizeTo(width,height);
  photoWindow.focus();
  return false;
}

function newScrollingWindow(url, name, width, height) {
  newScrollWin = window.open(url, name,"location=no,directories=no,menubar=no,status=no,toolbar=no,scrollbars=yes,height=" +height+ ",width=" +width+ ",resizable=yes");
  newScrollWin.resizeTo(width,height);
  newScrollWin.focus();
  return false;
}

function statusWindow(url, name, width, height) {
  photoWindow = window.open(url, name,"location=no,directories=no,menubar=no,status=yes,toolbar=no,scrollbars=no,height=" +height+ ",width=" +width+ ",resizable=yes");
  photoWindow.resizeTo(width,height);
  photoWindow.focus();
  return false;
}

// ------------------------------------------------------------------------

function newCLWin(theURL, W, H, header) {

  /* url hacks - so the flash doesnt need to be tweaked */
  //theURL = theURL.replace(/^get_mountain_cam\.cgi/, 'popup_content/get_mountain_cam.cgi');


  newWindow(theURL, '_blank', W+12, H+30);
}

function newCLWin2(theURL, W, H, header, bgcolor) {
  newWindow(theURL, '_blank', W+12, H+30);
}

    