// javascript and jscript source copyright (c) 2003 Thomas H. Field
var bname = navigator.appName;
var poppic = null;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function chIm() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<chIm.arguments.length; i+=2) {
			document[chIm.arguments[i]].src = chIm.arguments[i+1];
		}
	}
}

function makeArray(len) {
	for (var i = 0; i < len; i++) this[i] = null;
	this.length = len;
}
 
var runslideshow = true;
var randimg = false;
var first = 1;

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
		picture = new makeArray(80);

    picture[0] = "hdr/3/00arch.jpg";
    picture[1] = "hdr/3/01thor.jpg";
    picture[2] = "hdr/3/02horseshoe.jpg";
    picture[3] = "hdr/3/03houseafire.jpg";
    picture[4] = "hdr/3/04bowl.jpg";
    picture[5] = "hdr/3/05washmonnight.jpg";
    picture[6] = "hdr/3/06jefferson.jpg";
    picture[7] = "hdr/3/07lincornt.jpg";
    picture[8] = "hdr/3/08keybridge.jpg";
    picture[9] = "hdr/3/09flag.jpg";
    picture[10] = "hdr/3/10whitetop.jpg";
    picture[11] = "hdr/3/11lightbeam.jpg";
    picture[12] = "hdr/3/12firesett.jpg";
    picture[13] = "hdr/3/13aspens.jpg";
    picture[14] = "hdr/3/14sharptop.jpg";
    picture[15] = "hdr/3/15sailboat.jpg";
    picture[16] = "hdr/3/16dock.jpg";
    picture[17] = "hdr/3/17fishingboat.jpg";
    picture[18] = "hdr/3/18kayaks.jpg";
    picture[19] = "hdr/3/19dawnpalms.jpg";
    picture[20] = "hdr/3/20lollipop.jpg";
    picture[21] = "hdr/3/21lincoln.jpg";
    picture[22] = "hdr/3/22blossoms.jpg";
    picture[23] = "hdr/3/23cathedral.jpg";
    picture[24] = "hdr/3/24capitolflare.jpg";
    picture[25] = "hdr/3/25patricia.jpg";
    picture[26] = "hdr/3/26maligne.jpg";
    picture[27] = "hdr/3/27heenan.jpg";
    picture[28] = "hdr/3/28canoes.jpg";
    picture[29] = "hdr/3/29bowlake2.jpg";
    picture[30] = "hdr/3/30palms.jpg";
    picture[31] = "hdr/3/31bachelors.jpg";
    picture[32] = "hdr/3/32umbrella.jpg";
    picture[33] = "hdr/3/33osprey.jpg";
    picture[34] = "hdr/3/34seaoats.jpg";
    picture[35] = "hdr/3/35diver.jpg";
    picture[36] = "hdr/3/36blennie.jpg";
    picture[37] = "hdr/3/37coral.jpg";
    picture[38] = "hdr/3/38tubeworm.jpg";
    picture[39] = "hdr/3/39bigsun.jpg";
    picture[40] = "hdr/3/40vegas.jpg";
    picture[41] = "hdr/3/41fountain.jpg";
    picture[42] = "hdr/3/42goldengate.jpg";
    picture[43] = "hdr/3/43sfca.jpg";
    picture[44] = "hdr/3/44roanoke.jpg";
    picture[45] = "hdr/3/45aspens2.jpg";
    picture[46] = "hdr/3/46redwoods2.jpg";
    picture[47] = "hdr/3/47nhfall.jpg";
    picture[48] = "hdr/3/48tree.jpg";
    picture[49] = "hdr/3/49redwoods.jpg";
    picture[50] = "hdr/3/50svartifoss.jpg";
    picture[51] = "hdr/3/51tiny.jpg";
    picture[52] = "hdr/3/52elekala.jpg";
    picture[53] = "hdr/3/53waterfall.jpg";
    picture[54] = "hdr/3/54icefall.jpg";
    picture[55] = "hdr/3/55banff.jpg";
    picture[56] = "hdr/3/56dstree.jpg";
    picture[57] = "hdr/3/57dsrock.jpg";
    picture[58] = "hdr/3/58dsrise.jpg";
    picture[59] = "hdr/3/59fallfern.jpg";
    picture[60] = "hdr/3/60bigsur.jpg";
    picture[61] = "hdr/3/61blur.jpg";
    picture[62] = "hdr/3/62bowlingball.jpg";
    picture[63] = "hdr/3/63surclouds.jpg";
    picture[64] = "hdr/3/64yosemite.jpg";
    picture[65] = "hdr/3/65fireworks.jpg";
    picture[66] = "hdr/3/66keyreflect.jpg";
    picture[67] = "hdr/3/67mallsunrise.jpg";
    picture[68] = "hdr/3/68bigsky.jpg";
    picture[69] = "hdr/3/69libcongress.jpg";
    picture[70] = "hdr/3/70elekala2.jpg";
    picture[71] = "hdr/3/71blueberries.jpg";
    picture[72] = "hdr/3/72sundew.jpg";
    picture[73] = "hdr/3/73ice.jpg";
    picture[74] = "hdr/3/74bobcat.jpg";
    picture[75] = "hdr/3/75whitney.jpg";
    picture[76] = "hdr/3/76colorado.jpg";
    picture[77] = "hdr/3/77hearst.jpg";
    picture[78] = "hdr/3/78bowlake.jpg";
    picture[79] = "hdr/3/79vikchurch.jpg";

		window.setTimeout("NextImage();",100);
		first = 60;
		first = Math.round(Math.random()*(picture.length-5)/5)*5;
	}
}

