// JavaScript Document
<!--
var name = null;
var file = null;
var winwidth = null;
var winheight = null;
var hwnd = null;

var CRnow = "http://www.fourmilab.to/cgi-bin/uncgi/Solar?date=0&utc=1995%2F03%2F05+12%3A00%3A00&jd=2449782.00000&img=-k1&sys=-Si&imgsize=325&eyes=0&orb=-b1&lat=47%B0&ns=North&lon=7%B0&ew=East&hlat=90%B0&hns=North&hlon=0%B0&elements=1995+CR%0D%0AEpoch+1995+Jan.+23.0+TT+%3D+JDT+2449740.5+++++++++++++++++Marsden%0D%0AM+278.01564++++++++++++++%282000.0%29++++++++++++P+++++++++++++++Q%0D%0An+++1.12812404+++++Peri.++322.49940+++++%2B0.57914789+++++%2B0.81494950%0D%0Aa+++0.9138989++++++Node+++342.85889+++++-0.72954994+++++%2B0.50656337%0D%0Ae+++0.8733235++++++Incl.++++4.10461+++++-0.36379197+++++%2B0.28151531%0D%0AP+++0.87+++++++++++H++++21.5++++++++++G+++0.15"
 
var PTnow = "http://www.fourmilab.to/cgi-bin/uncgi/Solar?date=0&utc=1995%2F03%2F05+12%3A00%3A00&jd=2449782.00000&img=-k1&sys=-Si&imgsize=600&eyes=0&orb=-b1&lat=34%B0&ns=North&lon=85%B0&ew=West&hlat=15%B0&hns=North&hlon=45%B0&edump=-xe&elements=COMET+55P+%28Tempel-Tuttle%29%0D%0A+++++T+%3D+1998+Feb.+28+++++++++++Peri.+%3D+172%0D%0A+++++e+%3D+0.91+++++++++++++++++++++Node++%3D+++235.0%0D%0A+++++q+%3D+0.977+AU++++++++++++++++++Incl.+%3D++162.5%0D%0A"

var Halnowtop = "http://www.fourmilab.to/cgi-bin/uncgi/Solar?date=0&utc=2024%2F03%2F05+12%3A00%3A00&jd=2449782.00000&img=-k1&sys=-Sf&imgsize=600&eyes=0&orb=-b1&lat=34%B0&ns=North&lon=85%B0&ew=West&hl at=90%B0&hns=North&hlon=180%B0&edump=-xe&elements=COMET+1P%2F1982+U1+%28Halley%29%0D%0A+++++T+%3D+1986+Feb.+9+++++++++++Peri.+%3D+112%0D%0A+++++e+%3D+0.96725+++++++++++++++++++++Node++%3D++59.0+%0D%0A+++++q+%3D+0.587+AU++++++++++++++++++Incl.+%3D++162.2"
 
var Hyanow = "http://www.fourmilab.to/cgi-bin/uncgi/Solar?date=0&utc=1995%2F03%2F05+12%3A00%3A00&jd=2449782.00000&img=-k1&sys=-So&imgsize=600&eyes=0&orb=-b1&lat=34%B0&ns=North&lon=85%B0&ew=West&hlat=13%B0&hns=North&hlon=-50%B0&edump=-xe&elements=COMET+C%2F1996+B2+%28Hyakutake%29%0D%0A+++++T+%3D+1996+May++1.13965+TT+++++++++Peri.+%3D+130.2102%0D%0A+++++e+%3D+0.999662+++++++++++++++++++++Node++%3D++188.0430+2000.0%0D%0A+++++q+%3D+0.230035+AU++++++++++++++++++Incl.+%3D++124.9098%0D%0A"

