function cal_wp_room() {
var temm1
var temm;
var squ;
var num;
var if_go = true;
var rom_wid;
var rom_hei;
var rom_len;
//alert(document.Form1.wr_square.value);
rom_wid = parseFloat(document.Form1.wr_wid.value);
rom_hei = parseFloat(document.Form1.wr_hei.value);
rom_len = parseFloat(document.Form1.wr_len.value);
if (document.Form1.w_unit.value == "feet") {
//if (document.Form1.w_unit.options[document.Form1.w_unit.selectedIndex].value == "feet") {
if (rom_wid > 500 || rom_wid < 0) {
alert("\nPlease type a correct value.");
document.Form1.wr_wid.value="";
document.Form1.wr_wid.focus();
if_go = false;
}
else {
temm = rom_wid - Math.floor(rom_wid);
if (temm <= 0.5 && temm > 0)
{
rom_wid = Math.ceil(rom_wid) - 0.5;
}
else {
rom_wid = Math.ceil(rom_wid);
}
}
if (rom_hei > 500 || rom_hei < 0) {
alert("\nPlease type a correct value.");
document.Form1.wr_hei.value="";
document.Form1.wr_hei.focus();
if_go = false;
}
else {
temm = rom_hei - Math.floor(rom_hei);
if (temm <= 0.5 && temm > 0)
{
rom_hei = Math.ceil(rom_hei) - 0.5;
}
else {
rom_hei = Math.ceil(rom_hei);
}
}
if (rom_len > 500 || rom_len < 0) {
alert("\nPlease type a correct value.");
document.Form1.wr_len.value="";
document.Form1.wr_len.focus();
if_go = false;
}
else {
temm = rom_len - Math.floor(rom_len);
if (temm <= 0.5 && temm > 0)
{
rom_len = Math.ceil(rom_len) - 0.5;
}
else {
rom_len = Math.ceil(rom_len);
}
}
}	//39
else {
if (rom_wid > 6000 || rom_wid < 0) {
alert("\nUnreasonable number!!");
document.Form1.wr_wid.value="";
document.Form1.wr_wid.focus();
if_go = false;
}
else {
temm1 = rom_wid/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_wid = Math.ceil(temm1) - 0.5;
}
else {
rom_wid = Math.ceil(temm1);
}
}
if (rom_hei > 6000 || rom_hei < 0) {
alert("\nUnreasonable number!!");
document.Form1.wr_hei.value="";
document.Form1.wr_hei.focus();
if_go = false;
}
else {
temm1 = rom_hei/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_hei = Math.ceil(temm1) - 0.5;
}
else {
rom_hei = Math.ceil(temm1);
}
}
if (rom_len > 6000 || rom_len < 0) {
alert("\nUnreasonable number!!");		//60
document.Form1.wr_len.value="";
document.Form1.wr_len.focus();
if_go = false;
}
else {
temm1 = rom_len/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_len = Math.ceil(temm1) - 0.5;
}
else {
rom_len = Math.ceil(temm1);
}
}
}
squ = Math.ceil(((2*rom_wid + 2*rom_len)*rom_hei));
if (document.Form1.w_pattern.value == "standard") {
//if (document.Form1.w_pattern.options[document.Form1.w_pattern.selectedIndex].value == "standard") {
num = Math.ceil(squ / 23);
if (num%2 > 0)
{
num++;
}
}
else {
num = Math.ceil(squ / 20);	//79
if (num%2 > 0)
{
num++;
}
}
if (if_go == true && num > 0) {
document.getElementById("wr_square").innerHTML = squ;
document.getElementById("wr_res").innerHTML = num;
}
else {
document.getElementById("wr_square").innerHTML = "0";
document.getElementById("wr_res").innerHTML = "0";
}
}

