//---------------------------------------------------------------------------
// File.......: max_main_includes.js
// Purpose....: this file contains the variables that are used to control the
//              application.
// Copyright © 2006 Max Digital Broadcasting Corporation. All rights reserved.
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// user defined application information
//---------------------------------------------------------------------------
	var maxUserDef = {							// these are the user defined variables
		bilingual:app_bilingual,				// this is the flag for multy language support
		useheader:app_show_buttons,				// this is used to hide the header buttons when not required
		fadeSlides:app_fade_Slides,				// this is used to give the changing slides a fade effect
		filterDuration:app_fade_Duration,		// this is the filter duration
		slidepage:null,							// this is the number of the slide page
		helppage:null,							// the number of the help page
		startpage:app_start_page,				// this is the number of the starting page 
		showFootBanner: app_show_footer,		// this is used to use the footer
		webCastMode: app_web_cast_mode,			// this is to hide Video slider, Duration clock, and Slide Controls
		webCastModeOptions: app_web_cast_mode_optional_controls  // this is to hide/show specific controls; Video slider, Duration clock, and Slide Controls
	};

//---------------------------------------------------------------------------
// header page information
//---------------------------------------------------------------------------

	var maxHeader = {							// this is the header page information
		hblinks: Load_pages,					// the header page button links
		hbname: button_name						// the header button names
	};
	
//---------------------------------------------------------------------------
// frame set varables
//---------------------------------------------------------------------------

var pos = player_position;
if(app_type==1) {
	if (pos=='r')
	{
		var maxFrameVar = {
			bgcolor:"#326698",
			regsyscols:"750,*",
			systemcols:"0,750",
			systemrows:"59,347,*",
			bodycols:"465,280,*",
			nlcols:"358,392"
		};
	} else {
		var maxFrameVar = {
			bgcolor:"#326698",
			regsyscols:"750,*",
			systemcols:"0,750",
			systemrows:"59,347,*",
			bodycols:"270,480,*",
			nlcols:"358,392"
		};
	}
} else {
	var maxFrameVar = {
		bgcolor:"#326698",
		regsyscols:"750,*",
		systemcols:"0,750",
		systemrows:"59,347,*",
		bodycols:"358,392,*",
		nlcols:"358,392"
	};
}

//---------------------------------------------------------------------------
// Max Session information
//---------------------------------------------------------------------------
	var maxSession = {					// this is the session information
		current: 1,						// this is the current session number
		per_page: 9,					// this is the number of session to display on one page
		start: 1,						// this is the starting session number
		last: app_Session_count,		// this is the last session number
		pages:null
		};

	maxSession.pages = new Array(1,1,1,1,1,1); // number of session, topics, resources, option, support, requirements pages

//---------------------------------------------------------------------------
// Max Slide information
//---------------------------------------------------------------------------
	var maxSlide = {						// this is the slide information
		preload: null,						// this flag is used to indicate if we have preloaded the slides
		current: null,						// this is the current slide number
		startPath: "s0"+maxSession.start,	// this is used as the starting slide number
		start:1,							// this is used as the starting slide number
		last: 2,							// this is the last slide number
		imgName: "slide",					// this is the slide image name
		imgext: "jpg",						// this is the image file extention (gif,jpg)
		maxcount:null						// the largest number of slides.
		};


//-----------------------------------------------------------
//Max Flash 5/29/2007
//-----------------------------------------------------------
	var maxFlash = {
		preload: null,
		current: null,
		startPath: "s0"+maxSession.start,
		start:1,
		last: null,							// this is the last slide number
		imgName: "flash",					// this is the slide image name
		imgext: "swf",						// this is the image file extention (gif,jpg)
		maxcount:null						// the largest number of slides.		
	}

