function addtomybox(imageid){
	eval('document.form1.boxbtn' + imageid + '.src=\'addtobox.asp?imageid=' + imageid +'\';');
}

function slideshow(imageid,categoryid){
	thebox=document.form1.box.value;
	thenew=document.form1.shownew.value;
	document.form1.action='gallery.asp?action=viewimage&slideshow=on&categoryid=' + categoryid + '&imageid=' + imageid + '&box=' + thebox +'&shownew=' + thenew ;
	document.form1.submit();
}

function stopslideshow(){
	window.clearTimeout(timer1)
	document.form1.slideshowon.style.display='';
	document.form1.slideshowoff.style.display='none';
	document.getElementById("slideshowmode").style.display='none';
}

function ratefile(imageid){
	var	rating=window.open('rateimage.asp?imageid=' + imageid ,'rating','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width=200,height=240');
}

function clearmybox(){
if (confirm('Clear Your Favorite Files?')) self.location.href='gallery.asp?action=mybox&clear=1';
}

function openmybox(){
	var openmybox=window.open('mybox.asp'  ,'openmybox','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width=400,height=300');
}

function sendpostcard(imageid){
	var	postcard=window.open('sendpostcard.asp?imageid=' + imageid ,'postcard','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=720,height=460');
}

function doGalleryPics(el,start,reps){if(!nodeCheck(el))return;if(el.children!=null){start=(typeof(start)=="undefined")?1:start;reps=(typeof(reps)=="undefined")?99:reps+start-1;var i=0;var els=el.children;for(var e=0;e<els.length;e++){var ch=els[e];if((ch.nodeType=='ELEMENT')&&(ch.tagName=='item')){i++;if(i<=reps&&i>=start){var img=ch.ge("img")[0];var info=ch.ge("info")[0];d('<div class="polaroidOuter">');d('	<div class="polaroidInner" style="background:url(/gallery/'+img.ga("src")+') no-repeat center;">');var addDel=(ch.ga("fav")!="true")?"add this photo to":"remove this photo from";var fave=(ch.ga("fav")!="true")?"butAddToFaves":"butDeleteFromFaves";d('		<a href="javascript:addtomybox(\''+ch.ga("id")+'\')" title="Click here to '+addDel+' your favourites..."><img name="boxbtn'+ch.ga("id")+'" src="images/'+fave+'.gif" width="12" height="15" border="0" hspace=2 vspace=2 /></a>');d('	</div>');d('	<div class="polaroidTitle">');d('		<a href="/gallery/gallery.asp?action=viewimage&categoryid='+el.ga("id")+'&text='+el.ga("text")+'&imageid='+ch.ga("id")+'&box='+el.ga("box")+'&shownew='+el.ga("shownew")+'">'+ch.ga("title")+'</a>');d('	</div>');d('	<div class="polaroidText">');d('		<strong>Member:</strong> '+info.ga("member")+'<br /><strong>Angler:</strong> '+info.ga("angler")+'<br /><strong>Species:</strong> '+info.ga("species")+'<br /><strong>Location:</strong> '+info.ga("location")+'<br /><strong>Date:</strong> '+info.ga("date"));d('	</div>');d('</div>')}}}}}


function doGalleryPic(align,alt,lowSrc,lowWid,lowHt,hiSrc,hiWid,hiHt,hiLeft,hiTop){
	align=(align=="left")?" align=left":(align=="right")?" align=right":"";alt=(alt!="")?alt:(typeof(hiSrc)!="string")?"Click here for hi-res image...":"Image subject to copyright";d('<table '+t(0,0)+align+'><tr><td');if(typeof(hiSrc)=="string")d('><a href=# onclick="openPictureWindow(\''+hiSrc+'\','+hiWid+','+hiHt+',\''+alt+'\','+hiLeft+','+hiTop+');"');d('><img src='+lowSrc+' width='+lowWid+' height='+lowHt+' alt="'+alt+'" class=PicBorder border=0></a');d('></td><td valign=top background='+imgDir+'imgPicShadowRight.gif><img src='+imgDir+'imgPicShadowCnrTop.gif width=6 height=6></td></tr>');d('<tr><td background='+imgDir+'imgPicShadowBot.gif><img src='+imgDir+'imgPicShadowCnrLeft.gif width=6 height=6></td>');d('<td width=6><img src='+imgDir+'imgPicShadowCnrBot.gif width=6 height=6></td></tr></table>')
}