// Scripts for default page

if (top.location != self.location) {
	top.location = self.location;
}

// to set the default location of cursor in the Username field.
function usernameFocus() {
	document.frmLogin.Username.focus();
}

// the following code prevents opening multiple windows at a time
var SIZE = 7
var WindowisOpen = new Array(SIZE)	//to indicate which window is open
var Windows = new Array(SIZE)	//to store window object
var siteAdd = new Array(SIZE)	//store website address		
	
//website address to be displayed
siteAdd[0]="general/register.asp"
siteAdd[1]="general/about_ieb.asp"
//siteAdd[1]="general/about_iie.asp"
siteAdd[2]="general/unit_summary.asp"
siteAdd[3]="placement_test/test_frame.asp"
siteAdd[4]="general/no_credits.asp"
siteAdd[5]="general/unpwd_look.asp"
siteAdd[6]="general/terms.asp"
siteAdd[7]="general/disclaimer.asp"
siteAdd[8]="general/acknowledge.asp"
	
function openWindow(whichWindow,winWidth,winHeight,lang){
	for ( var counter = 0; counter < SIZE; counter++) {
		if (WindowisOpen[counter]) {
			Windows[counter].close()
			WindowisOpen[counter]=0
		}
	}
	
	var winl = (screen.width - winWidth) / 2;
	var wint = (screen.height - winHeight) / 2;
	
	getUrl = siteAdd[whichWindow]
	getUrl = getUrl + "?Lang=" + lang
	
	Windows[whichWindow]=window.open(getUrl,'displaySite','toolbar=no,width=' + winWidth + ',height=' + winHeight + ',status=no,scrollbars=yes,resizable=no,menubar=no,top=' + wint + ',left=' + winl)
		WindowisOpen[whichWindow] = 1
}	

function openPayment() {
	payWindow = openWindow(4,500,500);
	payWindow.focus()
}