function NextImage() {
	if (runslideshow) {
		if (randimg) first = Math.round(Math.random()*(picture.length-4));
		else {
			first -= 5;
			if (first < 0) first = picture.length - 5;
		}
		// test for filter-compatible browser (IE)
		if (document.images.slide0.filters) {
			document.images.slide0.style.filter="blendTrans(duration=1)";
			document.images.slide1.style.filter="blendTrans(duration=1)";
			document.images.slide2.style.filter="blendTrans(duration=1)";
			document.images.slide3.style.filter="blendTrans(duration=1)";
			document.images.slide4.style.filter="blendTrans(duration=1)";
			document.images.slide0.filters.blendTrans.Apply();
			document.images.slide1.filters.blendTrans.Apply();
			document.images.slide2.filters.blendTrans.Apply();
			document.images.slide3.filters.blendTrans.Apply();
			document.images.slide4.filters.blendTrans.Apply();
		}
		document.slide0.src = picture[first+0];
		document.slide1.src = picture[first+1];
		document.slide2.src = picture[first+2];
		document.slide3.src = picture[first+3];
		document.slide4.src = picture[first+4];
		// if this filter supported by browser:
		if (document.images.slide0.filters) {
			document.images.slide0.filters.blendTrans.Play();
			window.setTimeout("Play1();",500);
			window.setTimeout("Play2();",1000);
			window.setTimeout("Play3();",1500);
			window.setTimeout("Play4();",2000);
		}
	}
	window.setTimeout("NextImage();",9000);
}
function Play1() {document.images.slide1.filters.blendTrans.Play();}
function Play2() {document.images.slide2.filters.blendTrans.Play();}
function Play3() {document.images.slide3.filters.blendTrans.Play();}
function Play4() {document.images.slide4.filters.blendTrans.Play();}

function stopgo() {
	if (runslideshow) runslideshow = false;
	else runslideshow = true;
}

function randset() {
	if (randimg) randimg = false;
	else randimg = true;
}


// add initialization to window.onload
if (typeof window.onload == 'function')
{
	var func = window.onload;
	window.onload = function(){func();preloadImages();};
}
else
{
	window.onload = function(){preloadImages();};
}