function cal_wp_squ() {
var squ;
var num;
var if_go = true;
var rom_squ;
rom_squ = parseFloat(document.Form1.wr_squ.value);
if (document.Form1.w_unit.value == "feet") {
//if (document.Form1.w_unit.options[document.Form1.w_unit.selectedIndex].value == "feet") {
if (rom_squ > 2500 || rom_squ < 0 || isNaN(rom_squ)) {
alert("\nPlease type a correct value.");
document.Form1.wr_squ.value="";
document.Form1.wr_squ.focus();	//200
if_go = false;
}
else {
rom_squ = Math.ceil(rom_squ);
}
}
else {
if (rom_squ > 30000 || rom_squ < 0 || isNaN(rom_squ)) {
alert("\nPlease type a correct value.");
document.Form1.wr_squ.value="";
document.Form1.wr_squ.focus();
if_go = false;
}
else {
rom_squ = Math.ceil(rom_squ/144);
}
}
squ = rom_squ;
if (document.Form1.w_pattern.value == "standard") {
//if (document.Form1.w_pattern.options[document.Form1.w_pattern.selectedIndex].value == "standard") {
num = Math.ceil(squ / 23);		//221
if (num%2 > 0)
{
num++;
}
}
else {
num = Math.ceil(squ / 20);
if (num%2 > 0)
{
num++;
}
}
if (if_go == true && num > 0) {

document.getElementById("wr_res2").innerHTML = num;

}
else {
document.getElementById("wr_res2").innerHTML = "0";
}
}	//240

