<!-- Startup javascript functions

	// Example: preload( '01.gif', '02.gif' ); 
	function preload()
	{ 
	  var args = preload.arguments;
	  document.imageArray = new Array(args.length);
	  for(var i=0; i<args.length; i++)
	  {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
		
		// If image does not exist, show debug message
		//if ( (document.imageArray[i] != null) && (!document.imageArray[i].complete) ) {
		//	messageWindow('debug message', 'Image not found: ' + document.imageArray[i].src)
		//}
		
	  }
	}

	// Example: changeImages( 'image name', 'image file.fig' );
	function changeImages() 
	{
		if (document.images) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}


	// Example: messageWindow ( 'debug message', 'image not found');
	function messageWindow(title, msg)
	{
		var width="300", height="125";
		var left = (screen.width/2) - width/2;
		var top = (screen.height/2) - height/2;
		var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
		var msgWindow = window.open("","msgWindow", styleStr);
		var head = '<head><title>'+title+'</title></head>';
		var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
		msgWindow.document.write(head + body);
	}
	
	
	/* The lastModified property is derived from the HTTP header data sent by the web server. 
	   Servers generally obtain this date by examining the file's modification date. The last 
	   modified date is not a required portion of the header, and some servers do not supply it. 
	   If the server does not return the last modified information, JavaScript receives a 0, 
	   which it displays as January 1, 1970 GMT. The following code checks the date returned 
	   by lastModified and prints out a value that corresponds to unknown. 
	*/
	function GetLastModified (doc, strLastModified)
	{
		dtLastmod = document.lastModified // get string of last modified date
		strLastModified = Date.parse(dtLastmod)   // convert modified string to date
		if (lastmoddate == 0) {               // unknown date (or January 1, 1970 GMT)
		   	strLastModified = "Lastmodified: Unknown";
		} else {
			strLastModified = "LastModified: " + dtLastmod;
		}	
	}
	
	// Display dynamuic description
	// Use with <span id="dynamicDescription"></span>
	function DisplayDescription (txtDescription)
	{
		if (document.all) {					// ie4
			dynamicDescription.innerHTML=txtDescription;
		}
		else if (document.getElementById) {	// netscape
			document.getElementById("dynamicDescription").innerHTML=txtDescription;
		}
	}

	// Clear dynamic description
	function ClearDescription ()
	{
		DisplayDescription('');
	}

//-->
