if ( ! versions_loaded ) {

    // Determine Browser Version
    var bV   = parseInt( navigator.appVersion );
    var NS4  = (document.layers)         ? true : false;
    var NS3  = (document.images)         ? true : false;
    var IE4  = ((document.all)&&(bV>=4)) ? true : false;
    var ver4 = (NS4 || IE4)       ? true : false;
//    NS4 = NS5 || NS4;

    // Determine Browser Platform
    var MAC   = (navigator.userAgent.indexOf("Mac")      != -1) ? true : false;
    var Opera = (navigator.userAgent.indexOf("Opera")    != -1) ? true : false;
    var IE5   = (navigator.userAgent.indexOf("MSIE 5.0") != -1) ? true : false;

    var versions_loaded = true;
}

var winLastPageX = -1;
var winLastPageY = -1;
var winLastSizeX = -1;
var winLastSizeY = -1;

var objLogo = new Object();

function moveBkgrd(objx, objy)
{
	if( winLastPageX != getWindowLeft() || winLastPageY != getWindowTop() || winLastSizeX != getInsideWindowWidth() || winLastSizeY != getInsideWindowHeight() )
	{
		var scrollbarSize
		var layer = objLogo
		
		if ( IE4 )
			scrollbarSize = 0
		else
			scrollbarSize = 15
		
		var x = 0, y = 0;
		if( objx ) x = objx;
		if( objy ) y = objy;
		
		var imgX = getInsideWindowWidth() - getObjWidth(layer) - scrollbarSize  + getWindowLeft() - objx
		var imgY = getInsideWindowHeight() - getObjWidth(layer) - scrollbarSize + getWindowTop() - objy
	
		moveObjTo(layer, imgX, imgY)

		winLastPageX = getWindowLeft()
		winLastPageY = getWindowTop()
		winLastSizeX = getInsideWindowWidth()
		winLastSizeY = getInsideWindowHeight()
	}
}

/* *********************************************************
1. makeStaticLogo(imgObject, imgName, imgDesc, imgPath, imgHeight, imgWidth)

2. makeStaticLogo(layerObject)

************************************************************ */

function makeStaticLogo(obj, imgName, imgDesc, location, objx, objy)
{
//var result = "";
//for (var i in document) {
//    if( (new Object(document[i])).toString().indexOf("function") == -1 )
//        result += "document." + i + " = " + document[i];
//}
//   alert(result);
	if ( ver4 )
	{
		if( imgDesc )
		{
			if ( NS4 )
			{
				document.writeln("<layer name=\"container_" + imgName + "\" left=-" + obj.width + " top=-" + obj.height + " zindex=59000 height=" + obj.height + " width=" + obj.width + ">")
				if ( location )	document.writeln("<a href=\"" + location + "\">")
				document.writeln("<img border=0 src=\"" + obj.src + "\" name=\"" + imgName + "\" height=" + obj.height + " width=" + obj.width + ((imgDesc || imgDesc != "") ? " alt=\"" + imgDesc + "\"" : "") + ">")
				if ( location )	document.writeln("</a>")
				document.writeln("<\/layer>")
			} else {
				document.writeln("<div id=\"container_" + imgName + "\" style=\"position:absolute; zindex:59000 left:-" + obj.width + "; top:-" + obj.height + "; height:" + obj.height + "; width:" + obj.width + "\">")
				if ( location )	document.writeln("<a href=\"" + location + "\">")
				document.writeln("<img border=0 src=\"" + obj.src + "\" name=\"" + imgName + "\" height=" + obj.height + " width=" + obj.width + ((imgDesc || imgDesc != "")? " alt=\"" + imgDesc + "\"" : "") + ">")
				if ( location )	document.writeln("</a>")
				document.writeln("<\/div>")
			}

			objLogo = findObject("container_" + imgName)
		}
		else
			objLogo = obj


		if ( objLogo )
		{
			var param;
			
			if( objx && objy )
				param = objx + ", " + objy;
			else
				param = "0, 0";
		
			window.setInterval("moveBkgrd(" + param + ")", 100);
		}
	}
}

var objSpinImages = new Array();
var objImg = new Object();
var totalSpinCount = 0;

function changeSpinLogo()
{
	if ( objSpinImages.length )
	{
		if ( totalSpinCount >= objSpinImages.length ) totalSpinCount = 0 
//		window.status="timer" + totalSpinCount
		objImg.src = objSpinImages[totalSpinCount++].src
	}
}

function spinStaticLogo(logoName, spinName, spinCount, spinInterval)
{
	if ( !spinInterval ) spinInterval = 100
	
	if ( ver4 )
	{
		if( !(objImg = findObject(logoName)) )
			return 

		for ( i = 0; i < spinCount; i++ )
		{
			objSpinImages[i] = new Image(30, 30)
			objSpinImages[i].src = spinName + i + ".gif"
		}
		window.setInterval("changeSpinLogo()", spinInterval);
	}
}

