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(p.neckStyle.selectedIndex==0){// barely shaped crew.  I'll be readjusting the neck later.
    placket="no";
    p.placketDepth.value=0;
    p.frontNeckDepth.value=p.backNeckDepth.value;
    p.placketWidth.value=0;
    p.collarHeight.value=Math.round(divide(p.neckWidth.value,7.0)*10)/10
    }
    
else{  placket="yes";
    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.placketWidth.value=Math.round(10*divide(p.neckWidth.value,6))/10; 
	p.collarHeight.value=Math.round(mult(p.neckWidth.value,0.75)*10)/10
    }
    }
 
    // override people who try to make placket deeper than armholes   
p.placketDepth.value=Math.min(eval(p.placketDepth.value), sub(p.armHoleDepth.value,p.backNeckDepth.value))
placketDepth= p.placketDepth.value; 
//alert("custom = " + custom +" placket=" +  placket +" depth= "+  placketDepth);

if(p.rollOrRib.selectedIndex==0){ 
	trimStitch="rib" 
	}
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);	
	}


Trim()


rollOrRib= "ribbed bands";
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.