
//================
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 Sideways Knit Raglan Sweater.</H1>")
    patternWindow.document.writeln("Author: Lucia Liljegren.<br><p>")
    
    // intro
    stuff="These directions were created based on user supplied information entered at a pattern generator located at  "+ window.location.href +" at "+ currentDate +" .  Code and general sweater design by Lucia Liljegren, <i>The  Knitting Fiend.<\/i>";
    
stuff+=". <p>Although these directions are long, you may want to consult the <em>additional</em> information I have published about knitting this sweater. Schematics and other detailed information appear on the design page and a number of supporting web pages.";
 stuff+=" Also, if you have <em>never</em> knit a project using short rows, I advise knitting a <a href='../Purses/BeverageSocks.html' target='_blank'>beverage sock</a>, or a <a href='../Hats/SidewaysJester.html' target='_blank'>sideways jester hat</a>.  <p>I have tried to make the pattern error free, but human error is always possible. If you have questions, email lucia liljegren. <p>";

    
    patternWindow.document.writeln(stuff); stuff="";
    
    // Preliminaries
    stuff+="<hr><h2>Preliminaries<\/h2>Stitch Gauge: "+ mainStIn +" st/inch; "+  mainRowIn +" row/inch.<br> Size is "+misses + " "+ missesSize +".<br> You asked for "+ rollOrRib +" at the body and sleeves and "+ buttonOrHem +" at the front opening. The sweater " + hood +". <P>";
    
    if((p.hood.selectedIndex ==1) && (p.buttonOrHem.selectedIndex==0)){stuff+=" <br><p><b>Warning<\/b>: I haven't coded or test knit a hood with button bands. You'll need to adjust the length of the button bands."}

 // Preparation
    stuff+=  "<h2>Preparation:<\/h2>Make 2 pieces of scrap knitting at least "+difNeedles+" stitches wide.&nbsp;&nbsp;You will use these when you add length for the sleeve or the body.<br><br>You are going to knit loads of short rows; review your manual and practice on a swatch.&nbsp; Make sure you move your weights from time to time.  I find it best when one weight is positioned under the working needles just next to the needles in hold; weights under the needles in hold are totally useless so shift them to weigh down the fabric under the needles that are knitting..<br><br>"

    
    patternWindow.document.writeln(stuff);stuff="";
    
   
    //  Front =========================================================================
    
    stuff = "<h2>Center Front<\/h2>";
    
    stuff+= "<ol><li>Mark Needles.<\/li>";
 stuff+= "<ol style='list-style-type: lower-alpha;'><li>Raise " +needle5+ "  needles to work position (A).  This corresponds to a length of "+maxLengthPrint+" inches.<\/li>"; 
   stuff+= "    <li>Needle 1: Mark the needle furthest to right. This is the location of the back neck, top sleeve etc.<\/li>"   
     stuff+= "   <li>Needle 2: This design has no needle 2.<\/li>"; 
   //stuff+= "   <li>Needle 2: Beginning at needle 1, count __+""+__ needles to the left.&nbsp; Mark as 'Needle 2'. This is the&nbsp; bottom of dart. (If one is worked.)<\/li>"; 
    stuff+= "   <li>Needle 3: Counting needle 1 as 'one', count " + needle3 + " needles in toward the left. Mark as 'Needle 3'.&nbsp; This is the location of underarm.&nbsp; Needle 3 is on the body of the sweater. (The length of the garment bewteen needles 1 and 3 is "+ frontArmholeDepthPrint +" inches; the additional "+backNeckDepthPrint+" inches for the armhole depth is provided by the top of the sleeve cap.)<br><\/li>"; 
    stuff+= "   <li>Needle 5: Mark the in work needle furthest to the left.  (The length of the garment between needles 1 and 5 is  "+maxLength +" inches.) <\/li>";
    stuff+= "   <li>Needle 4: Starting from the left, count "+ difNeedles +" needles to the right. Mark this needle as 'Needle 4'.&nbsp; This is the location of sleeve <span style='font-style: italic;'>or<\/span> body hem, whichever happens to be further to the right (that is shorter.)&nbsp; The illustration shows it as the body hem. (The length of knitted garment between needles 1 and 4 is " +minLength+ " inches.)<br><\/li>"
 
     stuff+= "<li>Note: The wording of the instructions assumes the sleeve is longer than the body.&nbsp; That's the way it generally works out. However, after you knit one sweater, you will probably understand the transition between pieces and will know how to modify the directions to make short sleeves.<br> <\/li><\/ol>";

   
    patternWindow.document.writeln(stuff);stuff="";
