/*--------------------------------------------------------------------
 * The following source code is a modified version of the original plugin "EqualHeights" for jQuery.
 *
 * JQuery Plugin: "EqualHeights"
 * by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
 *
 * Copyright (c) 2009 Filament Group
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)

 * JQuery Plugin : "EqualHeights-Light"
 * Modified by : Michael (http://www.webdevcodex.com)
 * Description : Does not use px-em dependencies based from the original version. Also fixes a small bug which does not allow divs to be of equal heights if there are more than 2 divs.

------------------------------------------------------------------------*/

jQuery.fn.equalheight = function() {
	jQuery(this).each(function(){
		var currentTallest = 0; //create currentTallest var
		
		//go through every child of the mother div
		jQuery(this).children().each(function(i){
			//keep checking every child's height and get the height of the tallest div											  
			if (jQuery(this).height() > currentTallest) { currentTallest = jQuery(this).height(); }
			
		});
		
		//bottom position ; nong
		jQuery(this).children().each(function(i){
		try{
		var diffheight = currentTallest-jQuery(this).height();
		(this).children[2].style.padding=diffheight+"px 0px 0px 0px";
		}catch(e){}
		});
		//end:nong
		
		//set currentTallest as pixels
		currentTallest = currentTallest+"px";
		
		//If browser is Microsoft Internet explorer, then use css "height: yypx"
		if (jQuery.browser.msie && jQuery.browser.version == 6.0) { jQuery(this).children().css({'height': currentTallest,'border-right':'1px dotted #DFCAF1'}); }
		
		//use css "min-height: yypx"
		jQuery(this).children().css({'min-height': currentTallest}); 
		$(".clear").css({"height":"0px","min-height":"0px","border-right":"0px"});
		$(".cartbutton").css({"vertical-align":"bottom"});
		$(".pc_left_noborder").css({"border-right":"0px"});
		
	});
	return this;
};