<!--
okay = false;  // wait until variables are initialized

var preload = new Array (

"images/spiritdance-logo5.gif",
"images/sun2b.gif",
"images/sun1b.gif",
"images/star1b.gif",
"images/star2b.gif",
"images/star3.gif",
"images/koko-small.gif",
"images/sun1b-current.gif",
"images/sun2b-current.gif",
"images/star1b-current.gif",
"images/star2b-current.gif",
"images/star3-current.gif",
"images/koko-small-over.gif",
"images/sun1b-over.gif",
"images/sun2b-over.gif",
"images/star1b-over.gif",
"images/star2b-over.gif",
"images/star3-over.gif",
"images/sun-icon.gif",
"images/penguindanceB2.gif",
"images/penguinstill.gif",
"images/btn-please.gif",
"images/btn-thanks.gif"

  );

// find out what browser this is
with(navigator) {
  code = appCodeName;
  app = appName;
  version = appVersion;
  iver = parseInt(version);
  ua = userAgent;
  }

// this will work in "Mozilla" 3+ (includes MSIE 4)
if ( code == "Mozilla" && iver >= 3 )  okay = true;
else { okay = false; }

if(okay) {
  // compile the RegExp because we use it a lot
  var re = new RegExp();
  re.compile("[\\/.:\\-\\s]", "g");

  // preload the images
  for (var i = 0; i < preload.length; i++) {
    i_preload(preload[i]);
    }
  var preloaded = true
  }

// take a filename and make a legal variable name from it
function iname (img)
{
var s = img.replace(re, "_");
return s;
}

// preload the images
function i_preload(img)
{
if(img) {
  var imgn = iname(img);
  eval(imgn + " = new Image()");
  eval(imgn + ".src = '" + img + "'");
  }
return true;
}

// swap two entries function
function doubleswap (name, image, name2, image2)
{
if(!okay) return true;
// dont try to do this before the preloading is finished
if(preloaded) document.images[name].src = image;
			  document.images[name2].src = image2;
return true;
}

// swap entry function
function swap (name, image)
{
if(!okay) return true;
// dont try to do this before the preloading is finished
	if(preloaded) document.images[name].src = image;
return true;
}

// toggle division visibility status
function toggle(targetId, hideId)
{
if(okay) {
  if(preloaded)	{
  		target = document.all( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  		hide = document.all( hideId );
  			if (hide.style.display == "none"){
  				hide.style.display = "none";
  			} else {
  				hide.style.display = "none";
  			}
  			
  		}
	}
}


function openAWindow( pageToLoad, winName, width, height, center) {
/* Opens a new window on the users desktop.
Arguments:
                pageToLoad - The URL of a page to load in the browser window.
                                         This can be a relative URL or fully qualified.
                winName -        Name of the new window.
                width -          The horizontal size of the new window.
                height -         The vertical size of the new window.
                center -     toggle centering on 4.0 browsers.
                                         1=centered window 0=no centering

                Values in the "args" section below can all be toggled in the
                same fashion as the center toggle.  Just modify the appropriate
                value in the args section to be either 0 or 1.
                
                A call to this function might look like this:
                <a href="javascript:openAWindow('ice.html','ice',375,250,1)">Ice</a>

                If you use this routine please leave all comments in place so that
                others may benefit as well.
                */
                                         
        xposition=0; yposition=0;
        if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
                xposition = (screen.width - width) / 2;
                yposition = (screen.height - height) / 2;
        }
        args = "width=" + width + "," 
        + "height=" + height + "," 
        + "location=0," 
        + "menubar=0,"
        + "resizable=1,"
        + "scrollbars=0,"
        + "status=0," 
        + "titlebar=0,"
        + "toolbar=0,"
        + "hotkeys=0,"
        + "screenx=" + xposition + ","  //NN Only
        + "screeny=" + yposition + ","  //NN Only
        + "left=" + xposition + ","     //IE Only
        + "top=" + yposition;           //IE Only

        window.open( pageToLoad,winName,args );
}


function popwindow( pagename, width, height ) {
	xposition=0; yposition=0;
	if (parseInt(navigator.appVersion) >= 4 ) {
		xposition = (screen.width - width) / 2;
		yposition = 0;
	}
        args = "width=" + width + "," 
        + "height=" + height + "," 
        + "location=0," 
        + "menubar=0,"
        + "resizable=0,"
        + "scrollbars=1,"
        + "status=0," 
        + "titlebar=0,"
        + "toolbar=0,"
        + "hotkeys=0,"
        + "screenx=" + xposition + ","  //NN Only
        + "screeny=" + yposition + ","  //NN Only
        + "left=" + xposition + ","     //IE Only
        + "top=" + yposition;           //IE Only


	window.open( pagename,"",args );
}

function closepop( pagename ) {
	
	window.close(pagename);
	
}


//-->