///////////////////
$('#newreply-form').submit(function(e) {
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_reply_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#newreply-form").serialize(),
success: function(result) {
// alert(result);
//document.getElementById('contactbox').innerHTML = data;
//window.location.href = "#contactbox";
// $("#myModaldialog").modal();
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
//$("#contactform").html("
"+arr[2]+"
");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
$('#email').val("");
$('#name').val("");
$('#tel').val("");
$('#detail').val("");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
replydat();
// if (typeof myid !== "undefined" )(replydat('myid');)
//$("#contactform").html(""+arr[2]+"
");
//$('#squarechpsw').modal('hide');
}
}
});
});
/////
//var $q = jQuery.noConflict();//set for $ is $j of JQUERY
$('#newtopic-form').submit(function(e) {
//alert("dsdsds");
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_newtopic_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#newtopic-form").serialize(),
success: function(result) {
// alert(result);
//document.getElementById('contactbox').innerHTML = data;
//window.location.href = "#contactbox";
// $("#myModaldialog").modal();
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
//$("#contactform").html(""+arr[2]+"
");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
$('#email').val("");
$('#name').val("");
$('#tel').val("");
$('#detail').val("");
$('#subject').val("");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
boarddat();
//$("#contactform").html(""+arr[2]+"
");
//$('#squarechpsw').modal('hide');
}
}
});
});
////mm
$('#newtopic_m-form').submit(function(e) {
//alert("dsdsds");
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_newtopic_m_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#newtopic_m-form").serialize(),
success: function(result) {
// alert(result);
//document.getElementById('contactbox').innerHTML = data;
//window.location.href = "#contactbox";
// $("#myModaldialog").modal();
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
//$("#contactform").html(""+arr[2]+"
");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
$('#email').val("");
$('#name').val("");
$('#tel').val("");
$('#detail').val("");
$('#subject').val("");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
boardmdat();
//$("#contactform").html(""+arr[2]+"
");
//$('#squarechpsw').modal('hide');
}
}
});
});
////
$('#newreply_m-form').submit(function(e) {
//alert("dsdsds");
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_reply_m_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#newreply_m-form").serialize(),
success: function(result) {
// alert(result);
//document.getElementById('contactbox').innerHTML = data;
//window.location.href = "#contactbox";
// $("#myModaldialog").modal();
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
//$("#contactform").html(""+arr[2]+"
");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
//$('#email').val("");
//$('#name').val("");
//$('#tel').val("");
$('#detail').val("");
$('#offpsw').val("")
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
replymdat();
}
}
});
});
////con
$('#mycontact-form').submit(function(e) {
//alert("dsdsds");
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_contact_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#mycontact-form").serialize(),
success: function(result) {
// alert(result);
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
$('#email').val("");
$('#name').val("");
$('#tel').val("");
$('#detail').val("");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
}
});
});
////////
////con
$('#inform-form').submit(function(e) {
//alert("dsdsds");
//prevent Default functionality
e.preventDefault();
//alert("oo0");
//get the action-url of the form
//var actionurl = e.currentTarget.action;
var actionurl ="aj_inform_save.php";
//do your own request an handle the results
$.ajax({
url: actionurl,
type: 'POST',
dataType : 'text',
data: $("#inform-form").serialize(),
success: function(result) {
// alert(result);
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//alert("ok");
//showModal('#myModaldialog');
//$("#myModaldialog").show();
$('#subject').val("");
$('#email').val("");
$('#name').val("");
$('#tel').val("");
$('#detail').val("");
$('#addressx').val("");
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
}
});
});
////////
function boarddat(){
$.ajax({url: "aj_boardrefresh.php", success: function(result){
$("#board").html(result);
}});
}
function replydat(){
$.ajax({url: "aj_replyrefresh.php", data: "id="+myid, success: function(result){
$("#reply").html(result);
$('html,body').animate({scrollTop: $("#newpost").offset().top}, 'slow');
}});
}
function boardmdat(){
$.ajax({url: "aj_boardmrefresh.php", success: function(result){
$("#board").html(result);
$('html,body').animate({scrollTop: $("#newpost").offset().top}, 'slow');
}});
}
function xx(){
alert("zzz");
//if (typeof myid !== "undefined" ) {alert(myid);}
}
function replymdat(){
$.ajax({url: "aj_replymrefresh.php", data: "id="+myid, success: function(result){
//alert(result);
$("#reply_m").html(result);
$('html,body').animate({scrollTop: $("#newpost").offset().top}, 'slow');
}});
}
function chkoff(){
$.ajax({url: "aj_chkoff.php", type: 'POST',dataType : 'text', data: $("#newreply_m-form").serialize(), success: function(result){
var arr = result.split(':::');
//alert(arr[1]);
if(arr[1] == "error"){
$('#dialogheader').html(arr[2]);
$('#document').html(arr[3]);
//$("html, body").animate({ scrollTop: 0 }, "slow");
$('#myModaldialog').modal('show');
}
if(arr[1] == "ok"){
//document.newreply_m-form.submit();
$('form[name=newreply_m-form]').submit();
}
}});
}