//---------------------------------------------------------------------------
// application path information
//---------------------------------------------------------------------------
	var maxPath = {					// this is the application path information
		root: null,					// the root directory
		home: null,					// the home directory
		slide: null,				// the slide folder
		back: null,					// path for background image for option, topics .....
		button: null,				// path for button images for the option, slide ...
		labels:null,				// path for image labels
		digits:null,				// path for counter digit images
		html: null,					// path for the html pages
		appserver: null				// url of application server to capture info
		};

	maxPath.digits = "images/control/counter/"			// path for the digits
	maxPath.button = "images/control/buttons/"			// path for the buttons
	maxPath.appserver = "http://rgaus.lily.lixar.net/MaxWare/site/"

//---------------------------------------------------------------------------
// application page information
//---------------------------------------------------------------------------

	var maxPageNames = {					// this is the page name information
		home:"max_home.htm",				// the main paage
		header:  "main_header.htm",			// the header page name
		contentif: "max_content_if.htm",	// the content page name
		contentil: "max_content_il.htm",	// the content page name
		player:  "max_player.htm",			// the player page name
		control: "max_control.htm"			// the control page name
	};

//---------------------------------------------------------------------------
// Media stream information
//---------------------------------------------------------------------------
	var maxStreamInfo = {			// this is the stream information
		speed: "h",					// the speed of the stream lowercase 
		asxname: null,				// the asx file name
		url:null,					// the url for the stream
		version: null,				// what is the version
		seek:false,					// flag used to seek marker
		local:false,				// used to determin if user is loacal on on net
		lang:null					// the language flag lowercase
		};



//---------------------------------------------------------------------------
// Max image information
//---------------------------------------------------------------------------

	var maxImages = {					// this is the image src information
		HighSpeed:"speed_btn_off.gif",
		LowSpeed:"speed_btn_off1.gif",
		background:"background.gif",
        logoOn:"images/control/max_logo_on.gif",
        logoOff:"images/control/max_logo_off.gif",
		footer:"images/footer/max_footer.gif",
		vsimg1:"images/footer/vol_slider_back.gif",
		vsimg2:"images/footer/controls_title_top.gif",
		footerBanner:"images/control/frame_33banner.gif",
		slidebtn:null,					// this is the slide button object name
		navbtn:null						// this is the nav button object name
		};


//---------------------------------------------------------------------------
// Max control button image information
//---------------------------------------------------------------------------
	var maxControlButtons = {
		names:	null,		// array of button names
		count:	null,		// array of button count
		isub:	"_but",		// the image sub name
		iext:	".gif",		// the image extetion (.gif,.jpg)
		state:	null,		// array of button states (on,off,dis,up,down)
		player: true
		};

//---------------------------------------------------------------------------
// Max control button information
//---------------------------------------------------------------------------
	//maxControlButtons.names = new Array("player","speed","lang","slide","ccb","mailto","participate");
	maxControlButtons.names = new Array("player","speed","lang","slide","ccb","share","participate");
	//maxControlButtons.count = new Array(2,1,1,4,1,1,1);
	maxControlButtons.count = new Array(2,1,1,4,1,1,1);
	maxControlButtons.state = new Array("_off","_on","_down","_dis");


//---------------------------------------------------------------------------
// the player control status stuff
//---------------------------------------------------------------------------
	var maxPlayerState = {		// this is the media player state information
		check:false,			// this flag is used to check the state
		play:null,				// value of play state depending on player version
		stop:null,				// value of stop state depending on player version
		pause:null,				// value of the pause state depending on player version
		ready:null,				// value of the ready state depending on player version
		ended:null				// value of the end of stream for mp9 only
	};


//---------------------------------------------------------------------------
// page button status
//---------------------------------------------------------------------------
var maxBtnStatus = new Array();
//---------------------------------------------------------------------------
// initialize the button status
//---------------------------------------------------------------------------
for (a=0; a<=maxHeader.hblinks.length; a++){
	maxBtnStatus[a] = new Array(true,true,true,true,true);		// the buttons status
}

//---------------------------------------------------------------------------
// this will set the slide and help page variable
//---------------------------------------------------------------------------

