<!--

function show(idLayer) 
{
	document.getElementById(idLayer).display='block';
}

function hide(idLayer) 
{
	document.getElementById(idLayer).display='none';
}

var nogo = 0;

function CalcPeople()
{
	var iRoomType = -1;
	rs=document.forms[0].elements["roomsize"].value;
	if(rs=="") rs = "0";
	var b=validate(rs);
	if(b==1)
	{
		alert("You must enter a number.");
	}
	else
	{
		nogo=1;
		iRoomType = get_radio_value();
		
		switch( iRoomType )
		{
		case 3: //Conference
			if(rs>1000) alert("A Conference Style Layout is Not Recommended for Room Sizes Larger than 1000 Sq. Ft.");
			break;
		case 4: //H-Square
			if(rs>2000 || rs<300) alert("A Hollow Square Style Layout is only Recommended for Room Sizes Between 300 and 2000 Sq. Ft.");
			break;
		case 10: //Convention - 8 x 10
			if(rs<1500) alert("A Convention Layout is Not Recommended for Rooms Smaller than 1500 Sq. Ft.");
			break;
		case 11: //Convention - 10 x 10		
			if(rs<1500) alert("A Convention Layout is Not Recommended for Rooms Smaller than 1500 Sq. Ft.");
			break;
		default:
			nogo = 0;
		};

		if (nogo!=1)
		{
			i=0;
			if(1 == iRoomType) i = .0832;
			if(2 == iRoomType) i = .0832;
			if(13 == iRoomType) i = .04163;
			if(3 == iRoomType) i = .024;
			if(4 == iRoomType) i = .024;
			if(5 == iRoomType) i = .100;
			if(6 == iRoomType) i = .069;
			if(7 == iRoomType) i = .057;
			if(8 == iRoomType) i = .100;
			if(9 == iRoomType) i = .111;
			if(10 == iRoomType) i = .00625;
			if(11 == iRoomType) i = .0050;34
			if(12 == iRoomType) i = .0286;

			peeps=rs*i;
			peeps=Math.round(peeps);
			document.frmCalculator.numberpeople.value=peeps;
		}
	}
}

function get_radio_value()
{
for (var i=0; i < document.frmCalculator.roomtype.length; i++)
   {
   if (document.frmCalculator.roomtype[i].checked)
      {
      return document.frmCalculator.roomtype[i].value;
      }
   }
}

function UpdateLabel()
{

	var iRoomType = get_radio_value();
	if(iRoomType == 10 || iRoomType == 11)
	{
		hide('PeopleLabel');
		show('BoothLabel');
		hide('PeopleLabel2');
		show('BoothLabel2');
		hide('PeopleLabel3');
		show('BoothLabel3');
	}	
	else
	{
		show('PeopleLabel');
		hide('BoothLabel');
		show('PeopleLabel2');
		hide('BoothLabel2');
		show('PeopleLabel3');
		hide('BoothLabel3');
	}
}	

function CalcRoom()
{
	var iRoomType = -1;
	pp=document.frmCalculator.people.value;
	if(pp=="") pp = "0";
	var d=validate(pp);
	if(d==1)
	{
		alert("You must enter a number.");
	}
	else
	{
		nogo=1;
		iRoomType = get_radio_value();

		switch( iRoomType )
		{
		case 3: //Conference
			if(pp>24) alert("A Conference Style Layout is Not Recommended for Groups of More than 24 People.");
			break;
		case 4: //H-Square
			if(pp>52 || pp<10) alert("A Hollow Square Style Layout is Only Recommended for Groups Between 10 and 52 People.");
			break;
		default:
			nogo = 0;
		};

		if(nogo!=1)
		{
			i=0;
			if(1 == iRoomType) i = 12.0321;
			if(2 == iRoomType) i = 12.0321;
			if(13 == iRoomType) i = 24.0211;
			if(3 == iRoomType) i = 40.16667;
			if(4 == iRoomType) i = 38.461;
			if(5 == iRoomType) i = 9.46969;
			if(6 == iRoomType) i = 14.492;
			if(7 == iRoomType) i = 17.543;
			if(8 == iRoomType) i = 10;
			if(9 == iRoomType) i = 9.009;
			if(10 == iRoomType) i = 160;
			if(11 == iRoomType) i = 200;
			if(12 == iRoomType) i = 35;

			roomz=pp*i;
			roomz=Math.round(roomz);
			document.frmCalculator.sizeofroom.value=roomz;
		}
	}
}

function validate(thenum)
{
	var valid = "0123456789"
	var mynum = eval(thenum.length);
	var ok = "yes";
	var temp;
	for (var i=0; i<mynum; i++) 
	{
		temp = "" + thenum.substring(i, i+1);
		if(valid.indexOf(temp) == "-1") ok = "no";
	}
	return (ok == "no")?1:0;
}
//-->


