window.onload=function() { attachBehaviors(); }; 
function attachBehaviors() { 
 if (document.getElementById('productpr1')) { 
 document.getElementById('productpr1').onchange=function() {  
 Display(this,this.selectedIndex);  
}; 
 } 
} 
function Display(obj,selind) { 
 if (! document.getElementById(obj.id)) {  
 alert('Oops! Something is not id\'ed correctly ' + obj.id);  
 return; 
 } 
 var divs = Array('p1-div','p2-div','p3-div','p4-div','p5-div'); 
 var opts = obj.options[selind].value.split(':'); 
 var div = opts[opts.length-1]; // takes last item, arrays are zero based. 
 for (j=0;j<divs.length;j++) { 
 if (document.getElementById(divs[j])) { 
  document.getElementById(divs[j]).style.display= 
 (divs[j]==div)?'block':'none'; 
 } 
 } 
} 
