$(function() {
    $('.autocenter').css({ 
        'position': 'absolute',
        'top': '50%',
        'left': '50%',
        'margin-top': -($(this).height()/2),
        'margin-left': -($(this).width()/2)
    });
});



	

function centerAjaxImage() {
    //alert($('#item2_ajax_content').find('img').height());
    winHeight = $(window).height();
    imgHeight = $('#item2_ajax_content').find('img').height();
    diffHeight = winHeight - imgHeight;
    result = diffHeight / 2;
		
		
    $('#item2_ajax_content img').animate({
        'margin-top': result
    },1200);
		
		
		

}
	
function centerAjaxImageQuick() {
    //alert($('#item2_ajax_content').find('img').height());
    winHeight = $(window).height();
    imgHeight = $('#item2_ajax_content').find('img').height();
    diffHeight = winHeight - imgHeight;
    result = diffHeight / 2;
		
	
		
    $('#item2_ajax_content img').css({
        'margin-top': result
    });

}

	
	
function centerImage() {
    //alert($('#item2_ajax_content').find('img').height());
    winHeight = $(window).height();
    imgHeight = $('.scale').height();
    diffHeight = winHeight - imgHeight;
    result = diffHeight / 2;
    $('.scale').css({
        'margin-top': result
    });

}

function centerShop(){
    winHeight = $(window).height();
    diffHeight = winHeight - 400;
    result = (diffHeight / 2);

    winWidth = $(window).width();

    diffWidth = winWidth - 600;
    widhtResult = (diffWidth / 2);

    $("#item4 .test").css('margin-left',widhtResult);
    $("#item4 .test").css('margin-top',result);




}
