///////////////////////////////////////////////////////////////////////////
function SwitchImg()
{ //start
	var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3)
	{
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    	if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        	(store.indexOf('document.all[')==0 && document.all==null))
         	store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
		obj = eval(store);

		if (obj != null)
		{
			switcher[keep++] = obj;
			switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
			obj.src = SwitchImg.arguments[rem+2];
		}
	}
	document.Data = switcher;
} //end

///////////////////////////////////////////////////////////////////////////
function RestoreImg()
{ //start
	if (document.Data != null)
		for (var rem=0; rem<(document.Data.length-1); rem+=2)
			document.Data[rem].src=document.Data[rem+1];
} //end

///////////////////////////////////////////////////////////////////////////
/* Function that displays status bar messages. */
function statusMessage (msgStr)
{
    window.status = msgStr;
    document.MM_returnValue = true;
}

///////////////////////////////////////////////////////////////////////////
/* Function that swaps images. */
function swapImage (id, newSrc)
{
	statusMessage (newSrc);
    var theImage = findImage(document, id, 0);
    if (theImage)
	{
        theImage.src = newSrc;
    }
}

///////////////////////////////////////////////////////////////////////////
/* Function that tracks and sets toggle group button states. */
function findImage (doc, name, j)
{
    var theImage = false;
    if (doc.images)
	{
        theImage = doc.images[name];
    }
    if (theImage)
	{
        return theImage;
    }
    if (doc.layers)
	{
        for (j = 0; j < doc.layers.length; j++)
		{
            theImage = findImage(doc.layers[j].document, name, 0);
            if (theImage)
			{
                return (theImage);
            }
        }
    }
    return (false);
}

///////////////////////////////////////////////////////////////////////////
function renderThumbnail (range, item)
{
	option = GetCookie ('Thumbnails');

	if (option == "Off")
	{
		return;
	} // if

	document.writeln ('<TD WIDTH=70>');
	document.writeln ('<A HREF=\"Items/' + item + '.html\"><IMG SRC=\"../../Pics/' + range + '/thumbs/tn_' + item + '.jpg\" BORDER=0></A>');
	document.writeln ('</TD>');
}
///////////////////////////////////////////////////////////////////////////
