function searchToNorm() {
	/*if ($.browser.msie && $.browser.version < 8) { 
		$('form.search .search input').width($('form.search div.search').width()-18); 
	}*/
}

$().ready(function() {
	if ($.browser.msie && $.browser.version < 8) { 
		var height = $('.footer').height();
		$('.footer').height(0).height(height);
		searchToNorm();
	}

});

$(window).resize(searchToNorm);

/*
function toggleGoodBox(id) {
	$goodBox = $('.bubble-good-box-'+id);
	var top = document.documentElement.scrollTop || document.body.scrollTop;
	$goodBox.css({ 
		top: top+40,
		left: ($('.wrapper').width()-$goodBox.width())/2
	}).show().find('.container').resizable({
		minHeight: $('.bubble-good', $goodBox).height()+$('.bubble-good-info', $goodBox).height()+110,
		minWidth: $('.bubble-good', $goodBox).width()
	}).parent().draggable();
}*/

function toggleGoodBox(id) {
    $goodBox = $('.bubble-good-box-'+id);
    var top = document.documentElement.scrollTop || document.body.scrollTop;
    $goodBox
        .find('.container')
            .width($('.bubble-good img', $goodBox).width()>450 ? $('.bubble-good img', $goodBox).width()+20 : 450)
            .parent()
        .css({ 
            top: top+40,
            left: ($('.wrapper').width()-$goodBox.width())/2
        }).show().find('.container').resizable({
            minHeight: $('.bubble-good', $goodBox).height()+$('.bubble-good-info', $goodBox).height()+110,
            minWidth: $('.bubble-good img', $goodBox).width()+20
        }).parent().draggable();
}


function closeGoodBox(id) {
	$goodBox = $('.bubble-good-box-'+id);
	$goodBox.hide().draggable('destroy'); 
}

$(function() {
	$('.draggable').draggable({
		handle:'h1'
	});

	$('#error-layout .cross').click(function() {
		$('#error-layout').remove();
		return false;
	});
	
	$('.wannaenter, #wannaenter, #login-layout a.cross').click(function() {
		$('#login-layout').css({top: 192+$(document).scrollTop(), left:"50%"}).toggle();
		return false;
	});
	
	$('.bubble-good-box .cross, .bubble-good-box .bubble-good img').click(function() { 
		$(this).parents('.bubble-good-box').hide().draggable('destroy'); 
		return false; 
	});
 });