// - V neck shaping
    stuff +=" <li>Optional Waste Yarn Cast On: Raise every other needle for the real cast on (which is described in the next instruction.)  Cast on with waste yarn. Knit a few rows.  Set row counter to zero.  Leave this stuff on the machine.  Now, when the instructions tell you to cast on, just pretend this stuff isn't there.  You can ewrap or latchtool cast on.  When you are finished, carefully snip the last row of waste  yarn in several places and remove.  It comes right off.  (I do this when I am going to knit short rows immediately because I find it's easier to hang and shift the weights and the work is less likely to hang up on the gatepegs if there is some knitting hanging from the needles.)<\/li>";
    
      stuff +="<li>Begin center front.";
      
      if(0<difNeedles){
      stuff+=" Move "+ difNeedles +" needles on the left hand side completely out of work (position A) so they don't knit.<\/li>";}
      
    stuff +=" <li>Begin COR (carriage on right.) Cast on over the "+ bodyNeedles +" raised needles.";
    
// hung hem.  Note that this option only makes sense if they aren't workign a Vneck. I'm using it for my hoodie.
    if( 0<hemRows){
	stuff +="<li>Set carriage tension one setting lower than for main portion of knitting. Set row counter to zero.  Knit to RC = " + hemRows + " rows ending COR (carriage on right).  Hang hem or mark to sew later.<br><\/li><li>Set row counter to zero. RC=0<br><\/li>";  
	 patternWindow.document.writeln(stuff);  stuff ="";  
    }
    
   // neck shaping or not, depending.
