﻿if (document.images) {
	var img_load_array = new Array();
	var img_array = new Array();
	img_array.push("images/infobox_title.jpg");
	img_array.push("images/moreInfo.gif");
	for (i=0; i<img_array.length; i++) {
		img_load_array[i] = new Image();
		img_load_array[i].src = img_array[i];
	}
}


// List available options
var sal_opts = new Array("Salad Options", "<ul><li>Tossed</li><li>Greek</li><li>Antipasto</li><li>Caesar</li></ul><br />");
var veg_opts = new Array("Vegetable Options", "<ul><li>Green Beans Almondine</li><li>Broccoli/Cauliflower/Carrot</li><li>Zucchini/Squash/Carrot</li><li>Green Beans/Yellow Beans/Carrot</li><li>Peas with Onions and Mushrooms</li><li>Baby Glazed Carrots</li><li>Corn</li></ul><br />");
var pot_opts = new Array("Potato Options", "<ul><li>Queen Ann</li><li>Red Skin</li><li>Au Gratin</li><li>Mashed</li><li>Baked</li><li>Twice Baked</li><li>Steak Fries</li><li>Rice Pilaf</li></ul><br />");
var pas_opts = new Array("Pasta Options", "<ul><li>Mostaccioli</li><li>Rotini</li><li>Fettuccini</li><li>Linguini</li></ul><p>With a choice of:</p><ul><li>Meat Sauce</li><li>Palomino</li><li>Alfredo Sauce</li><li>Marinara Sauce</li><li>Garlic and Oil</li></ul><br />");
var des_opts = new Array("Dessert Options", "<ul><li>Vanilla Ice Cream</li><li>Chocolate Ice Cream</li><li>Strawberry Ice Cream</li><li>Raspberry Sherbet</li><li>Orange Sherbet</li><li>Rainbow Sherbet</li></ul><p>-or-</p><p>Assorted Pastry Platter (includes):</p><ul><li>Cannoli</li><li>Chocolate Eclair</li><li>Carrot Cake</li><li>Texas Sheet Cake</li><li>Cheese Cake with Toppings</li><li>Chocolate Cream Swirl</li></ul>");

var pst_opts = new Array("Pastry Options", "<ul><li>Cannoli</li><li>Chocolate Éclair</li><li>Carrot Cake</li><li>Texas Sheet Cake</li><li>Cheese Cake with Toppings</li><li>Chocolate Cream Swirl</li></ul><br />");
var pas_out_opts = new Array("Pasta Options", "<ul><li>Mostaccioli</li><li>Rotini</li><li>Fettuccini</li><li>Linguini</li></ul><p>With a choice of:</p><ul><li>Meat Sauce</li><li>Palomino</li><li>Marinara Sauce</li><li>Garlic and Oil</li></ul><br />");

// Set positions
var posTop = 0;
var posLeft = 0;

// Utlity function to find where the hell the object is
function setObjPosition(obj) {
	if (obj.parentNode != null)
	{
		posTop += (typeof obj.parentNode.offsetTop == "number") ? obj.parentNode.offsetTop : 0;
		posLeft += (typeof obj.parentNode.offsetLeft == "number") ? obj.parentNode.offsetLeft : 0;
		setObjPosition(obj.parentNode);
	}
}

// Set the popup
function moreInfo(obj, opts) {
	var browser = navigator.userAgent.toLowerCase();
	var firefox = (browser.indexOf("firefox") != -1) ? true : false;
	var infoBox = document.getElementById("infoBox");
	posTop = 0;
	posLeft = 0;
	setObjPosition(obj);
	tmp_array = eval(opts);
	var html = "";
	html += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"240\" id=\"infoBox_tbl\">";
	html += "<tr>";
	html += "<td class=\"infoBox_title\">" + tmp_array[0] + "</td>";
	html += "</tr>";
	html += "<td style=\"padding-left:10px;padding-top:10px;\">" + tmp_array[1] + "</td>";
	html += "</tr>";
	html += "</table>";
	infoBox.innerHTML = html;
	infoBox.style.position = "absolute";
	infoBox.style.top = posTop + 10;
	infoBox.style.left = posLeft + obj.offsetWidth + 5;
	if (firefox) {
		infoBox.style.height = 280;
	}
	infoBox.style.display = "block";
}

// Hide the popup
function hideInfo() {
	var infoBox = document.getElementById("infoBox");
	posTop = 0;
	posLeft = 0;
	infoBox.style.display = "none";
}
