//
// global.js -- Copyright 2011 One More Story, Inc.
//
//
// Holds global constants and variables
//
if ( globals != "globals" ) {
	var globals			= "globals";		// Prevent multiple includes

	var debug			= false;
	if ( debug ) {
		alert( "In globals" );
	}


		//
		// Constants
		//


		// Site Info Banner Constants

			// !! IMPORTANT: there are 2 banners controlled below: only ONE can be 'on' at a time!

	var BANNER_STATUS	= "off";		// !! must be 'on' or 'off'
	var BANNER_SUBJECT	= "Holiday Discount! Click here";	// shows on the page
	var BANNER_BODY		= '<span style="font-size:140%;color:red;">Special Holiday Discount!</span><br /><br />' +
							'Holiday Special through Jan. 8th<br />' +
							'Discount code: <span style="color:red;">holiday</span><br /><br />' +
							'<div style="float:right;position:relative;padding-right:35px;"><img src="/img/icon_giftLg.png" alt="" /></div>' +
							'<div style="width:100%;text-align:center;">One Year - $36<br />' +
							'6 Months - $25<br />' +
							'3 Months - $14</div>';					// shows in the alert box

	var HOL_BANNER_STATUS	= "off";		// !! must be 'on' or 'off'
	var HOL_BANNER_SUBJECT	= "Holiday Discount! Click here";	// shows on the page
	var HOL_BANNER_BODY		= '<span style="font-size:140%;color:red;">Special Holiday Discount!</span><br /><br />' +
							'Holiday Special through Jan. 8th<br />' +
							'Discount code: <span style="color:red;">holiday</span><br /><br />' +
							'<div style="float:right;position:relative;padding-right:35px;"><img src="/img/icon_giftLg.png" alt="" /></div>' +
							'<div style="width:100%;text-align:center;">One Year - $36<br />' +
							'6 Months - $25<br />' +
							'3 Months - $14</div>';					// shows in the alert box

		// ITS debug controls - drop down and trace checkbox

	var ITS_DEBUG_SHOWING	= 'hide' ;				// can be 'show' or 'hide';

		// general

	var PROD_DOMAIN		= "www.onemorestory.com";

	var API_URL			= window.location.protocol + "//" + window.location.host + "/Logic/dbCall.aspx";
	var UPLOAD_URL		= window.location.protocol + "//" + window.location.host + "/Logic/upload.php";
	var DOMAIN_NAME		= window.location.host.toString();
	var NESTING_LEVEL	= 3;
	var CONTACT_EMAIL	= "carl@onemorestory.com";		// should be "carl@onemorestory.com" for production

		// Player Support

	var PLAYER_COOKIE			= "playerOpen";
	var PLAYER_WIN_NAME			= "playerWin";
	var PLAYER_FILE				= "player.html";

	var SAB_PLAYER_COOKIE		= "sabPlayerOpen";
	var SAB_PLAYER_WIN_NAME		= "sabPlayerWin";
	var SAB_PLAYER_FILE			= "sabPlayer.html";
	var SAB_DONE_FILE			= "sabdone.html";
	var SAB_PLAYER_DONE_FILE	= "sabPlayerDone.html";

	var TAB_PLAYER_COOKIE		= "tabPlayerOpen";
	var TAB_PLAYER_WIN_NAME		= "tabPlayerWin";
	var TAB_PLAYER_FILE			= "tabPlayer.html";
	var TAB_PLAYER_DONE			= "tabPlayerDone.html";

	var ITS_TAB_PLAYER_COOKIE		= "itsTabPlayerOpen";
	var ITS_TAB_PLAYER_WIN_NAME		= "itsTabPlayerWin";
	var ITS_TAB_PLAYER_FILE			= "itsTabPlayer.html";
	var ITS_TAB_PLAYER_DONE			= "itsTabPlayerDone.html";

	var LIBRARY_FOLDER			= "/Library/";


		//
		// Variables
		//


	var prefix		= "";
	var page		= "";
	var category	= "";
	var currentSub	= false;		// this variable is set to true when a subscription is in progress and false
									// when its done so avoid multiple concurrent subscriptions
	var curResults	= "";			// for displaying success/error form confirmations and logging errors
	var thisNum		= "";			// for the pop ups FARKLE -- can this name be any less descriptive?

		// Subscription pricing variables

	var price1				= "";
	var price2				= "";
	var price3				= "";
	var textPrice1			= "";
	var textPrice2			= "";
	var textPrice3			= "";
	var appliedPromo		= false;
	var NYSCountyTaxRate	= "";

		// for client-side form validation

	var newFunct 		= "";
	var submitCommand 	= "";
	var formClass 		= "";

		// for populating class activity list

	var studentArray 		= {};
	var studentInfoArray	= {};
	var curStudent;
	var numStudents;
	var curID;
	var isThisFirstTime;
	var curFirstName;
	var curLastName;

		// Passing user into to Google Analytics tracking

	var curIP;
	var curUserID;
	var curFN;
	var curLN;
	var curAdd1;
	var curAdd2;
	var curCity;
	var curState;
	var curCountry;
	var curEmail;
	var curPhone;
	var curPrice;
	var curPromo;
	var curTax;
	var curLength;

		// Player window

	var playerHandle	= null;			// Handle to player window
	var mainHandle		= null;			// Handle to main window
	var wasClosed		= false;		// Goes true first time playerClosing is called

	var pCookie		= "";
	var pWinName	= "";
	var pFile		= "";

	if ( debug ) {
		alert( "Done globals" );
		debug	= false;
	}

}

//* End Global Variables


