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);

if(isNaN(p.stitchMultiple.value) ) {p.stitchMultiple.value=9;}
stitchMultiple=Math.max(Math.round(p.stitchMultiple.value),1);
p.stitchMultiple.value = p.stitchMultiple.value;

stitchesOptimum= mult(p.chest.value,p.mainStIn.value);

if(isNaN(p.stitchMultiple.value) ) {p.stitchMultiple.value=2;}

stitchMultiple= 2*Math.max(p.stitchMultiple.value,1	); // the two is for stockinette-- since I already rounded for the top.

if(eval(p.roundUp.selectedIndex) ==0){      repeats =Math.ceil(divide(stitchesOptimum,stitchMultiple))+1}
else if(eval(p.roundUp.selectedIndex) ==1){ repeats =Math.ceil(divide(stitchesOptimum,stitchMultiple))}
else if(eval(p.roundUp.selectedIndex) ==2){ repeats =Math.floor(divide(stitchesOptimum,stitchMultiple))}
else{									  repeats =Math.floor(divide(stitchesOptimum,stitchMultiple))-1}

stitchesHem= repeats* stitchMultiple

repeats=repeats*2;
p.hemWidth.value= Math.round(divide(stitchesHem,p.mainStIn.value)*10)/10;
p.repeats.value= repeats;

calcGauge();
setMissesSizes();




// for now, cardigan only.

 if(custom == 0){
			
}



rollOrRib= "ribbed bands";
hood="has no hood";
buttonOrHem ="pullover";  buttonBandWidth=0; 
trimStitch="hung hem";

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

//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.