function setVisible(id, category) {
 
 hide(category); 
 setDescription(id);
 setPicture(id, category);
}

function setDescription(id){

 var descript = document.getElementById(id);
 descript.style.display = '';
}

function setPicture(id, category) {

  var x;  
  switch(category) {

  case 0:       x = document.getElementById('rvppicture');
		if (id == 'yishun')          x.style.backgroundPosition = '-100px 0px';
                else if (id == 'chensulan')  x.style.backgroundPosition = '-200px 0px';
                else if (id == 'clementi')   x.style.backgroundPosition = '-300px 0px';
                else if (id == 'touch')      x.style.backgroundPosition = '-400px 0px';
                else if (id == 'lb')         x.style.backgroundPosition = '-500px 0px';
                else if (id == 'sunlove')    x.style.backgroundPosition = '-600px 0px';
                else if (id == 'mindsville') x.style.backgroundPosition = '-700px 0px';
                else if (id == 'hospice')    x.style.backgroundPosition = '-800px 0px';
				else if (id == 'bhid')    x.style.backgroundPosition = '-900px 0px';
		break;

  case 1:       x = document.getElementById('sppicture');
                if (id == 'cscday')          x.style.backgroundPosition = '-100px 0px';
                else if (id == 'signature')  x.style.backgroundPosition = '-200px 0px';
                else if (id == 'paintahome') x.style.backgroundPosition = '-300px 0px';
                else if (id == 'ethelonter') x.style.backgroundPosition = '-400px 0px';
                else if (id == 'projectcan') x.style.backgroundPosition = '-500px 0px';
                else if (id == 'grantawish') x.style.backgroundPosition = '-600px 0px';
		break;
  
 case 2:        x = document.getElementById('xppicture');
                if      (id == 'trybe')       x.style.backgroundPosition = '-100px 0px';
                else if (id == 'bestbuddies') x.style.backgroundPosition = '-200px 0px';
                else if (id == 'yep')         x.style.backgroundPosition = '-300px 0px';           
                break;
 default :	break;
 }
}

function hide(category) {

 var rvp_arr = document.getElementById("rvpdescription").getElementsByTagName("div");   
 var sp_arr =  document.getElementById("spdescription").getElementsByTagName("div"); 
 var ep_arr =  document.getElementById("xpdescription").getElementsByTagName("div"); 

 var initial_arr = new Array();
 initial_arr[0] = 'rvp_default';
 initial_arr[1] = 'sp_default';
 initial_arr[2] = 'xp_default';

 var arr;
 var i;

 switch (category) { 
 case 0 : arr = rvp_arr; break;
 case 1 : arr = sp_arr;  break;
 case 2 : arr = ep_arr;  break;
 deafult: break;
 }

 if (category !=3)
 for(i=0; i<arr.length; i++) { arr[i].style.display = 'none'; }

 if (category==3) {
   for(i=0; i<rvp_arr.length; i++) { rvp_arr[i].style.display = 'none'; }
   for(i=0; i<sp_arr.length; i++) { sp_arr[i].style.display = 'none'; }
   for(i=0; i<ep_arr.length; i++) { ep_arr[i].style.display = 'none'; }
   for (i in initial_arr){ document.getElementById(initial_arr[i]).style.display=''; }
 }
}