function PopImg(w,h,id,photo_id) {
	barHeight = 40;
    win=window.open('pop_photo.asp?photo_id='+photo_id+'&img_url='+id,'itemwin','toolbar=no,location=no,menu=no,scrollbars=no,directories=no,resizable=yes,width='+w+',height='+(h+barHeight)+',screenX=0,screenY=0,top=0,left=0');
	win.focus();
}
function viewComments(id) {
    win=window.open('view_comments.asp?photo_id='+id,'viewmesswin','toolbar=no,location=no,menu=no,scrollbars=yes,directories=no,resizable=no,width=255,height=450');
    win.focus();
}
function getSafeElement(id) {
	return document.getElementById?document.getElementById(id):(document.all?document.all(id):null)
}

function resizeWindow_OLD() {
	barHeight = 40
	i = getSafeElement("theImage");
	if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0) {
		self.resizeTo(i.width+10,i.height+30+barHeight);
	} else {
		window.resizeTo(i.width+10,i.height+30+barHeight);
	}
}

function resizeWindow() {
	var i=0;
	if (navigator.appName == 'Netscape') i=0;
	if (document.images[0]) window.resizeTo(document.images[0].width+10 , document.images[0].height+100-i);
	self.focus();
}

function showInfo(d) {
	if (d) {
		getSafeElement("popPhotoInfoText").style.display = "block";
	} else {
		getSafeElement("popPhotoInfoText").style.display = "none";
	}
}

function showMeta(d) {
	if (d) {
		getSafeElement("popPhotoMetaText").style.display = "block";
	} else {
		getSafeElement("popPhotoMetaText").style.display = "none";
	}
}



function showComment(id) {
id = "comment"+id;
 if (getSafeElement(id).style.display == 'block') {
  // hide
  getSafeElement(id).style.display = 'none';
 } else {
  //show  
  getSafeElement(id).style.overflow = 'hidden';
  getSafeElement(id).style.height = '1px';
  getSafeElement(id).style.display = 'block';
  setTimeout("slowShow('"+id+"',2);",0);

 }
 
}

function showWriteComment(id) {
id = "writeComment"+id;
 if (getSafeElement(id).style.display == 'block') {
  // hide
  getSafeElement(id).style.display = 'none';
 } else {
  //show  
  getSafeElement(id).style.overflow = 'hidden';
  getSafeElement(id).style.height = '1px';
  getSafeElement(id).style.display = 'block';
  setTimeout("slowShow('"+id+"',2);",0);

 }
 
}

function slowShow(id,i) {
 if (i == 8) {
  getSafeElement(id).style.height = 'auto';
 } else {
  i++;
  getSafeElement(id).style.height = ((i*i)+10) + 'px';;
  setTimeout("slowShow('"+id+"',"+i+");",10);
 }

}




	
/* 
	Javascript to style odd/even table rows
	Derived from 'Zebra Tables' by David F. Miller (http://www.alistapart.com/articles/zebratables/)
	
	Modified by Jop de Klein, february 2005
	jop at validweb.nl
	http://validweb.nl/artikelen/javascript/better-zebra-tables/
*/

	var stripe = function() {
		var tables = document.getElementsByTagName("table");	

		for(var x=0;x!=tables.length;x++){
			var table = tables[x];
			if (! table) { return; }
			
			var tbodies = table.getElementsByTagName("tbody");
			
			for (var h = 0; h < tbodies.length; h++) {
				var even = true;
				var trs = tbodies[h].getElementsByTagName("tr");
				
				for (var i = 0; i < trs.length; i++) {
					//trs[i].onmouseover=function(){
					//	this.className += " ruled"; return false
					//}
					//trs[i].onmouseout=function(){
					//	this.className = this.className.replace("ruled", ""); return false
					//}
					
					if(even)
						trs[i].className += " even";
					
					even = !even;
				}
			}
		}
	}

	window.onload = stripe;