var myHeight;
var myWidth;
function bigpic(xsize, WINTITLE, WIDTH, HEIGHT) {
//myHeight = HEIGHT + 12;
myHeight = HEIGHT + 16;
myWidth = WIDTH + 24;
if (bname == "Microsoft Internet Explorer") {
	myHeight += 28;
	myWidth += 12;
}

text = "<html><head><title>" + WINTITLE + "Enlargement - www.PhotoCentric.Net</title><s" + "cript type='text/javascript' src='pcn2.js'></s" + "cript></head>";
text += "<body topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' bgcolor='#000000' onLoad='top.window.focus()'>";
text += "<center><img alt='www.PhotoCentric.net' src='" + xsize + "L.j";
text += "pg' border=0 GALLERYIMG='no'></a></center></body></html>";
poppic = window.open("","picwin","width=100,height=100,resizable=yes");
setTimeout("update()",50);
poppic.focus();
}

function enlarge(xsize, WIDTH, HEIGHT) {
myHeight = HEIGHT + 34;
myWidth = WIDTH + 24;
if (bname == "Microsoft Internet Explorer") {
	myHeight += 28;
	myWidth += 12;
}

text = "<html><head><title>Enlargement - www.PhotoCentric.Net</title><s" + "cript type='text/javascript' src='pcn2.js'></s" + "cript></head>";
text += "<body topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' bgcolor='#000000' onLoad='top.window.focus()'>";
text += "<center><img alt='www.PhotoCentric.net' src='" + xsize + "L.j";
text += "pg' border=0 GALLERYIMG='no'></a></center></body></html>";
poppic = window.open("","picwin","width=100,height=100,resizable=yes,toolbar=no,menubar=no,status=no");
setTimeout("update()",50);
poppic.focus();
}


function update() {
poppic.document.open();
poppic.document.write(text);
poppic.document.close();
poppic.resizeTo(myWidth, myHeight);
}

function eradic8() {
  if (poppic != null && poppic.open) poppic.close();
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0 
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
	if (restore) selObj.selectedIndex=0; 
} 

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}


// suppress error messages to end user when development finished
function stopError() {
  return true;
}
window.onerror = stopError;

// anti-spambot addresses
function PhotoCentric_Net() {
  var contact1 = "PhotoCentric.Net"
  var id = "tfield"
  var host = "erols."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "com>" + contact1 + "</a>")
}

function Roy_Sewall() {
  var contact1 = "Roy Sewall"
  var id = "roy"
  var host = "sewallinc."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "com>" + contact1 + "</a>")
}

function Tom_Field() {
  var contact1 = "Tom Field"
  var id = "tfield"
  var host = "erols."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "com>" + contact1 + "</a>")
}

function Kent_Mason() {
  var contact1 = "Kent Mason"
  var id = "kent.mason"
  var host = "att."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "net>" + contact1 + "</a>")
}

function Carl_Root() {
  var contact1 = "Carl Root"
  var id = "carldroot"
  var host = "comcast."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "net>" + contact1 + "</a>")
}

function Ted_Oberman() {
  var contact1 = "Ted Oberman"
  var id = "tober41"
  var host = "verizon."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "net>" + contact1 + "</a>")
}

function e_mail() {
  var contact1 = "e-mail"
  var id = "tfield"
  var host = "erols."
	if (document.all || document.getElementsByName)
	  document.write("<a href=" + "ma" + "il" + "to:" + id + "&#64" + host + "com>" + contact1 + "</a>")
}

// provide a bookmark this site function, only for IE 4+ browsers
// script from http://www.dynamicdrive.com
var bookmarkurl="http://www.photocentric.net"
var bookmarktitle=".PhotoCentric.Net - Tips, Articles"
function addbookmark(){
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function linkie4() {
	//if the user is using IE 4+
	if (document.all)
		document.write('<a href="javascript:addbookmark()">Bookmark this site!</a>')
}
