/*JavaScripts Prepared by Rob Studdert distudio@ozemail.com.au Copyright 2001*/
var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000); //sets a year from now in ms
var bc;
var dibcc='image_border_colour_preference';
sbtext=new Array(
'', //0
'Digital Image Studio, Photography',
'Digital Image Studio Copyright Policy and important information',
'e-mail Digital Image Studio',
'return to the Digital Image Studio index',
'return to the Publications and galleries index',//5
'go to the Digital Image Studio Web site...',
'e-mail comments to the author...',
'Click for the previous image',
'Click for the next image',
'Click to show thumb-nail image index',//10
'Digital Image Studio gallery...',
'return to the Canon ELPH Jr performance index',
'Click for a larger view',
'Canon ELPH Jr performance',
'Return to top of this page',//15
'Click for Robs Ireland Perspective',
'Click to view the entire frame',
'return to the Photo galleries index',
'return to the Project galleries index'
);

// end of common variable declarations

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" : "");
}
// cookie utilities
function sb(qt) {
	if (qt>=0)
			{
			qt=sbtext[qt];
			}
	this.window.status=qt;
	return true;
} // status bar comments

function ni(nf) {
	window.open('./menu.html#'+nf,'menuframe');
	window.status='Click to see the next frame';
	return true;
} // vgallery nav right/forward

function li(nb) {
	window.open('./menu.html#'+nb,'menuframe');
	window.status='Click to see the previous frame';
	return true;
} // vgallery nav left/back

// next/last image, nf url forward, nb url back "return(ni('forward name'));"

function savebc(bc) {
	document.bgColor=("aa7777");
	SetCookie(dibcc, bc , expiry);
	window.status="Border colour preference saved as "+bc;
	document.bgColor=(bc);
	return true;
} // vgallery dynamic border colour save

