function buddiesandvcorrect() {
   	var bvc = $('#buddiesandvc').height();
   	$('#buddiesandvc').css('height', parseInt(bvc+2)+'px');
}

window.onload = function() {
    correctCss();
};	
function correctCss() {
    var bavcorrect = false;
    var wraph = $('.wrap').height();
    var wrapperh = $('#wrapper').height();
    if (wraph<wrapperh) {
    	bavcorrect = true;
    }
        
	//window.onresize = SpotOnResize;
	spotaboutcorrect();
	
	$("#fon_body").height($("#wrapper").height() /*+20*/ );
	
	//spotheight(true);
	spotheight();
	
	
   	heightDivBestBuddies();
   	
   	if (bavcorrect) {
   	    buddiesandvcorrect();
   	}
}
function SpotOnAddVCWorld() {
    $("body").css("height", "auto");
    //$('#about_myself').css('height', 'auto');
    $('#buddiesandvc').css('height', 'auto');
    
    var bavcorrect = false;
    var wraph = $('.wrap').height();
    var wrapperh = $('#wrapper').height();
    if (wraph<wrapperh) {
    	bavcorrect = true;
    }
    
    $("#fon_body").height($("#wrapper").height());
    spotheight();
    heightDivBestBuddies();
   	if (bavcorrect) {
   	    buddiesandvcorrect();
   	}
    //correctCss(); 
}
    

function heightDivBestBuddies() {
    var content = $('div.bestbuddies .fotoBlock260:eq(0)').html();
    var h1 = 0, hf = 0, hs = 0, h = 0;
    if ( content != null ) {
        for (var i = 0; i <= 7; i++) {
            h1 = $('div.bestbuddies .fotoBlock260:eq(' + i + ')').height();
            if ( i <= 3 ) {
                if ( h1 != null ) {
                    if ( h1 > hf ) {
                        hf = h1;
                    }
                }
            } else {
                if ( h1 != null ) {
                    if ( h1 > hs ) {
                        hs = h1;
                    }
                }
            }
        }
        h = hf + hs;
    }
    if ( h > 100 ) {
        $("div.bestbuddies").css('height', (h + 50) + 'px');
    }
}
