/********************************************************************** 	
	The Alberta Library Online
	$Id: popupextservices.js,v 1.8 2005/10/12 17:18:24 pcharoen Exp $ 
   	External JavaScript file used to launch popup browser windows for
   	links within the extended services table; the two types of links are
   	the following:
		a) extended services links to resources outside SiteSearch 
           -- e.g., book search, music search, etc.
		b) "Explain" links within SiteSearch -- i.e., information
           about the various extended services links.
**********************************************************************/

// variables for old browser workaround routines
var name = navigator.appName;
var version = navigator.appVersion;
version = version.substring(0, 1);
var msie = "Microsoft Internet Explorer";
var netscape = "Netscape";
var workaround;
// variable for "searching Project Gutenberg" popup window
var pgWin;
// function to launch popup browser window for extended services links

function popUpResource() {
   if(name == msie && version <= 3) workaround = msie;
   else if(window.open)
   var newWinResource = window.open("", "resource", "width=800,height=500,top=30,left=30,status=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes");
}
// function to launch popup browser window for the All Music Guide extended
// services link (this popup browser window is wider than the "resource" popup)

function popUpAllMusic() {
   if(name == msie && version <= 3) workaround = msie;
   else if(window.open)
   var newWinAllMusic = window.open("", "allmusic", "width=865,height=500,top=30,left=30,status=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes");
}
// code to launch popup browser window for extended service to search
// the Project Gutenberg catalogue; popup informs user that they
// are searching the Project Gutenberg catalogue of public domain
// electronic texts, and popup closes when the Project Gutenberg
// page has finished loading in the parent window
// function to open "searching Project Gutenberg" popup browser window

function popUpGutenberg() {
   if(name == msie && version <= 3) workaround = msie;
   else if(window.open) pgWin = window.open("", "pgWin", "width=510,height=195,top=250,left=250,dependent");
   if(pgWin.opener == null) pgWin.opener = self;
   pgWin.focus();
   with(pgWin.document) {
      write('<HTML>');
      write('<HEAD><TITLE>Searching the Project Gutenberg catalogue...</TITLE>');
      write('</HEAD>');
      write('<BODY BGCOLOR="#C0C0C0">');
      write('<CENTER>');
      write('<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=5>');
      write('<TR>');
      write('<TD BGCOLOR="#FFFFFF" ALIGN=CENTER VALIGN=TOP>');
      write('<IMG SRC="../images/PROJECTGUTENBERG.jpg" WIDTH="468" HEIGHT="60" ALT="">');
      write('<BR><FONT SIZE=4 COLOR="red" FACE="Bookman Old Style">');
      write('You are now using the "<I>Project Gutenberg</I> Search<BR>');
      write('Engine" to search the <I>Project Gutenberg</I> catalogue<BR>');
      write('of public domain electronic texts<BR>');
      write('-- please be patient...');
      write('</FONT>');
      write('</TD>');
      write('</TR>');
      write('</TABLE>');
      write('</CENTER>');
      write('</BODY>');
      write('</HTML>');
   }
   pgWin.document.close();
}
// function to close the "searching Project Gutenberg" popup browser window

function closeGutenberg() {
   if(pgWin && !pgWin.closed) pgWin.close();
}
// function to launch popup browser windows to explain the various extended
// services resources

function popUpExplain(file) {
   if(window.open)
   var newWinExplain = window.open('/WebZ/extendedservices/' + file, 'explain', 'width=400,height=400,resizable =1,scrollbars=1,menubar=0,top=75,left=150');
   if(newWinExplain && !newWinExplain.closed) newWinExplain.focus();
}

// Explanation overLIB popup library function
// Parameter:
// 		width: Explanation popup width
// 		title: Explanation popup title 
// 		func: JavaScript function for explanation html
// Return:
// 		explanation anchor
// Ex: 
// 		overlibExplain(280, "Select A Library Catalogue", "search_form_working_explain_html()");
function overlibExplain(width, title, func) {
	//var ovPopup = "return overlib(" + func + ", WIDTH, " + width + ", HAUTO, CLOSEFONTCLASS, 'closefontClass', BGCOLOR, '#e5b76d',FGCOLOR, '#FFFFE0', CAPTION, '" + title + "', CAPTIONFONTCLASS, 'capfontClass', AUTOSTATUSCAP);";
	var ovStick = "return overlib(" + func + ", STICKY, CLOSECLICK, WIDTH, " + width + ", HAUTO, CLOSETEXT, '[Close]', CLOSEFONTCLASS, 'closefontClass', BGCOLOR, '#e5b76d',FGCOLOR, '#FFFFE0', CAPTION, '" + title + "', CAPTIONFONTCLASS, 'capfontClass', AUTOSTATUSCAP);";
	//var explain = '<a class="explain" href="javascript:void(0);" onmouseover="' + ovPopup + '" onclick="' + ovStick + '" onmouseout="nd();">[Explain]</a>';
	var explain = '<a class="explain" href="javascript:void(0);" onclick="' + ovStick + '" onmouseout="nd();">[Explain]</a>';
	return explain;
}

function overlibExtServicesExplain(width, title, func) {
	var ovStick = "return overlib(" + func + ", STICKY, CENTERPOPUP, CLOSECLICK, WIDTH, " + width + ", HAUTO, CLOSETEXT, '[Close]', CLOSEFONTCLASS, 'closefontClass', BGCOLOR, '#e5b76d',FGCOLOR, '#FFFFE0', CAPTION, '" + title + "', CAPTIONFONTCLASS, 'capfontClass', AUTOSTATUSCAP);";
	var explain = '<a class="explain" href="javascript:void(0);" onclick="' + ovStick + '" onmouseout="nd();">[Explain]</a>';
	return explain;
}

function getDisclaimerMessage() {
	return '<hr><p><b>Disclaimer and Limitation of Liability</b></p><p>Hypertext linkage to external database resources on the TAL Online Web site does not constitute endorsement by The Alberta Library (TAL) of the content found, nor of any products and services offered, on these Web sites, nor does The Alberta Library have any commercial arrangements with these external information content providers. 	Furthermore, the quality and accuracy of the information contained in 	these Web sites is the responsibility of the content providers, not of 	The Alberta Library.  Finally, The Alberta Library will under no 	circumstances be liable for any legal claims or copyright infringements that may arise from linking to these Web sites.</p>';
}

