// eval(is('v'));
function is(v){ return "(typeof(" + v + ") == 'undefined') ? false:true;";};

function notfound(obj)
{
	var fix = document.createElement("DIV");
	fix.style.width = "100px";
	fix.style.height = "75px";
	fix.style.border = "1px solid #e9e9e9";
	fix.style.padding = "2px";
	fix.style.textAlign = "center";
	fix.innerHTML = "Sorry Image could not be found.";
	if(document.all == null)
	{
		fix.style.display = "table-cell";
	}
	obj.parentNode.replaceChild(fix,obj);
}


function PHOTO(id,title,numcomments,sizes)
{
	this.gallerypage = null;
	this.markup = null;
	
	this.id = id;
	this.title = title;
	this.numcomments = numcomments;
	this.sizes = sizes;
}

PHOTO.prototype.render = function()
{
	this.markup = document.createElement("DIV");
	this.markup.className = "photodiv";
	var t = "";
	if(this.title != null && this.title != "")
	{
		t = " - " + this.title;
	}
	
	var code = "<a href='" + this.gallerypage.gallery.detailurl + "&photoid=" + this.id + "'><img src='images/" + this.id + "s.jpg' class='img' title='Click to Enlarge" + t + "' style='margin-bottom:1px;' alt='" + this.title + "' onerror='notfound(this);'></a>";
	this.markup.innerHTML = code;
	
	return this.markup;
}

PHOTO.prototype.unload = function()
{
	if(this.markup.parentNode != null)this.markup.parentNode.removeChild(this.markup);
	this.gallerypage = null;
	this.markup = null;
	
	this.id = null;
	this.title = null;
	this.numcomments = null;
	this.sizes = null;
}

function GALLERY(id, title, url, ajaxurl, detailurl, pagesize, numphotos)
{
	this.markup = null;
	
	this.controls = new Array();
	
	this.id = id;
	this.title = title;
	this.url = url;
	this.ajaxurl = ajaxurl;
	this.detailurl = detailurl;
	this.pagesize = pagesize;
	this.numphotos = numphotos;
	
	this.currentpage = null;
	this.cpage = null;
	this.going = false;
	
	this.loadedpages = new Array();
	this.maxloaded = 5;
}

GALLERY.prototype.addToDoc = function(c)
{
	this.markup = document.createElement("DIV");
	this.markup.style.overflow = "hidden";
	this.markup.style.position = "relative";
	this.markup.style.height = "650px";
	
	$(c).appendChild(this.markup);
	
	/*
	this.scroll = new Fx.Scroll(this.markup,
	{
		wait:false,
		duration: 1500,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Quad.easeInOut
	}); */
	
	//this.gotopage(this.currentpage || 1);
}

GALLERY.prototype.gotopage = function(pagenumber)
{
	var me = this;	
	
	var frame = 0;
	var page = null;
	var oldpage = me.cpage;
	var animi = null;
	
	function animate(d)
	{
		if (d != 'left')
		{
			if (page != null) {
				page.style.left = (100 - 2 * frame) + "%";
			}
			if (oldpage != null) {
				 oldpage.style.left = (-2 * frame) + "%";
			}
		}
		else
		{
			if (page != null) {
				page.style.left = (-100 + 2 * frame) + "%";
			}
			if (oldpage != null) {
				oldpage.style.left = (2 * frame) + "%";
			}
		}
		frame++;
		if (frame == 51)
		{
			if(oldpage.parentNode)oldpage.parentNode.removeChild(oldpage);
			clearInterval(animi);
			AH.add("results=" + (((pagenumber - 1) * me.pagesize) + 1),'Page ' + pagenumber);
			me.going = false;
		}
	}
	
	function cb(cbpage)
	{
		page = cbpage.render();
		
		if ((me.currentpage == null) || ((me.currentpage == pagenumber)))
		{
			//me.markup.innerHTML = "";
			page.style.left = 0;
			if (me.cpage != null)
			{
				me.cpage.parentNode.removeChild(me.cpage);
			}
			me.markup.appendChild(page);
			AH.add("results=" + (((pagenumber - 1) * me.pagesize) + 1),'Page ' + pagenumber);
			me.going = false;
		}
		else
		{
			if (me.currentpage > pagenumber)
			{
				//add on right
				//me.markup.innerHTML = "";
				page.style.left = "100%";
				me.markup.appendChild(page);
				animi = setInterval(
				function(){
					animate('left')
				},
				2
				);
				
			}
			else
			{
				//add on left
				//me.markup.innerHTML = "";
				page.style.left = "-100%";
				me.markup.appendChild(page);
				animi = setInterval(
				function(){
					animate('right')
				},
				2
				);
			}
			//window.location.hash = "results=" + pagenumber;
		}
		me.currentpage = cbpage.pagenumber;
		me.cpage = page;
		for( var i = 0; i < me.controls.length; i++)
		{
			me.controls[i].toNumber(me.currentpage);
		}
	}
	
	if(!me.going)
	{
		me.going = true;
		var l = this.loadedpages.length;
		var isloaded = null;
		for(var i = 0; i < l; i++)
		{
			if(this.loadedpages[i].pagenumber == pagenumber)
			{
				isloaded = i;
				break;
			}
		}
		if(isloaded == null)
		{
			if(l == this.maxloaded)
			{
				var p = null;
				if(me.currentpage == this.loadedpages[0].pagenumber)
				{
					p = this.loadedpages.pop();
				}
				else
				{
					p = this.loadedpages.shift();
				}
				p.unload();
			}
			
			isloaded = this.loadedpages.push(new GALLERYPAGE(pagenumber, this)) - 1;
			this.loadedpages[isloaded].loadpage(cb);
		}
		else
		{
			cb(me.loadedpages[isloaded]);
		}	
	}
}

