/*
function altPic(identifier,num){
   if(!num){
       num = (Math.round((Math.random()*4)+1));
	   tmp = new Image();
	   tmp.src = './'+identifier+num+'.jpg';
	   while(tmp.width == 0){
			num = (Math.round((Math.random()*4)+1));
		    tmp = new Image();
		    tmp.src = './'+identifier+num+'.jpg';		   
	   }
   }
   window.document.images[identifier].src = './'+identifier+num+'.jpg';
}
*/
function altPic(identifier,myids){
   myids = myids.split(',');
   if(myids.length > 1){
       num = (Math.round(Math.random()*(myids.length-1)));
       num = myids[num];
	   window.document.images[identifier].src = './'+identifier+num+'.jpg';
   } else if(myids.length==1){
	   num = myids[0];
	   window.document.images[identifier].src = './'+identifier+num+'.jpg';
   }
}

function primPic(identifier){
   window.document.images[identifier].src = './'+identifier+'.jpg';
}

function openBios(source_pic,selected1,selected2,selected3,alumni,day,loggedin){
   
   var thetarget;
   thetarget = loggedin ? 'brobio.php':'brobio.php';
   thetarget += "?myid="+source_pic+"&selected1="+selected1+"&selected2="+selected2+"&selected3="+selected3+"&alumni="+alumni+"&day="+day;
   //alert(thetarget);
   if(!window.bioswin || bioswin.closed){
      bioswin=window.open(thetarget,"bios","height=560,width=370,resizable=yes,status=no,location=no,menubar=no,toolbar=no,directories=no");
      bioswin.focus();
   }
   else{
      bioswin.focus();
      bioswin.location=thetarget;
   }
}

function openGeoBios(thetarget){     
   
   //alert(thetarget);
   if(!window.bioswin || bioswin.closed){
      bioswin=window.open(thetarget,"bios","height=540,width=410,resizable=yes,status=no,location=no,menubar=no,toolbar=no,directories=no");
      bioswin.focus();
   }
   else{
      bioswin.focus();
      bioswin.location=thetarget;
   }
}