if( 0< neckNeedles ){ 

stuff +="<li>Set carriage tension main setting; set to Hold for partial knitting. Knit 1 row ending COL (carriage on left).<br><\/li><li>Shape V neck using <span style='font-style: italic;'>increasing<\/span> short rows: (Note: When needles are in UWP, and you make a carriage pass, they should knit and move to WP)<br><\/li>"

  stuff +="<ol style='list-style-type: lower-alpha;'><li>Set carriage to partial knitting. (H on a Brother.)<br><\/li><li>Move "+neckNeedles+" needles furthest to the right from work position (WP which is B on a Brother)&nbsp; to hold (E) (for V neck).<\/li>  <li>You are about to begin knitting short rows. When knitting short rows, shift the weights periodically to keep weight under the needles in work.<\/li>";

  patternWindow.document.writeln(stuff); stuff ="";
    if(0<slowTimes){	 
    stuff +=" <li>Do the following "+slowTimes+" times (ending RC= "+interNeckShapeRC+ "; COL).<\/li><ul><li>Knit 1 row, wrap needle, knit 1 row. (COL)</li><li>Move "+slowNeedles+ " needles on right hand side from hold (E) to upper working position UWP-- which is D). <br> <\/li>  </ul> ";
      }
      if(0<fastTimes){
	stuff +=" <li>Do the following "+fastTimes+" times (ending RC= "+neckRowsP1+"; length from cast on = "+lengthToEndNeckShape+" inches.).<\/li> <ul><li>Knit 1 row, wrap needle, knit 1 row. (COL)<\/li> <li>Move "+ fastNeedles+ " needles on right hand side from hold to upper working position UWP. <br><\/li><\/ul>";
	}

 stuff +="<li>On the next pass, the needles you have just moved to UWP will knit.<\/li><\/ol>"
 }
 // no neck shaping.
 else{
 
 stuff +="<br><\/li><li>There is no neck shaping.  Knit to RC= "+neckRowsP1+"; length from cast on = " +lengthToEndNeckShape+ " inches; end COL (carriage on left).  Place carriage in hold to work shoulder shaping.<\/li>";
 }

    patternWindow.document.writeln(stuff); stuff ="";

    // Raglan on  Front =========================================================================
    stuff +="<li>Raglan Shoulder: Work decreasing short rows. <\/li>";
    
    stuff +="<ol style='list-style-type: lower-alpha;'>";
    stuff +="<li>Check that needle 3 is marked. You will slowly take needles out of work until all needles to the right of needle 3 are in NWP and not knitting.<br><\/li>";
    stuff +="<li>Do the following "+slowTimesRag+" times (ending RC= "+interRagShapeRC+". ) <\/li>";
    stuff +="      <ul><li>Knit 1 row, wrap needle, knit 1 row. (COL)<br><\/li><li>Move "+slowNeedlesRag+" needles on right hand side from work (B) to hold (E). <br><\/li>";
    stuff +="     <\/ul>";
    stuff +=" <li>Do the following "+fastTimesRag+" times (ending RC= "+endFrontShapeRow+").<\/li>";
    stuff +="      <ul> <li>Knit 1 row, wrap needle, knit 1 row. (COL)<\/li><li>Move "+fastNeedlesRag+" needles on right hand side from work (B) to hold (E). <\/li><\/ul>";
    
    stuff +="<li>All needles to the right of needle 3 should be in Hold; needle 3 is still in WP.<\/li><\/ol>";
    stuff += "<li>Work underarm.<\/li>";
    stuff +=" <ol style='list-style-type: lower-alpha;'><li>Knit "+underArmRows+" rows, (ending RC=" +RCunderArm+ "; " + CORend +"; length from cast on = "+halfFrontChestPrint+" inches. )<\/li>";
    stuff +="     <li>Break yarn. Thread carriage with waste yarn. With carriage still on partial knitting, knit a few rows.  &nbsp;(I use ravel cord for the first row of this sequence, then another waste yarn.) <br> <\/li>";
   stuff +="<\/ol>";
   stuff +="<\/ol>";
 
    patternWindow.document.writeln(stuff);  stuff ="";
    
    
    
    //  Sleeve =========================================================================
     stuff +=" <h2>Sleeve<\/h2>";
     
     backStuff="";// use to accumulate stuff that's the same!

     stuff +="Note: The raglan seaming occurs as you work the increasing short rows bringing the needles between needle 3 and needle 1 into work.&nbsp; If you reverse the color sequence of stripes you knit when working decreasing short rows, you can make stripes match. <br>";
     
     negDifNeedles=-difNeedles;
     if(0 < difNeedles){
	   stuff +="<ol><li>Raise "+difNeedles+"  out of work needles on left edge to work position.  Needle 5 should be in work.  <\/li>";
	   stuff +="<ol style='list-style-type: lower-alpha;'><li>Hang a piece of scrap yarn on the empty needles in work position.  Needle 5 and 3 should be in work.<br><\/li>";
	   }
    else{  
	stuff +="<ol style='list-style-type: lower-alpha;'><li>Move "+negDifNeedles+" in work needles on left bed to out of work position. Needle 4 and 3 should both be in WP. Drop stitches off needles moved to NWP.  <\/li>";
	 }

    stuff +="    <li> Work a few rows waste yarn ending "+CORend+".  Break  yarn.<\/li>";
    stuff +="    <li>Thread machine with sweater yarn.&nbsp;  <\/li><\/ol>";
    stuff +="<li>Work underarm and <span style='font-style: italic;'>begin<\/span> shaping sleeve from cuff to underarm.<\/li>";
    stuff +="<ol style='list-style-type: lower-alpha;'>";
    if(underArmRows <endHalfCuffShapeRows){
        stuff +="<li>Note: The next numbered step will begin when RC= "+ underArmRows + "  which happens before you complete this one. I advise, writing "+ underArmRows + " in BOLD by hand on this sheet to remind you to start the raglan shaping.<\/li>";
    }
     
    stuff +=" <li><b>Set row counter to zero.</b> Begin "+CORend+". RC=0.<br><\/li>";
    stuff +="<li>Knit "+ two + " rows, (ending RC= "+two+", COR)<\/li>";
    stuff +="<li>Keep needle 3 and the " +slowNeedlesCuff+ " needles immediately to its left in Work Position. Move <span style='font-style: italic;'>all other <\/span>needles to hold (E). (Only "+ four +" needles are in WP; these needles are <i>not</i> on the edges.)<\/li>";
    
    if(0<slowTimesCuff){
	stuff +="<li>Do the following " + slowTimesCuff+ " times, ending RC= "+interRagCuffRC+".<\/li>";
	stuff +="<ul><li>Knit 1 row, wrap needle, knit 1 row. (COR)<\/li><li>Move "+ slowNeedlesCuff+" needles on left hand side from hold (E) to upper working position UWP-- which is D).<\/li><\/ul>"; 
    }

    if(0<fastTimesCuff){
	stuff +="<li>Do the following "+fastTimesCuff+" times, ( ending RC="+endHalfCuffShapeRowsM2+"<\/li>";
	stuff +="<ul><li>Knit 1 row, wrap needle, knit 1 row. (COR)<\/li><li>Move "+fastNeedlesCuff+" needles on left hand side from hold (E) to upper working position UWP-- which is D).<\/li><\/ul>";
    }
    
    stuff +="<\/ol>";
    
 
   patternWindow.document.writeln(stuff);  stuff ="";
   
  // Sleeve raglan shaping 
   stuff +=" <li>Raglan Shaping: When RC= "+ underArmRows + " begin working <span style='font-style: italic;'>increasing short rows <\/span>on the <span style='font-style: italic;'>right hand<\/span> side of the bed.  I advise pushing the work against the gate pegs when knitting the first raglan shaping row so the knitting doesn't bind.  <\/li>";  
    stuff +="<ol style='list-style-type: lower-alpha;'>";
    if(underArmRows <endHalfCuffShapeRows){
	stuff +="   <li>Continue shaping sleeve on <span style='font-style: italic;'>left<\/span> side.<\/li>";  }
	
   stuff +="   <li>Tip for increasing short rows on the right side of the bed: You don't really need to count when&nbsp; moving needles this time.&nbsp;  Look at the wraps already on the needles&nbsp; When you are bringing needles to UWP,&nbsp; the left hand edge needle still in hold position should already be wrapped once.<\/li><\/ol> ";  
   stuff +=" <ol><li>Do the following "+fastTimesRag+" times (ending RC= "+interRagShapeRCSleeve+" ).<\/li>";  
   stuff +="     <ul><li>Move "+fastNeedlesRag+" needles on right hand side from hold (E) to UWP (D).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<br>  <\/li>";  
   stuff +="           <\/ul>"; 

   stuff +="     <li>Do the following "+slowTimesRag+" times (ending RC = " +totSleeveShapeRows+ " . )<\/li>";  
   stuff +=" <ul><li>Move "+slowNeedlesRag+" needles on right hand side from hold (E) to UWP (D).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<\/li><\/ul>";  
   stuff +="     <li>Needle 1 should have knit on final two passes. <br> <\/li><\/ol>";

    backstuff +=stuff;
    patternWindow.document.writeln(stuff);  stuff ="";
   // top cap
          
    stuff +="<li>Top of Sleeve:<\/li>";
    stuff +="<ol style='list-style-type: lower-alpha;'>";
    if(0<totTopSleeveRows){
    stuff +="    <li>Work "+ halfTopSleeveRows+" rows. (ending RC = "+halfSleeveRows+". Mark row for center of sleeve: length from waste yarn = "+lengthToCenterSleeve+" inches.  <br><\/li>";}
 
	/* Dart and after.
     stuff +="   <li>Set carriage back to partial kntting (H). Work dart:<\/li> <\/ol>";
     stuff +="<ol><li>I'm not coding this yet. Most raglans don't have these; I'll be adding it for people with thick arms like me!<br><\/li><\/ol>
       */
       
    if(0<totTopSleeveRows){ stuff +=" <li>Work "+ halfTopSleeveRowsP2+" rows.   (ending RC = "+afterTopSleeveRows+ ").</li>";}
    stuff +="<\/ol>";
     
    patternWindow.document.writeln(stuff);  stuff ="";
    
  // decreasing short rows-- cut and paste as much as possible from front.  
       
  stuff +="<li>Raglan shaping: (You may need to start shaping the sleeve on the left side while you do this.&nbsp; If necessary, note RC="+begHalfCuffShapeRows+" in bold on your sheet so you remember to begin working the other rows when necessary. I've marked ending row counts in bold because I find this shaping this side of the sleeve more difficult to keep track of than the other side.) <\/li>";
  stuff +="<li> Work <span style='font-style: italic;'>decreasing short rows.<\/span><\/li>";
  stuff +="<ol style='list-style-type: lower-alpha;'>";
 stuff +="<li>Do the following "+slowTimesRag+" times (ending <b>RC= "+interRagShapeRCSleeve2+".<\/b> ) <\/li>";
    stuff +="      <ul><li>Move "+slowNeedlesRag+" needles on right hand side from work (B) to hold (E). <br><\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<br><\/li><\/ul>";
    stuff +=" <li>Do the following "+fastTimesRag+" times (ending <b>RC= "+endRagShapeRCSleeve+"<\/b>).<\/li>";
    stuff +="    <ul><li>Move "+fastNeedlesRag+" needles on right hand side from work (B) to hold (E).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<\/li><\/ul>";
    stuff +="<\/ol>";
  
   stuff +=" <li>When <b>RC= "+begHalfCuffShapeRows+" <\/b>begin shaping on left hand side. <\/li>";
   stuff +="<ol style='list-style-type: lower-alpha;'><li>(Note, if you are still working the decreasing short rows for the raglan, make sure you mark needle 3.&nbsp; Remember to stop the decreasing shaping on the right just before you find yourself tempted to take it out of  work. )<\/li>";
   
   if(0<fastTimesCuff){
	stuff +="<li>Do the following "+fastTimesCuff+" times, ( ending <b>RC="+interRagCuffRC2+"<\/b>; on the last two passes, the needles for the edge of the sleeve cuff should be knitting.<\/li>";
	stuff +="<ul><li>Move "+fastNeedlesCuff+" needles on left hand edge from working position (B) to Hold-- which is (E).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COR)<\/li><\/ul>";
    }
      if(0<slowTimesCuff){
	stuff +="<li>Do the following " + slowTimesCuff+ " times, ending <b>RC= "+sleeveRowsM2+"<\/b>.<\/li>";
	stuff +="<ul><li>Move "+ slowNeedlesCuff+" needles on left hand side left hand edge from working position (B) to Hold-- which is (E).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COR)<\/li><\/ul>"; 
    }
    stuff +="<li>Put all sleeve needles on left hand side of bed to UWP.<\/li><li>Knit "+ two +" rows.<\/li>";
    stuff +="<\/ol>";
      
 stuff +="<li>All shaping should be complete when RC= "+sleeveRows+ " (Length from waste yarn = "+widthKnittedSleeve+" inches).  Break yarn.&nbsp; Thread with waste yarn. Knit a few rows.&nbsp; Break.<br><\/li>";
    stuff +="  <li>Take a break, stretch and relax.<br><\/li><\/ol>";

 patternWindow.document.writeln(stuff);  stuff ="";

