<!--
// ==========================================================
// By: Joseph McCloskey, 10/10/02
//       Portions provided by Interactive Impact from first web redesign, 8/2002
// ==========================================================

var layer_st;
layer_st = 'on';

// ==========================================================
function QueryString(strName) {
	// searches the location.search (trailer of URL after ?) for name
	// and returns the value after the = and before the next & if any
	
	var str = document.location.search;		// returns all info after ?
	var pos = str.indexOf(strName + "=");		// search for name parameter
	var s = "";
	if (pos != -1) {
	  s = str.substring(pos + strName.length + 1, str.length + 1);
	  pos = s.indexOf("&");
	  if (pos != -1) {
	  	 s = s.substring(0, pos);
	  }
	}
	return s;
}

// ==========================================================
function QueryStringShow() {
	//var frm = window.parent.frames;
	var s = document.location.search;
	alert("The Query String is " + s);
	//frm("main").src = doc.location.search;
}

// ==========================================================
function QueryStringWhole() {
	var s = document.location.search;
	return s;
}

// ==========================================================
function MsgBoxYesNo(strMsg) {
	// display a msgbox with OK/Cancel.  
	// Returns True if OK, False if Cancel

	var rtn = confirm(strMsg);
	return rtn;
}

// ==========================================================
function InputBox(strMsg, strDefault) {
	// display a msgbox with OK/Cancel.  
	// Returns True if OK, False if Cancel

	var rtn = prompt(strMsg, strDefault);
	return rtn;
}

// ==========================================================
function MsgBoxOK(strMsg) {
	// display a msgbox with OK only  
	
	alert(strMsg);
}

// ==========================================================
function DocTitle() {
	// renders the document title with appropriate font size, etc.
	var t,txt;
	var doc = document;
	var frm = window.parent.frames;
	t = "<strong><font size='";
	//with(doc) {
		if (frm.length > 0) {
			txt = frm("main").document.title};
		else {
			txt = doc.title;
		};
  		if (txt.length < 25) 
			{t = t + "6"} 
		else { 
			if (txt.length < 40) 
				{t = t + "5"} 
			else 
				{t = t + "4"};
		};
		t = t + "' color='#773E8F'>" + txt + "</strong>";
		//write(t);
	//}
	if (frm.length > 0) {
		frm("top").document.all.HeadTitle.innerHTML = t;
		window.parent.document.title = txt;
	}
	else {
		doc.all.HeadTitle.innerHTML = t;
	};

}

// ==========================================================
function TimeOut() {
	var tf;
	tf=window.setTimeout('ClearLayers()', 100);
}

// ==========================================================
function ClearLayers() {
	if(layer_st == 'off') {
		MM_showHideLayers('Layer1','','hide');
//		MM_swapImage('Image8','','../products/images/btns/btntransducer.gif',1);

		MM_showHideLayers('Layer2','','hide');
//		MM_swapImage('Image9','','../products/images/btns/btntemp.gif',1);

		MM_showHideLayers('Layer3','','hide');
//		MM_swapImage('Image10','','../products/images/btns/btnisolator.gif',1);

	
	}
}

// ==========================================================
function lstatusOver(imgname,imgpath) {

//	MM_swapImage(imgname,'',imgpath,1);
	layer_st = 'on';
	TimeOut();
}

// ==========================================================
function lstatusOut() {
	layer_st = 'off';
	TimeOut();
}

// ==========================================================
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// ==========================================================
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// ==========================================================
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// ==========================================================
function MM_findObj(n, d) { //v3.0
  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); return x;
}

// ==========================================================
// recoded to include "../" if necessary for image swap, JAM - 10/10/02
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
  var h,p,w,y,z
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){
      document.MM_sr[j++]=x;
      if(!x.oSrc) x.oSrc=x.src; 
      p=a[i+2];
      w="";
      y=document.URL;
      z=(y.length-9);
      h=y.substring(z);
      // check if not index.htm page
      if (h != "index.htm") {
        // check if image path does not have ../ prefix
        if (p.substring(0,3) != "../" ) {
          w = "../";
        }
      }
      x.src = w + p;
    }
}

// ==========================================================
//OLD code from above function
//function MM_swapImage() { //v3.0
//  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
//   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
//}

//-->

