
No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
layer = (document.all && No3) ? "document.all['L'+menu].style" : (document.layers && No3) ? "document.layers['L'+menu]" : (document.getElementById && No3) ? "document.getElementById('L'+menu).style" : 0;
var timer;

function Show() {
	if(layer) {
		if(timer) clearTimeout(timer);
		for(menu=0; menu<Layer.length; menu++) { 
			if(Layer[menu]) {
				eval(layer).visibility = "hidden"; 
			}
		}
		for(i=0; i<arguments.length; i++) {
			menu=arguments[i];
			eval(layer).visibility = "visible";
		}
	} 	
}

function Hide() {
	timer = setTimeout("Show()", 200);
}
            

//////////////////////////////////////////////////////
hovercolor   = "#FEBE50";	// color name/code
bgcolor      = "#FFCD6A";	// color name/code
background   = "";			// picture url
menu_border  = 1;			// IE only
border_color = "#395C6C";	// IE only
//////////////////////////////////////////////////////
if(document.all || document.getElementById){
	if(!background)  background=bgcolor;
	else  background = "url("+background+")"; 
}

function LayerSpecs(Left,Top,Width) {
	if(No3) {
		if(document.all) {
			/*Left+=8;
			Top+=1;
			Width-=6;*/
		}
		this.left  = Left;
		this.top   = Top;
		this.info  = "";
		T=0;				
		if (arguments.length > 4) {	
			for(i=3; i<arguments.length; i++) { 
				if(document.all || document.getElementById) {
					this.info += "<tr><td width=\""+Width+"\" onmouseover='this.bgColor=\""+hovercolor+"\"' onmouseout='this.bgColor=\"\"'>"+arguments[i]+"</td></tr>";
				} else {
					this.info += "<layer onmouseover='this.bgColor=\""+hovercolor+"\"' onmouseout='this.bgColor=\""+bgcolor+"\"' width=\""+Width+"\" position=\"relative\" top=\""+T+"\">&nbsp;"+arguments[i]+"</layer>";
				}
				T+=20;
			}
		}
	}
}


function alternate(id){
	if(document.getElementsByTagName){  
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr");  
		for(i = 0; i < rows.length; i++){          
			//manipulate rows
		    if(i % 2 == 0){
				rows[i].className = "even";
			}else{
				rows[i].className = "odd";
			}      
		}
	}
}

function alternatePlus(id, element) {
	if(document.getElementsByTagName) {
		var table = document.getElementById(id);
		var rows = table.getElementsByTagName(element);
		for(i = 0; i < rows.length; i++){
			//manipulate rows
		    if(i % 2 == 0){
				rows[i].className = "even";
			}else{
				rows[i].className = "odd";
			}
		}
	}
}


Layer = new Array();
Layer[0] = new LayerSpecs(1,110,155, '<a href="/products.asp" onmouseover="Show(0)">Product Overview</a>','<a href="/search.asp" onmouseover="Show(0)">Product Search</a>','<a href="/search_competitor.asp" onmouseover="Show(0)">Cross Reference</a>','<a href="/military.asp" onmouseover="Show(0)">Military Products</a>','<a href="/overview.asp" onmouseover="Show(0)">Markets Served</a>','<a href="/brochures.asp" onmouseover="Show(0)">Product Literature</a>');
Layer[1] = new LayerSpecs(100,110,155, '<a href="/rf_made_simple/freqrange.asp" onmouseover="Show(1)">Frequency Range Chart</a>','<a href="/rf_made_simple/glossary.asp" onmouseover="Show(1)">Glossary</a>','<a href="/rf_made_simple/techquestions.asp" onmouseover="Show(1)">Technical Questions</a>','<a href="/rf_made_simple/vswr_calculator.asp" onmouseover="Show(1)">VSWR Calculator</a>','<a href="/rf_made_simple/vswr.asp" onmouseover="Show(1)">VSWR Chart</a>');
Layer[2] = new LayerSpecs(176,150,200, '<a href="/distributors.asp" onmouseover="Show(2)">Locate a Distributor</a>','<a href="http://stkcheck.com/evs/amphenol/amphenolsearch.asp" onmouseover="Show(2)">Check Distributor Inventory</a>');
Layer[3] = new LayerSpecs(239,110,155, '<a href="/corporate_ww.asp" onmouseover="Show(3)">Amphenol Worldwide</a>','<a href="/corporate_rf.asp" onmouseover="Show(3)">Amphenol RF</a>','<a href="/employment_wp.asp" onmouseover="Show(3)">Employment</a>','<a href="/corporate_ef.asp" onmouseover="Show(3)">Engineering Focus</a>','<a href="/iso9001.asp" onmouseover="Show(3)">Quality Focus</a>','<a href="/quote.asp" onmouseover="Show(3)">Stock Quote</a>','<a href="/corporate_directions.asp" onmouseover="Show(3)">Weather/Directions</a>');
Layer[4] = new LayerSpecs(285,110,155, '<a href="/whatsnew_newsletter.asp" onmouseover="Show(4)"></a>','<a href="/whatsnew_newsletter.asp" onmouseover="Show(4)">Newsletter</a>');
Layer[5] = new LayerSpecs(345,110,155, '<a href="/contactus.asp" onmouseover="Show(5)">Amphenol RF</a>','<a href="/contactrep.asp" onmouseover="Show(5)">Manufacturer\'s Rep</a>');
Layer[6] = new LayerSpecs(51,110,155, '<a href="/sitetools/drawing.asp" onmouseover="Show(6)">Customer Drawing</a>','<a href="/sitetools/assembly.asp" onmouseover="Show(6)">Assembly Instructions</a>','<a href="/sitetools/Catalog.asp" onmouseover="Show(6)">Catalog</a>');
Layer[7] = new LayerSpecs(405,110,155, '<a href="/customer_login.asp" onmouseover="Show(7)">Customer Extranet</a>','<a href="/salesperson_login.asp" onmouseover="Show(7)">Salesperson Extranet</a>','<a href="/vendor_login.asp" onmouseover="Show(7)">Vendor Extranet</a>','<a href="/employee_login.asp" onmouseover="Show(7)">Employee Extranet</a>','<a href="/employee_login2.asp" onmouseover="Show(7)">Internal Employee Extranet</a>');