function cal_wp_wall() {
var temm;
var temm1;
var wp_wid = new Array();
var wp_hei = new Array();
var if_go = true;
var num  = 0;
var squ = 0;
wp_wid[0] = parseFloat(document.Form1.wid1.value);
wp_wid[1] = parseFloat(document.Form1.wid2.value);
wp_wid[2] = parseFloat(document.Form1.wid3.value);
wp_wid[3] = parseFloat(document.Form1.wid4.value);
wp_wid[4] = parseFloat(document.Form1.wid5.value);
wp_wid[5] = parseFloat(document.Form1.wid6.value);
wp_wid[6] = parseFloat(document.Form1.wid7.value);
wp_wid[7] = parseFloat(document.Form1.wid8.value);
wp_hei[0] = parseFloat(document.Form1.hei1.value);
wp_hei[1] = parseFloat(document.Form1.hei2.value);
wp_hei[2] = parseFloat(document.Form1.hei3.value);
wp_hei[3] = parseFloat(document.Form1.hei4.value);
wp_hei[4] = parseFloat(document.Form1.hei5.value);
wp_hei[5] = parseFloat(document.Form1.hei6.value);		//260
wp_hei[6] = parseFloat(document.Form1.hei7.value);
wp_hei[7] = parseFloat(document.Form1.hei8.value);
if (document.Form1.w_unit.value == "feet") {
//if (document.Form1.w_unit.options[document.Form1.w_unit.selectedIndex].value == "feet") {
if (wp_wid[0] > 500 || wp_wid[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid1.value="";
document.Form1.wid1.focus();
if_go = false;
}
else {
temm = wp_wid[0] - Math.floor(wp_wid[0]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[0] = Math.ceil(wp_wid[0]) - 0.5;
}
else {
wp_wid[0] = Math.ceil(wp_wid[0]);
}
}
if (wp_wid[1] > 500 || wp_wid[1] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid2.value="";
document.Form1.wid2.focus();
if_go = false;
}
else {
temm = wp_wid[1] - Math.floor(wp_wid[1]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[1] = Math.ceil(wp_wid[1]) - 0.5;
}
else {
wp_wid[1] = Math.ceil(wp_wid[1]);
}
}
if (wp_wid[2] > 500 || wp_wid[2] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid3.value="";
document.Form1.wid3.focus();
if_go = false;
}
else {
temm = wp_wid[2] - Math.floor(wp_wid[2]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[2] = Math.ceil(wp_wid[2]) - 0.5;
}
else {
wp_wid[2] = Math.ceil(wp_wid[2]);
}
}
if (wp_wid[3] > 500 || wp_wid[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid4.value="";
document.Form1.wid4.focus();
if_go = false;
}
else {
temm = wp_wid[3] - Math.floor(wp_wid[3]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[3] = Math.ceil(wp_wid[3]) - 0.5;
}
else {
wp_wid[3] = Math.ceil(wp_wid[3]);
}
}
if (wp_wid[4] > 500 || wp_wid[4] < 0) {
alert("\nPlease type a correct value.");	//301
document.Form1.wid5.value="";
document.Form1.wid5.focus();
if_go = false;
}
else {
temm = wp_wid[4] - Math.floor(wp_wid[4]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[4] = Math.ceil(wp_wid[4]) - 0.5;
}
else {
wp_wid[4] = Math.ceil(wp_wid[4]);
}
}
if (wp_wid[5] > 500 || wp_wid[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid6.value="";
document.Form1.wid6.focus();
if_go = false;
}
else {
temm = wp_wid[5] - Math.floor(wp_wid[5]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[5] = Math.ceil(wp_wid[5]) - 0.5;
}
else {
wp_wid[5] = Math.ceil(wp_wid[5]);
}
}
if (wp_wid[6] > 500 || wp_wid[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid7.value="";		//320
document.Form1.wid7.focus();
if_go = false;
}
else {
temm = wp_wid[6] - Math.floor(wp_wid[6]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[6] = Math.ceil(wp_wid[6]) - 0.5;
}
else {
wp_wid[6] = Math.ceil(wp_wid[6]);
}
}
if (wp_wid[7] > 500 || wp_wid[7] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid8.value="";
document.Form1.wid8.focus();
if_go = false;
}
else {
temm = wp_wid[7] - Math.floor(wp_wid[7]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[7] = Math.ceil(wp_wid[7]) - 0.5;
}
else {
wp_wid[7] = Math.ceil(wp_wid[7]);
}
}
if (wp_hei[0] > 500 || wp_hei[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei1.value="";
document.Form1.hei1.focus();
if_go = false;	//340
}
else {
temm = wp_hei[0] - Math.floor(wp_hei[0]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[0] = Math.ceil(wp_hei[0]) - 0.5;
}
else {
wp_hei[0] = Math.ceil(wp_hei[0]);
}
}
if (wp_hei[1] > 500 || wp_hei[1] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei2.value="";
document.Form1.hei2.focus();
if_go = false;
}
else {
temm = wp_hei[1] - Math.floor(wp_hei[1]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[1] = Math.ceil(wp_hei[1]) - 0.5;
}
else {
wp_hei[1] = Math.ceil(wp_hei[1]);
}
}
if (wp_hei[2] > 500 || wp_hei[2] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei3.value="";
document.Form1.hei3.focus();
if_go = false;
}
else {
temm = wp_hei[2] - Math.floor(wp_hei[2]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[2] = Math.ceil(wp_hei[2]) - 0.5;
}
else {
wp_hei[2] = Math.ceil(wp_hei[2]);
}
}
if (wp_hei[3] > 500 || wp_hei[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei4.value="";
document.Form1.hei4.focus();
if_go = false;
}
else {
temm = wp_hei[3] - Math.floor(wp_hei[3]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[3] = Math.ceil(wp_hei[3]) - 0.5;
}
else {
wp_hei[3] = Math.ceil(wp_hei[3]);
}
}
if (wp_hei[4] > 500 || wp_hei[4] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei5.value="";
document.Form1.hei5.focus();
if_go = false;
}
else {
temm = wp_hei[4] - Math.floor(wp_hei[4]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[4] = Math.ceil(wp_hei[4]) - 0.5;
}
else {
wp_hei[4] = Math.ceil(wp_hei[4]);
}
}	//380
if (wp_hei[5] > 500 || wp_hei[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei6.value="";
document.Form1.hei6.focus();
if_go = false;
}
else {
temm = wp_hei[5] - Math.floor(wp_hei[5]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[5] = Math.ceil(wp_hei[5]) - 0.5;
}
else {
wp_hei[5] = Math.ceil(wp_hei[5]);
}
}
if (wp_hei[6] > 500 || wp_hei[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei7.value="";
document.Form1.hei7.focus();
if_go = false;
}
else {
temm = wp_hei[6] - Math.floor(wp_hei[6]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[6] = Math.ceil(wp_hei[6]) - 0.5;
}
else {
wp_hei[6] = Math.ceil(wp_hei[6]);
}
}
if (wp_hei[7] > 500 || wp_hei[7] < 0) {
alert("\nPlease type a correct value.");		//400
document.Form1.hei8.value="";
document.Form1.hei8.focus();
if_go = false;
}
else {
temm = wp_hei[7] - Math.floor(wp_hei[7]);
if (temm <= 0.5 && temm > 0)
{
wp_hei[7] = Math.ceil(wp_hei[7]) - 0.5;
}
else {
wp_hei[7] = Math.ceil(wp_hei[7]);
}
}
}
else {
if (wp_wid[0] > 6000 || wp_wid[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid1.value="";
document.Form1.wid1.focus();
if_go = false;
}
else {
temm1 = wp_wid[0]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[0] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[0] = Math.ceil(temm1);
}
}
if (wp_wid[1] > 6000 || wp_wid[1] < 0) {
alert("\nPlease type a correct value.");		//420
document.Form1.wid2.value="";
document.Form1.wid2.focus();
if_go = false;
}
else {
temm1 = wp_wid[1]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[1] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[1] = Math.ceil(temm1);
}
}
if (wp_wid[2] > 6000 || wp_wid[2] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid3.value="";
document.Form1.wid3.focus();
if_go = false;
}
else {
temm1 = wp_wid[2]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[2] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[2] = Math.ceil(temm1);
}
}
if (wp_wid[3] > 6000 || wp_wid[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid4.value="";
document.Form1.wid4.focus();		//440
if_go = false;
}
else {
temm1 = wp_wid[3]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[3] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[3] = Math.ceil(temm1);
}
}
if (wp_wid[4] > 6000 || wp_wid[4] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid5.value="";
document.Form1.wid5.focus();
if_go = false;
}
else {
temm1 = wp_wid[4]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[4] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[4] = Math.ceil(temm1);
}
}
if (wp_wid[5] > 6000 || wp_wid[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid6.value="";
document.Form1.wid6.focus();
if_go = false;
}		//460
else {
temm1 = wp_wid[5]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[5] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[5] = Math.ceil(temm1);
}
}
if (wp_wid[6] > 6000 || wp_wid[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid7.value="";
document.Form1.wid7.focus();
if_go = false;
}
else {
temm1 = wp_wid[6]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[6] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[6] = Math.ceil(temm1);
}
}
if (wp_wid[7] > 6000 || wp_wid[7] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wid8.value="";
document.Form1.wid8.focus();
if_go = false;
}
else {
temm1 = wp_wid[7]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[7] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[7] = Math.ceil(temm1);
}
}
if (wp_hei[0] > 6000 || wp_hei[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei1.value="";
document.Form1.hei1.focus();
if_go = false;
}
else {
temm1 = wp_hei[0]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[0] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[0] = Math.ceil(temm1);
}
}
if (wp_hei[1] > 6000 || wp_hei[1] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei2.value="";
document.Form1.hei2.focus();
if_go = false;
}
else {
temm1 = wp_hei[1]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[1] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[1] = Math.ceil(temm1);
}
}
if (wp_hei[2] > 6000 || wp_hei[2] < 0) {
alert("\nPlease type a correct value.");	//501
document.Form1.hei3.value="";
document.Form1.hei3.focus();
if_go = false;
}
else {
temm1 = wp_hei[2]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[2] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[2] = Math.ceil(temm1);
}
}
if (wp_hei[3] > 6000 || wp_hei[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei4.value="";
document.Form1.hei4.focus();
if_go = false;
}
else {
temm1 = wp_hei[3]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[3] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[3] = Math.ceil(temm1);
}
}
if (wp_hei[4] > 6000 || wp_hei[4] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei5.value="";		//520
document.Form1.hei5.focus();
if_go = false;
}
else {
temm1 = wp_hei[4]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[4] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[4] = Math.ceil(temm1);
}
}
if (wp_hei[5] > 6000 || wp_hei[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei6.value="";
document.Form1.hei6.focus();
if_go = false;
}
else {
wp_hei[5] = Math.ceil(wp_hei[5]/12);
}
if (wp_hei[6] > 6000 || wp_hei[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei7.value="";
document.Form1.hei7.focus();
if_go = false;		//540
}
else {
temm1 = wp_hei[6]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[6] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[6] = Math.ceil(temm1);
}
}
if (wp_hei[7] > 6000 || wp_hei[7] < 0) {
alert("\nPlease type a correct value.");
document.Form1.hei8.value="";
document.Form1.hei8.focus();
if_go = false;
}
else {
temm1 = wp_hei[7]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_hei[7] = Math.ceil(temm1) - 0.5;
}
else {
wp_hei[7] = Math.ceil(temm1);
}
}
}
for(var i=0;i<8;i++) {
if (wp_wid[i] > 0 && wp_hei[i] > 0)
{
squ += wp_wid[i] * wp_hei[i];
}
}	//560
squ=Math.ceil(squ);
if (document.Form1.w_pattern.value == "standard") {
//if (document.Form1.w_pattern.options[document.Form1.w_pattern.selectedIndex].value == "standard") {
num = Math.ceil(squ / 23);
if (num%2 > 0)
{
num++;
}
}
else {
num = Math.ceil(squ / 20);
if (num%2 > 0)
{
num++;
}
}
if (if_go == true && num > 0) {
document.getElementById("wr_square3").innerHTML = squ;
document.getElementById("wr_res3").innerHTML = num;
}
else {
document.getElementById("wr_square3").innerHTML = "0";
document.getElementById("wr_res3").innerHTML = "0";
}
}

function cal_br_room() {
var temm;
var temm1;
var squ = 0;
var num = 0;
var if_go = true;
var rom_wid;
var rom_len;
rom_wid = parseFloat(document.Form1.br_wid.value);
rom_len = parseFloat(document.Form1.br_len.value);
if (document.Form1.b_unit.value == "feet") {
//if (document.Form1.b_unit.options[document.Form1.b_unit.selectedIndex].value == "feet") {
if (rom_wid > 500 || rom_wid < 0) {
alert("\nPlease type a correct value.");
document.Form1.br_wid.value="";
document.Form1.br_wid.focus();
if_go = false;
}
else {
temm = rom_wid - Math.floor(rom_wid);
if (temm <= 0.5 && temm > 0)
{
rom_wid = Math.ceil(rom_wid) - 0.5;
}
else {
rom_wid = Math.ceil(rom_wid);
}
}	//20
if (rom_len > 500 || rom_len < 0) {
alert("\nPlease type a correct value.");		//20
document.Form1.br_len.value="";
document.Form1.br_len.focus();
if_go = false;
}
else {
temm = rom_len - Math.floor(rom_len);
if (temm <= 0.5 && temm > 0)
{
rom_len = Math.ceil(rom_len) - 0.5;
}
else {
rom_len = Math.ceil(rom_len);
}
}
}	//39
else {
if (rom_wid > 6000 || rom_wid < 0) {
alert("\nUnreasonable number!!");
document.Form1.br_wid.value="";
document.Form1.br_wid.focus();
if_go = false;
}
else {
temm1 = rom_wid/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_wid = Math.ceil(temm1) - 0.5;
}
else {
rom_wid = Math.ceil(temm1);
}
}
if (rom_len > 6000 || rom_len < 0) {
alert("\nUnreasonable number!!");		//40
document.Form1.br_len.value="";
document.Form1.br_len.focus();
if_go = false;
}
else {
temm1 = rom_len/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_len = Math.ceil(temm1) - 0.5;
}
else {
rom_len = Math.ceil(temm1);
}
}
}
if (rom_wid > 0 && rom_len > 0)
{
squ = 2*(rom_len+rom_wid);
}
else {
squ = 0;
}
if (document.Form1.b_measure.value == "5_yard") {
//if (document.Form1.b_measure.options[document.Form1.b_measure.selectedIndex].value == "5_yard") {
num = Math.ceil(squ / 15);
}	//60
else {
num = Math.ceil(squ / 33);
}
if (if_go == true && num > 0) {
document.getElementById("b_length").innerHTML = squ;
document.getElementById("b_num").innerHTML = num;
}
else {
document.getElementById("b_length").innerHTML = "0";
document.getElementById("b_num").innerHTML = "0";
}
}

