// used for the URL rewrite
var URL = "http://www.crystek.com/microwave/";

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/* Functions that swaps down images. */
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function mmLoadMenus() {
  if (window.mm_menu_1101134839_0) return;
  	// [PLL SYNTHESIZERS]
	window.mm_menu_1101134839_0_1 = new Menu("PLL/Synthesizers",190,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,7,true,true,true,0,true,true);
		mm_menu_1101134839_0_1.addMenuItem("FAMILY&nbsp;OVERVIEW","location='"+URL+"pll.php'");
		mm_menu_1101134839_0_1.addMenuItem("CPLL58","location='"+URL+"cpll58.php'");
		mm_menu_1101134839_0_1.addMenuItem("CPLL66","location='"+URL+"product/1'");
			mm_menu_1101134839_0_1.hideOnMouseOut=true;
			mm_menu_1101134839_0_1.menuBorder=1;
			mm_menu_1101134839_0_1.menuLiteBgColor='#ffffff';
			mm_menu_1101134839_0_1.menuBorderBgColor='';
			mm_menu_1101134839_0_1.bgColor='';
			mm_menu_1101134839_0_1.childMenuIcon=URL+"images/buttons/arrows.gif";
	// [VCO CVCO55 PRODUCTS SUBMENU]
	window.mm_menu_1101134839_0_2_1 = new Menu("CVCO55&nbsp;&nbsp;(0.50&quot;x0.50&quot;)&nbsp;All",280,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,7,true,true,true,0,true,true);
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55BE&nbsp;&nbsp;(High&nbsp;Frequency)","location='"+URL+"product/6'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55BH&nbsp;&nbsp;(Ultra&nbsp;High&nbsp;Frequency)","location='"+URL+"product/7'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55CC&nbsp;&nbsp;(Coaxial&nbsp;Resonator)","location='"+URL+"product/5'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55CL&nbsp;&nbsp;(Narrow&nbsp;Band)","location='"+URL+"product/3'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55CM&nbsp;&nbsp;(Extra&nbsp;Modulation&nbsp;Port)","location='"+URL+"product/15'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55CW&nbsp;&nbsp;(Wide&nbsp;Band)","location='"+URL+"product/4'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55CXT&nbsp;&nbsp;(Coax&nbsp;Frequency&nbsp;Doubling)","location='"+URL+"product/22'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55FL&nbsp;&nbsp;(Low&nbsp;Noise&nbsp;Low&nbsp;Frequency)","location='"+URL+"product/21'");
		mm_menu_1101134839_0_2_1.addMenuItem("CVCO55&nbsp;All","location='"+URL+"product/2'");
		mm_menu_1101134839_0_2_1.hideOnMouseOut=true;
		mm_menu_1101134839_0_2_1.menuBorder=1;
		mm_menu_1101134839_0_2_1.menuLiteBgColor='#ffffff';
		mm_menu_1101134839_0_2_1.menuBorderBgColor='';
		mm_menu_1101134839_0_2_1.bgColor='';
	// [VCO PRODUCTS]
	window.mm_menu_1101134839_0_2 = new Menu("VCO&nbsp;Products",190,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,7,true,true,true,0,true,true);
		mm_menu_1101134839_0_2.addMenuItem("FAMILY&nbsp;OVERVIEW","location='"+URL+"vco.php'");
		mm_menu_1101134839_0_2.addMenuItem(mm_menu_1101134839_0_2_1,"location='"+URL+"product/2'");
		//2007-08-31  SF:  Removed comparison chart
		//mm_menu_1101134839_0_2.addMenuItem("CVCO55&nbsp;Comparison&nbsp;Chart","location='"+URL+"freqchart.php'");
		mm_menu_1101134839_0_2.addMenuItem("CVCO45&nbsp;&nbsp;(0.40&quot;x0.496&quot;)","location='"+URL+"product/9'");
		mm_menu_1101134839_0_2.addMenuItem("CVCO38&nbsp;&nbsp;(0.38&quot;x0.38&quot;)","location='"+URL+"product/23'");
		mm_menu_1101134839_0_2.addMenuItem("CVCO33&nbsp;&nbsp;(0.30&quot;x0.30&quot;)","location='"+URL+"product/10'");
		mm_menu_1101134839_0_2.addMenuItem("CVCO25&nbsp;&nbsp;(0.25&quot;x0.25&quot;)","location='"+URL+"product/11'");
			mm_menu_1101134839_0_2.hideOnMouseOut=true;
			mm_menu_1101134839_0_2.childMenuIcon=URL+"images/buttons/arrows.gif";
			mm_menu_1101134839_0_2.menuBorder=1;
			mm_menu_1101134839_0_2.menuLiteBgColor='#ffffff';
			mm_menu_1101134839_0_2.menuBorderBgColor='';
			mm_menu_1101134839_0_2.bgColor='';
	// [RF PRODUCTS]
	window.mm_menu_1101134839_0_3 = new Menu("RF&nbsp;Products",190,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,15,true,true,true,0,true,true);
		mm_menu_1101134839_0_3.addMenuItem("Attenuators","location='"+URL+"attenuator.php'");
		mm_menu_1101134839_0_3.addMenuItem("DC&nbsp;Block","location='"+URL+"dcblock.php'");
		mm_menu_1101134839_0_3.addMenuItem("Passive&nbsp;Doubler","location='"+URL+"cppd.php'");
		mm_menu_1101134839_0_3.addMenuItem("RF&nbsp;Cables","location='"+URL+"cable-select.php'");
		mm_menu_1101134839_0_3.addMenuItem("RF&nbsp;PRO","location='"+URL+"rfpro.php'");
		mm_menu_1101134839_0_3.addMenuItem("VCO&nbsp;Evaluation&nbsp;Boards","location='"+URL+"vcoeval.php'");
			mm_menu_1101134839_0_3.hideOnMouseOut=true;
			mm_menu_1101134839_0_3.menuBorder=1;
			mm_menu_1101134839_0_3.menuLiteBgColor='#ffffff';
			mm_menu_1101134839_0_3.menuBorderBgColor='';
			mm_menu_1101134839_0_3.bgColor='';
			mm_menu_1101134839_0_3.childMenuIcon=URL+"images/buttons/arrows.gif";
	// [REDBOX MENU]
	window.mm_menu_1101134839_0_4 = new Menu("RedBox&nbsp;Products",190,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,15,true,true,true,0,true,true);
		mm_menu_1101134839_0_4.addMenuItem("RedBox&nbsp;VCOs","location='"+URL+"redbox.php'");
		mm_menu_1101134839_0_4.addMenuItem("RedBox&nbsp;Amplifiers","location='"+URL+"amplifier.php'");
			mm_menu_1101134839_0_4.hideOnMouseOut=true;
			mm_menu_1101134839_0_4.menuBorder=1;
			mm_menu_1101134839_0_4.menuLiteBgColor='#ffffff';
			mm_menu_1101134839_0_4.menuBorderBgColor='';
			mm_menu_1101134839_0_4.bgColor='';
			mm_menu_1101134839_0_4.childMenuIcon=URL+"images/buttons/arrows.gif";
	// ----------------------------------
	// [PRODUCT SELECTION (MAIN ROOT MENU)]
	window.mm_menu_1101134839_0 = new Menu("root",190,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,1000,0,7,true,true,true,0,true,true);
		mm_menu_1101134839_0.addMenuItem(mm_menu_1101134839_0_2,"location='"+URL+"vco.php'");
		mm_menu_1101134839_0.addMenuItem(mm_menu_1101134839_0_1,"location='"+URL+"pll.php'");
		// [Red Box]
		//mm_menu_1101134839_0.addMenuItem("Red&nbsp;Box","location='"+URL+"redbox.php'");
		mm_menu_1101134839_0.addMenuItem(mm_menu_1101134839_0_4,"location='"+URL+"redbox.php'");		
		mm_menu_1101134839_0.addMenuItem(mm_menu_1101134839_0_3,"location='"+URL+"dcblock.php'");
			mm_menu_1101134839_0.hideOnMouseOut=true;
			mm_menu_1101134839_0.childMenuIcon=URL+"images/buttons/arrows.gif";
			mm_menu_1101134839_0.menuBorder=1;
			mm_menu_1101134839_0.menuLiteBgColor='#ffffff';
			mm_menu_1101134839_0.menuBorderBgColor='';
			mm_menu_1101134839_0.bgColor='';  
  // [CONTACT MENU]
  if (window.mm_menu_1020114928_0) return;
	window.mm_menu_1020114928_0 = new Menu("root",145,22,"Verdana, Arial, Helvetica, sans-serif",13,"#880907","#880907","#dedede","#cccccc","left","middle",3,0,200,-5,7,true,true,true,0,true,true);
		mm_menu_1020114928_0.addMenuItem("Corporate","location='"+URL+"contact_corporate.php'");
		mm_menu_1020114928_0.addMenuItem("Distributors","location='"+URL+"contact_distributors.php'");
		mm_menu_1020114928_0.addMenuItem("Representatives","location='"+URL+"contact_representatives.php'");
			mm_menu_1020114928_0.hideOnMouseOut=true;
			mm_menu_1020114928_0.menuBorder=1;
			mm_menu_1020114928_0.menuLiteBgColor='#ffffff';
			mm_menu_1020114928_0.menuBorderBgColor='';
			mm_menu_1020114928_0.bgColor='';

  mm_menu_1101134839_0.writeMenus();
  mm_menu_1020114928_0.writeMenus();
} // mmLoadMenus()

function searchHelp(element,id){
	var div = document.getElementById(id);
	
	switch(element.selectedIndex){
		case 1:
			div.innerHTML = "Enter a center frequency in Mhz below.";
			div.innerHTML += " You can enter a single value (such as 56)";
			div.innerHTML += " or a range (such as 34 - 100)";
			div.style.display = "block";
			break;
		case 2:
			div.innerHTML ="Enter a part number below.";
			div.innerHTML += " Value must have at least 3 characters";
			div.style.display = "block";
			break;
		default:
			div.style.display = "none";
	}
}

function showInfo(e,partnumber,phasenumber,download,url){
	//alert(e.clientX);
	var div = document.createElement("div");
	
	var partnumber = document.createTextNode(partnumber);
	var phasenumber = document.createTextNode(phasenumber);
	var separator = document.createElement("br");
	
	div.appendChild(partnumber);
	div.appendChild(separator);
	div.appendChild(phasenumber);
	
	div.style.position = "absolute";
	div.style.top = e.clientY;
	div.style.left = e.clientX;
	div.style.zIndex = "1000";
	document.body.appendChild(div);
}

// hides emails from spam bots
function safemail(name, domain, display) {
	var displayed;
	displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
	document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}
