var sPath = "/elt/teacher_login/";
var loginWindow;

function openWin(url, w, h, opts) {
    if ((!loginWindow || loginWindow.closed) && window.name != 'eltlogin') { 
	// open new window
	loginWindow = window.open( sPath+url, 'eltlogin', 'width='+w+',height='+h+','+opts);
    } else if (window.name == 'eltlogin') {
	// re-use the current window
	window.resizeTo(w, h);
	window.location.href = sPath + url;
	window.focus();
    } else {
	// re-use the child window
	loginWindow.resizeTo(w, h);
	loginWindow.location.href = sPath + url;
	loginWindow.focus();
    }
}

function login() {
   openWin('login.asp', 480, 510, 'locationbar=no,resizable=yes,scrollbars=yes');
}

function amend() {
    openWin('amendDetails.asp', 600, 720, 'locationbar=no,scrollbars=yes,resizable=yes');
}

function newAccount() {
    openWin('newAccount.asp', 580, 720, 'locationbar=no,resizable=yes,scrollbars=yes');
}


function logout() {
   openWin('logout.asp', 400, 400, 'locationbar=no,resizable=yes');
}

function logSuccess() {
    window.opener.location.reload();
    window.setTimeout('window.close();', 2000);
}

function termsCondition() {
    loginWindow1 = window.open(sPath + 'termsCondition.asp', 'eltlogin_terms', 'width=400,height=460,locationbar=no,resizable=yes');
    loginWindow1.focus();
}

