function updated_on()
{
	var dayNames	= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var monthNames	= new Array("January","February","March","April","May","June","July","August",
								"September","October","November","December");
	var ordinal 	= new Array("st","nd","rd","th","th","th","th","th","th","th",
								"th","th","th","th","th","th","th","th","th","th",
								"st","nd","rd","th","th","th","th","th","th","th","st");
								
	var dateObj 	= new Date(document.lastModified);
	var weekDay    	= dayNames[dateObj.getDay()];
	var dayOfMonth 	= dateObj.getDate();
	var ord 		= ordinal[dayOfMonth - 1];
	var monthName	= monthNames[dateObj.getMonth()];
	var year   		= dateObj.getFullYear();
	return weekDay + " the " + dayOfMonth + ord + " of " + monthName + ", " + year;
}
//*******************************************************************************************************************
var save_height=new Array()
var gsave_images = new Array();
//var image_count = 0

//==============================================================
function thumb(img){
	document.images[img].height=60
	return true
}
//==============================================================
function thumbs() {
	for (var i=0; i<document.images.length; i++) {
		thumb(i)
	}
	return true
}
//==============================================================
function showpic(img){
	var file = document.images[img].src;	//full name
	var ix = file.lastIndexOf(".");
	var ext = file.substring(ix+1);			// extension
	file = file.substring(0,ix);			// file without extension

	ix = file.lastIndexOf("thumbs");
	var name = file.substring(ix+6);		//pure filename without path info
	
	file = file.substring(0,ix-1);			//remove thumbs sub dir from the end of path
	file = file + name + "." + ext;			// full filespec in dir above thumbs
	var html = 
	'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'+
	"<html><head><title>" + document.images[img].alt + "</title>"+
	"<link rel='stylesheet' type='text/css' href='style.css'>"+
	"</head>"+
	"<body><center><img src='"+file+"'>"+
	"<br>"+document.images[img].alt+
	'<script language="JavaScript">'+
	"var h = Math.min(document.images[0].height,document.body.clientHeight - 50);"+
	"if (h < 200) h = document.body.clientHeight - 50;"+
	"document.images[0].height = h;"+
	"</script></body></html>"
	top.main.document.write(html)
	top.main.document.close()
}
function oldshowpic(img){
	var h = Math.min(save_height[img],document.body.clientHeight - 50)
	//alert("h="+h)
	var html = 
	'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'+
	"<html><head><title>" + document.images[img].alt + "</title>"+
	"<link rel='stylesheet' type='text/css' href='style.css'>"+
	"</head>"+
	"<body><center><img src='"+document.images[img].src+"' height="+h+">"+
	"<br>"+document.images[img].alt+
	"</body>"
	top.main.document.write(html)
	top.main.document.close()
}
//==============================================================
function init(){
// save the image heights before turning them into thumbnails
//	for (var i=0; i<document.images.length; i++) {
//	var h = document.images[i].height
//	if (h<100) {
//		h=600
//		window.alert("height: "+h+" avail "+av+" selected: "+Math.min(h,av))
//	}
//	save_height[i] = h
//	}
//	alert("Appname |" + navigator.appName
//	+ "| appVersion " + navigator.appVersion
//	+ " apCodeName " + navigator.appCodeName
//	+ " userAgent " + navigator.userAgent);

	thumbs()	// make them all thumbnails
	showpic(0)	// and show the first photo
}
//==============================================================
function pic(){
}
//==============================================================
// show pic in a new document
function go(img){
	var current_image = img
	var h = save_height[img]
	var image_count = document.images.length
	var html = 
	//"<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN"'>"+
	"<html><head><title>" + document.images[img].alt + "</title>"+
	"<link rel='stylesheet' type='text/css' href='style.css'>"+
	'<script language="JavaScript" src="lib.js"></script>'+
	"</head>"+
	"<body><center><img src='"+document.images[img].src+"' height="+h+"><P>"+document.images[img].name+"</p>"+
	"<a href='javascript:history.back()'> BACK </a>"+
	"</div></body>"
	document.write(html)
	return true
}
//*******************************************************************************************************************
//==============================================================
// cookie functions
//==============================================================
var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
	}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
			}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
		}
	return null;
	}

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
	}
