function onLoadPickName() {
w2 = top.window;
w3 = top.window.opener;
d1 = document.forms[0];
d2 = w2.document.forms[0];
d3 = w3.document.forms[0];
if (d2.nameID.value!="") {
	e = w3.document.getElementById (d2.nameID.value);
	e.value = d1.memberName.value;
}
if (d2.phoneID.value!="") {
	e = w3.document.getElementById (d2.phoneID.value);
	e.value = d1.memberPhone.value;
}
if (d2.emailID.value!="") {
	e = w3.document.getElementById (d2.emailID.value);
	e.value = d1.memberEmail.value;
}
top.close()
}
// Parameters: cols: number of columns across the table, photos: an array that stores all photos to be displayed in the table cells.
function buildGallery(cols, photos){
   var row='';
   var count=0;
   var res='';
   var rowPrefix = '<tr align="center">';
   var rowSuffix = '</tr>';
   var tdPrefix = '<td  height=120>';
   var tdSuffix = '</td>';
   var tot=photos.length;
   res = rowPrefix;
   count = 1;
   for(i=0;  i < tot; i++){
      res = res + tdPrefix + photos[i] + tdSuffix;
      count++;
      if (count > cols) {
         if (i == tot -1) {
            res = res + rowSuffix;
         }
         else {
            res = res + rowSuffix + rowPrefix;
         }
         count = 1;
      }
   }
   return res;
}
