function raglanCalcs(){

	// gauge

	p=document.sweaterForm;
	warning=" ";
	p.tooFewStitches.value ="No warning";
	lengthBeforeRatio=1
	widthBeforeRatio=1
	shrinks= "<br>You entered told the program your swatch doesn't change gauge after washing."
	if(eval(p.shrinks.selectedIndex)==0){
		p.lengthBefore.value=p.lengthAfter.value; 
		p.widthBefore.value=p.widthAfter.value;	
		shrinks= "You told the program your swatch doesn't change gauge after washing.  If it did shrink, but you forgot to take measurements before washing, use count rows to determine when to stop  knitting the lower yoke and sleeves.<br>"
		 }
	else{
		lengthBeforeRatio=divide(p.lengthBefore.value,p.lengthAfter.value);
		widthBeforeRatio=divide(p.widthBefore.value,p.widthAfter.value)
		percentShrink= (lengthBeforeRatio-1)*100;
		percentWidthShrink= Math.round(widthBeforeRatio-1)*100
		shrinks= "You told the program your yarn will shrink " +Math.round(percentShrink) +" percent in length and "+percentWidthShrink+" percent in width  after washing.  <br>"
		}
	lenghtBeforeRatio=divide(p.lengthBefore.value,p.lengthAfter.value);
	//alert(lengthBeforeRatio + "=" + p.lengthBefore.value + " / " + p.lengthAfter.value);

	calcGauge();


	if(eval(p.sizeRange.selectedIndex)==0){setMissesSizes();}
	else if(p.sizeRange.selectedIndex==1){setMensSizes();}
	else if(p.sizeRange.selectedIndex==2){setKidsSizes();}

	//  neckline selections

	if(custom==0){ // right now, only permit barely shaped crew with  polo attahced.
		
		//p.placketDepth.value= Math.round(mult(p.neckWidth.value,5))/10;
		p.frontNeckDepth.value=p.backNeckDepth.value; 
		p.bandWidth.value=Math.round(10*divide(p.neckWidth.value,6))/10; 
		//p.collarHeight.value=Math.round(mult(p.neckWidth.value,0.75)*10)/10
	}

	 
	/*
	if(p.rollOrRib.selectedIndex==0){ 
		 
		}
	else if(p.rollOrRib.selectedIndex==1 ) { 
		trimStitch="garter" 
		p.cuffTrim.value=mult(p.cuffTrim.value,0.75);
		p.bodyTrim.value=mult(p.bodyTrim.value,0.75);	
		}
	*/


	trimStitch="rib";
	//Trim();
	

	rollOrRib= "ribbed bands";
	buttonBands(rollOrRib);

	hood="has no hood";
	buttonOrHem ="pullover"; 
	buttonBandWidth=0; 

	//=============================================

 calcMasterValuesHK();
	yarnUsed();


	//if(p.hood.selectedIndex ==1){hoodCalcs()}
	// else{} // no hood.

	// do this calc last so date only fills if window fills. 
	now=new Date;
	currentYear= now.getYear() + 1900;
	currentMonth = now.getMonth() + 1;
	currentDate=now.getHours() +":"+ now.getMinutes() +":"+ now.getSeconds() + " on " +currentMonth+ "/" +now.getDate() +"/"+currentYear;
	p.patternCreationDate.value=currentDate;
}

//===========================================
function calcGauge(){

    mainStIn=divide(p.stitches.value,p.widthAfter.value); p.mainStIn.value=Math.round(100*mainStIn)/100;
    mainRowIn=divide(p.rows.value,p.lengthAfter.value); p.mainRowIn.value=Math.round(100*mainRowIn)/100;

    //ribStIn=divide(p.ribStitches.value,p.widthRib.value); p.ribStIn.value=Math.round(100*ribStIn)/100;
   // ribRowIn=divide(p.ribRows.value,p.lengthRib.value); p.ribRowIn.value=Math.round(100*ribRowIn)/100;

   // lengthFactor=divide(p.lengthRib.value,p.lengthAfter.value);
    //widthFactor=divide(p.widthRib,p.widthAfter.value);
}

// removed button band code.

// ==

function buttonBands(){
// pick up for front bands

	pickUpBand("ribbed");

// pick up for collar.
}
//===========

function pickUpBand(ribbed){

// text will be pick up 'threeStitches' every 'four rows  
// but variables for three stitches and rows are calculated based on whether the trim is rib or garter. 
        
	if(ribbed == "garter"){ spread=0.85; } // smaller number of garter stitche.
	else { spread = 1.0; } // appropriate for ribbed bands on stockinette.
	
   stitchesPer12 = spread* divide(mainStIn*12,mainRowIn); 
   //p.stitchesPer12.value=stitchesPer12;
  roundStitchesPer12=Math.round(stitchesPer12); 
   
   fourRows=12; 
   threeStitches=roundStitchesPer12;
   
   if(threeStitches%2==0){
		fourRows = divide(fourRows,2); 
		threeStitches=divide(threeStitches,2); }
		
	if(threeStitches%3==0){
		fourRows = divide(fourRows,3); 
		threeStitches=divide(threeStitches,3); }
		
	if(threeStitches%2==0){
		fourRows = divide(fourRows,2); 
		threeStitches=divide(threeStitches,2); }
		
	bandRows=Math.round(1.10*mult( p.bandWidth.value, p.mainRowIn.value)+1);

		
}

