var pics = new Array();

pics[0] = new Video(
	"Visman Jumping Rope",
	"showcase/jumprope_th2.png",
	"showcase/jumprope_th.png",
	"showcase/jumprope.png",
	"http://vizlab.rutgers.edu/",
	"Visible Human Animation from Vizlab at Rutgers University, 2003."
);

pics[1] = new Video(
	"The Incredible Visible Human",
	"showcase/incredible_th2.png",	
	"showcase/incredible_th.png",
	"showcase/incredible.png",
	"http://vizlab.rutgers.edu/carlos/gallery.html",
	"Volume deformation of the Visible Human data set, 2005."
);

pics[2] = new Video(
	"Tranches de Poisson",
	"showcase/carp_th2.png",
	"showcase/carp_th.png",
	"showcase/carp.png",
	"http://vizlab.rutgers.edu/carlos/displacement",
	"Cutting of a volumetric carp data set, 2006."
);


pics[3] = new Video(
	"With Apologies to Gautier",
	"showcase/gautier_th2.png",
	"showcase/gautier_th.png",
	"showcase/gautier.png",
	"http://vizlab.rutgers.edu/carlos/gallery.html",
	"Volume Deformation with Discontinuous Displacement Mapping, 2006."
);


pics[4] = new Video(
	"Mouse fetus deformation",
	"showcase/fetus_th2.png",
	"showcase/fetus_th.png",
	"showcase/fetus.png",
	"http://vizlab.rutgers.edu/carlos/index.html",
	"Deformation of volumetric objects, 2006. Featured in <a class='link' href='http://genex.hgu.mrc.ac.uk/Collaborations/ChrisArmit/MORPHO_HOMEPAGE.HTM' target='_top'>Chris Armit's Morphogenesis page.</a>"
);

pics[5] = new Video(
	"Frog Dissection",
	"showcase/frog_th2.png",
	"showcase/frog_th.png",
	"showcase/frog.png",
	"http://vizlab.rutgers.edu/carlos/feature/index.html",
	"Feature-aligned volume deformation of frog data set, 2006."
);

pics[6] = new Video(
	"Foot Surgery",
	"showcase/foot_th2.png",
	"showcase/foot_th.png",
	"showcase/foot.png",
	"http://vizlab.rutgers.edu/carlos/feature/index.html",
	"Feature-aligned volume deformation of a CT foot data set, 2006."
);

pics[7] = new Video(
	"Armadillo",
	"showcase/armadillo_th2.png",
	"showcase/armadillo_th.png",
	"showcase/armadillo.png",
	"http://vizlab.rutgers.edu/carlos/deforender/index.html",
	"Deformation on rendering space using programmable shaders, 2007."
);

pics[8] = new Video(
	"Torso",
	"showcase/torso_th2.png",
	"showcase/torso_th.png",
	"showcase/torso.png",
	"http://vizlab.rutgers.edu/carlos/deforender/index.html",
	"Deformation on rendering space using programmable shaders, 2007."
);

pics[9] = new Video(
	"Water Balloon",
	"showcase/water_th2.png",
	"showcase/water_th.png",
	"showcase/water.png",
	"http://vizlab.rutgers.edu/carlos/deformation/index.html",
	"Deformable Video Visualization, 2007."
);

pics[10] = new Video(
	"Tornado Simulation",
	"showcase/tornado_th2.png",
	"showcase/tornado_th.png",
	"showcase/tornado.png",
	"http://vizlab.rutgers.edu/carlos/deformation/index.html",
	"Illustrative deformation of a tornado simulation data set, 2007."
);


pics[11] = new Video(
	"Visman Walking",
	"showcase/walk_th2.png",
	"showcase/walk_th.png",
	"showcase/walk.png",
	"bodies/index.html",
	"Deformation of volumetric objects, 2007."
);

pics[12] = new Video(
	"Tomato",
	"showcase/greenTomato_th2.png",
	"showcase/greenTomato_th.png",
	"showcase/greenTomato.png",
	"gallery.html",
	"Good old-fashioned transfer functions on a tomato data set, 2008."
);

pics[13] = new Video(
	"Head.Foot.Hand",
	"showcase/hfh_th2.png",
	"showcase/hfh_th.png",
	"showcase/hfh.png",
	"gallery.html",
	"Good old-fashioned transfer functions on a number of anatomical CT data sets, 2008."
);

pics[14] = new Video(
	"Brain Aneurysm",
	"showcase/sizeTF_th2.png",
	"showcase/sizeTF_th.png",
	"showcase/sizeTF.png",
	"gallery.html",
	"Size-based color coding of an aneurysm, 2008."
);

pics[15] = new Video(
	"Masks",
	"showcase/masks_th2.png",
	"showcase/masks_th.png",
	"showcase/masks.png",
	"gallery.html",
	"Volume rendering of tetrahedral mesh and a number of spherical scalar functions, 2008."
);

