 var $j = jQuery.noConflict();
$j(document).ready(function(){

	//h2 tags
	var h2_one_height = $j(".h2_1_height h2").height();
	var h2_two_height = $j(".h2_2_height h2").height();
	var h2_three_height = $j(".h2_3_height h2").height();
	
	var h2_height_max = 0;
	
	if(h2_one_height > h2_two_height)	{
		h2_height_max=h2_one_height;
	}else{
		if(h2_two_height > h2_three_height){
			h2_height_max = h2_two_height;
		}else{
			h2_height_max = h2_three_height;
		}
	}
	
	$j(".h2_1_height h2").height(h2_height_max);
	$j(".h2_2_height h2").height(h2_height_max);
	$j(".h2_3_height h2").height(h2_height_max);	


	//boxes themselves
	var h2_one_height = $j(".h2_1_height .promo_box_center").height();
	var h2_two_height = $j(".h2_2_height .promo_box_center").height();
	var h2_three_height = $j(".h2_3_height .promo_box_center").height();
	
	var h2_height_max = 0;
	
	if(h2_one_height > h2_two_height)	{
		h2_height_max=h2_one_height;
	}else{
		if(h2_two_height > h2_three_height){
			h2_height_max = h2_two_height;
		}else{
			h2_height_max = h2_three_height;
		}
	}
	
	$j(".h2_1_height .promo_box_center").height(h2_height_max);
	$j(".h2_2_height .promo_box_center").height(h2_height_max);
	$j(".h2_3_height .promo_box_center").height(h2_height_max);
	
	
	
	$j(".promo_box_bg").each(function(){
								//Narrow Boxes H2s
								var h2_heights_array = new Array();
								var ii = 0;
								var h2_height_max = 0;
	
								$j(this).find("h2").each(function(){
									h2_heights_array[ii]= $j(this).height();
									//alert();
									ii++;
								});
	
								for(var ii=0; ii < (h2_heights_array.length+1); ii++){
									if(h2_heights_array[ii] > h2_height_max){
										h2_height_max=h2_heights_array[ii];
									}
								}
	
								$j(this).find("h2").each(function(){
									$j(this).height(h2_height_max);
								});
	
								//Narrow Boxes DIVs
								var div_heights_array = new Array();
								var ii = 0;
								var div_height_max = 0;
	
								$j(this).find(".narrow_box_center").each(function(){
									div_heights_array[ii]= $j(this).height();
									//alert();
									ii++;
								});
	
								for(var ii=0; ii < (div_heights_array.length+1); ii++){
									if(div_heights_array[ii] > div_height_max){
										div_height_max=div_heights_array[ii];
									}
								}
	
								$j(this).find(".narrow_box_center").each(function(){
									$j(this).height(div_height_max);
								});
								
	});
	
	
	
	
	$j(".lhs_top_hp").each(function(){
		var trimmed_html = $j(this).find(".promo_box_bg").html();
		trimmed_html = (trimmed_html).replace(/^\s*|\s*$/g,'');
		//alert(trimmed_html);
		if(trimmed_html=='<div class="clear"></div>' || trimmed_html=='<DIV class=clear></DIV>'){
			$j(this).remove();
		}
	});



	$j('div#text_size a').each(function(){             /* on clicking text size menu */
       $j(this).click(function(){
          
			var t=setTimeout("update_promoboxes()",1000);
       });
    });
	
});





function update_promoboxes(){
							//Narrow Boxes H2s
							//alert();
							var h2_heights_array = new Array();
							var ii = 0;
							var h2_height_max = 0;

							$j(this).find("h2").each(function(){
								h2_heights_array[ii]= $j(this).height();
								//alert();
								ii++;
							});

							for(var ii=0; ii < (h2_heights_array.length+1); ii++){
								if(h2_heights_array[ii] > h2_height_max){
									h2_height_max=h2_heights_array[ii];
								}
							}

							$j(this).find("h2").each(function(){
								$j(this).height(h2_height_max);
							});

							//Narrow Boxes DIVs
							var div_heights_array = new Array();
							var ii = 0;
							var div_height_max = 0;

							$j(this).find(".narrow_box_center").each(function(){
								div_heights_array[ii]= $j(this).height();
								//alert();
								ii++;
							});

							for(var ii=0; ii < (div_heights_array.length+1); ii++){
								if(div_heights_array[ii] > div_height_max){
									div_height_max=div_heights_array[ii];
								}
							}

							$j(this).find(".narrow_box_center").each(function(){
								$j(this).height(div_height_max);
							});
}