//
// Functions for opening a pop-up window 
// for displaying course info
//

var remote;

// PopUp a remote URL to describe a course
//
// <a href="javascript:popUpCourseUrl('http://www.connexions.org/', 'Course title')" alt="Alternative names here">
//
function popUpCourseUrl( url, coursename )
{
  if (remote) remote.close();
  remote=open( url, "coursename", 'width=660,height=500,resizable=1,scrollbars=1,status=1' );
  remote.focus();
}

// PopUp some simple text
//
// <a href="javascript:popUpText('some text to display', 'Course title')" alt="Alternative names here">
//
function popUpCourseText(text, coursename) 
{
  if (remote) remote.close();
  
  remote=open('', "coursename", 'width=350,height=250,resizable=1,scrollbars=1');
  remote.document.open('text/html')
  
  remote.document.write('<title>'+coursename+'</title>');
  remote.document.write('<body bgcolor="#ffffff" text="#000000" onLoad="if (window.focus) window.focus()">');
  remote.document.write('<p><font face="verdana,arial" align="justify">');
  remote.document.write( text );
  remote.document.write('</font></p></body>');
  
  remote.focus();
}


// PopUp simple text saying no website
//
// <a href="javascript:popUpNoWebsite()" alt="Alternative text here">
//
function popUpNoWebsite() 
{
  if (remote) remote.close();
  
  remote=open('', 'Nowebsite', 'width=200,height=50,resizable=1,scrollbars=1');
  remote.document.open('text/html')
  
  remote.document.write('<title>No website</title>');
  remote.document.write('<body bgcolor="#ffffff" text="#000000" onLoad="if (window.focus) window.focus()">');
  remote.document.write('<p><font face="verdana,arial" align="center">');
  remote.document.write( '<br>This organisation does not have a website' );
  remote.document.write('</font></p></body>');
  
  remote.focus();
}

// PopUp a remote URL to a provider or other external reference webpage
//
// <a href="javascript:popUpUrl('http://www.bexhillcollege.ac.uk/')" alt="Alternative stuff here">
//
function popUpUrl( url )
{
  if (remote) remote.close();
  remote=open( url, "organisation", 'width=750,height=500,resizable=1,scrollbars=1,status=1' );
  remote.focus();
}