GALLERY.prototype.unload = function()
{
	while(this.loadedpages.length)
	{
		var p = this.loadedpages.pop();
		p.unload();
	}
	if(this.markup.parentNode != null)this.markup.parentNode.removeChild(this.markup);
	this.markup = null;
	
	this.id = null;
	this.title = null;
	this.url = null;
	this.ajaxurl = null;
	this.detailurl = null;
	this.pagesize = null;
	this.numphotos = null;
	
	this.currentpage = null;
	
	this.loadedpages = null;
	this.maxloaded = null;
}

function GALLERYPAGE(pagenumber, gallery)
{
	this.gallery = gallery;
	this.markup = null;
	
	this.pagenumber = pagenumber;
	
	this.photos = new Array();
}

GALLERYPAGE.prototype.loadpage = function(cb)
{
	var me = this;
	var url = this.gallery.ajaxurl + "&results=" + (((this.pagenumber - 1) * this.gallery.pagesize) + 1);
	new Ajax(url, {
		method:'get',
		evalScripts: true,
		onComplete:function()
		{
			AjaxReturn.photos.each(function(photo){
				me.addPhoto(photo);
			});
			cb(me);
		}
	}).request();
}

GALLERYPAGE.prototype.addPhoto = function(photo)
{
	var p = new PHOTO(photo.id,photo.title,photo.numcomments,photo.sizes);
	p.gallerypage = this;
	this.photos.push(p);
}

GALLERYPAGE.prototype.render = function()
{
	var pagetable = document.createElement("TABLE");
	pagetable.className = "gallerypage";
	
	
	var s = this.gallery.pagesize;
	var l = this.photos.length;
	var row = null;
	for(var i = 0; i < s; i++)
	{
		if(i % 6 == 0)row = pagetable.insertRow(Math.floor(i/6));
		var cell = row.insertCell(i % 6);
		if(i < l)
		{
			cell.appendChild(this.photos[i].render());
		}
	}
	this.markup = pagetable;
	return this.markup;
}

GALLERYPAGE.prototype.unload = function()
{
	while(this.photos.length)
	{
		var p = this.photos.pop();
		p.unload();
	}
	if(this.markup != null && this.markup.parentNode != null)this.markup.parentNode.removeChild(this.markup);
	
	this.gallery = null;
	this.markup = null;
	this.pagenumber = null;
	this.photos = null;
}

function GALLERYCONTROL(gallery, showinfo, container)
{
	this.gallery = gallery;
	this.showinfo = showinfo;
	this.container = container;
	
	this.markup = null;
	this.info = null;
	this.numbers = null;
	
	this.gallery.controls.push(this);
}

GALLERYCONTROL.prototype.render = function()
{
	var me = this;
	this.markup = document.createElement("DIV");
	this.markup.align = "center";
	this.markup.className = "gallerycontrol";
	
	if(this.showinfo)
	{
		this.info = document.createElement("DIV");
		this.info.className = "gallerycontrolinfo";
		this.markup.appendChild(this.info);
	}
	
	var prev = document.createElement("DIV");
	prev.innerHTML = "&#171;";
	prev.onclick = function(){me.toPrev()};
	this.markup.appendChild(prev);
	this.prev = prev;
	
	this.numbers = document.createElement("DIV");
	this.markup.appendChild(this.numbers);
	
	var next = document.createElement("DIV");
	next.innerHTML = "&#187;";
	next.onclick = function(){me.toNext()};
	this.markup.appendChild(next);
	this.next = next;
	
	this.container.appendChild(this.markup);
	
	this.toNumber(this.gallery.currentpage);
}

