//scripts for creating and manipulating information windows
var jsSt='<script type="text/javascript">';
var jsFin='</script>';

var swapID;
var swapMax;
var swapIndex;
var swapText  = new Array();
var swapDelay = new Array();

//Following strings are used in writing the popups

var primeCl=jsSt+'function primeClose() {document.getElementById("popcloser").focus()}'+jsFin;

var setSize=jsSt + 'window.resizeTo(440,520)' + jsFin;

var swaplogic=jsSt+'\
var swapID;\
var swapMax;\
var swapIndex;\
var swapText  = new Array();\
var swapDelay = new Array();\
var newText;\
function timedSwap() {\
dothis=\'document.getElementById(swapID).innerHTML=swapText[swapIndex];setTimeout("timedSwap()")\';\
setTimeout(dothis,swapDelay[swapIndex]); \
swapIndex=swapIndex+1;\
if (swapIndex>swapMax) {swapIndex=1};\
}'+jsFin;


//Dynamic popup creation
function infbox2(msghead)
{
msg=window.open("information.htm", "_blank", "top=5, left=5, width=440, height=520, "
+ "toolbar=no, directories=no, status=yes, menubar=no, scrollbars=no, "
+ "resizable=yes, copyhistory=no");
msg.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">');
msg.document.write('<html><head><title>Information requested</title>');
msg.document.write('<link rel=stylesheet href="oakwood1.css" type="text/css">');
msg.document.write(primeCl + swaplogic);
msg.document.write('</head><body class=infpop onload="primeClose()">' + setSize);

msg.document.write(jsSt + 'swapID = window.opener.swapID;'
+ 'swapMax = window.opener.swapMax;swapIndex=window.opener.swapIndex;'
+ 'swapText = window.opener.swapText;swapDelay = window.opener.swapDelay;' + jsFin);
msg.document.write('<table><tr><td class=infpopbut>');
msg.document.write('<form><input class=infpopclose '
+ 'type="button" id="popcloser" value="Close" '
+ 'onBlur="window.close()" onClick="window.close()"></form>');
msg.document.write('</td></tr><tr><td class=infpopmain>');
msg.document.write('<h2 class=infpopHead>'+msghead+'</h2>');
msg.document.write('<div id=swapme>'+swapText[0]+'</div></td></tr></table>');
msg.document.write(jsSt + 'timedSwap()' + jsFin + '</body></html>');
msg.document.close();
}

//Normal (static) popup creation
function infbox(msghead,msgtext)
{
msg=window.open("information.htm", "_blank", "top=5, left=5, width=440, height=520, toolbar=no, directories=no, status=no, menubar=no, location=no, scrollbars=no, resizable=yes, copyhistory=no");
msg.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">');
msg.document.write('<html><head><title>Information requested</title>');

msg.document.write('<link rel=stylesheet href="oakwood1.css" type="text/css">');
msg.document.write(primeCl);
msg.document.write('</head><body class=infpop onload="primeClose()">' + setSize);    ///
msg.document.write('<table><tr><td class=infpopbut>');
msg.document.write('<form><input class=infpopclose '      ////
+ 'type="button" id="popcloser" value="Close" '
+ 'onBlur="window.close()" onClick="window.close()"></form>');
msg.document.write('</td></tr><tr><td class=infpopmain>');
msg.document.write('<h2 class=infpopHead>'+msghead+'</h2>');
msg.document.write(msgtext + '</td></tr></table></body></html>');

msg.document.close();
}
