function mkBeret(){
p =document.hatForm;

pester = document.location;

expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+6);
username = pester;

document.cookie="pester=" + username + "expires="+ expireDate.toGMTString(); 

if(document.cookie ==""){
/* @copyright 2004 Lucia Liljegren
*/
    alert("Please set your browser to accept cookies. You must accept cookies to run this page.");}
else {
    pesterZero=document.cookie.split("/")[0];  //figure out if local or away.    
    pesterRead = document.cookie.split("/")[4];
    pesterAway=document.cookie.split("/")[2];    
}
pester = "yes";
    if(pesterZero == "pester=file:" && pesterRead =="lucia"){pester="no"}
else if(pesterAway == "www.thedietdiary.com"){pester="no"}
else if(pesterAway == "thedietdiary.com"){pester="no"}
 else{ pester = "yes"; 
   p.mainStIn.value=0.01;
    p.mainRowIn.value=0.01;
    alert(" Please run my programs from my site at www.thedietdiary.com! " + " xaway  =" + pesterAway +":" ) } ;

//
p.tooFewStitches.value = "javascript is on";

  circumference = eval(p.hatCircumference.value);
  p.hatCircumference.value =  Math.round(circumference*10)/10;
  hatDiam=circumference/Math.PI;
  
castOn=Math.round(mult(p.hatCircumference.value,p.mainStIn.value)/2)*2+2;
p.castOn.value=castOn;
p.castOn2.value= castOn;

hemDepth= Math.max(1,hatDiam/4);
p.depthHem.value=Math.round(hemDepth*10)/10;
hemRows=Math.round(2*mult(hemDepth,p.mainRowIn.value));
p.hemRowsM2.value=hemRows-1;

hatHeight= hatDiam*1.25;
p.hatHeight.value=Math.round(hatHeight*10)/10;
totalHatRows=Math.round(mult(hatHeight,p.mainRowIn.value));
p.hatRows.value=Math.round((totalHatRows-hemRows));



//alert(hatRadius +":"+ p.castOn.value + ":  rightSideNeedle, " +p.rightSideNeedle.value)

}