GALLERYCONTROL.prototype.toNext = function()
{
	var n = this.gallery.currentpage + 1;
	if(n > Math.ceil(this.gallery.numphotos / this.gallery.pagesize))
	{
		n = Math.ceil(this.gallery.numphotos / this.gallery.pagesize);
	}
	this.gallery.gotopage(n);
}

GALLERYCONTROL.prototype.toPrev = function()
{
	var n = this.gallery.currentpage - 1;
	if(n < 1)n = 1;
	this.gallery.gotopage(n);
}

GALLERYCONTROL.prototype.toNumber = function(n)
{
	if(n != null);
	{
		var me = this;
		var nsdiv = document.createElement("DIV");
		
		var nmin = n - 4;
		var nmax = n + 4;
		if (nmax > Math.ceil(this.gallery.numphotos / this.gallery.pagesize)) {
			nmax = Math.ceil(this.gallery.numphotos / this.gallery.pagesize);
		}
		if (nmin < 1)
		{
			nmin = 1;
		}
		
		if(n == Math.ceil(this.gallery.numphotos / this.gallery.pagesize))
		{
			this.next.className = "endpage";
		}
		else
		{
			this.next.className = "pagenumber";
		}
		
		if(n == 1)
		{
			this.prev.className = "endpage";
		}
		else
		{
			this.prev.className = "pagenumber";
		}
		
		for (var i = nmin; i <= nmax; i++) {
			var ndiv = document.createElement("DIV");
			ndiv.className = "pagenumber";
			ndiv.innerHTML = i;
			
			var t = "Photos ";
			var x = (i - 1) * this.gallery.pagesize + 1;
			t += x;
			t += " - ";
			if (x + this.gallery.pagesize - 1 > this.gallery.numphotos) {
				t += this.gallery.numphotos;
			}
			else {
				t += x + this.gallery.pagesize - 1;
			}
			ndiv.title = t;
			if (i != n) {
				eval("ndiv.onclick = function(){me.gallery.gotopage(" + i + ")}");
			}
			else {
				if (this.showinfo) {
					this.info.innerHTML = t + " of " + this.gallery.numphotos;
				}
				ndiv.className = "selectedpage";
			}
			nsdiv.appendChild(ndiv);
		}
		
		this.markup.replaceChild(nsdiv, this.numbers);
		this.numbers = nsdiv;
		
	}
}


function PHOTOINFO(baseurl, ajaxurl, lastlinkcell, nextlinkcell, currentphoto, photopod, commentspod, postpod, titlebase)
{
	this.titlebase = titlebase;
	this.baseurl = baseurl;
	this.ajaxurl = ajaxurl;
	this.lastlinkcell = lastlinkcell;
	this.nextlinkcell = nextlinkcell;
	this.currentphoto = currentphoto;
	
	this.photopod = photopod;
	this.commentspod = commentspod;
	this.postpod = postpod;
	
	this.markup_photopod;
	this.markup_commentspod;
	this.markup_postpod;
	this.obj = null;
	
	postpod.addEvent('submit', function(e) {
			new Event(e).stop();
		 	if(!checkForm($('postpod'))){return};
			this.send({
				onComplete: function() {
					commentposted();
				}
			});
		});
		
		$('postpodbuttoncell').innerHTML = "<a onclick=\"if(!checkForm($('postpod'))){return}; $('postpod').send({onComplete: function() {commentposted();}});\" class=\"linkbutton\" title=\"Post Comment\" href=\"javascript:void(0);\"><span>Post Comment</span></a>"
	
}

PHOTOINFO.prototype.load = function(photoid)
{
	var me = this;
	var url = this.ajaxurl + "&photoid=" + photoid;
	new Ajax(url, {
		method:'get',
		evalScripts: true,
		onComplete:function()
		{
			me.unload();
			me.obj = AjaxReturn;
			me.render();
			AH.add("photoid=" + photoid, window.document.title);
		}
	}).request();
}

