var APIFactory = new APIFactory_Sim();
var FacilityAPI = APIFactory.getFacilityAPI();


popMsgView = '<div class="popMsgUI"><span id="msg"></span></div>';

$(document).ready(function(){
	$("#comfirm_btn").click(function(){endDialog(true);});
	$("#cancel_btn").click(function(){endDialog(false);});
	var paramsJson = FacilityAPI.getViewParam();
	var params=JSON.parse(paramsJson);
	//var params = {newver:"1.0.2"};
	if(params && params.newver) {
		$("#newver").text(params.newver);
	}
});

function endDialog(upgrade) {
	try {
		var result = "";
		if(upgrade) {
			result = "1";
		} else {
			if($("#skip_chkbox")[0].checked) {
				result = "-1";
			} else {
				result = "0";
			}
		}
		FacilityAPI.setViewResult(result);
		FacilityAPI.manageView(1);
	} catch(e) {
		//
	}
}