j = (Layer[0]) ? 0:1;
for(i=j; i<Layer.length; i++) {
	if((document.all || document.getElementById) && No3) {
		// pulled for adjusting page height... top:'+Layer[i].top+'px; 
		document.write('<div class="nav_menu" onmouseover="clearTimeout(timer)" onmouseout="Hide('+i+')" id="L'+i+'" style="position:absolute; visibility:hidden; left:'+Layer[i].left+'px;"><table style=" background:'+background+'; border: '+menu_border+'px solid '+border_color+'">'+Layer[i].info+'</table></div>');
	} else if(document.layers && No3) {
		document.write('<layer class="nav_menu" onmouseover="clearTimeout(timer)" onmouseout="Hide('+i+')" id="L'+i+'" position="absolute" visibility="hidden" bgcolor="'+bgcolor+'" background="'+background+'" top="'+Layer[i].top+'" left="'+Layer[i].left+'">'+Layer[i].info+'</layer>');	
	}
}

/* Functions to add event listeners, creating alternating row colors on the fly. */
var stack = [],
    interval,
    loaded; // has DOMContentLoaded or window.onload fired

// does the element or one of it's ancestors have a nextSibling?
function hasNextSibling(el) {
  return el.nextSibling ||
         (el.parentNode && hasNextSibling(el.parentNode));
}

function doPoll() {
  var notFound = [];
  for (var i=0; i<stack.length; i++) {
    var el = document.getElementById(stack[i].id);
    
    if (el && (hasNextSibling(el) || loaded)) {
      stack[i].callback();
    } else {
      notFound.push(stack[i]);
    }
  }
  stack = notFound;
  if (notFound.length < 1 || loaded) {
    stopPolling();
  }
}

function startPolling() {
  if (interval) {return;}
  interval = setInterval(doPoll, 10);
}

function stopPolling() {
  if (!interval) {return;}
  clearInterval(interval);
  interval = null;
}

function onContentAvailable(id, callback) {
  stack.push({id:id, callback:callback});  
  startPolling();
}

function lastPoll() {
  if (loaded) {return;}
  loaded = true;
  doPoll();
}

// Force one poll immediately when the document DOMContentLoaded event fires.
// This may be sooner than the next schedualed poll.
// Can't add this listener in at least Firefox 2 through DOM0 property assignment.
if (document.addEventListener) {
  document.addEventListener('DOMContentLoaded', lastPoll, false);
} else if (document.attachEvent) {
  // optimistic that one day Internet Explorer will support this event
  document.attachEvent('onDOMContentLoaded', lastPoll);
}

// Force one poll immediately when window.onload fires. For some pages if
// the brower doesn't support DOMContentLoaded the window.onload event
// may be sooner than the next schedualed poll.
window.onload = lastPoll;

