
//================
function raglanDirections(){


    raglanCalcs();
    patternWindow= window.open('','rowStitch','toolbar=yes, location=yes, scrollbars=yes, resizable=yes, width=400, height=500, left=0,top=0')
    patternWindow.document.write("<HTML><HEAD><BODY><H1>Knitting Directions For Seamless Knit Raglan Sweater.</H1>")
    patternWindow.document.writeln("Knit bottom to top. <br> Author: Lucia Liljegren.<br>")
    
    // intro
    stuff="These directions were created based on user supplied information entered in a design form for my pattern generator located at  "+ window.location.href +" on "+ currentDate +" .  Additional information, including schematics, on the design page and a number of supporting web pages. I advise you print out the design form for your records. Code and general sweater design by Lucia Liljegren, <i>The  Knitting Fiend.<\/i> ";
    
stuff +='<br>'+ p.tooFewStitches.value;
    
    patternWindow.document.writeln(stuff); stuff="";
    
    // Preliminaries
    stuff+="<hr><h2>Preliminaries<\/h2>";
	stuff+="<br> Size is "+misses + " "+ missesSize +".   Print out the design web page for further details. <P> You must achieve both the row and stitch gauge or your sweater may not fit and the yardage estimate will be incorrect.   I advise double checking your gauge as you knit.  ";

	stuff+="Stitch Gauge: "+ mainStIn +" st/inch; "+  mainRowIn +" row/inch in whatever pattern you picked as your main stitch pattern <em>after</em> you wash, dry and block the swatch. ";
	
	stuff += shrinks;
	
	
	    stuff+="<p><b>Materials:</b> To knit the main portion of the sweater, you will need circular needles in several lengths with the same diameter you used to knit your swatch.  You may also need double pointed needles to work the sleeves.  I recommend using smaller diameter needles to knit the trim on the cuffs and hem; I use 2 sizes smaller.  The directions suggest using 'appropriate' diameter needles to cast on.  I cast on tightly, so I use my larger diameter needles to cast on. If you cast on loosely, use the smaller needles to cast on. You must determine which diameter is most appropriate for your knitting style.<p>An estimate for the amount of yarn you need appears at the end of the pattern. ";  

if(trimStitch=="rib"){	
	oneByOneRib="1 x 1 rib";
	firstRow="then repeat (p1, k1)";
	}
else {
	oneByOneRib = "garter stitch"; 
	firstRow="then knit all stitches"; 
	}

 stuff+="<p>Option The program consistently suggests you knit "+oneByOneRib+"  for the trim. You may substitute <em>any</em> non curling stitch pattern, including rib, garter or seed stitch.";    
 
    patternWindow.document.writeln(stuff);stuff="";
    
     // ============ Sleeves
    stuff = "<h2>Sleeves<\/h2>";
    stuff+= "<ol><li>Cast On: Using appropriate  needles, cast on " + castOnCuffP1 + " stitches. Using smaller diameter circular needle or a set of double pointed needles, knit cuffs in "+oneByOneRib+".  Begin by slipping first stitch, then "+firstRow+" until only one stitch remains on working needle.  Slip the final stitch.  To join, place tips together, check that the knitting is not twisted. Slip the stitch on the right hand tip onto the left hand needle, k2 together. "+ castOnCuff + " stitches remaining in round.  Place a stitch marker <em> before<\/em> the stitch you just formed to indicate beginning of a round. The knit stitch after the stitch  marker will be a 'fake seam', and is neither on the front nor back of the sleeve.  <\/li>";
    stuff+= "<li>Rib: Knit in "+oneByOneRib+ " until work  measures "+ Math.round(mult(p.cuffTrim.value,lengthBeforeRatio)*10)/10 + " inches from cast on, finishing at the end of the round. Hang a row marker somewhere on this row. (I recommend you try on the cuff and test fit before continnuing to knit the sleeve.)<\/li>";
    stuff+= "<li>On next round, change to larger diameter needles and knit all stitches. Increase " +   incCuff + " stitches evenly over  " + castOnCuff +" stitches.  There are now "+ cuffStitches +" stitches on the needle.  Begin knitting in pattern stitch of your choice. (Notes: I recommend making sure the 'fake seam' stitch is always knit in stockinette, no matter what the stitch pattern because sweaters fold better along a knit ridge rather than a purl bump.  However, this is optional.  Also, if you are clever and know how to increase and establish your stitch pattern at the same time,  you can knit this row in your pattern stitch.  )<\/li>";  
    stuff+= "<li>Hang a row marker under the row you just knit. You will use this to measure the length of the sleeve below the yoke.</li> ";
    stuff+= "<li>Work " +fastIncSleeve+ " rounds ending at stitch  marker.  <\/li>"; 
    stuff+= "<li>You will now increase " + incSleeveStitches + " stitches over " + printIncRowsSleeve + " rows by periodically working increase rounds as follows: Knit 1 stitch, m1, work until 1 stitch remains in round, m1, k1.  ('m1' stands for 'make 1'.)<\/li>"; 
    if(0 < fastTimes){
	stuff+= "<li>Do the following " +fastTimes+ " times: **Work one increase round.  Work "+ fastIncSleeve +" rounds even. **  (There should be "+stitchesAfterFast+" stitches on the needle. )<\/li> "; }
    if(0 < slowTimes){
	stuff+= "<li>Do the following " +slowTimes+ " times: **Work one increase round.   Work "+ slowIncSleeve +" rounds even. ** <\/li> "; }  
	
	lengthFromCastOn=sleeveLengthToUnderarmM1+eval(p.cuffTrim.value);
	
    stuff+= "<li>There should be " +bicepStitches + " stitches on the needle. Work even in pattern stitch until sleeve  measures " + Math.round(mult(sleeveLengthToUnderarmM1,lengthBeforeRatio)*10)/10 +" inches from end of rib. (If your row gauge is correct, there will be a total of  "+rowsSleeve +" rounds in worked in pattern stitch up to the armhole. The length from the cast on should be "+Math.round(mult(lengthFromCastOn,lengthBeforeRatio)*10)/10  +" inches";
	
	if(lengthBeforeRatio != 1){
		stuff+= "; after you wash the sweater, the length from the cast on to this point will be "+ Math.round(lengthFromCastOn*10)/10 + " inches";
	}
	
	stuff+= ". )<\/li> "; 
    stuff+= "<li>If you are knitting a decorative stitch pattern, note the row number in the pattern sequence. You will want to make sure both sleeves and body end on the same row.<\/li>";
    stuff+= "<li>Slip stitch marker, knit "+firstSleeveYoke+"  stitches, bind off "+ halfUnderArmStitches + " stitches, drop marker, bind off "+ halfUnderArmStitchesP1 + " stitches. (The second bind off includes the fake seam stitch.  The bound off stitches should be symmetric around the fake seam.)  <\/li> ";  
    stuff+= "<li>Put sleeves on a stitch holder, keeping round marker in place.  <\/li> ";  
    stuff+= "<\/ol>";
    patternWindow.document.writeln(stuff);stuff="";

   
    //  Front =========================================================================
    
    stuff = "<h2>Body<\/h2>";
    
    stuff+= "<ol><li>Cast On: Using appropriate  needles, cast on " + castOnBodyP1 + " stitches. Using smaller diameter circular needles knit "+oneByOneRib+", beginning by slipping first stitch, then "+firstRow+" ; continue across row. Slip the final stitch.  You will now begin to  work in rounds. Place tips together, and check that the knitting is not twisted. Slip the stitch on the right hand tip onto the left hand needle, k2 together. "+ castOnBody + " stitches remaining in round.  Slip the stitch you just worked back to the right hand tip, place a stitch marker, then slip the stitch back. The stitch  marker indicates beginning of a round; the knit stitch after the  marker is the 'fake seam' and is neither on the front nor back of the sweater. <\/li>";
    stuff+= "<li>Rib: Work "+ oneByOneRib +" until work  measures "+Math.round(mult(p.bodyTrim.value,lengthBeforeRatio)*10)/10   + " inches from cast on, finishing at the end of the round. <\/li>";
      stuff+= "<li>On next round, change to larger diameter needles and knit all stitches. Place a slippable stitch marker.  ";
	  
	  if(0<incBack){
	    stuff+= "Increase " + incFront + " stitches evenly over the first " + castOnFront +" stitches.   Place another stitch marker. Increase " + incBack + " stitches evenly over the remaining "+ castOnBack +" stitches. There are now "+ bodyFront +" stitches on the front and "+ bodyBack  + " stitches on the back.  (Note: If you are clever and know how to increase and establish your stitch pattern at the same time,  you can knit this row in your pattern stitch.)";}
		
		else{
		stuff+= "Knit " + castOnFront + " stitches, place another marker, knit " + castOnBack + " stitches. You have reached the first marker which indicates the beginning of the round.";
		}
		
		 stuff+= "<\/li>";
      stuff+= "<li>Hang a row marker under the row you just knit. You will use this to measure length.</li>";
	  
	  lengthFromCastOn= lengthToUnderarm-lengthOneRow + eval(p.bodyTrim.value);
	  
      stuff+= "<li>Work all stitches in round using pattern stitch of your choice until work measures "+ Math.round(mult(lengthToUnderarm-lengthOneRow,lengthBeforeRatio)*10)/10 +" inches from the end of rib (which is the beginning of the main stitch pattern).  If your row gauge is correct, there will be "+ rowsToUnderArm +" rounds between the ribbing and underarm. The length from the cast on should be "+Math.round(mult(lengthFromCastOn,lengthBeforeRatio)*10)/10 +" inches.<\/li>";
      stuff+= "<li>If you are knitting a complicated stitch pattern, note the row number in the pattern sequence. You will want to make sure the sleeves and body end on the same row. Knit an extra row if necessary.<\/li>";

     stuff+= "<li>Slip stitch marker. Knit the fake seam stitch, knit "  +  firstFrontYoke  +"  stitches. Bind off "+halfUnderArmStitches+" stitches, drop stitch marker, bind off "+halfUnderArmStitchesP1+" stitches (including the fake seam stitch); knit "+ backYoke+"  stitches, bind off "+halfUnderArmStitches+" stitches, drop stitch marker, bind off "+halfUnderArmStitchesP1+" stitches. <li>  Place front stitches and back stitches on separate stitch holders. <\/li>";

    stuff+= "<\/ol>";
    patternWindow.document.writeln(stuff);stuff="";  
      
// Yoke
  stuff = "<h2>Yoke<\/h2>";
  stuff+= "<b>Discussion:</b>";
  stuff+= "<ol><li> The yoke will be approximately "+ Math.round(10*frontArmholeDepth)/10 + " inches deep measured at the center of the sleeve <em>after you wash the sweater<\/em> ";
  
 if(lengthBeforeRatio !=1){stuff+= ", but "+ Math.round(10*mult(frontArmholeDepth,lengthBeforeRatio))/10 + " inches deep before you wash the sweater";}
  
  stuff+= ". This will require you to knit approximately "+ ragRows+ " rows.  Double check your row gauge before proceeding, if it's off, the armhole depth will be off."; 
  stuff+= "<li>You will shape the raglan by alternating reduction rounds and plain rounds.   <ol style='list-style-type: lower-alpha;'><li> Reductions rounds are worked as follows: Begin 2 stitches <em>before</em> reaching back right shoulder shoulder marker. Then, (K2tog,  slip marker,  SSK, work in stitch pattern across sleeve until you are 2 stitches ahead of the next marker), repeat 3 times, you will end up 2 stitche ahead of the marker.  If you are working broken rib, or a fancy stitch pattern,  continue working the fancy stitch pattern. However, I recommend you work the stitch before and the stitch after each markers in stockinette; that is, knit these stitches every row). This creates a decorative two stitch wide 'ray' along the raglan. <\/li>";
  stuff+= "<\/li>";
  stuff+="<li>Plain rounds are worked as follows: Begin 2 stitches before marker,(work 1 stitch in pattern stitch, k1, slip marker,  k1, work in pattern stitch until 2 stitches remain before marker) repeat 3 times. <\/li><\/ol>";
  
  stuff+= "<li>Note: You will need to begin shaping the neckline (or placket) before you finish the raglan shaping.  So, read ahead, and make sure you start when you need to.  If you are knitting a placket, hang a marker on the center front and back of this row to help you measure.<\/li>";
  stuff+= "<\/ol><\/li>";

  stuff+= "<b>Begin Shaping Raglan:</b>";
  stuff+= "<ol><li>Put the two sleeves and the body on a circular needle which must be sufficiently large to hold all the stitches.  Place one sleeve on needle ( "+sleeveYoke+ " stitches ); place a marker; place front body stitches on needle ( "+ frontYoke+ " stitches ); place a marker; place other sleeve on  needle ( "+sleeveYoke+ " stitches ); place a marker  place back stitches on needle ( "+ backYoke+ " stitches ); place a marker.  Choose which side will be the back. Attach yarn at the right shoulder on the back, and begin each round by first knitting around the back, then around the sleeve, front, then the other sleeve.  <\/li>";
 stuff+= "<li>Attach yarn at right shoulder as seen from the back of the sweater. Hang row markers on front and back as you knit this row.  This shoulder is the official beginning of the round. Work "+smallRegRagP1+" rounds even.   <\/li>";
 stuff+= "<li>Now begin to shape as follows:  <\/li>";
 if(0<largeTimesRag){
    stuff+= "<ol style='list-style-type: lower-alpha;'><li>Do the following "+largeTimesRag+" times: **Knit 1 reduction round, knit "+largRegRag+" rounds even. ( "+ remBeforeSmall +" stitches remain between markers at front; " + remSleeveBeforeSmall+" stitches remain between sleeve markers.)<\/ol>";
    }
if(0<smallTimesRag){
    stuff+= "<ol style='list-style-type: lower-alpha;'><\/li><li>Do the following "+smallTimesRag+" times: **Knit 1 reduction round, knit  "+smallRegRag+" rounds even.<\/ol>";
    }
stuff+= "<\/li><\/ol>";
// placket

backForthDisc="<b>Discussion: <\/b> You will begin working rows back and forth, starting and ending at the neck divide.  If necessary, work and additoinal rounds to be certain you divide on a row that requires a raglan reduction.  (This is because you will want to be certain the reductions, occur on when the public side of the garment is facing you. Otherwise, the decorative decreases can be difficult to work.)  <\/b>"; 
if(placket=="yes" ){
    stuff += "<b>Divide for Placket:<\/b><br>";
     stuff +=backForthDisc; backForthDisc="";
    stuff += "<ol><li> When work measures " + Math.round(10*belowPlacket*lengthBeforeRatio)/10 + " inches from the beginning of the yoke, prepare to divide. <\/li>";
    stuff += "<li> On front, locate the "+ placketStitches + " center stitches. Place markers on either side and check these stitches are centered. Break sweater yarn.  Slip stitches from left needle to right needle until you reach the second neck marker (on the left side of the front when the front of the sweater is facing you.)<\/li> ";
    stuff += "<li>Row 1: Cast on "+ placketStitches + " stitches.   With public side of work facing you, work in pattern stitch until you reach the right hand neck divide marker. (Do not forget to continue working raglan shaping -- you should work a reduction this row.) When you reach the right hand neck divide marker, work the "  + placketStitches + " placket stitches in garter stitch. You should reach the  point where you attached the yarn.  <str>Turn</str>; you are working rows now.<\/li>";
    stuff += "<li>Row 1: Work the " + placketStitches + " placket stitches in garter stitch.  Change to sweater pattern stitch.  Continue around. Knit until you reach the " + placketStitches + " stitches you cast on for the placket.  Work these in garter stitch.   <str>Turn</str>. From now on, work the placket stitches in garter stitch, work all even rows without shaping at neck.<\/li>";
    stuff += "<li>Row 3: Work as for row 1, always working the placket stitches in garter stitch, and the rest in the sweater pattern stitch.  Continue raglan shaping sequence. Read ahead for further neck shaping instructions.   </li>";
    stuff += "<li>Note: When you complete the sweater, you will tack the lower portion of the placket to the inside of the sweater.  </li><\/ol>";
}

stuff += "<b>Front Neck Shaping:<\/b><br>";
 if(placket !="yes" ) {stuff +=backForthDisc; backForthDisc="";} 
stuff+= "<ol><li> When  " + frontNeckShapeStitches + " stitches remain between back markers, and " + sleeveStitchesAtNeck +" stitches remain between sleeve markers,  begin shaping the curved portion of the front neck. Begin shaping on a raglan reduction round; with the public side (outside) of the garment should be facing you.<\/li>";

frontNeckShapeStitchesM2=frontNeckShapeStitches-2
begEngeNeckStitchesM1=begEngeNeckStitches-1;

 if(placket !="yes" ) {
    stuff+= "<li>On front,  locate the center " +frontNeckStitches + " stitches and place them on a stitch holder. (I recommend a thick piece of yarn.) There should be "+ begEngeNeckStitches +" stitches on each side of the front. <\/li><li>  With right side of garment facing you, attach  yarn on left side of neck split, and work in pattern stitch around row, ending at the other side of the neck spilt.   Turn.  The inside (non-public) side of the garment should be facing you and there is a gap where the neck belongs.  Work a row in pattern stitch. (Note, because you are now knitting back and forth, you will need to reverse knit and purl stitches).  Turn. There should be "+frontNeckShapeStitchesM2+" stitches between back markers and " + begEngeNeckStitchesM1 +" stitches on the each side of the front. <\/li>";
    
    //alert("no placket" + placketStitches+": front"+ frontNeckStitches);

    }
 else{
    
    firstNeckBindOff= (placketStitches+frontNeckStitches)/2;
    
    //alert("placket" + placketStitches+": front"+ frontNeckStitches);
    
    stuff+= "<li>At beginning of row, bind off " + firstNeckBindOff+ "  stitches. (There should now be "+begEngeNeckStitches+ " stitches on the neck side of the first stitch marker.<\/li><li>Working required raglan decreases, work in pattern stitch to the end of the row. Turn work. At beginning or row,  bind off " + firstNeckBindOff+ " stitches; work to the end of the row. (There should be "+frontNeckShapeStitchesM2+" stitches between back markers and " + begEngeNeckStitchesM1 +" stitches on the each side of the front.)<\/li>";
  }


stuff+= "<li>While continuuing to shape raglans as described earlier, shape front neck as follows: <\/li>";
stuff+= "<ol style='list-style-type: lower-alpha;'>";

stuff+= "<li>Do the following  " + edgeNeckStitchesM1+ " times: ** SSK,  work to end of row in pattern stitch  until 2 stitches remain on working side of needle, K2tog.  Turn. Work next row plain. **  <\/li><\/ol>";

stuff+= "<li>There should now be 2 stitches left on the front neck side of the stitch markers; right side facing.<\/li>";
stuff+= "<li>K2 tog, slip marker work in pattern stitch, working the remaining raglan decreases as you normally do. End with an SSK decrease. There is now 1 stitch remaining on front neck side of each marker.  <\/li>";
 stuff+= "<li>You have "+ neckStitches + " stitches on the back neck; "+remSleeveAfterSmall+" stitches remain between sleeve markers. <\/li>";
 stuff+= "<li>Optional: Raise the back neck.  Continue any raglan decreases required. <\/li><li> Begin on a wrong side facing row.  At beginning of row, bind off " + halfRemSleeve +" stitches,  work to the end of the row.  Turn, bind off "+ halfRemSleeve +" stitches, work to end of row. Turn work.</li>At beginning of row, bind off 2 stitches, work to the end of the row, but, bind off 2 stitches, turn, work to the end of the row. Repeat until all sleeve stitches are bound off.  (You may only be able to decrease 1 stitch on the final pass.)  Place remaining "+ neckStitches +" stitches on a string.<\/li>";
 stuff+= "<li>Try on the neck and see if you like it!  If not rip back and work the front neck shaping a few rows earlier or later, depending on whether the neck is too tight or too loose.  If it fits, you're ready to add a neck treatment of your choice.  <\/li>";
 stuff+= "<\/ol><br>";
 
stuff += "<b>Collar:<\/b><br>";
stuff+= "<ol>";
//alert(lengthBeforeRatio);
if(p.neckStyle.selectedIndex==0){
    stuff+= "<li>For a crew neck: Using a circular needle, starting at back shoulder, pick up "+ pickUpSlant + " stitches on neck edge between back and front, slide front neck stitches onto needle, pick up "+ pickUpSlant + " stitches from neck edge, put back neck stitches on needle. With knit side facing, purl 1 round, reducing stitches to make sure you have a multiple of 2 stitches on the needle.  Using smaller diameter needles, knit  1 x 1 ribbing until collar measures "+ Math.round(10*mult(p.collarHeight.value,lengthBeforeRatio))/10 + " inches tall. Bind off.  Tidy everythign up. Block, wear.  <\/li>";
    }
 
 else{
 
    frontPickUp=pickUpSlant+firstNeckBindOff;
    changeNeedlePt=Math.round(divide(p.collarHeight.value,3));
    
    stuff+= "<li>Polo: Using a circular needle, pick up "+ frontPickUp + " stitches between outside edge of placket and back stitches on stitch holder; place back neck stitches on needle. Pick up " +frontPickUp+" stitches bewteen back and placket edge.  If necessary, reduce a stitch to be sure the number of stitches is a multiple of two.  Using smaller diameter needles, knit  1 x 1 ribbing until collar measures " +changeNeedlePt + " inches from sweater edge.  Switch to larger diameter needles. Knit until collar measures "+ Math.round(10*mult(p.collarHeight.value,lengthBeforeRatio))/10 + " inches tall. Bind off. <\/li>";
 }
 
   stuff+= "<\/ol>";
  patternWindow.document.writeln(stuff);stuff="";
  stuff += "<b>Finish Up:<\/b><br>";
   stuff+= "<ol><li> Sew underarm seams, bottom of placket down. Weave in ends. Tidy everything up. Block as appropriate for your yarn; wear.  Send me a photo and let me show you off at my blog. <\/li><\/ol>";
 stuff+= "<\/ol>";
  patternWindow.document.writeln(stuff);stuff="";
  
 
  
//  
           
 // 
 yarnUsedText();
/* 
   stuff+= "<ol style='list-style-type: lower-alpha;'><li><\/li>"; 
   stuff+= "    <li>Test Line<\/li>"   
   
     
*/

     stuff+= "<HR>Copyright, Lucia Liljegren 2005<br> You may print an individual copy directly from my site, and knit your sweater. No other form of reproduction or redistribution permitted.";
     patternWindow.document.writeln(stuff);stuff="";
	           
    patternWindow.document.write("<\/BODY><\/HEAD><\/HTML>")
    patternWindow.document.close();
 }
    

