function gotoshow(){
	window.location=slidelinks[whichlink]
}
function previous() {
	whichimage = (whichimage == 0) ? slideimages.length - 1 : whichimage-1;
	document.images.show.src = imageholder[whichimage].src;
	whichlink=whichimage;
	if (window.timeout) window.clearTimeout(window.timeout); 
	window.timeout = window.setTimeout("rotate()", slidespeed);
}
function rotate() {
	whichimage = (whichimage == slideimages.length - 1) ? 0 : whichimage+1;
	document.images.show.src = imageholder[whichimage].src;
	whichlink=whichimage;
	if (window.timeout) window.clearTimeout(window.timeout); //Nirisha - needed to clear timer to remove rotation when 'next' or 'previous' button pressed
	window.timeout = window.setTimeout("rotate()", slidespeed);
}

function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function rollImages(name,over){
	if(window.document.images)	{
		if (over)
			window.document[name].src = "images/" + name + "_off.jpg";
		else
			window.document[name].src =  "images/" + name + "_on.jpg";
	}
}
//===========================
// 18 Feb 97 created Eric Krock
//
// (c) 1997 Netscape Communications Corporation

// VARIABLE DECLARATIONS
var digits = "0123456789";
var lowercaseLetters = "abcdefghijklmnopqrstuvwxyz"
var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
// whitespace characters
var whitespace = " \t\n\r";
// decimal point character differs by language and culture
var decimalPointDelimiter = "."

// CONSTANT STRING DECLARATIONS
var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."
// i is an abbreviation for "invalid"
var iEmail = "This field must be a valid email address (like foo@bar.com). Please re-enter."
var iString = "This field must be a valid string (no non-alphabetic characters). Please re-enter."
var iNum = "This field must be a valid integer. Please enter values 0-9 only."

// Global variable defaultEmptyOK defines default return value for many functions 
var defaultEmptyOK = false
// Check whether string s is empty.
function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}
// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace (s)
{   var i;
    // Is s empty?
    if (isEmpty(s)) return true;
    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }
    // All characters are whitespace.
    return true;
}

// Removes all whitespace characters from s.
// Global variable whitespace (see above)
// defines which characters are considered whitespace.

function stripWhitespace (s)
{   return stripCharsInBag (s, whitespace)
}

// Removes initial (leading) whitespace characters from s.
// Global variable whitespace (see above)
// defines which characters are considered whitespace.
function stripInitialWhitespace (s)
{   var i = 0;

    while ((i < s.length) && charInString (s.charAt(i), whitespace))
       i++;
    
    return s.substring (i, s.length);
}

// Returns true if character c is an English letter 
// (A .. Z, a..z).
//
// NOTE: Need i18n version to support European characters.
// This could be tricky due to different character
// sets and orderings for various languages and platforms.
function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}
// Returns true if character c is a digit 
// (0 .. 9).

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

// Returns true if character c is a letter or digit.
function isLetterOrDigit (c)
{   return (isLetter(c) || isDigit(c))
}

// isInteger (STRING s [, BOOLEAN emptyOK])
// 
// Returns true if all characters in string s are numbers.
function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }
   // All characters are numbers.
    return true;
}
// isAlphabetic (STRING s [, BOOLEAN emptyOK])
// 
// Returns true if string s is English letters 
// (A .. Z, a..z) only.
//
function isAlphabetic (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphabetic.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-alphabetic character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is letter.
        var c = s.charAt(i);

        if (!isLetter(c))
        return false;
    }

    // All characters are letters.
    return true;
}

// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c -- in other words:
function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
     // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function warnEmpty (theField, s)
{   theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}
function warnInvalid (theField, s)
{   theField.focus()
    theField.select()
    alert(s)
    return false
}


/* FUNCTIONS TO INTERACTIVELY CHECK VARIOUS FIELDS. */

// checkString (TEXTFIELD theField, STRING s, [, BOOLEAN emptyOK==false])
// Check that string theField.value is not all whitespace.
function checkString (theField, s, emptyOK)
{   // Next line is needed on NN3 to avoid "undefined is not a number" error
    // in equality comparison below.
	var val = theField.value;
    if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(val))) return true;
    if (isWhitespace(val)) 
       return warnEmpty (theField, s);
   if(!isAlphabetic(stripWhitespace (val)))
		return warnInvalid(theField, iString);
    else return true;
}


// checkEmail (TEXTFIELD theField [, BOOLEAN emptyOK==false])
function checkEmail (theField, emptyOK)
{   if (checkEmail.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else if (!isEmail(theField.value, false)) 
       return warnInvalid (theField, iEmail);
    else return true;
}

function checkNumber(theField, s, emptyOK)
{
	var val = theField.value;
    if (checkNumber.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(val))) return true;
    if ((emptyOK == true) && isWhitespace(val)) 
       return true;
   if(!isInteger(val))
		return warnInvalid(theField, iNum);
    else return true;	
}




