home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CyberMycha 2003 October
/
cmycha200310.iso
/
NHL2004
/
NHL2004Demo.exe
/
fe
/
COMMON
/
js
/
GUI_FrameWork.js
< prev
next >
Wrap
Text File
|
2003-08-20
|
37KB
|
1,018 lines
GUI_FrameWork = function()
{
this.isLoaded = false;
this.currentScreenObj = null;
this.isNavigatingProp = false;
this.navTimerID = 0;
this.teamId = "";
this.skinned = false;
this.skinMainMenu = false;
this.isInCreatePlayer = false;
top.attachEvent("onload", this.OnMainLoad);
};
GUI_FrameWork.prototype.console = {};
GUI_FrameWork.prototype.console.println = function(htmlStr) { htmlStr = null; };
GUI_FrameWork.prototype.general = {};
GUI_FrameWork.prototype.general.data = new Array();
GUI_FrameWork.prototype.ticker = {};
GUI_FrameWork.prototype.ticker.data = new Array();
GUI_FrameWork.prototype.ticker.loadFromServer = function()
{
function OnTickerDataComplete(data)
{
var xmlDom = new ActiveXObject("MSXML2.DOMDocument");
xmlDom.async = false;
var bLoaded = xmlDom.loadXML("<ticker_news>" + data + "</ticker_news>");
if (bLoaded) {
var nodes = xmlDom.selectNodes("ticker_news/line");
if (nodes) {
for (var idx=0; idx < nodes.length; idx++)
{
System.GUI.ticker.data[idx] = nodes[idx].text;
};
top.document.all.ticker_data.innerHTML = "<div>" + System.GUI.ticker.data.join("!~^!").replace(/(?:\!\~\^\!)/g, "</div><div>") + "</div>";
top.document.all.ticker_sample.innerHTML = "<div>" + System.GUI.ticker.data[0] + "</div>";
System.GUI.ticker._lineHeight = top.document.all.ticker_sample.offsetHeight;
System.GUI.ticker._currentLine = 0;
System.GUI.ticker._startAnimation();
};
} else {
};
xmlDom = bLoaded = nodes = idx = data = null;
};
System.GUI.ticker._stopAnimation();
getTickerLines("ticker", "public_ticker_en_us", "line", OnTickerDataComplete, true);
};
GUI_FrameWork.prototype.ticker.loadFromString = function(str)
{
System.GUI.ticker._stopAnimation();
System.GUI.data.length = 0;
System.GUI.data[0] = str;
top.document.all.ticker_data.innerHTML = System.GUI.ticker.data[0];
System.GUI.ticker._currentLine = 0;
System.GUI.ticker._currentLineWidth = top.document.all.ticker_data.scrollWidth;
System.GUI.ticker._startAnimation();
str = null;
};
GUI_FrameWork.prototype.ticker._startPos = 40;
GUI_FrameWork.prototype.ticker._stopPos = 0;
GUI_FrameWork.prototype.ticker._moveTimeoutID = -1;
GUI_FrameWork.prototype.ticker._animTimerID = -1;
GUI_FrameWork.prototype.ticker._animStarTime = -1;
GUI_FrameWork.prototype.ticker._currentLine = -1;
GUI_FrameWork.prototype.ticker._lineHeight = -12;
GUI_FrameWork.prototype.ticker._stopAnimation = function()
{
clearInterval(System.GUI.ticker._moveTimeoutID);
clearInterval(System.GUI.ticker._animTimerID);
top.document.all.ticker_data.style.pixelTop = System.GUI.ticker._startPos;
System.GUI.ticker._animStartTime = -1;
System.GUI.ticker._currentLine = -1;
System.GUI.ticker._startPos = 40;
System.GUI.ticker._stopPos =0;
};
GUI_FrameWork.prototype.ticker._startAnimation = function()
{
top.document.all.ticker_data.style.pixelTop = System.GUI.ticker._startPos;
System.GUI.ticker._animStartTime = (new Date()).getTime();
System.GUI.ticker._animTimerID = setInterval(function() { System.GUI.ticker._animate(); }, 55);
};
GUI_FrameWork.prototype.ticker._animate = function()
{
var tmpNewLine = System.GUI.ticker._currentLine +1;
if (top.document.all.ticker_data.style.pixelTop > System.GUI.ticker._stopPos ) {
top.document.all.ticker_data.style.pixelTop -=2;
} else {
var currentTime = (new Date()).getTime();
if (currentTime > (System.GUI.ticker._animStartTime + 7000)) {
clearInterval(System.GUI.ticker._animTimerID);
System.GUI.ticker._currentLine++;
if (System.GUI.ticker.data[System.GUI.ticker._currentLine]) {
System.GUI.ticker._stopPos += (-1 * System.GUI.ticker._lineHeight);
System.GUI.ticker._animStartTime = currentTime;
System.GUI.ticker._animTimerID = setInterval(function() { System.GUI.ticker._animate(); }, 55);
} else {
System.GUI.ticker._stopPos = 0;
System.GUI.ticker._currentLine = 0;
top.document.all.ticker_data.style.pixelTop = System.GUI.ticker._startPos;
System.GUI.ticker._animStartTime = currentTime;
System.GUI.ticker._animTimerID = setInterval(function() { System.GUI.ticker._animate(); }, 55);
};
};
};
};
GUI_FrameWork.prototype.ticker._rewind = function()
{
if (System.GUI.ticker._moveTimeoutID != -1) { clearTimeout(System.GUI.ticker._moveTimeoutID); };
clearInterval(System.GUI.ticker._animTimerID);
if (System.GUI.ticker._currentLine >1) {
System.GUI.ticker._currentLine = System.GUI.ticker._currentLine -1;
} else {
System.GUI.ticker._currentLine = 0;
};
top.document.all.ticker_data.style.pixelTop = (-1 * (System.GUI.ticker._currentLine*System.GUI.ticker._lineHeight));
System.GUI.ticker._stopPos = (-1 * ((System.GUI.ticker_currentLine + 1)*System.GUI.ticker._lineHeight));
if (!System.GUI.ticker._isPaused) {
System.GUI.ticker._moveTimeoutID = setTimeout(function() { System.GUI.ticker._animStartTime = (new Date()).getTime(); System.GUI.ticker._currentLine++; System.GUI.ticker._animTimerID = setInterval(function() {System.GUI.ticker._animate(); } , 55); System.GUI.ticker._moveTimeoutID=-1; }, 7000);
};
};
GUI_FrameWork.prototype.ticker._pause = function()
{
if (System.GUI.ticker._moveTimeoutID != -1) { clearTimeout(System.GUI.ticker._moveTimeoutID); };
if (!System.GUI.ticker._isPaused) {
clearInterval(System.GUI.ticker._animTimerID);
System.GUI.ticker._isPaused = true;
} else {
System.GUI.ticker._animStartTime = (new Date()).getTime();
System.GUI.ticker._animTimerID = setInterval(function() { System.GUI.ticker._animate(); }, 55);
System.GUI.ticker._isPaused = false;
};
};
GUI_FrameWork.prototype.ticker._fastForward = function()
{
if (System.GUI.ticker._moveTimeoutID != -1) { clearTimeout(System.GUI.ticker._moveTimeoutID); };
clearInterval(System.GUI.ticker._animTimerID);
if (System.GUI.ticker._currentLine < System.GUI.ticker.data.length ) {
System.GUI.ticker._currentLine = System.GUI.ticker._currentLine +1;
} else {
System.GUI.ticker._currentLine = System.GUI.ticker.data.length-1;
};
top.document.all.ticker_data.style.pixelTop = (-1 * (System.GUI.ticker._currentLine*System.GUI.ticker._lineHeight));
System.GUI.ticker._stopPos = (-1 *((System.GUI.ticker._currentLine + 1)*System.GUI.ticker._lineHeight));
if (!System.GUI.ticker._isPaused) {
System.GUI.ticker._moveTimeoutID = setTimeout(function() { System.GUI.ticker._animStartTime = (new Date()).getTime(); System.GUI.ticker._animTimerID = setInterval(function() {System.GUI.ticker._animate();System.GUI.ticker._moveTimeoutID=-1; } , 55); }, 7000);
};
};
GUI_FrameWork.prototype.commandBar = {};
GUI_FrameWork.prototype.debugMenu = {};
GUI_FrameWork.prototype.loadingDialog = {};
GUI_FrameWork.prototype.loadingDialog.isOn = false;
GUI_FrameWork.prototype.loadingDialog.text = "";
GUI_FrameWork.prototype.loadingDialog.buttonPressed = false;
GUI_FrameWork.prototype.loadingDialog.onButtonClick = function()
{
if (!System.GUI.loadingDialog._bIgnoreCancel) {
top.document.all.divDialogBox.setCapture(true);
gblRRManager.doCancel();
System.GUI.loadingDialog._bIgnoreCancel = false;
};
};
GUI_FrameWork.prototype.loadingDialog.show = function()
{
if (!this.text) { this.text = scMsg("SC_LOADING"); };
this._bIgnore = false;
top.document.all.divDialogBox.setCapture(false);
System.GUI.dialog.innerHTML = "<br><center id='loading_status_text'>" + this.text + "</center><img src='" + System.getInstallFolder() + "fe/nhl/images2/widgets/load_sm.gif'><br><center style='font-size:7pt;font-family:verdana;'>" + scMsg('SC_CANCELING_OUT_OF_EASO') + "</center>";
System.GUI.dialog.setSize( 400 , 100 );
System.GUI.dialog.clearButtons();
System.GUI.dialog.addButton("cancelBtn1", scMsg("SC_CANCEL", true), System.GUI.loadingDialog.onButtonClick, false);
System.GUI.dialog.setStyle("NONE");
System.GUI.dialog.show();
this.isOn = true;
};
GUI_FrameWork.prototype.loadingDialog.showNoNav = function()
{
System.GUI.isNavigatingProp = true;
System.GUI.loadingDialog.show();
};
GUI_FrameWork.prototype.loadingDialog.hideNoNav = function()
{
System.GUI.isNavigatingProp = false;
System.GUI.loadingDialog.hide();
};
GUI_FrameWork.prototype.loadingDialog.hideCancel = function()
{
top.document.all.divBtnBox.style.visbility='hidden';
};
GUI_FrameWork.prototype.loadingDialog.showCancel = function()
{
top.document.all.divBtnBox.style.visbility='visible';
};
GUI_FrameWork.prototype.loadingDialog._bIgnore = false;
GUI_FrameWork.prototype.loadingDialog.ignoreCancel = function() { this._bIgnore = true; };
GUI_FrameWork.prototype.loadingDialog.dontIgnoreCancel = function() {this._bIgnore = false; };
GUI_FrameWork.prototype.loadingDialog.getStatusText = function() { return this.text; };
GUI_FrameWork.prototype.loadingDialog.hide = function()
{
this.setText(scMsg("SC_LOADING"));
System.GUI.dialog.hide();
System.GUI.loadingDialog.buttonPressed = false;
this.isOn = false;
top.document.releaseCapture();
};
GUI_FrameWork.prototype.loadingDialog.setText = function(sText)
{
this.text = sText;
if (this.isOn) {
var status_text_area = System.GUI.dialog.getElement("loading_status_text");
if (status_text_area) {
status_text_area.innerText = sText;
};
status_text_area = null;
};
sText = null;
};
GUI_FrameWork.prototype.nowBtns = {};
GUI_FrameWork.prototype.nowBtns.showPlayAndSim = function()
{
top.document.all.frame_b2.style.visibility = "visible";
top.document.all.playNow_btn.style.visibility = "visible";
top.document.all.sim_btn.style.visibility = "visible";
top.document.all.frame_b.style.visibility = "hidden";
top.document.all.frame_b1.style.visibility = "hidden";
};
GUI_FrameWork.prototype.nowBtns.showPlay = function()
{
top.document.all.frame_b1.style.visibility = "visible";
top.document.all.playNow_btn.style.visibility = "visible";
top.document.all.frame_b.style.visibility = "hidden";
top.document.all.frame_b2.style.visibility = "hidden";
top.document.all.sim_btn.style.visibility = "hidden";
};
GUI_FrameWork.prototype.nowBtns.hide = function()
{
top.document.all.playNow_btn.style.visibility = "hidden";
top.document.all.sim_btn.style.visibility = "hidden";
top.document.all.frame_b.style.visibility = "visible";
top.document.all.frame_b1.style.visibility = "hidden";
top.document.all.frame_b2.style.visibility = "hidden";
};
GUI_FrameWork.prototype.nowBtns.onplayclick = function(){};
GUI_FrameWork.prototype.nowBtns.onsimclick = function(){};
GUI_FrameWork.prototype.dialog = {};
GUI_FrameWork.prototype.profile_viewer = {};
GUI_FrameWork.prototype.left_nav = {};
GUI_FrameWork.prototype.Screens = {};
GUI_FrameWork.prototype.playSFX = function(sfxID)
{
var Audio = window.external.GameInterface.AudioInterface;
switch (sfxID)
{
case 0:
case "transition":
Audio.PlayTransitionSFX();
break;
case 1:
case "toggleBtn":
Audio.PlayToggleSFX();
break;
case 2:
case "ok":
Audio.PlayAcceptSFX();
break;
case 3:
case "tabClick":
Audio.PlayTabSelectSFX();
break;
case 4:
case "gridClick":
Audio.PlayGridSelectSFX();
break;
case 5:
case "alert":
Audio.PlayWarningSFX();
break;
case 6:
case "navHover":
Audio.PlayNavRolloverSFX();
break;
case 7:
case "menuOn":
Audio.PlayMenuOpenSFX();
break;
case 8:
case "menuOff":
Audio.PlayMenuCloseSFX();
break;
case 9:
case "menuHover":
Audio.PlayMenuHoverSFX();
break;
case 10:
case "scrollBtn":
Audio.PlayScrollButtonSFX();
break;
case 11:
case "scroll":
Audio.PlayScrollSFX();
break;
case 12:
case "dropdownOpen":
Audio.PlayDropListOpenSFX();
break;
case 13:
case "dropdownClose":
Audio.PlayDropListCloseSFX();
break;
case 14:
case "joinGame":
Audio.PlayJoinGameSFX();
break;
case 15:
case "playMatchupGame":
Audio.PlayCreatedGameSFX();
break;
case 16:
case "newMessage":
Audio.PlayNewChatMessageSFX();
break;
case 17:
case "messageSent":
Audio.PlayMessageSentSFX();
break;
case 18:
case "messageWindow":
Audio.PlayMessageWindowOpenSFX();
break;
case 19:
case "addBuddy":
Audio.PlayNewBuddyItemSFX();
break;
case 20:
case "deleteBuddy":
Audio.PlayDeleteBuddyItemSFX();
break;
case 21:
case "messageWaiting":
Audio.PlayMessageWaitingSFX();
break;
case 22:
case "buyCards":
Audio.PlayBuyCardsSFX();
break;
case 23:
case "sellCards":
Audio.PlaySellCardsSFX();
break;
case 24:
case "flipCard":
Audio.PlayFlipCardSFX();
break;
case 25:
case "login":
Audio.PlayEASOLoginSFX();
break;
case 26:
case "type":
Audio.PlayTypingSFX();
break;
};
sfxID = Audio = null;
};
GUI_FrameWork.prototype.getActiveLanguage = function()
{
var aLanguage = new Array("English", "SWED", "GER", "FINN", "FR");
return aLanguage[window.external.GameInterface.ActiveLanguage];
}
GUI_FrameWork.prototype.setTitleMovie = function(src)
{
top.document.all.flashTitleMovie.style.visibility = "hidden";
if (src != "none")
{
top.document.all.flashTitleMovie.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="548" height="59">' +
'<param name=movie value="../../nhl/images2/flash/' + System.GUI.getActiveLanguage() + '/' + src + '">' +
'<PARAM NAME=menu VALUE=false>' +
'<PARAM NAME=wmode VALUE=transparent>' +
'</object>';
top.document.all.flashTitleMovie.style.visibility = "visible";
}
src = null;
};
GUI_FrameWork.prototype.hideTitleMovie = function()
{
top.document.all.flashTitleMovie.style.visibility = "hidden";
/*
top.document.all.flashTitleMovie.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="548" height="59">' +
'<param name=movie value="../../nhl/images2/flash/English/' + src + '">' +
'<PARAM NAME=menu VALUE=false>' +
'<PARAM NAME=wmode VALUE=transparent>' +
'</object>';
top.document.all.flashTitleMovie.style.visibility = "visible";
src = null;
*/
};
GUI_FrameWork.prototype.setTeamSkin = function(teamId, bMainMenu)
{
this.teamId = teamId;
this.applyTeamSkin(bMainMenu);
};
GUI_FrameWork.prototype.applyTeamSkin = function(bMainMenu)
{
if (bMainMenu)
this.setBackground("fe/NHL/images2/backgrounds/" + this.teamId + "/main_menu_background_right.jpg");
else
this.setBackground("fe/NHL/images2/backgrounds/" + this.teamId + "/background_right.jpg");
this.setLeftNavBackground("fe/NHL/images2/backgrounds/" + this.teamId + "/background_left.jpg");
top.document.all.bg_left_curve.src = System.getInstallFolder() + "fe/NHL/images2/backgrounds/" + this.teamId + "/main_menu_background_left.jpg";
this.setTickerBackground("fe/NHL/images2/common/" + this.teamId + "/ticker.gif");
top.document.all.divDialogHeader.src = System.getInstallFolder() + "fe/NHL/images2/common/" + this.teamId + "/1x1_subhead.gif";
//top.document.all.left_nav_back.src = System.getInstallFolder() + "fe/NHL/images2/common/" + this.teamId + "/1x1_subhead.gif";
System.GUI.Screens["1"] = new Screen_Hash("1", "fe/NHL/html/offline_home.html", "", "", "", "fe/NHL/images2/backgrounds/" + System.GUI.getTeamSkin() + "/main_menu_background_right.jpg", false);
};
GUI_FrameWork.prototype.getTeamSkin = function()
{
return this.teamId;
};
GUI_FrameWork.prototype.setBackground = function(src)
{
top.document.all.screen_bg.src = top.document.all.slide_trans_img.src = System.getInstallFolder(true) + src;
src = null;
};
GUI_FrameWork.prototype.setLeftNavBackground = function(src)
{
top.document.all.bg_left_curve2.src = System.getInstallFolder() + src;
src = null;
};
GUI_FrameWork.prototype.setTickerBackground = function(src)
{
top.document.all.ticker.src = System.getInstallFolder() + src;
src = null;
}
GUI_FrameWork.prototype.setLeftNav = function(leftNavObjName, leftNavArrayName)
{
if (top[leftNavObjName] && top[leftNavObjName][leftNavArrayName]) {
top.document.all.left_nav.load(top[leftNavObjName], leftNavArrayName);
};
};
GUI_FrameWork.prototype.setLocation = function(src)
{
this.isNavigatingProp = true;
if ( __navigatecapturetimer__ != 0) {
clearInterval(__navigatecapturetimer__);
};
//__navigatecapturetimer__ = setInterval(__checkNavTime__, 100);
//__navigatecapture__ = true;
//top.document.all.divDialogBox.setCapture(true);
this.currentScreenObj = null;
top.document.all.Editorial_Frame.src = System.getInstallFolder(true) + src;
src = null;
};
GUI_FrameWork.prototype.playTransition = function(bForward, bPlayLeftNav, onStopHandler)
{
if (top.document.all.slide_trans_img) {
top.document.all.slide_trans_img.style.visibility = "visible";
window.external.PumpMessages();
};
if (onStopHandler) {
onStopHandler();
};
bForward = bPlayLeftNav = onStopHandler = null;
};
GUI_FrameWork.prototype.setTitle = function(txt)
{
top.document.all.screen_title_txt.value = txt;
txt = null;
};
GUI_FrameWork.prototype.setLeftNavSelection = function(newNavID)
{
top.document.all.left_nav.setSelectedItem(newNavID);
if (this.Screens[newNavID + ""]) {
this.currentScreenObj = this.Screens[newNavID + ""];
};
newNavID = null;
};
GUI_FrameWork.prototype.editLeftNavItem = function(oldNavID, newNavID, newText)
{
top.document.all.left_nav.editItem(oldNavID, newNavID, newText);
oldNavID = newNavID = newText = null;
};
GUI_FrameWork.prototype.clearLeftNav = function() { top.document.all.left_nav.clear(); };
GUI_FrameWork.prototype.getCurrentScreen = function() { return this.currentScreenObj; };
GUI_FrameWork.prototype.isNavigating = function() { return this.isNavigatingProp; };
GUI_FrameWork.prototype.setChyronInfo = function(bandName, songName, albumName)
{
function doSetInfo(bandName, songName, albumName)
{
top.document.all.juke_song_title.innerText = songName;
top.document.all.juke_song_artist.innerText = bandName;
top.document.all.juke_song_album.innerText = albumName;
//System.GUI.showChyron();
//setTimeout(function() { System.GUI._tabSwitch(); }, 4000);
//bandName = songName = albumName = null;
};
if (!System.GUI.isNavigating()) {
setTimeout(function() { doSetInfo(bandName, songName, albumName); bandName=songName=albumName=null; }, 55);
} else {
setTimeout(function() { doSetInfo(bandName, songName, albumName); bandName=songName=albumName=null; }, 1000);
};
};
GUI_FrameWork.prototype._tabSwitch = function()
{
if (System.Session.getProfile()) {
if (top.document.all.chryonRect.style.visibility != "hidden") {
System.GUI.showBuddyList();
};
};
};
GUI_FrameWork.prototype.showChyron = function()
{
System.GUI.playSFX(3);
top.document.all.blTabs.src ='../images/framework/chyron_on_tab.jpg';
top.document.all.chryonRect.style.visibility="visible";
top.hideAllBuddyContextMenus();
};
GUI_FrameWork.prototype.showBuddyList = function()
{
System.GUI.playSFX(3);
top.document.all.blTabs.src ='../images/framework/buddy_on_tab.jpg';
top.document.all.chryonRect.style.visibility="hidden";
};
GUI_FrameWork.prototype.findMember = function()
{
if (!System.GUI.isNavigating()) {
if (System.Session.getProfile()) {
if (this.dialog.document_src != "fe/sc/html/find_member.html") {
this.dialog.document_src = "fe/sc/html/find_member.html";
};
this.dialog.setSize(520, 400);
this.dialog.show();
} else {
this.showMenuDetour();
};
};
};
GUI_FrameWork.prototype.showErrorDialog = function(msg, width, height, fOnOk)
{
if (!width) width = 340 ;
if (!height) height = 147 ;
this.dialog.innerHTML = msg;
this.dialog.addButton("okBtn", scMsg("SC_OK", true), fOnOk);
this.dialog.setSize(width, height);
this.dialog.show();
msg = null;
};
GUI_FrameWork.prototype.onLoginFromDetour = null;
GUI_FrameWork.prototype.showMenuDetour = function(fOnSignIn)
{
this.dialog.document_src ="fe/sc/html/menu_detour.html";
this.dialog.addButton("closeBtn", scMsg("SC_CLOSE", true), function() { System.GUI.onLoginFromDetour = null; });
System.GUI.dialog.setSize(520, 396);
this.onLoginFromDetour = (fOnSignIn) ? fOnSignIn : null;
this.dialog.show();
};
GUI_FrameWork.prototype.showHelpDialog = function()
{
this.dialog.document_src = "fe/sc/html/easo_help.html";
this.dialog.addButton("closeBtn", scMsg("SC_CLOSE", true));
System.GUI.dialog.setSize(630, 480);
this.dialog.show();
};
GUI_FrameWork.prototype.setToolTip = function(sText)
{
top.document.all.helpText.value = " " + sText;
sText = null;
};
GUI_FrameWork.prototype.navigate = function(screenID)
{
if (__navigatecapturetimer__ != 0) { return false; };
if (!this.isNavigatingProp) {
this.isNavigatingProp = true;
//__navigatecapture__ = true;
//__navigatecapturetimer__ = setInterval(__checkNavTime__, 100);
try {
top.document.all.scrollstopper.focus();
} catch (e) {};
var contentWindow = top.document.frames["Editorial_Frame"];
var contentFrame = top.document.all["Editorial_Frame"];
var installFolder = System.getInstallFolder(true);
var screenObj = null;
var canNavigate = true;
if (this.Screens[screenID]) {
screenObj = this.Screens[screenID];
} else {
canNavigate = false;
this.isNavigatingProp = false;
};
if (canNavigate) {
if (screenObj.getScreenSrc() == "HELP" || screenObj.getScreenSrc() == "PRIZES" || screenObj.getScreenSrc() == "SUBSCRIBE") {
canNavigate = false;
this.isNavigatingProp = false;
screenObj["navigationCallback"](screenID);
return canNavigate;
};
};
if (canNavigate) {
if (this.currentScreenObj) {
if (this.currentScreenObj.getScreenSrc() == screenObj.getScreenSrc()) {
if (this.currentScreenObj.getLeftNavArrayName() == screenObj.getLeftNavArrayName()) {
canNavigate =false;
this.isNavigatingProp = false;
} else {
canNavigate = true;
this.isNavigatingProp = true;
};
} else {
canNavigate = true;
this.isNavigatingProp = true;
};
};
};
if(parseInt(screenID) != 2666) { System.ScratchPad.challengeExitPage = screenID; }
if (canNavigate) {
if (screenObj.requiresLogin() && !System.Session.getUserLKey()) {
this.showMenuDetour(function() { System.GUI.navigate(screenID); });
canNavigate = false;
this.isNavigatingProp = false;
return;
};
if (contentWindow["canExitScreen"]) {
if ("UpdateMusicThread" in window.external.GameInterface.AudioInterface) {
window.external.GameInterface.AudioInterface.UpdateMusicThread();
};
if (contentWindow["canExitScreen"](screenID)) {
if ("UpdateMusicThread" in window.external.GameInterface.AudioInterface) {
window.external.GameInterface.AudioInterface.UpdateMusicThread();
};
if (parseInt(screenID) < 1000 || parseInt(screenID) == 2666) {
//window.external.GameInterface.RestoreGameState();
this.nowBtns.hide();
};
if (this.Screens[screenID]["navigationCallback"]) {
if (screenObj["navigationCallback"](screenID)) {
canNavigate = true;
this.isNavigatingProp = true;
} else {
canNavigate = false;
this.isNavigatingProp = false;
};
} else {
canNavigate = true;
this.isNavigatingProp = true;
};
} else {
canNavigate = false;
this.isNavigatingProp = false;
};
} else {
if (parseInt(screenID) < 1000 || parseInt(screenID) == 2666) {
//window.external.GameInterface.RestoreGameState();
this.nowBtns.hide();
};
if (screenObj["navigationCallback"]) {
if (screenObj["navigationCallback"](screenID)) {
canNavigate = true;
this.isNavigatingProp = true;
} else {
canNavigate = false
this.isNavigatingProp = false;
};
} else {
canNavigate = true;
this.isNavigatingProp = true;
};
};
};
if (canNavigate) {
this.currentScreenObj = screenObj;
//this is where i determine which left nav art to show as well...
if (parseInt(screenID) < 1000)
{
top.document.all.left_nav.clear();
//if (screenID == 1)
//{
// gui_ShowLeftNavMenuArt();
//}
//else
//{
gui_ShowLeftNavArt();
//}
}
else
{
gui_ShowLeftNavArt();
}
System.GUI.setTitle("");
function ReallyDoNavigate() {
if (top.document.all.slide_trans_img) {
top.document.all.slide_trans_img.style.visibility = "visible";
window.external.PumpMessages();
};
contentWindow.document.location.href= installFolder + screenObj.getScreenSrc();
if (screenObj.getLeftNavObjectName() && screenObj.getLeftNavArrayName()) {
top.document.all.left_nav.load(top[screenObj.getLeftNavObjectName()], screenObj.getLeftNavArrayName());
};
if (screenObj.getTitle() && screenObj.getTitle() != top.document.all.screen_title_txt.innerText) {
top.document.all.screen_title_txt.value = screenObj.getTitle();
System.GUI.setTitleMovie(screenObj.getTitle());
};
if (screenObj.getBackgroundSrc()) {
top.document.all.screen_bg.src = installFolder + screenObj.getBackgroundSrc();
};
contentWindow = installFolder = screenObj = canNavigate = screenID = null;
};
if (System.GUI.navTimerID == 0) {
System.GUI.navTimerID = setTimeout(function() { ReallyDoNavigate(); }, 110);
};
//alert('play sound 1');
System.GUI.playSFX(0);
} else {
this.isNavigationProp = false;
};
};
return canNavigate;
};
GUI_FrameWork.prototype.OnMainLoad = function()
{
var bLoadingFromBrowserState = false;
var loginCookie = null;
top.document.body.style.visibility = "visible";
GUI_FrameWork.prototype.left_nav = top.document.all.left_nav;
GUI_FrameWork.prototype.profile_viewer = top.document.all.profile_viewer;
GUI_FrameWork.prototype.dialog = top.document.all.sys_dialog;
GUI_FrameWork.prototype.commandBar = new TopMenuBar();
GUI_FrameWork.prototype.commandBar.loadMenu(top_menu_arrays, "menu_1", "menu_1_toggler");
GUI_FrameWork.prototype.commandBar.loadMenu(top_menu_arrays, "menu_2", "menu_2_toggler");
GUI_FrameWork.prototype.commandBar.loadMenu(top_menu_arrays, "menu_3", "menu_3_toggler");
GUI_FrameWork.prototype.commandBar.showMyClub = function()
{
top.document.all.menu_2_btn_4.style.display = "";
top.document.all.menu_2_bg.style.pixelHeight = top.document.all.menu_2.offsetHeight - (parseInt(top.document.all.menu_2.style.borderWidth) * 2);
};
GUI_FrameWork.prototype.commandBar.hideMyClub = function()
{
top.document.all.menu_2_btn_4.style.display = "none";
top.document.all.menu_2_bg.style.pixelHeight = top.document.all.menu_2.offsetHeight - (parseInt(top.document.all.menu_2.style.borderWidth) * 2);
};
GUI_FrameWork.prototype.handleError = System.handleError;
System.GUI.commandBar.hideMyClub();
gui_LoadBrowserState(); //do this first so that state gets loaded for the league check
try {
var postGameLeague = System.Session.getPostGameLeague();
var oGameFace = window.external.GameInterface;
if (postGameLeague) {
oGameFace.LeagueServerInterface.LoadLeagueInternal(postGameLeague.leagueType,postGameLeague.leagueID);
oGameFace.ExecutorServerInterface.LoadExecutorInternal(0);
oGameFace.LeagueServerInterface.LeagueDispatch.ManagerInterface.ReportGame(oGameFace.ExecutorServerInterface.ExecutorDispatch.GameStatInterface);
};
} catch (e) {
System.handleError(e.description);
};
try {
if (System.Session.getPostGameNavigation()) {
if (gui_IsPostGameNavToOnline(System.Session.getPostGameNavigation())) {
if (gui_LoadBrowserState()) {
gui_LoadUserProfile(true); //there is a post game nav and it requires login
} else {
//there is a post game nav, it requires online, but no login info was set
//TODO ERROR Condition error, should I load a different league if Login was required for nav?
System.GUI.navigate("1");
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
} else if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
top.document.frames['Editorial_Frame'].hideLoginInfo();
};
};
} else {
if (gui_LoadBrowserState()) {
gui_LoadUserProfile(true); //there is a post game nav and it does not require login
};
};
} else {
if (gui_LoadBrowserState()) {
gui_LoadUserProfile(false); //no post game nav but login info exists
} else {
if (gui_LoadLoginCookie()) {
gui_AutoLogin();
} else {
//TODO absolutely nothing set, so go to main, should I clear the league just in case?
System.GUI.navigate("1");
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
} else if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
top.document.frames['Editorial_Frame'].hideLoginInfo();
};
};
};
};
System.GUI.ticker.loadFromServer();
System.GUI.isLoaded = true;
window.external.GameInterface.MainLoaded();
} catch (e) {
window.external.GameInterface.MainLoaded();
System.GUI.navigate("1");
System.GUI.isLoaded = true;
};
};
GUI_FrameWork.prototype.OnContentWindowLoad = function()
{
top.document.frames["Editorial_Frame"].document.body.style.backgroundColor = "transparent";
top.document.frames["Editorial_Frame"].document.body.style.backgroundImage = "url(" + System.getInstallFolder(true) + "fe/common/images/framework/transparent.gif)";
top.document.frames["Editorial_Frame"].document.body.style.zIndex = -1;
if (top.document.all.slide_trans_img) {
top.document.all.slide_trans_img.style.visibility = "hidden";
setTimeout("CollectGarbage()", 1);
};
if (System.Session.getProfile()) {
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
};
} else {
if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
top.document.frames['Editorial_Frame'].hideLoginInfo();
};
};
System.GUI.playSFX(0);
System.GUI.isNavigatingProp = false;
System.GUI.navTimerID = 0;
};
function gui_LoadPostGameNavigation()
{
return System.Session.getPostGameNavigation();
};
function gui_IsPostGameNavToOnline(screenID)
{
if (System.GUI.Screens[screenID]) {
return System.GUI.Screens[screenID].requiresLogin();
};
return false;
};
function gui_LoadBrowserState()
{
return System.Session.loadState();
};
var gui_MyUserProfile, bNavToPostGameScreen, bPostGameNavNeedsLogin;
function gui_OnStartupProfileLoadingCancel()
{
//TODO ERROR Condition error, should I load a different league if Login was required for nav? --profile loading was cancelled
//No alan says it will be fine
if (bNavToPostGameScreen) {
if (bPostGameNavNeedsLogin) {
System.GUI.navigate("1");
} else {
System.GUI.navigate(System.Session.getPostGameNavigation());
};
} else {
System.GUI.navigate("1");
};
System.GUI.loadingDialog.hide();
return false;
};
function gui_LoadUserProfile(bNavToPostGame)
{
gui_MyUserProfile = new User_Profile();
//System.GUI.loadingDialog.setText(scMsg("SC_RETRIEVING_PROFILE"));
//System.GUI.loadingDialog.show();
bPostGameNavNeedsLogin = (gui_IsPostGameNavToOnline(System.Session.getPostGameNavigation()));
bNavToPostGameScreen = (bNavToPostGame) ? true : false;
if (System.Session.getUserName()) {
gblRRManager.onCancel = gui_OnStartupProfileLoadingCancel;
gui_MyUserProfile.load(System.Session.getUserName(), null, gui_OnUserProfileLoaded);
} else {
//TODO ERROR Condition error, should I load a different league if Login was required for nav? -- loading profile failed
if (bPostGameNavNeedsLogin) {
System.GUI.navigate("1");
} else {
System.GUI.navigate(System.Session.getPostGameNavigation());
};
System.GUI.loadingDialog.hide();
};
};
function gui_OnUserProfileLoaded(bLoaded)
{
if (bLoaded) {
System.Session.setProfile(gui_MyUserProfile);
System.GUI.profile_viewer.setLoginInfo(System.Session.getUserName(), System.Session.getPassword());
System.GUI.profile_viewer.loadProfile(gui_MyUserProfile);
window.external.PumpMessages();
bl_connect();
if (System.Session.getProfile().getClubID()) {
System.GUI.commandBar.showMyClub();
};
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
};
System.GUI.showBuddyList();
System.Session.onlogin = null;
top.document.all.btn_logout.style.visibility = 'visible';
if (bNavToPostGameScreen) {
System.GUI.navigate(System.Session.getPostGameNavigation());
} else {
System.GUI.navigate("1");
};
System.GUI.loadingDialog.hide();
} else {
//TODO ERROR Condition error, should I load a different league if Login was required for nav?--loading profile failed
//NO according to a
if (bNavToPostGameScreen) {
if (bPostGameNavNeedsLogin) {
System.GUI.navigate("1");
} else {
System.GUI.navigate(System.Session.getPostGameNavigation());
};
} else {
System.GUI.navigate("1");
};
System.GUI.loadingDialog.hide();
};
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
} else if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
top.document.frames['Editorial_Frame'].hideLoginInfo();
};
System.GUI.loadingDialog.hide();
};
function gui_LoadLoginCookie()
{
loginCookie = System.Session.getLoginCookie();
if (loginCookie) {
return true;
} else {
return false;
};
};
function gui_AutoLogin()
{
var loginCookie = System.Session.getLoginCookie();
System.GUI.profile_viewer.setLoginInfo(loginCookie.userName, loginCookie.passWord);
//login will handle it self if there is a cancel or error
System.Session.onlogin = gui_OnAutoLoginComplete;
System.Session.login(loginCookie.userName, loginCookie.passWord);
};
function gui_OnAutoLoginComplete(bool)
{
if (!bool) {
//Error on login, handle error will still fire
System.GUI.navigate("1");
System.Session.onlogin = null;
};
if (System.Session.getProfile()) {
if (System.Session.getProfile().getClubID()) {
System.GUI.commandBar.showMyClub();
} else {
System.GUI.commandBar.hideMyClub();
};
System.GUI.loadingDialog.hide();
System.GUI.navigate("1");
} else {
System.GUI.navigate("1");
};
if (top.document.frames['Editorial_Frame'].showLoginInfo) {
top.document.frames['Editorial_Frame'].showLoginInfo();
} else if (top.document.frames['Editorial_Frame'].hideLoginInfo) {
top.document.frames['Editorial_Frame'].hideLoginInfo();
};
};
var __navigatecapturetimer__ = 0;
var __navigatecapture__ = false;
function __checkNavTime__()
{
//if (__navigatecapturetimer__ != 0 && __navigatecapture__)
//{
// if (top.document.frames["Editorial_Frame"].document.readyState == "complete")
// {
// clearInterval(__navigatecapturetimer__);
// __navigatecapturetimer__ = 0;
// __navigatecapture__ = false;
// top.document.releaseCapture(true);
// };
//};
};
function gui_ShowLeftNavMenuArt()
{
top.document.all.top_left_logo2.src="../../nhl/images2/screen_images/mainmenu_topleft.gif";
top.document.all.top_left_logo.src="../../nhl/images2/common/1x1_transparent.gif";
//top.document.all.menu_2.offsetHeight
img_sport_logo.style.top = "80px";
img_sport_logo.style.left = "30px";
bg_left_curve.style.visibility = "visible";
bg_left_curve2.style.visibility = "hidden";
left_nav_items.style.visibility = "hidden";
}
function gui_ShowLeftNavArt()
{
top.document.all.top_left_logo2.src="../../nhl/images2/common/nhl2004_logo.gif";
top.document.all.top_left_logo.src="../../nhl/images2/common/logo_idle.gif";
img_sport_logo.style.top = "-100px";
img_sport_logo.style.left = "-100px";
bg_left_curve.style.visibility = "hidden";
bg_left_curve2.style.visibility = "visible";
left_nav_items.style.visibility = "visible";
}