// Name of first box on page
nextWords = "keywords";
netscape = "";
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");

// Handles keypress 
function keyDown(DnEvents) {
	k = (netscape) ? DnEvents.which : window.event.keyCode;
	if (k == 13) { // Enter key pressed
		eval('document.doKeywords.' + nextWords + '.focus()'); 
	return true; // Submit query
   	}	
}

// Work together to analyze keystrokes
document.onkeydown = keyDown;
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);

// End of Hit Enter submit query


// Image Pop Window
function PopUp(ImagePath,ImageWidth,ImageHeight,ImageTitle) {

  	var win = window.open('','','toolbar=no,location=no,directories=no,status=no,scrollbars=auto,resizable=no,copyhistory=no,' + 'width=' + ImageWidth + '' + ',height=' + ImageHeight + '');
	Interface = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'TITLE' + '>大燈文化 - ' + ImageTitle + '</' + 'TITLE' + '>';
	Interface += '</' + 'HEAD' + '><' + 'BODY BGCOLOR="#CC6600" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">';
	Interface += '<IMG SRC="' + ImagePath + '" WIDTH="' + ImageWidth + '" HEIGHT="' + ImageHeight + '" GALLERYIMG="no">';
	Interface += '</' + 'BODY' + '></' + 'HTML' + '>';
	win.document.write(Interface);
	win.focus();
	win.document.close();
	return false;
}
// End of Pop Window


// Text Pop Window
function showNews(Title,News,scrnWidth,scrnHeight) {

  	var win = window.open('','','toolbar=no,location=no,directories=no,status=no,scrollbars=auto,resizable=yes,copyhistory=no,' + 'width=' + scrnWidth + '' + ',height=' + scrnHeight + '');
	Txt = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'TITLE' + '>大燈文化 - ' + Title + '</' + 'TITLE' + '>';
	Txt += '</' + 'HEAD' + '><' + 'BODY BGCOLOR="#EEEEBB">';
	Txt += '<TABLE WIDTH="100%" BORDER="0">';
  	Txt += '<TR>';
	Txt += '	<TD VALIGN="TOP"><IMG SRC="/learning/_gadget/icon_flora.gif" HSPACE="10"></TD>';
	Txt += '	<TD>' + News +'</TD>';
	Txt += '</TR></TABLE>';
	Txt += '</' + 'BODY' + '></' + 'HTML' + '>';
	win.document.write(Txt);
	win.focus();
	win.document.close();
	return false;
}
// End of Pop Window