pics[16] = new Video(
	"Aircraft Wing Turbulence",
	"showcase/lwt_th2.png",
	"showcase/lwt_th.png",
	"showcase/lwt.png",
	"gallery.html",
	"High-quality volume rendering of unstructured mesh of an LWT aircraft simulation, 2008."
);


pics[17] = new Video(
	"Veiled Chameleon",
	"showcase/chameleon_th2.png",
	"showcase/chameleon_th.png",
	"showcase/chameleon.png",
	"gallery.html",
	"Volume and isosurface rendering with ambient occlusion, 2009."
);

pics[18] = new Video(
	"J., P., G. and R.",
	"showcase/beetles_th2.png",
	"showcase/beetles_th.png",
	"showcase/beetles.png",
	"gallery.html",
	"I like Ringo better, 2009."
);

pics[19] = new Video(
	"Probabilities in Monopoly",
	"showcase/monopoly_th2.png",
	"showcase/monopoly_th.png",
	"showcase/monopoly.png",
	"gallery.html",
	"Eigenvector centralities in the network of probabilities of the Monopoly (TM) board game."
);


function Video_Print() {
	var temp="";
	temp += "<span>"+this.title+"</span";
	temp += "<img src='"+this.pic+"' width=320>";
	//temp += "<a href='showcase.html?v="+(i-1) + "' target='vidframe'>Prev</a>";
	window.document.write(temp);
}

function Video(Title, Pic2, Pic, HiRes, Url, Description) {
	this.title = Title;
	this.pic2 = Pic2;
	this.pic = Pic;
	this.hires = HiRes,
	this.url = Url;
	this.description = Description;
	this.print = Video_Print;
}

function showPic(id) {
	pic = parseInt(id);
	if(pic<0) pic = 0;
	if(pic>pics.length-1) pic=pics.length-1;
	//if(pic<1 || pic>pics.length-1) return;
		var str="";
		str+="<table><tr>";
		//str+=("<a href='"+pics[pic].url+"' class='title' target='_top'>"+pics[pic].title+"</a>");
		str+="</tr>";
		str+="<tr>";
		str+="<td class='leftBtn' style='vertical-align:middle'><a href='javascript:' class='btn-left-gallery'></a></td>";
		str+="<td class='description' style='text-align:center;' id='gallery'>";
		var w;
		var W = 2;
		str+="<table><tr>";
		for(w=-W; w<0 ; w++) {
		    str+=("<td>");
		    if(pic+w>=0) str+="<img src='"+pics[pic+w].pic2+"' style='background:url(showcase/shadow.png);padding:13px;' class='btn-left-gallery'>";
		    else str+="<img style='width:126px' src='vis/empty.png'>";
		    str+=("</td>");
		}
		str+=("<td style='background-color:#FFFFFF;border:1px solid #E0E0E0;'><a href=\"javascript:showHires('"+pics[pic].hires+"');\"><img src='"+pics[pic].pic2+"' style='background:url(showcase/shadow.png);padding:13px;border:0px;'></a></td>");
		for(w = 1; w<=W ; w++) {
		    str+=("<td>");
		    if(pic+w<pics.length) str+="<img src='"+pics[pic+w].pic2+"' style='background:url(showcase/shadow.png);padding:13px;' class='btn-right-gallery'>";
		    else str+="<img style='width:126px' src='vis/empty.png'>";
		    str+=("</td>");
		}
	               // str+=("<img src='"+pics[pic+2].pic2+"' style='background:url(showcase/shadow.png);padding:13px;' class='btn-right-gallery'>");
		str+="</tr>";
		str+="<tr>";

		str+="<td colspan="+(2*W+1)+">";
		//str+=("<span>[</span> <a href='"+pics[pic].hires+"' target='_new'>"+pics[pic].title+"</a> <span>]</span>");
		str+=("<span>[</span> <a href=\"javascript:showHires('"+pics[pic].hires+"');\">"+pics[pic].title+"</a> <span>]</span>");
		str+=("<span> "+pics[pic].description+"</span>");

		str+="</td>";
		str+="</tr>";
		str+="</tr></table>";
		str+="<td class='rightBtn' style='vertical-align:middle'><a href='javascript:' class='btn-right-gallery'></a></td>";
		str+="</td>";
		str+="</tr>";
                str+="<tr><td></td>";
	        str+="<td colspan=1 style='text-align:right'>";
//		str+="[<a href='javascript:'  id='hide' class='hide'>Open Gallery</a>]";
	        str+="</td><td></td></tr>";
		str+="</table>";
		$("#info").html(str);
		jQuery(".btn-left-gallery").click(function(){
			if(pic>0) showPic(pic-1);
		});
		jQuery(".btn-right-gallery").click(function(){
			if(pic<pics.length) showPic(pic+1);
		});
		jQuery("#hide").click(function(){
			parent.window.closeGallery();
		});
}
