// *** VARIABLES *********************************************************/
window.name='BondUniversity';

// compliance test variables
var width;
var height;
var bestfit_width = 720; //980
var bestfit_height = 750; //645
var t = 0;
var l = 0;
// set up width and height for new window
if ((screen.availWidth < bestfit_width) || (screen.availHeight < bestfit_height))
{
	width = screen.availWidth - 5;
	height = screen.availHeight - 60;
}
else
{
	width = bestfit_width;
	height = bestfit_height;
}
if (screen.availWidth > bestfit_width) 
{
    l = (screen.availWidth - bestfit_width) / 2;
}
if (screen.availHeight > bestfit_height) 
{
    t = (screen.availHeight - bestfit_height) / 2;
}

var compFeatures = 'width=' + width + ',height=' + height + ',resizable=0,scrollbars=1,status=1,top=' + t + ',left=' + l;



var cWin = null;

function launchWindow(url)
{
	cWin = window.open(url,'login', compFeatures);
	setTimeout('isWindowOpen()', 700);
}

function isWindowOpen()
{
	if ((cWin == null) || (typeof(cWin) == 'undefined'))
	{
		alert('Your computer has a pop-up blocker which is preventing you from launching the application form.\n\n' +
				'Please disable your popup blocker.');
	}
}


/// -----------------------------------------------------------------------------
/// <procedure>externallinks</procedure>
/// <summary>
/// 	Opens other site links in a new window.
/// </summary>
/// <remarks>
///     If a link starts with http:// it is assumed that its a link to another 
///     site so it will be opened in another window.
/// </remarks>
/// <history>
/// 	[Gavin Bruce] 24/05/2007 Created
/// </history>
/// -----------------------------------------------------------------------------
function externallinks()
{
    var c = document.getElementById('page');
    if(c)
    {
        var ls = c.getElementsByTagName('a');
        for (var i=0; i<ls.length; i++){
            
            if (ls[i].getAttribute('href').toLowerCase().substring(0, 7) == 'http://')
            {
                window.alert(ls[i].getAttribute('href').toLowerCase());
                ls[i].onclick=function(){ 
                    this.title += ' (opens in a new window)';
                    window.open(this.href); 
                    return false 
                }
            }
        }
    }
}

//window.onload=function(){
//    if(!document.getElementById && !document.createTextNode){return;}
//    externallinks();
//}


function help(url) {
    window.open(url,'help', 'width=400,height=500,resizable=0,scrollbars=1,status=1');
}
