﻿function getFlashMovie(movieName) // Virker dette i IE8?
{
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}

function CloseWindow()
{
    window.Close();
}

function OpenUniLogin(strUrl)
{
    l = Popup(strUrl, "relogin", 650, 450);
    l.focus();
}

function UniLogin(success)
{
    getFlashMovie('FinancialLiteracy').JsLogin(success);//TBD
}

function Popup(URL, name, w, h)
{
    return window.open(URL, name, "width=" + w + ",height=" + h);
}

function GetPageName()
{
    var file_name = document.location.href;
    var end = (file_name.indexOf(".aspx") == -1) ? file_name.length : file_name.indexOf(".aspx");
    return file_name.substring(file_name.lastIndexOf("/") + 1, end);
}

function openTermsWindow()
{
	var windowWidth = 700;
	var windowHeight = 400;

	var xPos = (window.screen.width / 2) - (windowWidth / 2);
	var yPos = (window.screen.height / 2) - (windowHeight / 2);

	var termsWindow = window.open("Teacher/Terms.aspx", "showTerms", "width=" + windowWidth + ",height=" + windowHeight + ",left=" + xPos + ",top=" + yPos + ",resizable=1,scrollbars=1,status=0,toolbar=0,location=0,menubar=0,directories=0");
	termsWindow.focus();
}