<html>
<head>
<script type="text/javascript">
/**
*Constant Variables used to identify array locations ie. room[breakfast];
*First Dimmension
**/
var breakfast = 0;
var lunch = 1;
var dinner = 2;
var special = 3;
var full = 4;
/**
*More constant variables used to identify array locations
*Second Dimmension: ie. room[breakfast][roomString];
**/
var roomString = 0;
var midweekcost = 1;
var weekendcost = 2;
var room = 0;
var podium = 1;
var piano = 2
var podiumPPA = 3;
var PPA = 4;
var scr = 5;
var AV = 6;
var cat = 7;
var dancefloor = 8;
/**
*Constructor:
*Creates a new BilliardRoom Object and sets all variables to their default value
*This includes room costs for various times, and equipment rental costs.
**/
function billiard() {
this.time = new Array(new Array(),new Array(),new Array(),new Array(),new Array());
this.time[breakfast][roomString] = "Breakfast - 7:00 AM through 10:00 AM";
this.time[lunch][roomString] = "Lunch - 11:00 AM through 2:00 PM";
this.time[dinner][roomString] = "Dinner - 5:00 PM through PM";
this.time[special][roomString] = "Special Event - 5:00 PM through 12:00 AM";
this.time[full][roomString] = "7AM-4PM Business Meeting";
this.time[breakfast][midweekcost] = 75;
this.time[lunch][midweekcost] = 75;
this.time[dinner][midweekcost] = 150;
this.time[special][midweekcost] = 195;
this.time[full][midweekcost] = 100;
this.time[breakfast][weekendcost] = 100;
this.time[lunch][weekendcost] = 100;
this.time[dinner][weekendcost] = 195;
this.time[special][weekendcost] = 250;
this.time[full][weekendcost] = 150;
this.pointPartOfDay = 1;
this.pointPartOfWeek = 1;
this.allCosts = new Array(9);
for (i = 0; i < 9; i++) { this.allCosts[i] = 0; }
this.cost = 0;
}
/**
*Updates cost variable
*Should be called after any changes to values.
*All instance methods call this method when necessary.
*There should not be any need to change instance variables directly
**/
billiard.prototype.calculate = function() {
this.cost = 0;
for (i = 0; i < 9; i++) {
this.cost += this.allCosts[i];
}
}
/**
*Sets the room cost to the appropriate room cost
*@param partOfDay (integer) - use the constant variables for part of day ie.
*breakfast, lunch, dinner, special, full
*
*@param partOfWeek (integer) - use the constant variables for part of week ie.
*weekendCost, midWeekCost
**/
billiard.prototype.setRoom = function(partOfDay,partOfWeek) {
this.allCosts[room] = this.time[partOfDay][partOfWeek];
this.pointPartOfDay = partOfDay;
this.pointPartOfWeek = partOfWeek;
this.calculate();
}
/**
* Adds piano rental to the object
**/
billiard.prototype.addPiano = function() {
this.allCosts[piano] = 20;
this.calculate();
}
/**
* Adds podium rental to the object
**/
billiard.prototype.addPodium = function() {
this.allCosts[podium] = 10;
this.calculate();
}
/**
* Adds Podium/PA Package deal to the object
**/
billiard.prototype.addPodiumPPA = function() {
this.allCosts[podiumPPA] = 35;
this.calculate();
}
/**
*Adds PA system to object
**/
billiard.prototype.addPPA = function() {
this.allCosts[podium] = 30;
this.calculate();
}
/**
* Adds portable screen to the object
**/
billiard.prototype.addScr = function() {
this.allCosts[scr] = 10;
this.calculate();
}
/**
* Changes all values to holiday pricing
**/
billiard.prototype.holiday = function() {
this.time[breakfast][midweekcost] = 100;
this.time[lunch][midweekcost] = 100;
this.time[dinner][midweekcost] = 200;
this.time[special][midweekcost] = 250;
this.time[full][midweekcost] = 150;
this.time[breakfast][weekendcost] = 125;
this.time[lunch][weekendcost] = 125;
this.time[dinner][weekendcost] = 250;
this.time[special][weekendcost] = 295;
this.time[full][weekendcost] = 350;
this.setRoom(this.pointPartOfDay,this.pointPartOfWeek);
}
/**
* Changes all values to normal year pricing
**/
billiard.prototype.unholiday = function() {
this.time[breakfast][midweekcost] = 75;
this.time[lunch][midweekcost] = 75;
this.time[dinner][midweekcost] = 150;
this.time[special][midweekcost] = 195;
this.time[full][midweekcost] = 100;
this.time[breakfast][weekendcost] = 100;
this.time[lunch][weekendcost] = 100;
this.time[dinner][weekendcost] = 195;
this.time[special][weekendcost] = 250;
this.time[full][weekendcost] = 150;
this.setRoom(this.pointPartOfDay,this.pointPartOfWeek);
}
/**
* Adds off-site catering fee
**/
billiard.prototype.catering = function() {
value = 350;
if (this.allCosts[cat] != value) {
this.allCosts[cat] = value;
} else {
this.allCosts[cat] = 0;
}
this.calculate();
}
/**
* Calculates cost of dance floor, and adds cost to object
**/
billiard.prototype.addDanceFloor = function(height,width) {
if ((height+width)%3 != 0) {
alert("Error occured while calculating dance floor cost. Dance flooring must be in increments of 3'x3' tiles. The change was not made.");
} else {
sqft = height*width;
if (sqft < 144)
costperft = .52;
else if (sqft < 225)
costperft = .44;
else if (sqft < 324)
costperft = .37;
else
costperft = .29
this.allCosts[dancefloor] = costperft*sqft;
this.calculate();
}
}
/**
* Instantiates the billard class for use throughout the page.
**/
bill = new billiard();
</script>
<script>
function updateFields() {
document.getElementById('bf').innerHTML = bill.time[breakfast][bill.pointPartOfWeek];
document.getElementById('ln').innerHTML = bill.time[lunch][bill.pointPartOfWeek];
document.getElementById('dn').innerHTML = bill.time[dinner][bill.pointPartOfWeek];
document.getElementById('se').innerHTML = bill.time[special][bill.pointPartOfWeek];
document.getElementById('fdr').innerHTML = bill.time[full][bill.pointPartOfWeek];
document.getElementById('cost').innerHTML = bill.cost;
return 1;
}
</script>
</head>
<body>
<form action='index.php?link=price&post=lodge' method='post'>
<b>"The Lodge"</b> <br />
So far your quote is: $ <font id="cost">0</font> <br />
About when will the event be?
<select onchange='if(this.selectedIndex == 0) {bill.unholiday();updateFields()} else { bill.holiday();updateFields()}' id='date' name='date'>
<option value='else'>Jan. 02 - Nov. 20</option>
<option value='christmas'>Nov. 20 - Jan. 01</option>
</select>
<br />
What part of the week will the event occur?
<select onchange='if(this.selectedIndex == 0) {bill.pointPartOfWeek = 1;} else { bill.pointPartOfWeek = 2;}updateFields();alert(updateFields());' id='day' name='day'>
<option value='0'>Monday thru Thursday</option>
<option value='1'>Friday, Saturday, or Sunday</option>
</select>
<br />
<input type='hidden' name='cost' id='hide' /><br />
<b>Please select which of these best describes your event:</b>
<br />
<input onclick="bill.setRoom(breakfast,bill.pointPartOfWeek);updateFields()" type="radio" name="time" id="bfl" value="bf" />Breakfeast (7:00-10:00am) $<font id="bf"></font><br />
<input onclick="bill.setRoom(lunch,bill.pointPartOfWeek);updateFields()" type="radio" name="time" id="lnl" value="ln" />Lunch (11:00-2:00pm) $<font id="ln"></font><br />
<input onclick="bill.setRoom(dinner,bill.pointPartOfWeek);updateFields()" type="radio" name="time" id="dnl" value="dn" />Dinner (5:00-10:00pm) $<font id="dn"></font><br />
<input onclick="bill.setRoom(special,bill.pointPartOfWeek);updateFields()" type="radio" name="time" id="sel" value="se" />Special Event - (5:00-12:00pm) $<font id="se"></font><br />
<input onclick="bill.setRoom(full,bill.pointPartOfWeek);updateFields()" type="radio" name="time" id="fdrl" value="fdr" />7-4 Business Meeting $<font id="fdr"></font><br />
<script>updateFields()</script>
<br /><b>Check that which apply:</b> <br />
<input name='offsite' onclick='bill.catering();updateFields();' id='offsite' type='checkbox' /> Off-site catering ($350) - required for events that serve food other than what is offered by Brick29 and Elisabeta Europian Market.<br />
<input onclick='bill.addPodium();updateFields();' type='checkbox' name='podium' /> Podium ($20).<br />
<input onclick='bill.addPiano();updateFields();' type='checkbox' name='piano' /> Piano ($25).<br />
<input onclick='bill.addPPA();updateFields();' type='checkbox' name='ppa' /> Portable PA system. ($10)<br />
<input onclick='bill.addPPA();updateFields();' type='checkbox' name='podiumppa' /> Package Deal: Portbale PA System and Podium ($35)<br />
<input onclick='bill.addPPA();updateScr();' type='checkbox' name='scr' /> Portable Screen ($ 10.00)<br />
<b>
<br />
Dance Flooring: <i>Floor tiles come in 3'x3' tiles. These can be arranged in any manner you choose. </i><br />
<input onclick='bill.addDanceFloor(12,12);updateFields();' type='checkbox' id='1212' name='1212' /> Under 144 ft² (12'x12')- $.52/ft²<br />
<input onclick='bill.addDanceFloor(15,15);updateFields();' type='checkbox' id='1515' name='1515' /> Under 225 ft² (15'x15')- $.44/ft² <br />
<input onclick='bill.addDanceFloor(18,18);updateFields();' type='checkbox' id='1818' name='1818' /> Under 324 ft² (18'x18')- $.37/ft²<br />
<input onclick='bill.addDanceFloor(21,21);updateFields();' type='checkbox' id='2121' name='2121' /> Over 441 ft² (21'x21')- $.29/ft² <br />
<input type='submit' value='Book This Event!' />
</form>
</body>
</html>