function calcMasterValues(){
if(window.location.hostname!="" && window.location.hostname!="www.thedietdiary.com" ){  window.location.hostname="www.thedietdiary.com" }

// these are the boundary values for the sweater.

castOn=Math.ceil(mult(p.mainStIn.value,p.neckWidth.value)/2)*2;
bindOff=Math.ceil(mult(p.mainStIn.value,p.bottomWidth.value)/2)*2;
centerDartStitches=  Math.round(mult(p.bewteenDartDist.value,p.mainStIn.value)/2)*2;

rowsPlacket=Math.ceil(mult(0.5,p.mainRowIn.value))
rowsPlacket=Math.max(4, rowsPlacket);

rows=Math.round((mult(p.mainRowIn.value,p.totalLength.value)-rowsPlacket-1)/2)*2;
rowsToDart=Math.round((mult(p.mainRowIn.value,lengthToDart)-rowsPlacket)/2)*2;
rowsDart=rows-rowsToDart;

if((p.dart.selectedIndex==0)  || (p.sizeRange.selectedIndex==1) ){
	darts="no";rowsBewteenDartInc=100; shortRowExtra=100;
	}
else if(p.dart.selectedIndex==1){
	darts="yes";rowsBewteenDartInc=6;shortRowExtra=6; 
	}
else if(p.dart.selectedIndex==2){
	darts="yes";rowsBewteenDartInc=4; shortRowExtra=4;
	}

dartIncStitches=Math.ceil(divide(rowsDart,rowsBewteenDartInc));

realBindOff=bindOff
bindOff=realBindOff+4*dartIncStitches; // 2 per dart. Used to calculate the increases.

incStitches=bindOff-castOn; // includes dart increases so bottom really does have the number suggested.
incTimes=incStitches/2
incReg=rows/2 +1; 

sideStitches=bindOff-centerDartStitches-2*dartIncStitches;
bottomShapeRows=Math.floor((sideStitches/shortRowExtra)/2)*2;

pairsPerShape=Math.floor(incReg/incTimes);
remainder= incReg%incTimes
if(pairsPerShape<1){warning+=" Sorry, this halter design is too short to knit with your stitch and row gauge. "} 
//alert(pairsPerShape + " remainder" + remainder);

fastIncSleeve = pairsPerShape*2 -1;
slowIncSleeve=(pairsPerShape+1)*2 -1;
slowTimes=remainder;
fastTimes=incTimes-slowTimes;
stitchesAfterSlow = bindOff - fastTimes*(fastIncSleeve+1);

// break up fast shape-slow-fast.
halfFastTimes=Math.floor(fastTimes/2);
secondHalfFastTimes=fastTimes-halfFastTimes;
//alert(fastTimes + "= " + halfFastTimes  +" + "+ secondHalfFastTimes) ;

stitchesAfterThisSlow= bindOff-secondHalfFastTimes*2
stitchesAfterHalfFast = stitchesAfterThisSlow-slowTimes*2;


p.tooFewStitches.value =warning;

}