PHOTOINFO.prototype.render = function()
{
	if (this.obj != null)
	{
		
		this.markup_photopod = document.createElement("DIV");
		
		var o = this.obj;
		
		var p = o.photoinfo;
		
		window.document.title = ((p.title != '')? p.title + ' - ':'') + this.titlebase;
		
		$('commentref').value = p.photoid;
		
		this.currentphoto.innerHTML = "Photo " +p.photonum + " of " + p.numphotos;
		
		if(eval(is('p.previd')))
		{
			this.lastlinkcell.innerHTML = "<a href='" + this.baseurl + "&photoid=" + p.previd + "' onclick='return PIC0.prev();'>&laquo; Last</a>";
		}
		else
		{
			this.lastlinkcell.innerHTML = "";
		}
		
		if(eval(is('p.nextid')))
		{
			this.nextlinkcell.innerHTML = "<a href='" + this.baseurl + "&photoid=" + p.nextid + "' onclick='return PIC0.next();'>Next &raquo;</a>";
		}
		else
		{
			this.nextlinkcell.innerHTML = "";
		}
		
		
		var pdiv = document.createElement("DIV");
		pdiv.align="center";
		
			var l = document.createElement("A");
			l.href = "javascript:void(0)";
			
			var s = "no";
			if(p.h > 570)
			{
				s = "yes";
			}
			l.setAttribute('onclick',"NewWindow('viewlarge.cfm?photoid=" + p.photoid + "','popup'," + p.w + "," + p.h + ",'" + s + "');");
			
				var pic = document.createElement("IMG");
				if(eval(is('p.sizes.L')))
				{
					pic.src="images/" + p.photoid + "l.jpg";
				}
				else
				{
					pic.src="/main/no_image_lg.gif";
				}
				
				if(p.title != "")pic.title = "Click to Enlarge - " + p.title;
				else pic.title = "Click to Enlarge";
				pic.className = "img";
				
			l.appendChild(pic);
			
		pdiv.appendChild(l);
		
		this.markup_photopod.appendChild(pdiv);
		
		var t0 = document.createElement("TABLE");
			t0.className = 'maintext';
			t0.style.width = "100%";
			t0.cellPadding = "0";
			t0.cellSpacing = "0";
			t0.style.border = "0";
			
			var tr0 = t0.insertRow(0);
			var td0 = tr0.insertCell(0);
					td0.style.width = "70%";
						var c = "<br>Submitted By: ";
						if(eval(is('p.mid')))
						{
							c += '<img src="/myprofile/icons_signin.gif" border="0" style="margin-bottom:-3px;"> ';
							c += '<a href="/people/?member='+ p.mid +'" style="text-decoration:underline;">';
							if(p.mname != "")c+= p.mname;
							else c+= 'Anonymous';
							c+= '</a>';
						}
						else
						{
							if(p.photocredit != "")
							c = "Credit: ";
							if(p.website != "")
							{
								c += '<a href="' + p.website + '" target="_blank" style="text-decoration:underline;">' + p.photocredit + '</a>';
							}
							else
							{
								c+= p.photocredit;
							}
						}
					td0.innerHTML = c;
			var td_sizes = tr0.insertCell(1);
					td_sizes.style.width = "30%";
					td_sizes.style.textAlign = "right";
					td_sizes.style.whiteSpace = "nowrap";
						if(eval(is('p.sizes.XXL')) && p.sizes.XXL == true)
						{
							var l = document.createElement("A");
							l.href = "javascript:void(0)";
							
							var s = "no";
							if(p.h > 570)
							{
								s = "yes";
							}
							
							l.setAttribute('onclick',"NewWindow('viewlarge.cfm?photoid=" + p.photoid + "','popup'," + p.w + "," + p.h + ",'" + s + "');");
							
								var pic = document.createElement("IMG");
								pic.src="/main/enlarge.gif";
								pic.title = "Click here to view XX Large version (opens in new window).";
								pic.style.border = 0;
								
							l.appendChild(pic);
							td_sizes.appendChild(l);
						}
						
						if(eval(is('p.sizes.FULL')) && p.sizes.FULL == true)
						{
							var l = document.createElement("A");
							l.href = "javascript:void(0)";
							
							var s = "yes";
							
							l.setAttribute('onclick',"NewWindow('viewlarge.cfm?photoid=" + p.photoid + "&type=full','popup'," + eval(is('p.cw'))? p.cw : 960 + "," + eval(is('p.ch'))? p.ch : 720 + ",'" + s + "');");
							
								var pic = document.createElement("IMG");
								pic.src="/main/xxl.gif";
								pic.title = "Click here to view XX Large version (opens in new window).";
								pic.style.border = 0;
								
							l.appendChild(pic);
							td_sizes.appendChild(l);
						}
						
						if(eval(is('p.sizes.W')) && p.sizes.W == true)
						{
							var l = document.createElement("A");
							l.href = "javascript:void(0)";
							
							var s = "yes";
							
							l.setAttribute('onclick',"NewWindow('viewlarge.cfm?type=wallpaper&photoid=" + p.photoid + "','popup',1024,768,no);");
							
								var pic = document.createElement("IMG");
								pic.src="/main/wallpaper.gif";
								pic.title = "Click here for wallpaper version (opens in new window).";
								pic.style.border = 0;
								
							l.appendChild(pic);
							td_sizes.appendChild(l);
						}
						
						if(eval(is('p.sizes.MOV')))
						{
							var l = document.createElement("A");
							l.href = "javascript:void(0)";
							
							var s = "yes";
							
							l.setAttribute('onclick',"NewWindow('viewmovie.cfm?photoid=" + p.photoid + "','popup',438,340,no);");
							
								var pic = document.createElement("IMG");
								pic.src="/main/movies_lt.gif";
								pic.title = "Click here to view this movie (opens in new window).";
								pic.style.border = 0;
								
							l.appendChild(pic);
							td_sizes.appendChild(l);
						}
						
		
		this.markup_photopod.appendChild(t0);				
		
		if(eval(is('p.paypal')) && p.paypal != null)
		{
			this.markup_photopod.innerHTML += "<br>" +  p.paypal + "<br>";
		}
		
		if(eval(is('p.potd')))
		{
			this.markup_photopod.innerHTML += "<br><b>" +  p.potd + ((p.title != '')? " - " + p.title:'') + "</b><br>";	
		}
		else
		{
			this.markup_photopod.innerHTML += "<br><b>Posted:" +  p.posted + ((p.title != '') ? " - " + p.title:'') + "</b><br>";	
		}
		
		if(p.caption) this.markup_photopod.innerHTML += p.caption;
		
		if (p.location != "") {
		//location artist information and comments
		var t1 = document.createElement("TABLE");
			t1.className = 'maintext';
			t1.style.width = "100%";
			t1.cellPadding = "0";
			t1.cellSpacing = "0";
			t1.style.border = "0";
			
			var tr1 = t1.insertRow(0);
				var td1 = tr1.insertCell(0);
					td1.style.width = "100px";
					td1.style.verticalAlign = "top";
					td1.innerHTML = "<b>Location:</b>";
					
				var td2 = tr1.insertCell(1);
					td2.style.verticalAlign = "top";
					td2.innerHTML = p.location + "<br><br>";
					
			var tr2 = t1.insertRow(1);
				var td3 = tr2.insertCell(0);
					td3.style.width = "100px";
					td3.style.verticalAlign = "top";
					td3.innerHTML = "<b>Artist & Year:</b>";
					
				var td4 = tr2.insertCell(1);
					td4.style.verticalAlign = "top";
					td4.innerHTML = p.artist + "<br><br>";
					
			var tr3 = t1.insertRow(2);
				var td5 = tr3.insertCell(0);
					td5.style.width = "100px";
					td5.style.verticalAlign = "top";
					td5.innerHTML = "<b>Information:</b>";
					
				var td6 = tr3.insertCell(1);
					td6.style.verticalAlign = "top";
					td6.innerHTML = p.information + "<br><br>";
			
			var tr4 = t1.insertRow(3);
				var td7 = tr4.insertCell(0);
					td7.style.width = "100px";
					td7.style.verticalAlign = "top";
					td7.innerHTML = "<b>Interesting Points:</b>";
					
				var td8 = tr4.insertCell(1);
					td8.style.verticalAlign = "top";
					td8.innerHTML = p.comments + "<br><br>";
			
			this.markup_photopod.appendChild(t1);
			
		}
		
		if (p.galleryid != 0) {
			var gdiv = document.createElement("DIV");
			gdiv.align = "center";
			gdiv.innerHTML = '<br><b><a href="displaygallery.cfm?type=regular&galleryid=' + p.galleryid + '">Click here to view this gallery.</a></b>'
			this.markup_photopod.appendChild(gdiv);
		}
		
		this.photopod.appendChild(this.markup_photopod);
		
		if(o.comments.length != 0)
		{
			$('outercommentspod').style.display = "block";
		}
		else
		{
			$('outercommentspod').style.display = "none";
		}
		
		this.commentspod.innerHTML = "";
		this.markup_commentspod = document.createElement("DIV");
		
		var t2 = document.createElement("TABLE");
		t2.className = 'maintext';
			t2.style.width = "100%";
			t2.cellPadding = "0";
			t2.cellSpacing = "0";
			t2.style.border = "0";
		
		for(var i = 0; i < o.comments.length; i++)	
		{
			var trX = t2.insertRow(i);
			var tdX = trX.insertCell(0);
			var tY = document.createElement("TABLE");
				tY.style.width = "100%";
				tY.cellPadding = "0";
				tY.cellSpacing = "0";
				tY.style.border = "0";
				tY.style.marginTop = "2px";
				
				var trY = tY.insertRow(0);
				var tdY = trY.insertCell(0);
					tdY.className = 'maintext';
					tdY.innerHTML = "<a name='comment" + o.comments[i].commentid + "'></a> Posted: " + o.comments[i].posted;
				
				var tdZ = trY.insertCell(1);
					tdZ.className = 'reportsm';
					tdZ.setAttribute('align','right');
					tdZ.innerHTML = "<a href='javascript:void(0)' onclick=\"NewWindow('/main/report.cfm?directoryid=" + o.comments[i].directoryid + "&commentid=" + o.comments[i].commentid + "','popup','400','250','no');return false;\">Report This Comment</a>";
					
			tdX.appendChild(tY);
			tdX.innerHTML += o.comments[i].comment + o.comments[i].poster;
			
			if(o.comments[i].edited != null)
			{
				tdX.innerHTML += "<i>This comment was edited on " + o.comments[i].edited + ".</i><br><br>";
			}
			
			if(i < o.comments.length - 1)
			{
				var tLine = document.createElement("TABLE");
				tLine.style.width = "100%";
				tLine.style.height="1px";
				tLine.cellPadding = "0";
				tLine.cellSpacing = "0";
				tLine.style.border = "0";
				tLine.style.marginTop = "5px";
				tLine.style.marginBottom = "5px";
				
				var trLine = tLine.insertRow(0);
				var tdL1 = trLine.insertCell(0);
					tdL1.style.width = "30px";
					tdL1.innerHTML = '<img src="/main/sub_separator_left.gif" border="0">';
				
				var tdL2 = trLine.insertCell(1);
					//tdL2.style.width = "*";
					tdL2.style.backgroundColor = "#E9E9E9";
					tdL2.innerHTML = '<img src="/main/transparent.gif" border="0">';
				
				var tdL3 = trLine.insertCell(2);
					tdL3.style.width = "30px";
					tdL3.innerHTML = '<img src="/main/sub_separator_right.gif" border="0">';
				
				tdX.appendChild(tLine);
				
			}
		}
		
		this.markup_commentspod.appendChild(t2);
		this.commentspod.appendChild(this.markup_commentspod);
			
	}
};