function cal_br_length() {
var temm;
var temm1;
var num;
var if_go = true;
var rom_squ;
rom_squ = parseFloat(document.Form1.t_leng.value);
if (document.Form1.b_unit.value == "feet") {
//if (document.Form1.b_unit.options[document.Form1.b_unit.selectedIndex].value == "feet") {
if (rom_squ > 2500 || rom_squ < 0 || isNaN(rom_squ)) {
alert("\nPlease type a correct value.");
document.Form1.t_leng.value="";
document.Form1.t_leng.focus();	//200
if_go = false;
}
else {
temm = rom_squ - Math.floor(rom_squ);
if (temm <= 0.5 && temm > 0)
{
rom_squ = Math.ceil(rom_squ) - 0.5;
}
else {
rom_squ = Math.ceil(rom_squ);
}
}
}
else {
if (rom_squ > 30000 || rom_squ < 0 || isNaN(rom_squ)) {
alert("\nPlease type a correct value.");
document.Form1.t_leng.value="";
document.Form1.t_leng.focus();
if_go = false;
}
else {
temm1 = rom_squ/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
rom_squ = Math.ceil(temm1) - 0.5;
}
else {
rom_squ = Math.ceil(temm1);
}
}
}
if (document.Form1.b_measure.value == "5_yard") {
//if (document.Form1.b_measure.options[document.Form1.b_measure.selectedIndex].value == "5_yard") {
num = Math.ceil(rom_squ / 15);
}	//60
else {
num = Math.ceil(rom_squ / 33);
}
if (if_go == true && num > 0) {
document.getElementById("b_num2").innerHTML = num;
}
else {
document.getElementById("b_num2").innerHTML = "0";
}
}

