//Author: Ivan Christov

//returns random image and its caption for the central image
function set_up() {
	var counter = Math.round(Math.random()*100) % 10;
	var divref, divtxt, alt, img, caption;
	
	//load appropriate image & caption
	switch(counter) {
		case 0:
			img=new Image(); 
			img.src="images/random0.jpg"; 
			alt="Lorenz Attractor";
			caption="Above: A Poincare section of the Lorenz strange attractor.";
			break
		case 1:
			img=new Image();
			img.src="images/random1.jpg"; 
			alt="Predator-Prey Attractor";
			caption="Above: A 3D portrait of a strange attractor of a Gause predator-prey model.";
			break
		case 2:
			img=new Image(); 
			img.src="images/random2.jpg"; 
			alt="Wind Tunnel";
			caption="Above: Gas flow at Mach 3 in a wind tunnel past a backward-facing step. Reproduced from ongoing joint work with Prof. <A HREF=\"http://www.math.tamu.edu/~popov\">Bojan Popov</A>. <A HREF=\"cv.html#J6\">More information</A>.";
			break
		case 3:
			img=new Image(); 
			img.src="images/random3.jpg"; 
			alt="Taylor Shock";
			caption="Above: Simulation of a shock wave evolving into a diffusive soliton (Taylor shock) under a novel traffic flow equation<BR> that includes drivers' reaction times. Reproduced from ongoing joint work with Dr. P.M. Jordan. <A HREF=\"cv.html#J5\">More information</A>.";
			break
		case 4:
			img=new Image(); 
			img.src="images/random4.jpg"; 
			alt="Solitons";
			caption="Above: Space-time diagram of the solution to the Korteweg&ndash;de Vries equation with a spatially periodic sine wave initial condition <BR>(i.e., the famous Zabusky and Kruskal numerical experiment).";
			break	
		case 5:
			img=new Image(); 
			img.src="images/random5.jpg"; 
			alt="Wavelet Edge Detector";
			caption="Above: A multiscale wavelet edge detector in action. <A HREF=\"research.html#wedgedet\">More information</A>.";
			break
		case 6:
			img=new Image(); 
			img.src="images/random6.jpg"; 
			alt="2D Dam-Break";
			caption="Above: Numerical solution to the 2D radially-symmetric dam-break problem for the shallow-water equations.<BR> Reproduced from joint work with Prof. <A HREF=\"http://web.mit.edu/romanstocker/\">Roman Stocker</A>. <A HREF=\"research.html#IWB\">More information</A>.";
			break
		case 7:
			img=new Image(); 
			img.src="images/random7.jpg"; 
			alt="Composite shock wave";
			caption="Above: Solution to the Riemann problem of the nonconvex scalar hyperbolic conservation law u<SUB>t</SUB> + sin(u)<SUB>x</SUB> + cos(u)<SUB>y</SUB> = 0, via a central scheme, resulting in a composite shock wave. Reproduced from ongoing work with Prof. <A HREF=\"http://www.math.tamu.edu/~popov\">Bojan Popov</A>. <A HREF=\"research.html#C2D\">More information.</A>";
			break
		case 8:
			img=new Image(); 
			img.src="images/random8.jpg"; 
			alt="Solition-antisoliton interaction";
			caption="Above: Interaction of a soliton (particle) and anti-solition (anti-particle) under the sine-Gordon equation,<BR> which models a mesonic field. Reproduced from ongoing work with Prof. <A HREF=\"http://www.ucs.louisiana.edu/~cic6380\">Christo Christov</A>. <A HREF=\"cv.html#J4\">More information.</A>";
			break
		case 9:
  		img=new Image(); 
  		img.src="images/random9.jpg"; 
  		alt="Granular mixing";
  		caption="Above: Deformation of a blob of particles in a granular tumbled flow in a square container over four flow periods <I>T<SUB>f</SUB></I>. <BR> Reproduced from ongoing work with Profs. <A HREF=\"http://www.chem-biol-eng.northwestern.edu/people/faculty/ottino.html\">J.M. Ottino</A> and <A HREF=\"http://www.mech.northwestern.edu/lueptow/\">R.M. Lueptow</A>. <A HREF=\"research.html#granular\">More information.</A>";
  		break
		default:
			img=new Image();
			img.src="images/blank.jpg";
			alt="Blank Image";
			caption="An error occurred; no image displayed.";
			break
	}
	
	divtxt = '<IMG src="'+img.src+'" alt="'+alt+'">'
           +'<BR><DIV class="caption">'+caption+'</DIV>';
	if (document.getElementById) {
		divref = document.getElementById('dynamic');
	} else if (document.all) {
		divref = document.all['dynamic'];
	}
	divref.innerHTML = divtxt;
}

function last_updated() {
  var lustring = new String();
  var months = new Array();
  months[1] = "January";  months[2] = "February";  months[3] = "March";
  months[4] = "April";    months[5] = "May";       months[6] = "June";
  months[7] = "July";     months[8] = "August";    months[9] = "September";
  months[10] = "October"; months[11] = "November"; months[12] = "December";
  updated = new Date(document.lastModified);
  upmonth = updated.getMonth() + 1;
  upday   = updated.getDate();
  upyear  = updated.getFullYear();
  lustring = months[upmonth] + " " + upday + ", " + upyear;
  return lustring;
}
