
var banners = [["/markets/mobile_devices", "/images/home_banners/mobileDevices.gif"],
               ["/markets/industrial", "/images/home_banners/industrial.gif"],
               ["/markets/automotive", "/images/home_banners/automotive.gif"],
               ["/markets/military_aerospace", "/images/home_banners/milAero.gif"],
               ["/markets/it_datacom", "/images/home_banners/itDatacom.gif"],
               ["/markets/medical.html", "/images/home_banners/medical.gif"],
               ["/markets/mobile_networks", "/images/home_banners/mobileNetworks.gif"]
               ];
               //["/markets/broadband.html", "/images/home_banners/broadband.gif"],

var factoids = [["/images/factoids/cod.gif", "Amphenol has a high tech solution for the cables you need right away. <a href=\"http://www.cablesondemand.com\" target=\"_new\">http://www.CablesonDemand.com</a> has the Amphenol cables you need when you need them."]
               ];
                //["/images/factoids/broadband.jpg", "In one year, Amphenol Times Fiber Communications produces almost enough cable to reach from the earth to the moon and back."],
                //["/images/factoids/industrial.jpg", "Lighting the Eiffel Tower took 20 mountain climbers, 44,000 lbs of lights, and some seriously high performance Amphenol connectors."],
                //["/images/factoids/it.jpg", "Virtually all internet traffic passes through an Amphenol interconnect somewhere along its path."],
                //["/images/factoids/medical.jpg", "Working with leading medical device manufacturers, Amphenol provides interconnect solutions to prolong the lives of millions."],
                //["/images/factoids/milAero.jpg", "Amphenol's Zero-G series connectors tolerate temperature fluctuations between -170 and 280 degrees, and can withstand over 175,000 thermal cycles."],
                //["/images/factoids/mobileDevices.jpg", "In 2007 more than half of the world's 1.1 billion produced phones included at least one Amphenol component."],
                //["/images/factoids/mobileNetworks.jpg", "Amphenol is the only company that can support the entire interconnect requirements of a cellular infrastructure system."],
                //["/images/factoids/automotive.jpg", "One Amphenol hybrid car connector handles as much electrical power as a small town house complex."],

window.addEvent('domready', function() {
  // random factoid
  var fact_index = Math.floor(Math.random()*factoids.length);
  $('home_fact_pic').src = factoids[fact_index][0];
  $('home_fact_text').innerHTML = factoids[fact_index][1];

  // random banner
  var ban_index = Math.floor(Math.random()*banners.length);
  var banner = $('product_banner');
  banner.getElement('a').href = banners[ban_index][0];
  banner.getElement('img').src = banners[ban_index][1];
  
  // swap random market image with flash file.
  /*var mark_element = $('market_img');
  var fall_back = mark_element.innerHTML;
  var name = 'home_markets';
  var src = '/flash/home.swf';
  var w = 579;
  var h = 288;
  var bgcolor = '#ffffff';
  var flash_str = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="' + name + '" align="middle">'
  + '<param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="' + src + '" /><param name="quality" value="high" /><param name="bgcolor" value="' + bgcolor + '" /><param name="wmode" value="opaque" />'
  + '<embed src="' + src + '" wmode="opaque" quality="high" bgcolor="' + bgcolor + '" width="' + w + '" height="' + h + '" name="' + name + '" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
  + '</object>'; //fall_back + 
  mark_element.innerHTML = flash_str;*/
	var mark_element = $('market_img');
	flashembed(mark_element, {src: "/flash/home.swf", wmode: 'opaque'});

});

