function setKidsSizes(){

custom=0;
  
// set sizes  -- I need to subtract 1 and put custom first.

    SizeIndex=sub(p.SizeChild.selectedIndex,1); // now do add the custom to the pull down menu.
    Size= SizeIndex+2;
    if(4<Size){Size = 4+ (SizeIndex-2)*2 }
	
if(p.SizeChild.selectedIndex==0){
		custom=1; missesSize="custom"; p.height.value="??"
		p.weight.value="??"; 
	 }
	 
else{ // kids size


	 
misses = "children's size";
missesSize = Size;

   // missesSize= (2*(eval(p.missesSize.selectedIndex)-1))+4 
   // missesSizeIndex=eval(p.missesSize.selectedIndex-1)
   // misses="Misses";
   
    var numSizes=7;
    height = '??'; weight = '??';
    if (Size == 8){ height = 51; weight = 60;}
    if (Size == 10){ height = 53; weight = 66;}
    if (Size == 12){ height = 57; weight = 84;}
    if (Size == 14){ height = 60; weight = 96;}
    if (Size == 16){ height = 62; weight = 110;}
	
    
    p.height.value=height;
    p.weight.value=weight;


wearerChest=21+SizeIndex*1;
if( 6<Size){
    wearerChest = 26 + (SizeIndex-4)*2;
    
}

    chestEase=1.5*(1 +1*wearerChest/34);  
    p.chest.value=Math.round((wearerChest+chestEase)*10)/10;

    shoulder = 9.25+ SizeIndex*0.25;
    if(4<Size){shoulder = 10.25 + (SizeIndex-3)*(13-10.25)/5;}
    shoulderEase=1/2;
	
	//alert(Size +" : height= "+ height + " :weight = "+weight + ": shoulder=" + shoulder) ;

   // p.shoulderWidth.value = Math.round(10*(shoulder+shoulderEase))/10;
    p.wearerShoulderWidth.value=Math.round(10*(shoulder))/10;
    
    armholeDepth = 4.25 +SizeIndex*0.25
    if(6<Size){armholeDepth = 5.5 + (SizeIndex-4)*(7.5-5.5)/4;}
    armholeDepthEase = (0.8) + ((Size-2)/2)*(1.6-0.8)/(46-34) // based on rate of increase in misses size range

    p.armHoleDepth.value =Math.round(10*(armholeDepth +armholeDepthEase+ 0.5 ))/10 ;  // Add 0.5" because measured from cllar extra here. a little more because it's a cardi.
    
    sweaterLength=mult(p.chest.value,0.58) ; //?? I need something.	
    p.totalLength.value=Math.round(sweaterLength*10)/10-2.8; 
    
    headCirc = 19.5 + (22-19.5)*SizeIndex/8;
   
    headNeck= 0.87* headCirc/2.7;
    shoulderNeck= shoulder/3;
    //alert(headNeck + ":" + shoulderNeck);
    
    largeNeck= Math.max(headNeck,shoulderNeck)
    smallNeck=Math.min(headNeck,shoulderNeck)
    
	//alert("size" + Size + "headCirc=" + headCirc + ":" + SizeIndex + " headNeck " + headNeck + " large=" + largeNeck)

    p.neckWidth.value= Math.round(10*(largeNeck))/10;
	//p.frontNeckDepth.value =p.neckWidth.value;
    p.shoulderSlope.value=0.5
	
    wrist=4.5+SizeIndex*(6.0-4.5)/numSizes;
    p.cuffWidth.value=Math.round((wrist*1.3)*10)/10;
    //alert(wrist);
	
    lowerSleeveLength = 7.5+(SizeIndex)*(1/2);
    if(Size == 8){lowerSleeveLength =12;}
    if(Size == 10){lowerSleeveLength =13.5;}
    if(Size == 12){lowerSleeveLength =15;}
    if(Size == 12){lowerSleeveLength =16;}
    if(Size == 16){lowerSleeveLength =16.5;}

    sleeveLength= lowerSleeveLength + armholeDepth;
	//fullSleeveLength = sleeveLength+shoulder/2;
	
    p.armLength.value=Math.round(sleeveLength*10)/10;
    p.wearerShoulderWidth.value=Math.round(shoulder*10)/10;
	
    bicep=6 +(Size-2)*0.25;	
    bicepEase = chestEase/2+0.5;

    p.sleeveWidth.value=bicep+bicepEase;
    //alert(p.sleeveWidth.value + " = " +bicep+ " +" + bicepEase);
		
	p.buttonBandWidth.value=5/8;
	//p.neckTrim.value=1;
	p.cuffTrim.value=1.5;
	p.bodyTrim.value=1.5;

} // end else for non-custome sizes.

  
    // finish up -- I think same for everything? 
    // enter minimum sleeve values for raglans
    chestWidth=divide(p.chest.value,2);
    neckWidth=eval(p.neckWidth.value);
    shoulder=eval(p.wearerShoulderWidth.value)
  

    p.minSleeveWidth.value=chestWidth-neckWidth;
    p.sleeveWidth.value=Math.max(p.minSleeveWidth.value,p.sleeveWidth.value);
    
    
    // Band can't be too small.
	p.backNeckDepth.value=divide(sub(p.sleeveWidth.value,p.minSleeveWidth.value),2);
	//alert("misses: " + p.backNeckDepth.value +"= ("+p.sleeveWidth.value+ " - " + p.minSleeveWidth.value + ")/2)" );
// standard Sleeve Length reaches wrist.
// 	       
    raglanSleeveLength = add(p.armLength.value,(shoulder-neckWidth)/2); 
    p.standardSleeveLength.value=Math.round(raglanSleeveLength*100)/100;
    if(p.SizeChild.selectedIndex !=0){p.shortenSleeveLength.value=0; p.sleeveLength.value=p.standardSleeveLength.value;}// otherwise customize!
    
    p.sleeveLength.value=sub(p.standardSleeveLength.value ,p.shortenSleeveLength.value);
   sleeveLength=eval(p.sleeveLength.value);
	    



warning +="<b>WARNING: </b><br>This is a kid's size. I found data in standards tables, but I need to reality check these by comparing to sweaters in stores and pattern books.  But, Mom wants this to knit for my cute nephew as soon as possible.  So, so it's up! I'll be coding the rest of the kid's sizes, and checking over the weekend!";
	
}
//================TEEN BOYS Lucia Liljegren ==============

function setTeenBoysSizes(){
alert('Teen Boys -- not coded yet.');
}
//================TEEN GIRLS Lucia Liljegren ==============

function setTeenGirlsSizes(){
alert('Teen Girls -- not coded yet -- ');
}


