{"id":5601,"date":"2022-06-16T17:32:44","date_gmt":"2022-06-16T17:32:44","guid":{"rendered":"http:\/\/maritimetents.com\/?page_id=5601"},"modified":"2022-10-05T21:26:45","modified_gmt":"2022-10-05T21:26:45","slug":"tent-size-calculator","status":"publish","type":"page","link":"https:\/\/maritimetents.com\/new-brunswick\/tent-size-calculator\/","title":{"rendered":"Tent Size Calculator!"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"5601\" class=\"elementor elementor-5601\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ca43f29 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ca43f29\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-cc1b87f\" data-id=\"cc1b87f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-0ba37e1 elementor-widget elementor-widget-html\" data-id=\"0ba37e1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<head>\r\n\r\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n\t\t<!-- jquery -->\r\n\t\t<script\r\n\t\t\tsrc=\"http:\/\/code.jquery.com\/jquery-1.12.4.min.js\"\r\n\t\t\tintegrity=\"sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=\"\r\n\t\t\tcrossorigin=\"anonymous\"><\/script>\r\n\r\n\t\t<!-- Latest compiled and minified CSS -->\r\n\t\t<link rel=\"stylesheet\" href=\"http:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.1.1\/css\/bootstrap.min.css\">\r\n\r\n\t\t<!-- Latest compiled and minified JavaScript -->\r\n\t\t<script src=\"http:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.1.1\/js\/bootstrap.min.js\"><\/script>\r\n\r\n\t\t<!-- jquery bootstrap wizard -->\r\n\t\t<script src=\"https:\/\/cdn.rawgit.com\/VinceG\/twitter-bootstrap-wizard\/d79e9a2e\/jquery.bootstrap.wizard.min.js\"><\/script>\r\n\r\n\t\t<!-- fontawesome -->\r\n\t\t<link href=\"http:\/\/netdna.bootstrapcdn.com\/font-awesome\/4.0.3\/css\/font-awesome.css\" rel=\"stylesheet\">\r\n\r\n\t\t<!-- iframe resizer -->\r\n\t\t<script src=\"https:\/\/cdn.rawgit.com\/davidjbradshaw\/iframe-resizer\/master\/js\/iframeResizer.contentWindow.min.js\"><\/script>\r\n\r\n\t\t<!-- my codes -->\r\n\t\t<script>var ITEM_GROUP = {\r\n\tSEATING: 'Seating',\r\n\tOTHER_TABLES: 'Tables',\r\n\tFOOD: 'Food',\r\n\tMUSIC: 'Entertainment',\r\n\tSTANDING: 'Standing',\r\n};\r\n\r\nfunction \/* class *\/ Item(group, name, spacePer, note, products) {\r\n\tthis.id = name.split(' ').join('');\r\n\tthis.shouldCheck = false; \/\/ Whether or not the user should be asked about this item\r\n\tthis.count = 0;\r\n\tthis.group = group;\r\n\tthis.name = name;\r\n\tthis.note = note;\r\n\tthis.spacePerCount = spacePer;\r\n\r\n\tthis.products = products; \r\n\r\n\tthis.getSpaceRequired = function () {\r\n\t\treturn this.count * this.spacePerCount;\r\n\t}\r\n}\r\n\r\nvar items = [\r\n\tnew Item(ITEM_GROUP.SEATING, 'Banquet Table', 12, 'How many people would you like seated at a banquet table?'),\r\n\tnew Item(ITEM_GROUP.SEATING, 'Round Table', 10, 'How many people would you like seated at a round table?'),\r\n\tnew Item(ITEM_GROUP.SEATING, 'Row Seating', 6, 'How many people would you like seated in row seating?'),\r\n\tnew Item(ITEM_GROUP.SEATING, 'Head Table', 20, 'How many people would you like seated at the head table?'),\r\n\tnew Item(ITEM_GROUP.FOOD, 'Buffet Tables', 100, 'How many buffet tables do you need?'),\r\n\tnew Item(ITEM_GROUP.FOOD, 'Four Foot Cake Tables', 50, 'How many cake tables do you need?'),\r\n\tnew Item(ITEM_GROUP.FOOD, 'Four Foot Beverage Tables', 50, 'How many beverage tables do you need?'),\r\n\tnew Item(ITEM_GROUP.FOOD, 'Bars', 150, 'How many bars do you need? One bar supports ~140 People w\/ 2 Bartenders'),\r\n\tnew Item(ITEM_GROUP.MUSIC, 'Disc Jockey Area', 100, 'How many DJ areas would you like set up?'),\r\n\tnew Item(ITEM_GROUP.MUSIC, 'Band', 35, 'If having a band, how many members do they have?'),\r\n\tnew Item(ITEM_GROUP.MUSIC, 'Dance Floor', 3, 'How many people are you expecting at your dance?'),\r\n\tnew Item(ITEM_GROUP.OTHER_TABLES, 'Gift Tables', 100, 'How many gift tables do you need?'),\r\n\tnew Item(ITEM_GROUP.OTHER_TABLES, 'Guest Book Tables', 50, 'How many guestbook tables do you need?'),\r\n\/\/TODO: get size of these tables\r\n\tnew Item(ITEM_GROUP.OTHER_TABLES, 'Other Table Small', 50, 'How many small tables do you need?'),\r\n\tnew Item(ITEM_GROUP.OTHER_TABLES, 'Other Table Large', 100, 'How many large tables do you need?'),\r\n\tnew Item(ITEM_GROUP.STANDING, 'Standing without Table', 10),\r\n\tnew Item(ITEM_GROUP.STANDING, 'Standing with Table', 8),\r\n];\r\n\r\nfunction \/* class *\/ Product(name, id, image, size, available, description) {\r\n\tthis.count = 0;\r\n\tthis.available = available;\r\n\tthis.id = id\r\n\tthis.size = size;\r\n\tthis.name = name;\r\n\tthis.image = image;\r\n\tthis.description = description;\r\n}\r\n\r\nvar tents = [\r\n\tnew Product('MQ 10x10 Tent', '207116', '10.jpg', 10*10, 2, 'Get protection from the sun with elegant shade structures for corporate event, commercial or home use.'),\r\n\tnew Product('MQ 20x20 Tent', '207182', '20.jpg', 20*20, 6, 'Matrix-Marquee Party Tents make great festival tents, food service tents, retail tents, security & first aid tents, covered walkways, ticket kiosks, and portable pavilions.'),\r\n\tnew Product('MQ 20x30 Tent', '207186', '23.jpg', 20*30, 3, 'The Matrix-Marquee is the world\\'s most functional, fast, flexible and portable tent and canopy. Available as shown with plain or cathedral window walls. Four tents are displayed here.'),\r\n\tnew Product('MQ 30x30 Tent', '207188', '30.jpg', 30*30, 4, 'This is the tent we used for our own son\\'s reception. Plenty of room with no centre pole to the ground that allowed us to arrange the tables and chairs as we wished. I cannot say enough about how great this tent looks and functions.'),\r\n\tnew Product('MQ 40 Hexagon Tent', '207206', '40.jpg', 1040, 2, 'The Hexagon 40 Tent is a perfect multi-purpose outdoor event tent. The top-of-the-line materials and meticulous design make it not only a stunning event tent, but a trusted structure for heavy weather conditions that you would find in the Maritimes.'),\r\n];\r\n\r\nvar otherProducts = [\r\n\tnew Product('Fan Back Chair White', '207480', 'fanback.jpg', null, 488, 'Folding Fan Back chairs are ideal to be used for indoor or outdoor parties. Available in white.'),\r\n\tnew Product('White Resin Chair with seating pad', '207482', 'whiteresin.jpg', null, 444, 'White Resin Folding Chairs with comfort seating pad. Made to be sturdier and more comfortable than regular rental chairs. We recommend these for your VIPs.'),\r\n\tnew Product('Six Foot Banquet Table', '207516', 'banquet.jpg', null, 150, 'Our 6\\' Banquet Tables are great for seating up to 8 people. They can also be used for buffet lines, DJ Service, Head Table, or guest book.'),\r\n\tnew Product('Sixty Inch Round Table', '207510', 'round.jpg', null, 76, 'Accommodate up to 8 people at each table.'),\r\n\tnew Product('Twenty Foot Squared Dance Floor', '207490', 'dance.jpg', null, 2, 'This 20\\' X 20\\' Portable Dance Floor comes in Wood grain with silver trim. This size can easily fit 40 couples. This Portable dance floor can be used indoors or outdoors. It is recommended to use a plywood subfloor if setting up dance floor on uneven ground.')\r\n]\r\n\r\n\/\/ Represents a relationship between an item and a product\r\nfunction ProductItemPair(itemId, productId, productPerItem) {\r\n\tthis.item = itemId;\r\n\tthis.product = productId;\r\n\tthis.productPerItem = productPerItem;\r\n\r\n\tthis.getProductCount = function (items) {\r\n\t\treturn Math.ceil(items * productPerItem);\r\n\t}\r\n}\r\n\r\nvar productItemPairs = [\r\n\tnew ProductItemPair('BanquetTable', '207516', 1 \/ 8), \/\/ Rect Banquet Table\r\n\tnew ProductItemPair('BanquetTable', '207480', 1), \/\/ White Fan-back chairs\r\n\tnew ProductItemPair('RoundTable', '207510', 1 \/ 8), \/\/ Round Table\r\n\tnew ProductItemPair('RoundTable', '207480', 1), \/\/ White Fan-back chairs\r\n\tnew ProductItemPair('HeadTable', '207516', 1 \/ 4), \/\/ Rect Banquet Table\r\n\tnew ProductItemPair('HeadTable', '207482', 1), \/\/ White Resin Padded Chairs\r\n\tnew ProductItemPair('RowSeating', '207480', 1), \/\/ White Fan-back chairs\r\n\tnew ProductItemPair('BuffetTables', '207516', 1), \/\/ Rect Banquet Table\r\n\tnew ProductItemPair('FourFootCakeTables', '207510', 1), \/\/ Round Table\r\n\tnew ProductItemPair('FourFootBeverageTables', '207510', 1), \/\/ Round Table\r\n\tnew ProductItemPair('DiscJockeyArea', '207516', 1), \/\/ Rect Banquet Table\r\n\tnew ProductItemPair('DanceFloor', '207490', 1 \/ 80), \/\/ Dance Floor\r\n\tnew ProductItemPair('GiftTables', '207516', 1), \/\/ Rect Banquet Table\r\n\tnew ProductItemPair('GuestBookTables', '207510', 1), \/\/ Round Table\r\n\tnew ProductItemPair('OtherTableSmall', '207510', 1), \/\/ Round Table\r\n\tnew ProductItemPair('OtherTableLarge', '207516', 1), \/\/ Rect Banquet Table\r\n]\r\n\r\nvar itemsById = {};\r\nitems.forEach(function(item) { itemsById[item.id] = item; });\r\n\r\nvar productsById = {};\r\ntents.forEach(function(tent) { productsById[tent.id] = tent; });\r\notherProducts.forEach(function(product) { productsById[product.id] = product; });\r\n\r\nfunction \/* class *\/ PackageItem(id, count, specialName) {\r\n\tthis.product = productsById[id];\r\n\tthis.count = count || 1;\r\n\tthis.specialName = specialName;\r\n}\r\nfunction \/* class *\/ Package(id, name, products) {\r\n\tthis.id = id\r\n\tthis.name = name;\r\n\tthis.products = products;\r\n}\r\nvar packages = [\r\n\tnew Package('wed80', 'Wedding Reception 80 Guests', [new PackageItem('207188'), new PackageItem('207480', 80), new PackageItem('207510', 10), new PackageItem('207516', 1, 'Buffet Table')]),\r\n\tnew Package('wed100', 'Wedding Reception 100 Guests', [new PackageItem('207186', 2), new PackageItem('207480', 100), new PackageItem('207510', 13), new PackageItem('207516', 1, 'Buffet Table')]),\r\n\tnew Package('wed120', 'Wedding Reception 120 Guests', [new PackageItem('207188', 2), new PackageItem('207480', 120), new PackageItem('207510', 15), new PackageItem('207516', 2, 'Buffet Table')]),\r\n\tnew Package('wed150', 'Wedding Reception 150 Guests', [new PackageItem('207186', 4), new PackageItem('207480', 150), new PackageItem('207510', 19), new PackageItem('207516', 3, 'Buffet Table')]),\r\n\tnew Package('wed175', 'Wedding Reception 175 Guests', [new PackageItem('207186', 4), new PackageItem('207480', 175), new PackageItem('207510', 22), new PackageItem('207516', 4, 'Buffet Table')]),\r\n\tnew Package('wed200', 'Wedding Reception 200 Guests', [new PackageItem('207186', 5), new PackageItem('207480', 200), new PackageItem('207510', 25), new PackageItem('207516', 4, 'Buffet Table')])\r\n]\r\n\r\n\r\n\r\n\/\/ var tents = [\r\n\/\/ \tnew Product('MQ 10x10 Tent', '207116', '10.jpg', 10*10, 2, 'Get protection from the sun with elegant shade structures for corporate event, commercial or home use.'),\r\n\/\/ \tnew Product('MQ 20x20 Tent', '207182', '20.jpg', 20*20, 6, 'Matrix-Marquee Party Tents make great festival tents, food service tents, retail tents, security & first aid tents, covered walkways, ticket kiosks, and portable pavilions.'),\r\n\/\/ \tnew Product('MQ 20x30 Tent', '207186', '23.jpg', 20*30, 3, 'The Matrix-Marquee is the world\\'s most functional, fast, flexible and portable tent and canopy. Available as shown with plain or cathedral window walls. Four tents are displayed here.'),\r\n\/\/ \tnew Product('MQ 30x30 Tent', '207188', '30.jpg', 30*30, 4, 'This is the tent we used for our own son\\'s reception. Plenty of room with no centre pole to the ground that allowed us to arrange the tables and chairs as we wished. I cannot say enough about how great this tent looks and functions.'),\r\n\/\/ \tnew Product('MQ 40 Hexagon Tent', '207206', '40.jpg', 1040, 2, 'The Hexagon 40 Tent is a perfect multi-purpose outdoor event tent. The top-of-the-line materials and meticulous design make it not only a stunning event tent, but a trusted structure for heavy weather conditions that you would find in the Maritimes.'),\r\n\/\/ ];\r\n\r\nfunction \/* class *\/ Configuration(id, name, products, footage, description) {\r\n\tthis.id = id;\r\n\tthis.name = 'Tent Configuration: ' + name;\r\n\tthis.products = products;\r\n\tthis.size = footage;\r\n\tthis.image = id + '.png';\r\n\tthis.count = 0;\r\n\tthis.description = description;\r\n}\r\nvar configs = [\r\n\tnew Configuration('20x20', '20x20', ['207182'], 400),\r\n\tnew Configuration('20x30', '20x30', ['207186'], 600),\r\n\tnew Configuration('2x20x20', '40x20', ['207182', '207182'], 800, 'Two of our fantastic 20x20 Tents side by side!'),\r\n\tnew Configuration('30x30', '30x30', ['207188'], 900),\r\n\tnew Configuration('Hex', 'Hex', ['207206'], 1035),\r\n\tnew Configuration('2x20x30', '40x30', ['207186', '207186'], 1200, 'Two of our fantastic 20x30 Tents side by side!'),\r\n\tnew Configuration('3x20x20', '60x20', ['207182', '207182', '207182'], 1200, 'Three of our fantastic 20x20 Tents side by side!'),\r\n\tnew Configuration('H+20x20', 'Hex + 20x20', ['207182', '207206'], 1435, 'One of our beautiful Hexagon tents with an attached 20x20 Tent by it\\'s side!'),\r\n\tnew Configuration('H+2x20x20', 'Hex + 20x20 + 20x20', ['207182', '207182', '207206'], 1835, 'One of our beautiful Hexagon tents with two attached 20x20 Tents!'),\r\n\tnew Configuration('2x30x30', '60x30', ['207188', '207188'], 1800, 'Two of our fantastic 30x30 Tents side by side!'),\r\n\tnew Configuration('2x30x30+20x30', '80x30', ['207188', '207188', '207182'], 2400, 'Two of our fantastic 30x30 Tents, with a 20x30 in between!'),\r\n\tnew Configuration('2xH+20x20', '2 Hex + 20x20', ['207182', '207206', '207206'], 2470, 'Two of our beautiful Hexagon tents with an attached 20x20 Tent!'),\r\n];\r\n\r\n\/* Adds a tab to the navigation *\/\r\nfunction addTab(tabId, label, content) {\r\n\t$('#navList').append(\r\n\t\t'<li><a href=\"#' + tabId + '\" data-toggle=\"tab\">' + label + '<\/a><\/li>'\r\n\t);\r\n\r\n\t$('#tabContainer').append(\r\n\t\t'<div class=\"tab-pane\" id=\"' + tabId + '\">' + content + '<\/div>'\r\n\t);\r\n}\r\n\r\nfunction generateInitialPages() {\r\n\t\/\/ Add an intro tab\r\n\taddTab('tabIntro', 'Introduction', `\r\n\t\t<div class=\"jumbotron\">\r\n\t\t\t<h1>Tent Size Calculator!<\/h1>\r\n\t\t\t<p>Looking for the right tents and accessories for your event but not quite sure what you need? We&#39;re here to help! The calculator will determine how much tent space you will need, all you need to do is click &quot;Next&quot; to begin.<\/p>\r\n\t\t<\/div>` + getButtons()\/\/+ generatePackageList()\r\n\t);\r\n\r\n\t\/\/ Add a tab for each item group\r\n\tObject.keys(ITEM_GROUP).forEach(function(groupKey) {\r\n\t\tvar group = ITEM_GROUP[groupKey];\r\n\t\taddTab('tab' + group, group, generateGroupOptions(group));\r\n\t});\r\n\r\n\t\/\/ Bind the input box controls to the data in the items array, the buttons are already bound\r\n\titems.forEach(function(item) {\r\n\t\t$('#' + item.id + 'Count').bind('keyup mouseup', function () {\r\n\t\t\titem.count = parseInt($('#' + item.id + 'Count').val(), 10);\r\n\t\t\titem.count = Math.max(item.count, 0);\r\n\t\t\t$('#' + item.id + 'Count').val(item.count);\r\n\t\t});\r\n\t});\r\n\r\n\t\/\/ Add final page placeholder and populate it.\r\n\taddTab('tabFinish', 'Results', '<div id=\"resultsTab\"><\/div>' + getButtons());\r\n\tpopulateResultsTab();\r\n}\r\n\r\n\/\/ Generates the html string for a tab for 1 item group\r\nfunction generateGroupOptions(itemGroup) {\r\n\tvar result = getButtons() + `<div class=\"tent-item-container\">`;\r\n\r\n\titems.forEach(function(item) {\r\n\t\tif(item.group !== itemGroup) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar note = item.note || \"\";\r\n\r\n\t\tvar itemText = `\r\n\t\t\t<div id=\"` + item.id + `\" class=\"tent-calc-item\">\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t<div class=\"panel-heading\"><label for=\"basic-url\">` + item.name + `<\/label><\/div>\r\n\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t<p>` + note + `<\/p>\r\n\t\t\t\t<div class=\"input-group tent-calc-input\">\r\n\t\t\t\t\t<input id=\"` + item.id + `Count\" type=\"number\" min=\"0\" class=\"form-control\"\r\n\t\t\t\t\t\t\t\taria-label=\"` + item.name + `\" value=\"` + item.count + `\">\r\n\t\t\t\t\t<div class=\"input-group-btn\">\r\n\t\t\t\t\t\t<button class=\"btn btn-default\" type=\"button\" onclick=\"addCount('`+ item.id +`', -1)\"><i class=\"fa fa-minus\"><\/i><\/button>\r\n\t\t\t\t\t\t<button class=\"btn btn-default\" type=\"button\" onclick=\"addCount('`+ item.id +`',  1)\"><i class=\"fa fa-plus\"><\/i><\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t`;\r\n\t\tresult += itemText;\r\n\t})\r\n\r\n\tresult += `<\/div>`;\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction tentSpaceNeeded() {\r\n\treturn items.reduce(function(a, b) { return a + b.getSpaceRequired(); }, 0);\r\n}\r\n\r\n\/\/ Generates a list of tents they should totally rent\r\nfunction generateProductList() {\r\n\tvar result = \"\";\r\n\tvar reccomended = [];\r\n\tvar spaceNeeded = tentSpaceNeeded();\r\n\t\r\n\tvar combinedProducts = tents.concat(otherProducts);\r\n\tcombinedProducts.forEach(function(product) {\r\n\t\tproduct.count = 0;\r\n\t});\r\n\tconfigs.forEach(config => config.count = 0)\r\n\r\n\tvar config = null;\r\n\tvar tmp;\r\n\tfor(var i = 0; i < configs.length; i++) {\r\n\t\ttmp = configs[i];\r\n\t\tif(tmp.size > spaceNeeded) {\r\n\t\t\tif(!config){\r\n\t\t\t\tconfig = tmp;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(config) {\r\n\t\tconfig.count ++;\r\n\t\tconfig.products.forEach(productId => {\r\n\t\t\tif(productsById[productId]) {\r\n\t\t\t\tproductsById[productId].count += 1;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (config.description) {\r\n\t\t\tcombinedProducts.unshift(config);\r\n\t\t}\r\n\t}\r\n\r\n\tproductItemPairs.forEach(function(pair) {\r\n\t\tif(itemsById[pair.item].count <= 0) { return; }\r\n\t\tproductsById[pair.product].count += pair.getProductCount(itemsById[pair.item].count);\r\n\t});\r\n\r\n\tcombinedProducts.forEach(function(product) {\r\n\t\tif(product.count == 0) { return; }\r\n\r\n\t\tvar count = \"\";\r\n\t\tif(product.count > 1) {\r\n\t\t\tcount += product.count + \"x - \t\";\r\n\t\t}\r\n\r\n\t\tresult += `\r\n\t\t\t<div id=\"` + product.id + `\" class=\"tent-calc-item col-xs-12 col-sm-6 col-md-4 col-lg-3\">\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t<label for=\"basic-url\">` + count + product.name + `<\/label>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t` + product.description + `\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"panel-footer\">\r\n\t\t\t\t\t\t<img decoding=\"async\" class=\"tent-img\" src=\"https:\/\/maritimetents.com\/new-brunswick\/wp-content\/uploads\/sites\/2\/2022\/10\/` + product.image + `\"><\/img>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t`;\r\n\t});\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction generateLinkParams() {\r\n\tvar result = \"\";\r\n\ttents.concat(otherProducts).forEach(function(product) {\r\n\t\tif(product.count > 0) {\r\n\t\t\tresult += '&' + product.id + '=' + product.count;\r\n\t\t}\r\n\t});\r\n\treturn result;\r\n}\r\n\r\nfunction generateLinkParamsPackage(package) {\r\n\tvar result = \"\";\r\n\tpackage.products.forEach(function(product) {\r\n\t\tif(product.count > 0) {\r\n\t\t\tresult += '&' + product.product.id + '=' + product.count;\r\n\t\t}\r\n\t});\r\n\treturn result;\r\n}\r\n\r\nfunction populateResultsTab() {\r\n\tvar tab = $('#resultsTab');\r\n\tvar result = \"\";\r\n\tvar spaceNeeded = tentSpaceNeeded();\r\n\r\n\tvar productList = generateProductList();\r\n\r\n\tif(spaceNeeded == 0) {\r\n\t\tresult += `\r\n\t\t\t<div class=\"jumbotron\">\r\n\t\t\t\t<h1>Oh No! It's an empty party!<\/h1>\r\n\t\t\t\t<p>Add some items on the previous pages to see how much space you'll need!<\/p>\r\n\t\t\t<\/div>\r\n\t\t`;\r\n\t} else if (spaceNeeded > configs[configs.length - 1].size) {\r\n\t\tresult += `\r\n\t\t\t<div class=\"jumbotron\">\r\n\t\t\t\t<h1>You Need ` + spaceNeeded + ` Square Feet of Tent Space<\/h1>\r\n\t\t\t\t<p>Whoa, that's a big party! None of our default configurations are large enough, please <a href=\"https:\/\/maritimetents.com\/new-brunswick\/contact-us\/\">contact us<\/a> and we can find a custom solution! Or <a href=\"https:\/\/maritimetents.com\/new-brunswick\/io_quoteform\/\" target=\"_top\">Click here<\/a> to begin a free quote now and build your own custom configuration!<\/p>\r\n\t\t\t<\/div>\r\n\t\t\t`;\r\n\t} else {\r\n\t\tresult += `\r\n\t\t\t<div class=\"jumbotron\">\r\n\t\t\t\t<h1>You Need ` + spaceNeeded + ` Square Feet of Tent Space<\/h1>\r\n\t\t\t\t<p>The recommended products are shown below. <a href=\"https:\/\/maritimetents.com\/new-brunswick\/io_quoteform\/\">Click here<\/a> to begin a free quote now!<\/p>\r\n\t\t\t<\/div>\r\n\t\t\t`;\r\n\t\tresult += productList;\r\n\t}\r\n\r\n\ttab.html(result);\r\n}\r\n\r\nfunction addCount(itemId, value) {\r\n\tif(!itemsById[itemId]) {\r\n\t\tconsole.log('invalid item ' + itemId);\r\n\t\treturn;\r\n\t}\r\n\tvar item = itemsById[itemId];\r\n\tif(isNaN(item.count)) {\r\n\t\titem.count = 0;\r\n\t}\r\n\titem.count += value;\r\n\titem.count = Math.max(item.count, 0);\r\n\t$('#' + item.id + 'Count').val(item.count);\r\n}\r\n\r\n\r\n\/\/ Generates a list of packages\r\nfunction generatePackageList() {\r\n\tvar result = '<div class=\"tent-item-container\">';\r\n\r\n\tpackages.forEach(function(package) {\r\n\t\tvar productList = \"<ul>\";\r\n\t\tpackage.products.forEach(function(product) {\r\n\t\t\tproductList += \"<li>\";\r\n\t\t\tif(product.count > 1) productList += product.count + \" x \";\r\n\t\t\tproductList += product.specialName || product.product.name;\r\n\t\t\tproductList += \"<\/li>\";\r\n\t\t});\r\n\t\tproductList += \"<\/ul>\";\r\n\r\n\t\tvar linkParams = generateLinkParamsPackage(package);\r\n\r\n\t\tresult += `\r\n\t\t\t<div id=\"` + package.id + `\" class=\"tent-calc-item\">\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t<label for=\"basic-url\">` + package.name + `<\/label>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t` + productList + `\r\n\t\t\t\t\t\t<br>\r\n\t\t\t\t\t\t<a class=\"btn btn-primary startQuoteBtnRight\" href=\"https:\/\/maritimetents.com\/new-brunswick\/io_quoteform\/` + linkParams + `\" target=\"_top\">Start a Quote<\/a>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t<\/div>\r\n\t\t`;\r\n\t});\r\n\r\n\tresult += '<\/div>';\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction getButtons() {\r\n\treturn `\r\n\t<ul class=\"pager wizard\">\r\n\t\t<li class=\"previous\"><a href=\"#\" class=\"\">Previous<\/a><\/li>\r\n\t\t<li class=\"next\"><a href=\"#\" class=\"\">Next<\/a><\/li>\r\n\t<\/ul>\r\n\t`;\r\n\treturn '';\r\n}\r\n\r\n\/\/basic wizard w\/ progress\r\n$(document).ready(function() {\r\n\tgenerateInitialPages();\r\n\r\n\t$('#rootwizard').bootstrapWizard({onTabShow: function(tab, navigation, index) {\r\n\t\tvar $total = navigation.find('li').length;\r\n\t\tvar $current = index+1;\r\n\t\tvar $percent = ($current\/$total) * 100;\r\n\t\t$('#rootwizard .progress-bar').css({width:$percent+'%'});\r\n\r\n\t\t\/\/ Recalculate the total on results tab shown\r\n\t\tif($total == $current) {\r\n\t\t\tpopulateResultsTab();\r\n\t\t}\r\n\t}});\r\n});\r\n<\/script>\r\n\t\r\n\t<\/head>\r\n<body>\r\n\t\t<div id=\"rootwizard\">\r\n\t\t\t<div class=\"container\">\r\n\t\t\t\t<ul id=\"navList\">\r\n\t\t\t\t\t\r\n\t\t\t\t\t<!-- <li><a href=\"#tab1\" data-toggle=\"tab\">First<\/a><\/li> -->\r\n\r\n\t\t\t\t<\/ul>\r\n\t\t\t<\/div>\r\n\t\t\t<div id=\"bar\" class=\"progress\">\r\n\t\t\t\t<div class=\"progress-bar\" role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 0%;\"><\/div>\r\n\t\t\t<\/div>\r\n\t\t\t<!--<ul class=\"pager wizard\">\r\n\t\t\t\t<li class=\"previous\"><a href=\"#\" class=\"\">Previous<\/a><\/li>\r\n\t\t\t\t<li class=\"next\"><a href=\"#\" class=\"\">Next<\/a><\/li>\r\n\t\t\t<\/ul>-->\r\n\t\t\t<div class=\"tab-content container-fluid\" id=\"tabContainer\">\r\n\r\n\t\t\t\t<!--\r\n\t\t\t\t<div class=\"tab-pane\" id=\"tab1\">\r\n\t\t\t\t\t1\r\n\t\t\t\t<\/div>\r\n\t\t\t\t-->\r\n\t\t\t\t\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t\t\r\n\t<\/body>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ac293d6 elementor-widget elementor-widget-spacer\" data-id=\"ac293d6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"io_meta_description":"","footnotes":""},"class_list":["post-5601","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/pages\/5601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/comments?post=5601"}],"version-history":[{"count":25,"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/pages\/5601\/revisions"}],"predecessor-version":[{"id":6084,"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/pages\/5601\/revisions\/6084"}],"wp:attachment":[{"href":"https:\/\/maritimetents.com\/new-brunswick\/wp-json\/wp\/v2\/media?parent=5601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}