$(window).load(function(){  
	//doboxheights()
})
$(document).ready(function () {

    var Left = Math.max($('.LeftPane').height());
    var Right = Math.max($('.RightPane').height());
    var Content = Math.max($('.ContentPane').height());

    if (Content > Left) {
        $('.LeftPane').height(Content);
    }

    if (Content > Right) {
        $('.RightPane').height(Content);
    }

    // shift the positioning of the addthis shortlist overlay.
	var addbtn = $("ul.share li.add:last");
	var p = addbtn.offset();
	addbtn.bind("click", function(){
		setTimeout(function(){
		$("#at15s").css({left:p.left-250,top:p.top+30})
		},50)
})


    // delay the profile wrapping a little while the images load so we can calculate the correct heights
	var is_chrome = /chrome/.test( navigator.userAgent.toLowerCase() );
	if (is_chrome){
	setTimeout(function() {doboxheights()},1300);
	}
	else{
	setTimeout(function() {doboxheights()},1300);
	}


$(".information-row ul.see li:first-child").addClass("first");

      
        //   $(".information-row ul.see li:first-child")
      // .css("padding-left", "38px")

      //     $(".cms-text ul.see li:first-child")
      // .css("padding-left", "38px")

        });
		
			function doboxheights(){
	var cnt = 3
	if ($(".ContentPane").hasClass("wide")){cnt = 4}
	$(".cms-profile-b").each(function(i){
		if (i == 0 ){$(this).before($("<div class=\"pwrap\"\>"));return true}
		if((i+1)%cnt ==0 || i+1 == $(".cms-profile-b").length){$(this).after($("<div class=\"pwrap\"\>"));}
	})
	
	var maxheight = 0;
	$(".pwrap").each(function () {
	    $(this).nextUntil(".pwrap").each(function () {
	        var el = $(this)
	        el.css('height', '');
	        maxheight = (el.height() > maxheight) ? el.height() : maxheight;
	        
	    })
	    $(this).nextAll(".cms-profile-b").css('height', maxheight);
	    maxheight = 0
	})


}

