function uniformDescriptions() {
	
	// get all divs in the document
	var all_divs = document.getElementsByTagName('div');
	
	// loop all divs
	for (var i = 0; i < all_divs.length; i++) {
		
		// found a subCategory div
		if(all_divs[i].className == "subCategory"){
		
			// get all <p>'s in the div
			var all_Ps = all_divs[i].getElementsByTagName('p');
			
			// initialise the var to track the highest
			var descrip_highest = 0;
			var title_highest = 0;
			var weight_highest = 0;
			
			// get heights of each of those P's - updating 'highest'' if necessary
			for (var j = 0; j < all_Ps.length; j++) {
				if(all_Ps[j].className == "descrip"){
					 
					 if(all_Ps[j].offsetHeight > descrip_highest){
					 	descrip_highest = all_Ps[j].offsetHeight;
					 }
					 
				}
				if(all_Ps[j].className == "title"){
					 
					 if(all_Ps[j].offsetHeight > title_highest){
					 	title_highest = all_Ps[j].offsetHeight;
					 }
					 
				}
				if(all_Ps[j].className == "weight"){
					 
					 if(all_Ps[j].offsetHeight > weight_highest){
					 	weight_highest = all_Ps[j].offsetHeight;
					 }
					 
				}
			}
			
			// set heights
			for (var k = 0; k < all_Ps.length; k++) {
			
				// if this is a p with the descrip class on it, resize
				if(all_Ps[k].className == "descrip"){
					 all_Ps[k].style.height = descrip_highest+"px";
				}
				// ditto for title
				if(all_Ps[k].className == "title"){
					 all_Ps[k].style.height = title_highest+"px";
				}
				// and for weight
				if(all_Ps[k].className == "weight"){
					 all_Ps[k].style.height = weight_highest+"px";
				}
				
			}
			
		}else{
			// not a subcat, do nothing
		}
	}
	
}

window.onload = uniformDescriptions;