var SLnow = "http://www.fourmilab.to/cgi-bin/uncgi/Solar?date=0&utc=1994%2F07%2F16+12%3A00%3A00&jd=2449782.00000&img=-k1&sys=-Sf&imgsize=800&eyes=0&orb=-b0&lat=34%B0&ns=North&lon=85%B0&ew=East&hl at=90%B0&hns=North&hlon=-40%B0&edump=-xe&elements=COMET+D%2F1993+F2+%28Shoemaker-Levy9%29%0D%0A+++++T+%3D+1994+Mar.+30.2298+TT+++++++++Peri.+%3D++355.0085%0D%0A+++++e+%3D+0.207429+++++++++++++++++++Node++%3D+++220.9268+2000.0%0D%0A+++++q+%3D+5.379401+AU++++++++++++++++++Incl.+%3D+++5.8232"

function launch(file,name,winwidth,winheight)
{
var string="width="+winwidth+",height="+winheight+"toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes"
hwnd = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd.focus()  
          }
}
function scroll(file,name,winwidth,winheight)
{
var string="width="+winwidth+",height="+winheight+"toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes,scrollbars=yes"
hwnd2 = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd2.focus()  
          }
}
function locscroll(file,name,winwidth,winheight)
{
var string="width="+winwidth+",height="+winheight+"toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes,scrollbars=yes,location=yes,status=yes"
hwnd3 = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd3.focus()  
          }
}
function locscrollmenu(file,name,winwidth,winheight)
{
var string="width="+winwidth+",height="+winheight+"toolbar=yes,directories=no,resizable=yes,dependent=yes,scrollbars=yes,location=yes,status=yes,menubar=yes"
hwnd4 = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd4.focus()  
          }
}

function locmenu(file,name,winwidth,winheight)
{
var
string="width="+winwidth+",height="+winheight+"toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes,scrollbars=no,location=yes,status=yes,menubar=yes"
hwnd5 = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd4.focus()  
          }
}

function linkwin(file,name,winwidth,winheight)
{
var
string="width="+winwidth+",height="+winheight+"toolbar=yes,directories=no,menubar=yes,resizable=yes,dependent=yes,scrollbars=no,location=no,status=yes"
hwnd5 = window.open(file,name,string) ;
          if (navigator.appName == "Netscape") {
             hwnd4.focus()  
          }
}

function strobel()
{
var winheight="450"
var winwidth="700"
string="width="+winwidth+",height="+winheight+"toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes,scrollbars=yes,location=yes,status=yes,menubar=yes"
strobel = window.open("http://www.bc.cc.ca.us/programs/sea/astronomy/book.htm","strobel",string) ;
          if (navigator.appName == "Netscape") {
             hwnd4.focus()
          }
strobel.location.replace("http://csep10.phys.utk.edu/astr161")
}

newwin=null;
function flashwin(file,name,winwidth,winheight){
var string1="width="+winwidth+",height="+winheight+"toolbar=no,";
var string2="directories=no,menubar=no,resizable=yes,dependent=yes,scrollbars=no";
var string=string1+string2;
newwin=window.open(file,name,string)
   if (navigator.appName == "Netscape") {
             newwin.focus()          }
   }

   function launchright(file){
        right = window.open(file,"topright")
   }

   function launchfinder(file){
        right2 = window.open(file,"botright")
   }

   function launchbottom(file){
        bot = window.open(file,"bottom")
   }

    function launchnav(file,fwindow){
      var menu=GetCookie("showmenu");
      if(menu=="Y"){
         navwin = window.open(file,fwindow) ;
      }
    }

//  Function to launch the nav window

function NavWin(){ 
   var read=GetCookie("showmenu")
     if(read=="Y"){
        navwin = window.open('../nav/navwin.html','navwin',
"resizable=yes,toolbar=no,directories=no,scrollbars=no,menubar=no,width=205,height=500") ;
     }
}

//  Function to set cookie to toggle navwindow launch on and off
// original version:
    function x0SetCookie(showmenu)
      {
        document.cookie="showmenu="+showmenu+"; path=/";
       }

// 7-6-99 - version from ai4/misc_stuff/x1cookie.js:
// now change from "font" to "style" in function:
    function SetCookie(showmenu,style)
      {
        document.cookie="showmenu="+showmenu+":"+"style="+style+"; path=/";
       }

