function Research() {}
Research.prototype = {
	init:function() {
		$('.research_rollover')
		.mouseenter(function(){$('.rollover_text', this).fadeIn('slow')})
		.mouseleave(function(){$('.rollover_text', this).fadeOut()});
		$('#carousel').cycle({ pause: 3 });
		$(".res1").hide();			// random topic pick for each of the three research columns
		$(".res2").hide();
		$(".res3").hide();
		var divs1 = $("div.res1").get().sort(function(){ 
            		return Math.round(Math.random())-0.5;	// 
           	}).slice(0,1);	
		var divs2 = $("div.res2").get().sort(function(){ 
            		return Math.round(Math.random())-0.5;	// 
           	}).slice(0,1);
		var divs3 = $("div.res3").get().sort(function(){ 
            		return Math.round(Math.random())-0.5; 	//
           	}).slice(0,1);
		$(divs1).show();
		$(divs2).show();
		$(divs3).show();
		$('#gallery a').lightBox(); 
		$('#pubs').lionbars();
		$('#eva_bio_page').lionbars();	
	}
}


function People() {}
People.prototype = {
	init:function() {
	//var self = this;
		$('.people_rollover')
			$(".people_color").hide();	
			$(".people_rollover").hover(
    		  function(){
        		$(this).find(".people_bw,.people_color").toggle();
    		  }, 
    		  function(){
        		$(this).find(".people_bw,.people_color").toggle();
    		  }
		    );
	}
}

function Nuts() {}
Nuts.prototype = {
	init:function() {
		$('.nuts_rollover')
			$(".nuts_show").hide();	
			$(".nuts_rollover").hover(
    		  function(){
        		$(this).find(".nuts_hide,.nuts_show").toggle();
    		  }, 
    		  function(){
        		$(this).find(".nuts_hide,.nuts_show").toggle();
    		  }
		    );
	}
}



function eaddr(u) {
   var u, h, t, addr, a = "&#64;", d = "berkeley.edu", l = arguments.length;
   switch(l)
   {
   case 1: // username only
      u = arguments[0]; addr = u + a + d; t = u + "&#64;" + d; break;
   case 2: // username + domain OR username + hostname OR username + text
      u = arguments[0];
      if ( arguments[1].match(/\./) ) {       // username + domain
         d = arguments[1]; addr = u + a + d; t = u + "&#64;" + d;
      } else if ( arguments[1].match(/ /) ) { // username + text
         t = arguments[1]; addr = u + a + d;
      } else {                                // username + hostname
         h = arguments[1]; addr = u + a + h + "." + d; t = u + "&#64;" + h + " dot " + d;
      }
      break;
   case 3: // username + domain + text OR username + hostname + domain OR username + hostname + text
      u = arguments[0];
      if ( arguments[1].match(/\./) ) {        // username + domain + text
         d = arguments[1]; t = arguments[2]; addr = u + a + d;
      } else if ( arguments[2].match(/ /) ) { // username + hostname + text
         h = arguments[1]; t = arguments[2]; addr = u + a + h + "." + d;
      } else {                                // username + hostname + domain
         h = arguments[1]; d = arguments[2]; addr = u + a + h + "." + d; t = u + " at " + h + " dot " + d;
      }
      break;
   case 4: // username + hostname + domain + text
      u = arguments[0]; h = arguments[1]; d = arguments[2]; t = arguments[3]; addr = u + a + h + "." + d;
      break;
   default:
      document.write("BROKEN CALL TO eaddr()"); var FAIL = "Y";
   }
   if ( ! ( FAIL == "Y" ) ) { document.write("<" + "A" + " " + "HREF=" + "mail" + "to:" + addr + ">" + t + "<\/A>"); }
}




$(function(){
	var people = new People();
	people.init();
})

$(function(){
	var nuts = new Nuts();
	nuts.init();
})

$(function(){
	var res = new Research();
	res.init();
})