for (a=0; a<=maxHeader.hbname.length; a++){
	if (maxHeader.hbname[a] == "slide"){
		maxUserDef.slidepage = a
	}
	if (maxHeader.hbname[a] == "help"){
		maxUserDef.helppage = a
	}
}


var currentload = 0;

//---------------------------------------------------------------------------
// Max player parameter settings 
//---------------------------------------------------------------------------
	var maxPlayer = {							// this is the media player information
		mpwidth: app_player_width,				// the player width for ie mp9
		mpheight: app_player_height,			// the player height for ie mp9
		mptop: app_player_top,					// this is the player top
		mpleft: app_player_left,				// this is the player left
		nsoffsetht:12,							// this is the height offset for the ns plugin
		nsoffsetwd:0,							// this is the width offset for the ns plugin
		ubp: true,								// use both versions parameter
		autostart: false,						// start the player automaticaly true=yes false=no
		captioning:closed_captioning,			// player captioning true=yes false=no
		useSami:use_Sami_file,
		invokeURLs:false,						// true Default. URL events should launch a browser.  false URL events should not launch a browser.
		uiMode: app_player_uimode,				// see the note bellow
		windowlessVideo: false,					// this is set at a default
		CurrentPosition: 0,						// this is set at a default
		CurrentMarker: 0,						// this is set at a default
		playCount: 1,							// this is set at a default
		rate: 1,								// this is set at a default
		enabled: true,							// this is set at a default
		enableContextMenu: false,				// this is set at a default
		AnimationAtStart: false,				// this is set at a default
		PreviewMode:false,						// this is set at a default
		CapID:"cc",
		SAMILang:null,
		SAMIStyle:null,
		SAMIFileName:null,
		Mute:false,								// this is set at a default
		stretch:true,							// do not strech to fit player window
		p9Volume:80,							// ver 9 Zero specifies no volume and 100 specifies full volume, current volume 80
		p6Volume:-200,							// ver 6 This property specifies or retrieves the volume, in hundredths of decibels.
												// Zero specifies full volume and 10,000 specifies no volume.
												// the default value is 600.
		version:null,							// the actual version
		TransparentAtStart:false,				// this is set at a default
		DisplayString:"<object id=\"MaxPlayer1\" ",			// this is the object tag container
		codeBase:" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\" ",

		EmbedString:"<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" src=\"\" name=\"MaxPlayer1\" id=\"MaxPlayer1\"  ",
		ParamString:null,					// this is the parameters string tag
		volume: 80								// this is the media player volume
		};

//---------------------------------------------------------------------------
// uiMode
// NOTE -- this will set the uiMode in the player  to immulate the p9 uiMode!
//---------------------------------------------------------------------------
//  value			description
//---------------------------------------------------------------------------
// the uimode parameters strings
//---------------------------------------------------------------------------

	var maxPlParam = {
		invisible:null,
		none:null,
		mini:null,
		full:null
	};

	var maxEmbParam = {
		invisible:null,
		none:null,
		mini:null,
		full:null
	};

//---------------------------------------------------------------------------
//  invisible		Player is embedded without any visible user interface
//					(controls, video or visualization window).
//---------------------------------------------------------------------------
maxPlParam.invisible = "<param name=\"ShowAudioControls\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowDisplay\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowGotoBar\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowPositionControls\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowTracker\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowStatusBar\" value=false>\n";
maxPlParam.invisible += "<param name=\"ShowControls\" value=false>\n";

maxEmbParam.invisible = " ShowAudioControls=0";
maxEmbParam.invisible += " showdisplay=0";
maxEmbParam.invisible += " ShowGotoBar=0";
maxEmbParam.invisible += " ShowPositionControls=0";
maxEmbParam.invisible += " ShowTracker=0";
maxEmbParam.invisible += " showstatusbar=0";
maxEmbParam.invisible += " showcontrols=0";
maxEmbParam.invisible += " showvolumecontrols=0";

