tate=0;
yoko=0;
function step_img_tate() { 
if(pic_a==1) return;
tate++;
if(tate>=pic_a) tate=0;
var url=$("#prof_th img").eq(tate).attr("src");
url=url.replace('_thpy','_py');
$("#prof_pic_tate").attr({src:url});
$(".image_qanda dl").hide();
if(tate<3) $(".image_qanda dl").eq(tate).show();
}

function step_img_yoko() { 
if(pic_b==1) return;
yoko++;
if(yoko>=pic_b) yoko=0;
var url=$("#prof_th2 img").eq(yoko).attr("src");
url=url.replace('_thpx','_px');
$("#prof_pic_yoko").attr({src:url});
}

function step_th_tate(event) { 
this.blur();
tate=this.id.replace("prof_th_tate_","")-2;
step_img_tate();
}

function step_th_yoko(event) { 
this.blur();
yoko=this.id.replace("prof_th_yoko_","")-2;
step_img_yoko();
}


function sendform() {
$.ajax({
type:"POST",
url:"../send_ladisurl.html",
data: $("form").serialize(),
dataType: "json",
cache: false,
error :function(XMLHttpRequest, textStatus, errorThrown){alert("エラー「"+textStatus+"」");},
success: function(data){alert(data.str);$("#prof_keitai form").fadeOut(300);$("#prof_keitai span").css({fontWeight:'normal'});}
});
}

function dk_img_on() {
$(this).closest(".image_qanda").children("dl").css({backgroundColor:'#FFF',filter:'alpha(opacity=80)','-moz-opacity':'0.8',opacity:'0.8'},5000);
}
function dk_img_off() {
$(this).closest(".image_qanda").children("dl").css({backgroundColor:''},500);
}



$(function(){
$("#prof_pic_tate").click(step_img_tate).hover(dk_img_on,dk_img_off);
$(".image_logo_tate").click(step_img_tate).hover(dk_img_on,dk_img_off);
$(".image_qanda").click(step_img_tate).hover(dk_img_on,dk_img_off);
$("#prof_yoko_spc").click(step_img_yoko);
$(".image_logo_yoko").click(step_img_yoko);
$("#prof_th img").click(step_th_tate);
$("#prof_th2 img").click(step_th_yoko);
$("#prof_keitai span").click(function(){
this.blur();
$("#prof_keitai form").toggle();
if($("#prof_keitai form").css("display")=='none'){
$("#prof_keitai span").css({fontWeight:'normal'});
}else{
$("#prof_keitai span").css({fontWeight:'bold'});
}
});

$("#prof_keitai form .submitbtn").click(sendform);
});