function cal_br_wall() {
var wp_wid = new Array();
var wp_hei = new Array();
var num  = 0;
var squ = 0;
var if_go = true;
wp_wid[0] = parseFloat(document.Form1.wwid1.value);
wp_wid[1] = parseFloat(document.Form1.wwid2.value);
wp_wid[2] = parseFloat(document.Form1.wwid3.value);
wp_wid[3] = parseFloat(document.Form1.wwid4.value);
wp_wid[4] = parseFloat(document.Form1.wwid5.value);
wp_wid[5] = parseFloat(document.Form1.wwid6.value);
wp_wid[6] = parseFloat(document.Form1.wwid7.value);
wp_wid[7] = parseFloat(document.Form1.wwid8.value);
if (document.Form1.b_unit.value == "feet") {
//if (document.Form1.b_unit.options[document.Form1.b_unit.selectedIndex].value == "feet") {
if (wp_wid[0] > 500 || wp_wid[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid1.value="";
document.Form1.wwid1.focus();
if_go = false;
}
else {
temm = wp_wid[0] - Math.floor(wp_wid[0]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[0] = Math.ceil(wp_wid[0]) - 0.5;
}
else {
wp_wid[0] = Math.ceil(wp_wid[0]);
}
}
if (wp_wid[1] > 500 || wp_wid[1] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid2.value="";
document.Form1.wwid2.focus();
if_go = false;
}
else {
temm = wp_wid[1] - Math.floor(wp_wid[1]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[1] = Math.ceil(wp_wid[1]) - 0.5;
}
else {
wp_wid[1] = Math.ceil(wp_wid[1]);
}
}
if (wp_wid[2] > 500 || wp_wid[2] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid3.value="";
document.Form1.wwid3.focus();
if_go = false;
}
else {
temm = wp_wid[2] - Math.floor(wp_wid[2]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[2] = Math.ceil(wp_wid[2]) - 0.5;
}
else {
wp_wid[2] = Math.ceil(wp_wid[2]);
}
}
if (wp_wid[3] > 500 || wp_wid[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid4.value="";
document.Form1.wwid4.focus();
if_go = false;
}
else {
temm = wp_wid[3] - Math.floor(wp_wid[3]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[3] = Math.ceil(wp_wid[3]) - 0.5;
}
else {
wp_wid[3] = Math.ceil(wp_wid[3]);
}
}
if (wp_wid[4] > 500 || wp_wid[4] < 0) {
alert("\nPlease type a correct value.");	//301
document.Form1.wwid5.value="";
document.Form1.wwid5.focus();
if_go = false;
}
else {
temm = wp_wid[4] - Math.floor(wp_wid[4]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[4] = Math.ceil(wp_wid[4]) - 0.5;
}
else {
wp_wid[4] = Math.ceil(wp_wid[4]);
}
}
if (wp_wid[5] > 500 || wp_wid[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid6.value="";
document.Form1.wwid6.focus();
if_go = false;
}
else {
temm = wp_wid[5] - Math.floor(wp_wid[5]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[5] = Math.ceil(wp_wid[5]) - 0.5;
}
else {
wp_wid[5] = Math.ceil(wp_wid[5]);
}
}
if (wp_wid[6] > 500 || wp_wid[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid7.value="";		//320
document.Form1.wwid7.focus();
if_go = false;
}
else {
temm = wp_wid[6] - Math.floor(wp_wid[6]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[6] = Math.ceil(wp_wid[6]) - 0.5;
}
else {
wp_wid[6] = Math.ceil(wp_wid[6]);
}
}
if (wp_wid[7] > 500 || wp_wid[7] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid8.value="";
document.Form1.wwid8.focus();
if_go = false;
}
else {
temm = wp_wid[7] - Math.floor(wp_wid[7]);
if (temm <= 0.5 && temm > 0)
{
wp_wid[7] = Math.ceil(wp_wid[7]) - 0.5;
}
else {
wp_wid[7] = Math.ceil(wp_wid[7]);
}
}
}
else {
if (wp_wid[0] > 6000 || wp_wid[0] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid1.value="";
document.Form1.wwid1.focus();
if_go = false;
}
else {
temm1 = wp_wid[0]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[0] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[0] = Math.ceil(temm1);
}
}
if (wp_wid[1] > 6000 || wp_wid[1] < 0) {
alert("\nPlease type a correct value.");		//420
document.Form1.wwid2.value="";
document.Form1.wwid2.focus();
if_go = false;
}
else {
temm1 = wp_wid[1]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[1] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[1] = Math.ceil(temm1);
}
}
if (wp_wid[2] > 6000 || wp_wid[2] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid3.value="";
document.Form1.wwid3.focus();
if_go = false;
}
else {
temm1 = wp_wid[2]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[2] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[2] = Math.ceil(temm1);
}
}
if (wp_wid[3] > 6000 || wp_wid[3] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid4.value="";
document.Form1.wwid4.focus();		//440
if_go = false;
}
else {
temm1 = wp_wid[3]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[3] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[3] = Math.ceil(temm1);
}
}
if (wp_wid[4] > 6000 || wp_wid[4] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid5.value="";
document.Form1.wwid5.focus();
if_go = false;
}
else {
temm1 = wp_wid[4]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[4] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[4] = Math.ceil(temm1);
}
}
if (wp_wid[5] > 6000 || wp_wid[5] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid6.value="";
document.Form1.wwid6.focus();
if_go = false;
}		//460
else {
temm1 = wp_wid[5]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[5] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[5] = Math.ceil(temm1);
}
}
if (wp_wid[6] > 6000 || wp_wid[6] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid7.value="";
document.Form1.wwid7.focus();
if_go = false;
}
else {
temm1 = wp_wid[6]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[6] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[6] = Math.ceil(temm1);
}
}
if (wp_wid[7] > 6000 || wp_wid[7] < 0) {
alert("\nPlease type a correct value.");
document.Form1.wwid8.value="";
document.Form1.wwid8.focus();
if_go = false;
}
else {
temm1 = wp_wid[7]/12;
temm = temm1 - Math.floor(temm1);
if (temm <= 0.5 && temm > 0)
{
wp_wid[7] = Math.ceil(temm1) - 0.5;
}
else {
wp_wid[7] = Math.ceil(temm1);
}
}
}
for(var i=0;i<8;i++) {
if (wp_wid[i] > 0)
{
squ += wp_wid[i];
}
}	//560
if (document.Form1.b_measure.value == "5_yard") {
//if (document.Form1.b_measure.options[document.Form1.b_measure.selectedIndex].value == "5_yard") {
num = Math.ceil(squ / 15);
}	//60
else {
num = Math.ceil(squ / 33);
}
if (if_go == true && num >0) {
document.getElementById("b_length3").innerHTML = squ;
document.getElementById("b_num3").innerHTML = num;
}
else {
document.getElementById("b_length3").innerHTML = "0";
document.getElementById("b_num3").innerHTML = "0";

}
}


