﻿// JScript File
$(document).ready(
    function(){
        var rhtHeight = $('div#leaseThisFor').height() + $('div#leaseDetails').height() + 10;
        var lftHeight = $('div#detailsImg').height() + $('div#imgScroll').height() + $('div#addAskShare').height() + $('img#ContactSeller2').height() + $('div#vehicleLocation').height() + 40;
        if ($('div.sellerInfo').height() > 0)
        {            
            rhtHeight += $('div.sellerInfo').height() + 10
        }
        
        if ($('div.dealerInfo').height() > 0)
        {
            rhtHeight += $('div.dealerInfo').height() + 20;
        }
        var newHeight = (rhtHeight - lftHeight) + $('table#askShareTbl').height();
        if (rhtHeight > lftHeight)
        {
            $('table#askShareTbl').css({height:newHeight});   
        }else{
            newHeight = (lftHeight - rhtHeight) + $('div#leaseDetailsContent').height() - 10;
            $('div#leaseDetailsContent').css({height:newHeight});
        }       
        
        if ($('div#vehicleFeatures').height() > $('div#vehicleLocation').height()){
            newHeight = $('div#vehicleFeatures').height()-29; //the -29 accounts for the padding and image height.
            $('div#vehLocationContent').css({height:newHeight});
        }else{
            newHeight = $('div#vehicleLocation').height()-29;
            $('div#vehicleFeaturesContent').css({height:newHeight}); //the -29 accounts for the padding and image height.
        }
                     
    }
);