PHOTOINFO.prototype.unload = function()
{
	this.photopod.innerHTML = "";
	if(this.markup_photopod != null && this.markup_photopod.parentNode != null)
	{
		this.markup_photopod.parentNode.removeChild(this.markup_photopod);
		this.markup_photopod = null;
	}
	
	if(this.markup_commentspod != null && this.markup_commentspod.parentNode != null)
	{
		this.markup_commentspod.parentNode.removeChild(this.markup_commentspod);
		this.markup_commentspod= null;
	}
	if(this.markup_postpod != null && this.markup_postpod.parentNode != null)
	{
		this.markup_postpod.parentNode.removeChild(this.markup_postpod);
		this.markup_commentspod = null;
	}
	this.obj = null;
};

PHOTOINFO.prototype.next = function()
{
	this.load(this.obj.photoinfo.nextid);
	return false;
}

PHOTOINFO.prototype.prev = function()
{
	this.load(this.obj.photoinfo.previd);
	return false;
}

function commentposted()
{
	if(!dbox)
	{
		var c = document.createElement("div");
		c.className = "maintext";
		var o = new AlertBox(name,"Your comment has been received and will be posted to the site shortly. Thank you!");
		c.appendChild(o.optsbox);
		var b = document.createElement("div");
		b.style.bottom = 5 + "px";
		b.style.right = 5 + "px";
		b.style.left = 5 + "px";
		b.style.position = "absolute";
		b.style.textAlign = "center";
		b.innerHTML = "<a onclick=\"closebox()\" class=\"linkbutton\" title=\"Ok\" href=\"javascript:void(0);\"><span>OK</span></a>"
		c.appendChild(b);
		openbox(512,256,"Comment Received",c);
	}
}



