// JavaScript Document
// Worst image rotator script ever.
var today = new Date();
var thePics = new Array();
var photo_root = "images/photos/rotator/"
var thumb_extension = "_sm";
var image_extension = ".jpg";

//If you want to add a picture, please include it in the array below:
// field1 = picture nae
thePics[0] = ['pai/DineshPai_QiWei','Project supervised by Dr. Dinesh Pai','http://www.cs.ubc.ca/~pai']
thePics[1] = ['heidrich/beeCrossHatch','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[2] = ['heidrich/Picture 1','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[3] = ['heidrich/projector','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[4] = ['heidrich/tt-teal','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[5] = ['joanna/merged-menus-with-hand','Hover or tap? Supporting pen-based menu navigation for older adults. <br /> Moffatt, K., and McGrenere, J.','http://www.cs.ubc.ca/~joanna']
thePics[6] = ['joanna/Multi-Layer',' Multi-layered interfaces to improve older adults initial learnability of mobile applications. <br /> Leung. R., Findlater, L., McGrenere, J., and Graf, P.','http://www.cs.ubc.ca/~joanna']
thePics[7] = ['van/gbwc','Generalized Biped Walking Control.<br />Stelian Coros, Philippe Beaudoin, and Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[8] = ['van/mocap','"Walk to here": A Voice-Driven Animation System.<br />Zhijin Wang and Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[9] = ['van/quadruped','Locomotion Skills for Simulated Quadrupeds.<br />Stelian Coros, Andrej Karpathy, Ben Jones, Lionel Reveret, and Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[10] = ['van/simbicon','SIMBICON:  Simple Biped Locomotion Control.<br />Kangkang Yin, Kevin Loken, and Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[11] = ['tmm/clade.orig','TreeJuxtaposer: Scalable Tree Comparison using Focus+Context with Guaranteed Visibility.<br />Tamara Munzner, Francois Guimbretiere, Serdar Tasiran, Li Zhang, and Yunhong Zhou.','http://www.cs.ubc.ca/~tmm']
thePics[12] = ['tmm/docs_glimmer','Glimmer: Multilevel MDS on the GPU.<br />Stephen Ingram, Tamara Munzner and Marc Olano.','http://www.cs.ubc.ca/~tmm']
thePics[13] = ['tmm/hour4compare','Cerebral: Visualizing Multiple Experimental Conditions on a Graph with Biological Context.<br />Aaron Barsky, Tamara Munzner, Jennifer L. Gardy, and Robert Kincaid.','http://www.cs.ubc.ca/~tmm']
thePics[14] = ['tmm/late_screenshot1','LiveRAC - Interactive Visual Exploration of System Management Time-Series Data.<br />Peter McLachlan, Tamara Munzner, Eleftherios Koutsofios, Stephen North.','http://www.cs.ubc.ca/~tmm']
thePics[15] = ['tmm/lge_study_embedded_highest','Overview Use in Multiple Visual Information Resolution Interfaces.<br />Heidi Lam, Robert Kincaid, and Tamara Munzner.','http://www.cs.ubc.ca/~tmm']
thePics[16] = ['tmm/MooreComposite','GrouseFlocks: Steerable Exploration of Graph Hierarchy Space.<br />Daniel Archambault, Tamara Munzner, and David Auber.','http://www.cs.ubc.ca/~tmm']
thePics[17] = ['tmm/ProgMDSLayout-S200KbShot4','Steerable, Progressive Multidimensional Scaling.<br />Matt Williams and Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[18] = ['tmm/Stone1999Cover2','Grouse: Feature-Based, Steerable Graph Hierarchy Exploration.<br />Daniel Archambault, Tamara Munzner, and David Auber.','http://www.cs.ubc.ca/~tmm']
thePics[19] = ['tmm/sv2_main','Session Viewer: Visual Exploratory Analysis of Web Session Logs.<br />Heidi Lam, Daniel Russell, Diane Tang, and Tamara Munzner.','http://www.cs.ubc.ca/~tmm']
thePics[20] = ['rbridson/Picture 3','Evolving sub-grid turbulence for smoke animation.<br />H. Schechter and R. Bridson','http://www.cs.ubc.ca/~rbridson']
thePics[21] = ['sheffa/sheffa_abf','ABF++: Fast and Robust Angle Based Flattening.<br />A. Sheffer, B. Levy, M. Mogilnitsky, A, Bogomyakov.','http://www.cs.ubc.ca/~sheffa']
thePics[22] = ['sheffa/sheffa_capture','Markerless Garment Capture.<br /> D. Bradley, T. Popa, A. Sheffer, W. Heidrich, T. Boubekeur.','http://www.cs.ubc.ca/~sheffa']
thePics[23] = ['sheffa/sheffa_curvedfolds','Curved Folding.<br />M. Kilian, S. Floery, Z. Chen, N. J. Mitra, A. Sheffer, H. Pottmann.','http://www.cs.ubc.ca/~sheffa']
thePics[24] = ['sheffa/sheffa_ddshape','Deformation-Driven Shape Correspondence.<br />R. Zhang, A. Sheffer, D. Cohen-Or, Q. Zhou, O. van Kaick, A. Tagliasacchi.','http://www.cs.ubc.ca/~sheffa']
thePics[25] = ['sheffa/sheffa_expressive','3D Collage: Expressive Non-Realistic Modeling.<br />R. Gal, O, Sorkine, T., Popa, A. Sheffer, D. Cohen-Or.','http://www.cs.ubc.ca/~sheffa']
thePics[26] = ['sheffa/sheffa_mameshdeform','Material Aware Mesh Deformation.<br />D. Julius, T. Popa, A. Sheffer.','http://www.cs.ubc.ca/~sheffa']
thePics[27] = ['sheffa/sheffa_resize','Non-homogeneous Resizing of Complex Models.<br />V. Kraevoy, A. Sheffer, D. Cohen-Or, A. Shamir.','http://www.cs.ubc.ca/~sheffa']
thePics[28] = ['sheffa/sheffa_shuffler','Model Composition from Interchangeable Components.<br />V. Kraevoy, D. Julius, A. Sheffer.','http://www.cs.ubc.ca/~sheffa']
thePics[29] = ['sheffa/sheffa_upright','Upright Orientation of Man-Made Objects.<br />H. Fu, D. Cohen-Or, G. Dror, A. Sheffer.','http://www.cs.ubc.ca/~sheffa']

/*
thePics[0] = ['pai/DineshPai_QiWei','Project supervised by Dr. Dinesh Pai','http://www.cs.ubc.ca/~pai']
thePics[1] = ['heidrich/beeCrossHatch','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[2] = ['heidrich/Picture 1','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[3] = ['heidrich/projector','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[4] = ['heidrich/tt-teal','Project supervised by Dr. Wolfgang Heidrich','http://www.cs.ubc.ca/~heidrich']
thePics[5] = ['joanna/IMG_1929','Project supervised by Dr. Joanna McGrenere','http://www.cs.ubc.ca/~joanna']
thePics[6] = ['joanna/merged-menus-with-hand','Project supervised by Dr. Joanna McGrenere','http://www.cs.ubc.ca/~joanna']
thePics[7] = ['joanna/Multi-Layer','Project supervised by Dr. Joanna McGrenere','http://www.cs.ubc.ca/~joanna']
thePics[8] = ['van/sca08-mmg','Project supervised by Dr. Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[9] = ['van/sigasia08-scws','Project supervised by Dr. Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[10] = ['van/siggraph08-cont','Project supervised by Dr. Michiel van de Panne','http://www.cs.ubc.ca/~van']
thePics[11] = ['tmm/clade.orig','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[12] = ['tmm/docs_glimmer','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[13] = ['tmm/hour4compare','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[14] = ['tmm/late_screenshot1','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[15] = ['tmm/lge_study_embedded_highest','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[16] = ['tmm/MooreComposite','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[17] = ['tmm/ProgMDSLayout-S200KbShot4','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[18] = ['tmm/Stone1999Cover2','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[19] = ['tmm/sv2_main','Project supervised by Dr. Tamara Munzner','http://www.cs.ubc.ca/~tmm']
thePics[20] = ['rbridson/Picture 1','Project with Dr. Robert Bridson','http://www.cs.ubc.ca/~rbridson']
thePics[21] = ['rbridson/Picture 2','Project with Dr. Robert Bridson','http://www.cs.ubc.ca/~rbridson']
thePics[22] = ['rbridson/Picture 3','Project supervised by Dr. Robert Bridson','http://www.cs.ubc.ca/~rbridson']
thePics[23] = ['rbridson/Picture 5','Project with Dr. Robert Bridson','http://www.cs.ubc.ca/~rbridson']
// the following picture is not Bridson --- whose is it?
thePics[24] = ['rbridson/Picture 6','Imager project','http://www.cs.ubc.ca/labs/imager']
thePics[25] = ['sheffa/sheffa_abf','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[26] = ['sheffa/sheffa_capture','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[27] = ['sheffa/sheffa_curvedfolds','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[28] = ['sheffa/sheffa_ddshape','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[29] = ['sheffa/sheffa_expressive','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[30] = ['sheffa/sheffa_mameshdeform','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[31] = ['sheffa/sheffa_resize','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[32] = ['sheffa/sheffa_shuffler','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
thePics[33] = ['sheffa/sheffa_upright','Project supervised by Dr. Alla Sheffer','http://www.cs.ubc.ca/~sheffa']
*/
//end of array. Do not edit past this point.

function galleryImage(which) {
  document.write(
      '<table width="100%" class="homepageimage">',
      '<caption align="bottom">', '<a href="' , thePics[which][2]  , '">' , thePics[which][1], '</a></caption>',
      '<tr><td>',
      '<a href="', photo_root, thePics[which][0], image_extension, '">',
      '<img src="', photo_root, thePics[which][0], thumb_extension, image_extension, '" alt="', thePics[which][1] , '" border="1" width="210px">',
      '</a>',
      '</td></tr></table>'
  );
}

// Retrieve a random integer 0 .. thePics.length
function randomNumber () { 
    var rand = Math.floor(thePics.length * Math.random());
    return rand;    
}

function randomImage() {
    galleryImage(randomNumber());
}


// Unused for Imager lab, stale, probably bitrotted.
function allImages() {
  var count = 0;
  document.write(
    '<div style="position:absolute;',
    ' left:0px;',
    ' top:0px; ',
    ' width:200px;',
    ' height:100%;',
    ' overflow:auto;">',
    'Current Rotation<br>'
  );
  while (count <= 9) {
    document.write(
      '<table>',
      '<caption align="right">',
      //count, '&nbsp;&rarr;&nbsp;#', rotation[count], '</caption>',
      'time&nbsp;*:0', count, '<br>shows&nbsp;image<br>#', rotation[count], '</caption>',
      '<tr><td>',
      '<img src="', thePics[rotation[count]], '" alt="An image from our gallery">',
      '</td></tr>',
      '</table>'
    );
    count++;
  }
  while (count <= 59) {
    document.write(
      '<table>',
      '<caption align="right">',
      'time&nbsp;*:', count, '<br>shows&nbsp;image<br>#', rotation[count], '</caption>',
      '<tr><td>',
      '<img src="', thePics[rotation[count]], '" alt="An image from our gallery">',
      '</td></tr>',
      '</table>'
    );
    count++;
  }
  document.write(
    '</div>',
    '<div style="position:absolute;',
    ' top:0px; ',
    ' width:200px;',
    ' height:100%;',
    ' overflow:auto;">',
    'All images<br>'
  );
  count = 0;
  while (count <= numofPics) {
//    if (oldPics[count] != 1) {
      document.write('<div style="float:right">', count, '</div>');
      galleryImage(count);
//    }
    count++;
  }
  document.write(
    '</div>'
  );
}
function imageMap()
{
	document.write('<div width="200px">');
	for(var i=0; i< thePics.length; i++){
	document.write('Image:');
	document.write(i);
		galleryImage(i);
	}
	document.write('</div>');



}