// (7-6-99) this is old and definitely should not be needed now?
//  Function to read cookie to toggle navwindow launch on and off
// original version:
  function GetCookieOrig(name)
      {
        var namestr=name+"=";
        var namelen=namestr.length;
        var cooklen=document.cookie.length;
        var pos=document.cookie.indexOf("showmenu=");
        pos=11;
        if(document.cookie=="")
          {
             return "NONE";
           }
        else
          {
             return unescape(document.cookie.substring(namelen,pos));
           }
       }

// (7-6-99) now replace this version with the one below:
// modified rwk 1/22/99:
  function x0GetCookie(name)
      {
        var namestr=name+"=";
//   document.write("namestr=" + namestr + "<p>");
        var namelen=namestr.length;
//   document.write("namelen=" + namelen + "<p>");
        var cooklen=document.cookie.length;
//        var pos=document.cookie.indexOf("showmenu=");
//  var pos=namelen+2;		// original value
  var pos=namelen+1;		// value needed in order to work with exp1.html and new *.js files
   var cookval=document.cookie;
//   document.write("cookval = " + cookval + "<p>");
//   document.write("name = " + name + "<p>");
//   document.write("pos = " + pos + "<p>");
        if(document.cookie=="")
          {
             return "NONE";
           }
        else
          {
    var red= unescape(document.cookie.substring(namelen,pos));
//    document.write("red= " + red + "<p>");
             return unescape(document.cookie.substring(namelen,pos));
           }
       }

// (7-6-99) version taken from ai4/misc_stuff/x1cookie.js;
// [function apparently created on 4/9/99, but not moved into this file until 7/6/99]
//  (rwk 4/9/99; modified MWG's GetCookie function to use IndexOf
//  to find position of beginning of desired substring:
  function GetCookie(name) {
//  position in string at which name begins:
        var namestart=document.cookie.indexOf(name);
// now find the first = (equals sign) after namestart and set valstart to the
// next position:
      var valstart=document.cookie.indexOf("=",namestart)+1;
// (for now) assume value is only a single character;
// set pos to second position after the equals sign:
        var pos=valstart+1;
        if(document.cookie=="")
          {
            return "NONE";
          }
        else
          {
           return unescape(document.cookie.substring(valstart,pos));
          }
   }

// (7-6-99) also from x1cookie.js; this is used in x1prefs.html to indicate
// whether the nav window is being used or not:
var showmenu_ans;
function ShowNav(ans) {
        showmenu_ans=ans;
        return showmenu_ans;
}

// (7-6-99) from ai4/misc_stuff/x1css-select.js:

function left_style() {
// (4/14/99) have renamed style files in case we want to change more than just main text size;
//      medium --> opt1
//      large  --> opt2
//      small  --> opt3
// use style with medium main text font if nothing chosen from form
// (e.g., if page accessed from ai4/index.html or ai4/work1.html:
var styleval=GetCookie("style");
if (styleval=="l") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-left-course1-opt2.css\">"); }
else
  {
    if (styleval=="s") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-left-course1-opt3.css\">"); }
    else { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-left-course1-opt1.css\">"); }
  }
}


function right_style() {
// (4/14/99) have renamed style files in case we want to change more than just main text size;
//      medium --> opt1
//      large  --> opt2
//      small  --> opt3
// use style with medium main text font if nothing chosen from form
// (e.g., if page accessed from ai4/index.html or ai4/work1.html:
var styleval=GetCookie("style");
if (styleval=="l") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-right-course1-opt2.css\">"); }
else
  {
    if (styleval=="s") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-right-course1-opt3.css\">"); }
    else { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-right-course1-opt1.css\">");
 }
  }
}

function finder_style() {
// (4/14/99) have renamed style files in case we want to change more than just main text size;
//      medium --> opt1
//      large  --> opt2
//      small  --> opt3
// use style with medium main text font if nothing chosen from form
// (e.g., if page accessed from ai4/index.html or ai4/work1.html:
var styleval=GetCookie("style");
if (styleval=="l") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-finder-course1-opt2.css\">"); }
else
  {
    if (styleval=="s") { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-finder-course1-opt3.css\">"); }
    else { document.write("<link rel=\"stylesheet\" href=\"../../../astrostuff/ai-finder-course1-opt1.css\">");
 }
  }
}




