emptyFrame="";

function calcre() {
var currentOffset="";
var currentWidth,newWidth,newOffset,currentInsideWidth,newInsideWidth,currentOutsideWidth,newOutsideWidth;
	with (document.nissansportz_woc) {

		currentWidth=CWWre.value*25.4;
		newWidth=NWWre.value*25.4;

		currentOffset=CWOre.value;
		newOffset=NWOre.value;
	}

	currentInsideWidth =(currentWidth/2) + parseInt(currentOffset);
	currentOutsideWidth=(currentWidth/2) - parseInt(currentOffset);

	newInsideWidth =(newWidth/2) + parseInt(newOffset);
	newOutsideWidth=(newWidth/2) - parseInt(newOffset);
	distance= (currentInsideWidth-newInsideWidth);

	if (Math.round(distance)<0) {
		out = Math.round(Math.abs(distance)) + "mm LESS";
	}
	else if (Math.round(distance)>0) {
		out = Math.round(Math.abs(distance)) + "mm MORE";
	}
	else {
		out ="Identical";
	}

	if (Math.round(newOutsideWidth-currentOutsideWidth)>0) {
		out2 = "EXTEND an extra ";
		out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
		out2 +="mm";
	}
	else if (Math.round(newOutsideWidth-currentOutsideWidth)<0) {
		out2 = "RETRACT by ";
		out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
		out2 +="mm";
	}
	else {
		out2 = "Identical";
	}

	with (document) {
		document.nissansportz_woc.strutre.value = out;
		document.nissansportz_woc.wheeloutsidere.value = out2;
	}

}

function fr18350z() {

	with (document.nissansportz_woc) {
		CWWfr.value=8;
		CWOfr.value=30;
		CWfrdesc.value = "350Z 18 Standard Front";
	}
	calcfr();
}

function re18350z() {

	with (document.nissansportz_woc) {
		CWWre.value=8;
		CWOre.value=30;
		CWredesc.value = "350Z 18 Standard Rear";
	}
	calcre();
}

function frra350z() {

	with (document.nissansportz_woc) {
		CWWfr.value=8;
		CWOfr.value=30;
		CWfrdesc.value = "350Z 19 Rays Front";
	}
	calcfr();
}

function rera350z() {

	with (document.nissansportz_woc) {
		CWWre.value=8.5;
		CWOre.value=33;
		CWredesc.value = "350Z 19 Rays Rear";
	}
	calcre();
}

function frni350z() {

	with (document.nissansportz_woc) {
		CWWfr.value=8.5;
		CWOfr.value=25;
		CWfrdesc.value = "350Z 19 Nismo Front";
	}
	calcfr();
}

function reni350z() {

	with (document.nissansportz_woc) {
		CWWre.value=9.5;
		CWOre.value=30;
		CWredesc.value = "350Z 19 Nismo Rear";
	}
	calcre();
}

function frjd350z() {

	with (document.nissansportz_woc) {
		CWWfr.value=7.5;
		CWOfr.value=30;
		CWfrdesc.value = "350Z 17 JDM Front";
	}
	calcfr();
}

function rejd350z() {

	with (document.nissansportz_woc) {
		CWWre.value=8;
		CWOre.value=33;
		CWredesc.value = "350Z 17 JDM Rear";
	}
	calcre();
}

function fr18370z() {

	with (document.nissansportz_woc) {
		CWWfr.value=8;
		CWOfr.value=43;
		CWfrdesc.value = "370Z 18 Standard Front";
	}
	calcfr();
}

function rean350z() {

	with (document.nissansportz_woc) {
		CWWre.value=8.5;
		CWOre.value=33;
		CWredesc.value = "350Z GT4 18 Rear";
	}
	calcre();
}

function fran350z() {

	with (document.nissansportz_woc) {
		CWWfr.value=8;
		CWOfr.value=30;
		CWfrdesc.value = "350Z GT4 18 Front";
	}
	calcfr();
}

function re18370z() {

	with (document.nissansportz_woc) {
		CWWre.value=9;
		CWOre.value=15;
		CWredesc.value = "370Z 18 Standard Rear";
	}
	calcre();
}

function fr19370z() {

	with (document.nissansportz_woc) {
		CWWfr.value=9;
		CWOfr.value=47;
		CWfrdesc.value = "370Z 19 GT Front";
	}
	calcfr();
}

function re19370z() {

	with (document.nissansportz_woc) {
		CWWre.value=10;
		CWOre.value=30;
		CWredesc.value = "370Z 19 GT Rear";
	}
	calcre();
}

function frr35() {

	with (document.nissansportz_woc) {
		CWWfr.value=9.5;
		CWOfr.value=45;
		CWfrdesc.value = "R35 2009 GT-R Front";
	}
	calcfr();
}

