var progress_id = "loading";
var loadItems = function() {
	this.scriptBriefStatusAve = false;
	this.testBrief = false;
};
function SetProgress(progress) {
	if (progress) {
		$("#" + progress_id + " > div").css("width", String(progress) + "%"); // 控制#loading
		$("#" + progress_id + " > div").html(String(progress) + "%"); // 显示百分比
	}
}

function doProgress() {
	var progress = getProgress();
	SetProgress(progress);
	if (progress >= 100) {
		$('#load').modal('hide');
		return;
	}
	if (progress < 100) {
		$('#load').modal('show');
		setTimeout("doProgress()", 1000);
	}
}
function getProgress() {
	var progress = 0;
	for ( var key in loadItems) {
		if (loadItems[key])
			progress += (100 /2);
	}
	return progress;
}
$('#cancelLoading').click(function() {
	window.location.replace("testplans.jsp");
});
