﻿// JScript File

function setStartPage()
{
	url = document.URL;
	document.all.startpage.setHomePage(url);
}

function addFavorite()
{
	url = document.URL;
	window.external.addfavorite(url,"SuperRTL-Merchandising");
}

function toggleLayer(whichLayer)
{
    if (document.getElementById)
    {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;       
		style2.display = style2.display? "":"block";
    }
    else if (document.all)
    {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
    }
    else if (document.layers)
    {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
    }
}

// Displays/Hides Text in Statusbar
function hidestatus(statusmsg)
{
	window.status = statusmsg;

	return true;
}

function go(url)
{
    var oWin = window.open(url, '_blank');

    if (oWin)
    {
        if (oWin.focus) oWin.focus();
    }
    oWin = null;

	return false;
}

function openTerms(moduleid)
{
	day = new Date();
	id = day.getTime();
	width = 400;
	height = 600;

	if (location.host != "localhost")
	{
		URL = "http://" + location.host + "/DesktopModules/EoaLottery/TermsOfUse.aspx?mid=" + moduleid;
	}
	else
	{
		URL = "http://" + location.host + "/superrtl-md/DesktopModules/EoaLottery/TermsOfUse.aspx?mid=" + moduleid;
	}

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+ width +',height='+ height +',left = 150, top = 150');");
}

function openGame(moduleid)
{
	day = new Date();
	id = day.getTime();
	width = 780;
	height = 590;

	if (location.host != "localhost") {
		URL = "http://" + location.host + "/DesktopModules/EoaLottery/FlashGame.aspx?mid=" + moduleid;
	}
	else {
		URL = "http://" + location.host + "/superrtl-md/DesktopModules/EoaLottery/FlashGame.aspx?mid=" + moduleid;
	}

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+ width +',height='+ height +',left = 100, top = 100');");
}