function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent) {
        while (1) {
            curtop+=obj.offsetTop;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.y) {
        curtop+=obj.y;
    }
    return curtop;
}

jQuery(document).ready(function() {
	var slideSpeed = 200
	if(mailListStatus === 'wait')
	{
		jQuery("#maillist_form").hide();
	}
	else{
		var yPos = findPosY(document.getElementById('mail-list-div'));
		jQuery('html,body').animate({scrollTop: yPos}, 1000);
	}
	jQuery(".slide-mail-form").click(function(e) {
		jQuery("#maillist_form").slideToggle(slideSpeed);
		e.preventDefault();
	});
	/*$(".slide-div").each(function() { $(this).css({height: $(this).height()}); });
	$(".slide").click(function() {
		var divId = $(this).attr("rel");
		if($("#toggle-" + divId).attr("src") == 'static/images/dash.png') {
			$("#toggle-" + divId).attr({src: 'static/images/plus.png'})
		} else {
			$("#toggle-" + divId).attr({src: 'static/images/dash.png'})
		}
		$("#content-" + divId).slideToggle(slideSpeed);
	});*/
});