//---------------------------------------------------------------------------
//	none            Player is embedded without controls, and with only the video
//                  or visualization window displayed.
//---------------------------------------------------------------------------
maxPlParam.none = "<param name=\"ShowAudioControls\" value=false>\n";
maxPlParam.none += "<param name=\"ShowDisplay\" value=false>\n";
maxPlParam.none += "<param name=\"ShowGotoBar\" value=false>\n";
maxPlParam.none += "<param name=\"ShowPositionControls\" value=false>\n";
maxPlParam.none += "<param name=\"ShowTracker\" value=false>\n";
maxPlParam.none += "<param name=\"ShowStatusBar\" value=false>\n";
maxPlParam.none += "<param name=\"ShowControls\" value=false>\n";

maxEmbParam.none = " ShowAudioControls=0";
maxEmbParam.none += " showdisplay=0";
maxEmbParam.none += " ShowGotoBar=0";
maxEmbParam.none += " ShowPositionControls=0";
maxEmbParam.none += " ShowTracker=0";
maxEmbParam.none += " showstatusbar=0";
maxEmbParam.none += " showcontrols=0";
maxEmbParam.none += " showvolumecontrols=0";

//---------------------------------------------------------------------------
//  mini			Player is embedded with the status window, play/pause,
//					stop, mute, and volume controls shown in addition to the
//					video or visualization window.
//---------------------------------------------------------------------------
maxPlParam.mini = "<param name=\"ShowAudioControls\" value=true>\n";
maxPlParam.mini += "<param name=\"ShowDisplay\" value=false>\n";
maxPlParam.mini += "<param name=\"ShowGotoBar\" value=false>\n";
maxPlParam.mini += "<param name=\"ShowPositionControls\" value=false>\n";
maxPlParam.mini += "<param name=\"ShowTracker\" value=false>\n";
maxPlParam.mini += "<param name=\"ShowStatusBar\" value=true>\n";
maxPlParam.mini += "<param name=\"ShowControls\" value=true>\n";

maxEmbParam.mini = " ShowAudioControls=1";
maxEmbParam.mini += " showdisplay=0";
maxEmbParam.mini += " ShowGotoBar=0";
maxEmbParam.mini += " ShowPositionControls=0";
maxEmbParam.mini += " ShowTracker=0";
maxEmbParam.mini += " showstatusbar=1";
maxEmbParam.mini += " showcontrols=1";
maxEmbParam.mini += " showvolumecontrols=1";

//---------------------------------------------------------------------------
//  full			Default. Player is embedded with the status window, seek bar,
//					play/pause, stop, mute, next, previous, fast forward, fast reverse,
//					and volume controls in addition to the video or visualization window.
//---------------------------------------------------------------------------
maxPlParam.full = "<param name=\"ShowAudioControls\" value=true>\n";
maxPlParam.full += "<param name=\"ShowDisplay\" value=false>\n";
maxPlParam.full += "<param name=\"ShowGotoBar\" value=false>\n";
maxPlParam.full += "<param name=\"ShowPositionControls\" value=false>\n";
maxPlParam.full += "<param name=\"ShowTracker\" value=true>\n";
maxPlParam.full += "<param name=\"ShowStatusBar\" value=true>\n";
maxPlParam.full += "<param name=\"ShowControls\" value=true>\n";

maxEmbParam.full = " ShowAudioControls=1";
maxEmbParam.full += " showdisplay=0";
maxEmbParam.full += " ShowGotoBar=0";
maxEmbParam.full += " ShowPositionControls=0";
maxEmbParam.full += " ShowTracker=1";
maxEmbParam.full += " showstatusbar=1";
maxEmbParam.full += " showcontrols=1";
maxEmbParam.full += " showvolumecontrols=1";

//---------------------------------------------------------------------------
// these flags are to detect when the frames are loaded
//---------------------------------------------------------------------------
	var PageLoaded = {				// this is the page loaded flags
		Top: false,					// Top is the home page frameset
		Player: false,				// Player is the player page frame
		Content:false,				// the content page
		Control:false,				// the control page 
		Slide: false,				// Slide is the slide page frame
		Nav: false,					// Nav is the header page frame
		All:false					// all loaded flag
		};


