';
function AddS(fid)
{
console.log("Add " + fid);
$("#myModal_97").find("#__btnRegister").attr("onclick","__reg("+fid+")");
$("#myModal_97").find("#__btnRegister").attr("touchend","__reg("+fid+")");
$("#myModal_97").find("#__btnRegister").attr("id","__btnRegister_"+fid);
$("#myModal_97").find("#__txtName").attr("id","__txtName_"+fid);
$("#myModal_97").find("#__txtEmail").attr("id","__txtEmail_"+fid);
$("#myModal_97").find("#__txtAddress").attr("id","__txtAddress_"+fid);
$("#myModal_97").find("#__txtPhone").attr("id","__txtPhone_"+fid);
$("#myModal_97").find("#__txtNote").attr("id","__txtNote_"+fid);
//$("#__btnRegister_"+fid).attr("onclick", "OpenF("+fid+")" );
}
function OpenF(fid){
modal = document.getElementById("myModal_"+fid);
modal.style.display = "block";
}
setTimeout(function() { AddS(97); }, 2000);
function __reg(fid){var formid=fid;var name=$("#__txtName_"+fid).val();var phone=$("#__txtPhone_"+fid).val();var email=$("#__txtEmail_"+fid).val();var mess=$("#__txtMessage_"+fid).val();var str="";if(name==""){str+="-Vui lòng nhập họ tên "}
if(phone==""){str+="-Vui lòng nhập số điện thoại "}
if(email==""){str+="-Vui lòng nhập email "}
if(str!=""){alertify
.alert(str, function(){
CloseReg(fid);
}).setHeader("Thông báo");}else{$.post("https://portal.datacare.vn/do/reg.aspx",{name:name,phone:phone,email:email,mess:mess,formid:formid},function(data){alert("Đăng ký thành công.");CloseReg(fid);})}}
document.getElementById("getform_97").innerHTML += '';
element = document.getElementById("myModal_97");
element.classList.remove("col-md-6");
element.classList.remove("col-xs-12");
// Get the modal
modal_97 = document.getElementById("myModal_97");
// Get the button that opens the modal
btn_97 = document.getElementById("myBtn_97");
// Get the element that closes the modal
span_97 = document.getElementById("btnClose_97");
// When the user clicks on the button, open the modal
btn_97.onclick = function() {
console.log("open modal click");
modal_97.style.display = "block";
}
// When the user clicks on (x), close the modal
span_97.onclick = function() {
modal_97.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal_97) {
modal_97.style.display = "none";
}
}
function CloseReg(id)
{
$("#myModal_"+id).hide();
}