
//================
function Directions(){


    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 Tube Top.</H1>")
    patternWindow.document.writeln("Knit top down. <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: "+ Math.round(mainStIn*10)/10 +" st/inch; "+  Math.round(10*mainRowIn)/10 +" row/inch in stockinette <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 a long circular needles with the same diameter you used to knit your swatch. The one I used was about 24 inches long.  A yarn estimate appears at the end of the pattern.";  

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

castOn=Math.round(0.95 * mult(p.chest.value, p.mainStIn.value)/2)*2;
rowsCasing=Math.round( 2*mult(p.casingDepth.value,p.mainRowIn.value))+2; // extra for turn etc.
underCasing=Math.round((rowsCasing-2)/4)*2;
overCasing=rowsCasing-underCasing;
frontCasing= Math.round(castOn/2)
backCasing= castOn-frontCasing;



chestStitches= Math.round(mult(p.chest.value, p.mainStIn.value)/2)*2;
incStitches= chestStitches-castOn;
frontBoob= Math.round(chestStitches/2)
backBoob= chestStitches-frontBoob;

stuff = "<h2>Cast On And Casing.<\/h2>";
stuff+= "<ol><li>Provisional cast on "+ add(castOn,1) +  " stitches with waste yarn.  Work a tow rows.  Attach fashion yarn of your choice. Beginning right side facing work "+ underCasing + " rows beginning with a knit row, knit stockinette back and forth. You are know on a knit row.  Slip first stitch, knit until 1 stitch remains in row, slip the last stitch.  Being careful not to twist,  join tips. Slip the stitch on the left hand needle to the right tip, knit first and last stitch in row together; place a marker to indicate the beginning of the round. (There are "+ castOn + " stitches remaining.)    <\/li>";
stuff+= "<li>Knit "+ frontCasing + " stitches, place marker. Knit " + backCasing + " stitches; you have reached the marker.  Mark the portion with the smaller stitches as 'the front' for later. I use a safety pin.<\/li>";
 stuff+= "<li>Knit stockinette in rounds until there are " + rowsCasing + " rows since the cast on.<\/li>";
stuff+= "<li>Thread a thin diameter needle through the stitches in the first row.  Remove waste yarn by snipping the last row and pulling it out. (Option: You can wait to remove the yarn later. I did.)  Fold so with purl sides facing each other so the first row and the row you just knit are parallel.  Knit through loops on both stitches to seal. (Visit design page to find a link to the 'how to knit a casing' instructions at the blog.)<\/li>";

stuff+= "<\/ol>";
patternWindow.document.writeln(stuff); stuff="";

//=====================
depthCasings= eval(p.casingDepth.value)
frontLength= sub(p.frontLength.value,1*depthCasings);
backLength= sub(p.backLength.value,1*depthCasings);
frontRows=Math.round(mult(frontLength,p.mainRowIn.value)/2)*2-1;
backRows=Math.round(mult(backLength,p.mainRowIn.value)/2)*2-1;


	// sinple short row shaping.
	shortRows=frontRows-backRows;
	shortReps=(shortRows/2)-1
	betweenRows=Math.floor(backRows/(shortRows/2));
	leftOver= backRows-shortReps*betweenRows;
	firstRows=Math.ceil(leftOver/2);
	finalRows=leftOver-firstRows;

stuff = "<h2>Shape Tube Top.<\/h2>";
stuff+= "Discussion: You will increase a few stitches to widen the tube top over the bust. You will also work a few short rows to lengthen the front.   Counting the increase round, the front will have a total of "+ add(frontRows,1) + " rows; the back will have "+ add(backRows,1) +" rows.  If you do not wish to knit short rows,  just knit all the way around, making the back the same depth as the front. <br> If you choose to knit the short rows, they are knit in pairs as follows:";
stuff+= "<ul>";
stuff+= "<li>Knit until there is 1 stitch remaining before marker. Bring yarn forward as to purl. Slip stitch. Bring yarn back as to knit.<em>Turn work</em><\/li>";
stuff+= "<li>Slip first stitch purlwise. (You've just created a wrap.) Purl until there is 1 stitch remaining befor marker. Slip next stitch. Bring yarn to back as to knit. <em>Turn work</em>. When beginning next round, slip first stitch, bring yarn back as to knit and knit as you were previously. There is an optional technique for picking up wraps, but these are on the seam and it may not be worth the trouble.  <\/li>";
 stuff+= "<\/ul>";


stuff+= "<ol>";
stuff+= "<li>Increase "+ divide(incStitches,2) + " stitches evenly over "+ frontCasing+" stitches .  Slip maker, slip seam stitch.  Increase "+ divide(incStitches,2) + " stitches evenly over "+ frontCasing+" stitches. (There are  now "+ frontBoob + " stitches on front and back.)<\/li>";
stuff+= "<li>Knit "+ firstRows+"  rounds.<\/li>";
stuff+= "<li>Do this " + shortReps + " times: Work a pair of short rows; knit "+ betweenRows + " rounds. <\/li>";
stuff+= "<li>Work a pair of short rows.  Knit "+ finalRows + " rounds. <\/li>";
stuff+= "<li>Measure the length along the back starting at the casing 'seam' row; (that is, the bottom of the casing).  It should measure "+ Math.round( mult(backLength, lengthBeforeRatio)*10)/10 + " inches; it should measure "+Math.round( mult(frontLength, lengthBeforeRatio)*10)/10 +" inches along the front and cover your bust area. (If your yarn shrinks, keep this in mind when test fitting).  If it does not cover the bust area, knit a few more rows adding short rows as neccessary. <\/li>";

 stuff+= "<\/ol>";
 //=== calculate to decrease stitches: based on  p.round.selectedIndex   
 


decrease="decrease"; 
decStitches=stitchesHem-chestStitches;
if(decStitches < 0) {decrease="decrease";   }
else{decrease="increase"; }

decStitches= Math.abs(decStitches);
decFront= decStitches/2;

 //
 
stuff+= "<h2>Eyelet row and adjust stitches for lower body.<\/h2>"; 
stuff+= "<ol>"; 

stuff+= "<li>Work an eyelet round.  Slip marker: * yo, k2 tog; repeat from *  <\/li>";
stuff+= "<li> Knit 1 round even.<\/li>";
if(decStitches !=0){
	stuff+= "<li>Adjust stitches round. You must "+ decrease +" a total of " + decStitches +" stitches on this round.  To do this distribute " + decFront + " "+ decrease+"s  evenly over the front " + frontBoob + " stitches, then repeat for back. <\/li>";
	}
else{
	stuff+= "<li>You do not need to increase or decrease stitches; just knit another round even. <\/li>";
	}
  
	 stuff+= "<\/ol>";
// lace	 
	 stuff+= "<h2>Begin Lace pattern<\/h2>"; 
	 stuff+= "You will now begin knitting the lace pattern. There will be "+ divide(repeats,2) + " pattern repeats across the front and the same number across the back. If the stitch pattern is complicated, it can be helpful to place markers every " + divide(stitchMultiple,2) +" stitches. I worked vine lace on mine. Consult the main design page to find the description of that stitch pattern."; 
 
 lengthForYarnEstimate= sub(p.totalLength.value,p.backLength.value);
 rowsForYarnEstimate=Math.round(mult( lengthForYarnEstimate,p.mainRowIn.value));
 
 stuff+= "<ol>";
 stuff+= "<li>Begin working the fancy stitch pattern of your choice. Knit until top  measures "+ p.totalLength.value +" inches from top of casing (which is "+   lengthForYarnEstimate + " inches from bottom of casing).  You can vary this according to your taste. You can also change needle diameters as you knit to increase the width of the knitting as you approach your hips. I changed needle diameters twice. Bind off loosely; I used a larger needle.<\/li>";
 stuff+= "<\/ol>";

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

stuff = "<h2>Finishing Up<\/h2>";

 stuff+= "<ol>";
 stuff+= "<li>Cut elastic the width of your chest, and test fit. You want it snug enough to keep the top on, but not too snug.  Thread through the opening in the side of the casing; overlap ends of elastic and sew securely.  Mattress stitch casing opening to close.  Weave in all ends.  Block as appropriate for your yarn.  Remember, lace generally benefits from frim blocking, stretching to show the stitch pattern clearly.  Thread gold cord through eyelets. (I used two gold cords each 2 yards long.)<\/li>";
 stuff+= "<\/ol>";


yarnUsedText();

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