function rer35() {

	with (document.nissansportz_woc) {
		CWWre.value=10.5;
		CWOre.value=25;
		CWredesc.value = "R35 2009 GT-R Rear";
	}
	calcre();
}

function calcfr() {
var currentOffset="";
var currentWidth,newWidth,newOffset,currentInsideWidth,newInsideWidth,currentOutsideWidth,newOutsideWidth;
	with (document.nissansportz_woc) {

		currentWidth=CWWfr.value*25.4;
		newWidth=NWWfr.value*25.4;

		currentOffset=CWOfr.value;
		newOffset=NWOfr.value;
	}

	currentInsideWidth =(currentWidth/2) + parseInt(currentOffset);
	currentOutsideWidth=(currentWidth/2) - parseInt(currentOffset);

	newInsideWidth =(newWidth/2) + parseInt(newOffset);
	newOutsideWidth=(newWidth/2) - parseInt(newOffset);
	distance= (currentInsideWidth-newInsideWidth);

	if (Math.round(distance)<0) {
		out = Math.round(Math.abs(distance)) + "mm LESS";
	}
	else if (Math.round(distance)>0) {
		out = Math.round(Math.abs(distance)) + "mm MORE";
	}
	else {
		out ="Identical";
	}

	if (Math.round(newOutsideWidth-currentOutsideWidth)>0) {
		out2 = "EXTEND an extra ";
		out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
		out2 +="mm";
	}
	else if (Math.round(newOutsideWidth-currentOutsideWidth)<0) {
		out2 = "RETRACT by ";
		out2 +=Math.round(Math.abs(newOutsideWidth-currentOutsideWidth));
		out2 +="mm";
	}
	else {
		out2 = "Identical";
	}

	with (document) {
		document.nissansportz_woc.strutfr.value = out;
		document.nissansportz_woc.wheeloutsidefr.value = out2;
	}

}

function COLfr() {
	with (document.nissansportz_woc) {
		CWOfr.value=CWOfr.value-1;
		CWfrdesc.value = "Custom Front Wheel";
	}
	calcfr();
}

function CORfr() {

	with (document.nissansportz_woc) {
		CWOfr.value=parseInt(CWOfr.value)+1;
		CWfrdesc.value = "Custom Front Wheel";
	}
	calcfr();
}

function COLre() {
	with (document.nissansportz_woc) {
		CWOre.value=CWOre.value-1;
		CWredesc.value = "Custom Rear Wheel";
	}
	calcre();
}

function CORre() {

	with (document.nissansportz_woc) {
		CWOre.value=parseInt(CWOre.value)+1;
		CWredesc.value = "Custom Rear Wheel";
	}
	calcre();
}


function NOLfr() {
	with (document.nissansportz_woc) {
		NWOfr.value=NWOfr.value-1;
	}
	calcfr();
}

function NORfr() {

	with (document.nissansportz_woc) {
		NWOfr.value=parseInt(NWOfr.value)+1;
	}
	calcfr();
}

function CWLfr() {
	with (document.nissansportz_woc) {
	  CWWfr.value=CWWfr.value-0.5;
		CWfrdesc.value = "Custom Rear Wheel";
	}
	calcfr();
}

function CWRfr() {
	with (document.nissansportz_woc) {
      CWWfr.value=parseFloat(CWWfr.value)+0.5;
		CWfrdesc.value = "Custom Front Wheel";
	}
	calcfr();
}

function NWLfr() {
	with (document.nissansportz_woc) {
		       NWWfr.value=NWWfr.value-0.5;
	}
	calcfr();
}

function NWRfr() {
	with (document.nissansportz_woc) {
		       NWWfr.value=parseFloat(NWWfr.value)+0.5;
	}
	calcfr();
}

function NOLre() {
	with (document.nissansportz_woc) {
		NWOre.value=NWOre.value-1;
	}
	calcre();
}

function NORre() {

	with (document.nissansportz_woc) {
		NWOre.value=parseInt(NWOre.value)+1;
	}
	calcre();
}

function CWLre() {
	with (document.nissansportz_woc) {
		       CWWre.value=CWWre.value-0.5;
	}
	calcre();
}

function CWRre() {
	with (document.nissansportz_woc) {
            CWWre.value=parseFloat(CWWre.value)+0.5;
	}
	calcre();
}

function NWLre() {
	with (document.nissansportz_woc) {
		       NWWre.value=NWWre.value-0.5;
	}
	calcre();
}

function NWRre() {
	with (document.nissansportz_woc) {
		       NWWre.value=parseFloat(NWWre.value)+0.5;
	}
	calcre();
}


