/* globals.js
inkludes all global variables and constants used on the site.

*/

// This is the post data key sent to the REST service.
var POST_DATA_KEY = "Post_Data";
// This is the DIV element for the main page.
var DIV_MAIN_PAGE = "mainPage";
// This is the DIV element that holds the application menu.
var DIV_MENU = "menu"
// This is the DIV element that holds the menu
var DIV_START_PAGE = "startPage";
// This is the DIV element that holds the items in list format form.
var DIV_ITEMLIST_PAGE = "ItemListPage";
// This is the DIV element that holds the item page
var DIV_ITEM_PAGE = "ItemPage";
// This is the DIV element that holds the item page
var DIV_CALENDAR_PAGE = "calendar";
// This is the DIV element that holds the items in list format form.
var DIV_CARTLIST_PAGE = "cartListPage";
// This is the DIV element that holds the footer section of the pages.
var DIV_PAGE_FOOTER = "pageFooter";
// This is the DIV element that holds any picture floating over the pages.
var DIV_PAGE_PICTURE = "pictureFrame";
// Some of the element ids are defined below.
var MENU_ITEM = "menuItem";
var MENU_ITEM_SELECTION = "selected";
var MENU_ITEM_DEFAULT = "item";
var MENU_ITEM_SUBSELECTION = "subselected";
var MENU_ITEM_SUBDEFAULT = "subitem";
var PROD_ITEM = "prodItem";
var PROD_ITEM_SELECTION = "itemRowSelected";
var PROD_ITEM_DEFAULT = "itemRow";
// This is the HTML id of the field that displays the current user.
var CURRENT_USER_DISPLAY = "currentUserDisplay";
// Define the CSS values for visible and hidden controls.
var CSS_STYLE_VISIBLE = "visible";
var CSS_STYLE_HIDDEN = "hidden";

var INTERNAL_SERVER_ERROR_MSG = "Internal error in server. Please try again.";
// Variables to hold all the div elements.
var mainPageDivElement = null;
var menuDivElement = null;
var startPageDivElement = null;
var itemListPageDivElement = null;
var itemPageDivElement = null;
var calendarPageDivElement = null;
var cartListPageDivElement = null;
var pictureDivElement = null;
var pageFooterDivElement = null;
var currentActiveMenuItemName = "";
var currentActiveMenuSubItemName = "";
var currentlyShownElement = null;
var currentUserName = "Inte inloggad";


// Different HTTP readystate values. 
// Taken from w3.org XMLHttpRequest working group document
// http://www.w3.org/TR/XMLHttpRequest/
// Uninitialized i.e. this is the initial state.
var HTTP_READYSTATE_UNINITIALIZED = 0;
// Open method has been called.
var HTTP_READYSTATE_OPEN = 1;
// The User Agent successfully completed the request, but no data has been received yet.
var HTTP_READYSTATE_SENT = 2;
// All HTTP headers have been received. But HTTP body is yet to be received.
var HTTP_READYSTATE_RECEIVING = 3;
// The data transfer has been completed.
var HTTP_READYSTATE_LOADED = 4;
// The only HTTP status code that we care about here in this program.
var HTTP_STATUS_OK = 200;

// Some global variabels
var Server_request = null;
var Prod_request = null;
var Offer_request = null;
var ShowCheckoutInfo = true;
var cartTot = 0;
var Checkout_request = null;
var totDiff = 0;
var callBackGlobalArg = "";