	if (align->MeanAlIval != 0.0 && Plot3MLines)  // If we have more than one alignment
	{
        oPen = SelectObject(hdc, bluePen) ;
        oFnt = SelectObject(hdc, hfnt1) ;
		SetTextColor(hdc, RGB(0,0,0)) ;
		SetBkColor(hdc, RGB(255,255,255)) ;
		SetBkMode(hdc,TRANSPARENT) ;

	// plot the vertical line corresponding to the mIAP order.

		  xp = (int)((double)wd 
			  * (st.pord - lo_f) / fspan) + D.left ;
			MoveToEx(hdc, xp, D.bottom + 5, NULL ) ;
			LineTo(  hdc, xp, D.top - 8 ) ;

		// show mean IAP and the order corresponding to mIAP.

			sprintf(buff,"mIAP %4.3fdays", align->MeanAlIval) ;
			GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp - sz.cx/2, D.top - 35,buff,strlen(buff)) ;
			sprintf(buff,"%4.3f", st.pord) ; 
			GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp - sz.cx/2, D.bottom + 5 + sz.cy, buff, strlen(buff)) ;

	// plot the vertical line corresponding to the least IAP order.

		  xp = (int)((double)wd
			  * (st.ordforwee - lo_f) / fspan) + D.left ;
			MoveToEx(hdc, xp, D.bottom + 5, NULL ) ;
			LineTo(  hdc, xp, D.top - 8 ) ;

		// show least IAP and the order corresponding to it.
		// will be highest order, put texts on right.
			sprintf(buff,"%4.3fdays", st.weeIAP) ;
			//GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp + 8, D.top - 20, buff, strlen(buff)) ;
			sprintf(buff,"%4.3f", st.ordforwee) ; 
			//GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp + 8, D.bottom + 5 + sz.cy, buff, strlen(buff)) ;

	// plot the vertical line corresponding to the largest IAP order.

		  xp = (int)((double)wd 
			  * (st.ordforbig - lo_f) / fspan) + D.left ;
			MoveToEx(hdc, xp, D.bottom + 5, NULL ) ;
			LineTo(  hdc, xp, D.top - 8 ) ;

		// show largest IAP and the order corresponding to it.
		// (will be lowest order, put texts on left)
			sprintf(buff,"%4.3fdays", st.bigIAP) ;
			GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp - sz.cx - 8, D.top - 20,buff,strlen(buff)) ;
			sprintf(buff,"%4.3f", st.ordforbig) ; 
			GetTextExtentPoint32(hdc, buff, strlen(buff), &sz) ;
			TextOut(hdc, xp - sz.cx - 8, D.bottom + 5 + sz.cy, buff, strlen(buff)) ;

		SelectObject(hdc, oPen) ;
		SelectObject(hdc, oFnt) ;
	}
			
