/**
* 郵便番号検索
AjaxZip2.JSONDATA = 'lib/jquery.zip/data';
function search_address(obj) {
AjaxZip2.zip2addr(obj, 'address', 'address');
}
*/
/**
* ファイルアップロード
*/
function go_upload() {
$("#default-upload, #error-upload, #success-upload").hide();
$("#now-upload").show();
$("#upload_file").upload('contact.php?mode=filetest', function(res) {
$("#now-upload").hide();
if (res < 0) {
if (res == -1) $("#error-upload").html("ファイルの送信に失敗しました(-1)").show();
if (res == -2) $("#error-upload").html("添付できないファイルです").show();
if (res == -3) $("#error-upload").html("ファイルの送信が失敗しました(-3)").show();
} else
{
var filesize = res.split(":")[0];
var filename = res.split(":")[1];
if ( filesize > 16) {
$("#error-upload").html("添付できる容量を超えています。").show();
} else
{
$("#error-upload").hide();
$("#success-upload").html('' + filename + 'を追加しました
ファイル名が正しく表示されない場合は半角英数でファイル名を付け直して添付してみてください').show();
}
}
}, 'html');
}
/**
* 確認画面へ
*/
function go_confirm() {
$.post("contact.php", {
mode: "go_confirm",
sid: $("#sid").val(),
name: $("#name").val(),
email: $("#email").val(),
subject: $("#subject").val(),
content: $("#content").val()
}, function(text){
if (text == "error") {
location.href = "index.php";
} else
{
location.href = "confirm.php";
}
});
}
/**
* メール送信アンド完了ページ
*/
function go_thanks() {
$.post("contact.php", {
mode: "go_thanks"
}, function(text){
if (text != "") {
alert("このメッセージが表示された場合は、内容をお知らせください\n" + text);
return;
}
location.href = "thanks.php";
});
}
/**
* キャンセル
*/
function go_cancel() {
$.post("contact.php", {
mode: "go_cancel"
},function(){
location.href = "index.php";
});
}
/**
* 戻る
*/
function go_back() {
location.href = "index.php";
}