// half back up to extra bit.

  stuff +=" <h2>Back</h2>";

    stuff +="<ol> <li>Pick up last knitted row of the sweater front below waste yarn and rehang these stitches on the needles from  3 and to its left. If the sleeve is longer than the body, the "+difNeedles+ " needles to the left of needle 4 you raised for the cuff have only waste yarn on them.  Drop the waste yarn off these needles, and take the needles completely out of work. (A on a Brother).    Optional: remove waste yarn between front and back. (I left it on; I was worrried this wouldn't work. This makes the sweater look really, really wierd hanging on the machine, but it's less work than taking the waste yarn off.)  <\/li> ";
    stuff +=" ";
    stuff +="  <li>Set Row counter to 0, begin with " +CORend +" Thread with sweater yarn; knit  "+ underArmRows +" rows, ending COL and RC="+ underArmRows +".</li> ";
// cut and paste from sleeve.===========

// bit 2

  stuff +=" <ol style='list-style-type: lower-alpha;'><li>Do the following "+fastTimesRag+" times (ending RC= "+interRagShapeRCSleeve+" ).<\/li>";  
   stuff +="     <ul><li>Move "+fastNeedlesRag+" needles on right hand side from hold (E) to UWP (D).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<br>  <\/li>";  
   stuff +="           <\/ul>"; 

   stuff +="     <li>Do the following "+slowTimesRag+" times (ending RC = " +totSleeveShapeRows+ " . )<\/li>";  
   stuff +=" <ul><li>Move "+slowNeedlesRag+" needles on right hand side from hold (E) to UWP (D).<\/li><li>Knit 1 row, wrap needle, knit 1 row. (COL)<\/li><\/ul>";  
   stuff +="     <li>Needle 1 should have knit on final two passes. <br> <\/li><\/ol>";

    backstuff +=stuff;
    patternWindow.document.writeln(stuff);  stuff ="";
    
    
// end cut and paste from sleeve.===========

   
    stuff +=" <li>Set carriage to full knitting. (N.)<br>  </li>";
    stuff +=" <li>Work until RC=" +RCunderArm+ " rows .  <br>  <\/li><\/ol>";
  

   patternWindow.document.writeln(stuff);  stuff ="";
    // Extra bit

    if(   0<RCextraBit){ 
	stuff +="  <h2>Extra bit (Makes up for width of button band or hem).</h2>";
	stuff +="<ol>  <li>Work " + RCextraBit+ " rows. Mark Row for center back.  (RC = "+RChalfBack+". Length from waste yarn = "+ halfBackChestPrint+" inches)  </li>"; 
	stuff +="<li>Work " + RCextraBit+ " rows. (RC= " + RChalfBackPlus + ". )  </li></ol>";
   
	patternWindow.document.writeln(stuff);  stuff ="";    
    }

//   ==== the rest

raglanFinishing();
	           
    patternWindow.document.write("<\/BODY><\/HEAD><\/HTML>")
    patternWindow.document.close();
 }
    