// ---------------------------------------------------
// Following functions define button image rollovers:
// ---------------------------------------------------

var adim=20;                         // max number of rollovers on a page
var onImgArray=new Array(adim);      // array for mouseover images
for(i=0; i<adim; i++){
	onImgArray[i]=new Image();
}

var offImgArray=new Array(adim);     // array for mouseout images.  Normally
for(i=0; i<adim; i++){               // the same as the original image
	offImgArray[i]=new Image();
}

var clickImgArray=new Array(adim);   // array for mousedown images
for(i=0; i<adim; i++){
	clickImgArray[i]=new Image();
}

function imageOn(i){                                    // display mouseover
    document.images[i].src = onImgArray[i].src;
}

function imageOff(i){                                   // display mouseout
    document.images[i].src = offImgArray[i].src;
}

function imageClick(i){
    document.images[i].src = clickImgArray[i].src;      // display mousedown
}

// ----------------------------------------------------------------------------
// Function makeButtons(i,link,target,img,imgover,imgdown,message) 
// makes rollover buttons (up to adim per page; where adim is the 
// variable setting the array sizes set above)
// ----------------------------------------------------------------------------
// ARGUMENTS:
//   i = index of the button (0 to adim-1) on a page.  Needs to be unique
//   link = URL that the button will link to when clicked
//   target = target window (null value will target present window)
//   img = default button image (fully qualified path to file; can be URL)
//   imgover = button image to be displayed on mouseover (fully qualified 
//             path to file; can be URL)
//   imgdown = button image to be displayed on mousedown (fully 
//             qualified path to file; can be URL)
//   message = the message label to appear as popup tag on a mouseover 
//             (inserted in the alt field of the img tag)
//
// Place this javascript between the <head> ...</head> tags of an HTML 
// page and invoke the functions
// with scripts placed in the appropriate position in the 
// HTML page between the <body> ... </body> 
// tags of the following form (this example for 2 buttons on page, 
// repeat for up to adim buttons).
// (The script and close script tags can't be written literally in 
// this comment because javascript 
// insists on interpreting them literally even though this is a comment)
//
//      <script tag>
//	makeButtons(0,'next.html','next.gif','nextover.gif','nextdown.gif')
//	<close script tag>
//         *** (insert any required intervening HTML for formatting here)
//	<script tag>
//	makeButtons(1,'back.html','back.gif','backover.gif','backdown.gif')
//      <close script tag>
//
// Remember to give each button a unique index (the initial 
// argument i).  If no intervening
// HTML formatting is required, all calls to makeButtons 
// can be placed between a single set of
// script and close script tags.

// ----------------------------------------------------------------------------

function makeButtons(i,link,target,img,imgover,imgdown,message){

      // Put the image addresses into the relevant arrays
	onImgArray[i].src=imgover;
	offImgArray[i].src=img;
	clickImgArray[i].src=imgdown;

	// Place the button on the page
	document.write('&nbsp;<a href="'+link+'"'
               + 'target="' + target + '"'
               + 'onmouseover="imageOn(' +i +'); return true" '
               + 'onmouseout="imageOff(' +i +'); return true" '
               + 'onmousedown="imageClick(' +i +'); return true">'
               + '<img src="' + img + '" border=0 alt="' + message
               + '"></a>');
}

// [12/25/98 rwk] for right aligned buttons:
function makeRightButtons(i,link,target,img,imgover,imgdown,message){

      // Put the image addresses into the relevant arrays
        onImgArray[i].src=imgover;
        offImgArray[i].src=img;
        clickImgArray[i].src=imgdown;

        // Place the button on the page
        document.write('&nbsp;<a href="'+link+'"'
               + 'target="' + target + '"'
               + 'onmouseover="imageOn(' +i +'); return true" '
               + 'onmouseout="imageOff(' +i +'); return true" '
               + 'onmousedown="imageClick(' +i +'); return true">'
               + '<img src="' + img + '" border=0 align=right alt="' + message
               + '"></a>');
}

// -------------  End definition of button rollover functions ---------------

//-->


