function isaar(path,n,p){
  path = "http://plus.e-kyousei.tv/php/pss/ncomi/NcomiEvaluation.php";
  if(document.getElementById(n)){
    $.ajax({
       type: "POST",
       url: path,
       data: "n="+n+"&p="+p+"&t="+new Date(),
       cache: false,
       timeout: 5000,
       success: function(msg){
         $("#"+n).hide();
         $("#"+n).text(msg);
         if(p == 1 && msg != "回答済みです。"){
           document.getElementById("p_"+n).innerHTML = parseInt(document.getElementById("p_"+n).innerHTML) + 1;
         }
         $("#"+n).fadeIn("normal");
       },
       error: function(XMLHttpRequest, textStatus, errorThrown){
         $("#"+n).text(" 通信エラー[textStatus:"+textStatus+",errorThrown:"+errorThrown+"]");
         
       }
     });
  }else{
  }
}

function getKcmData(path,keyid,lpg,num,ftr){
  $.ajax({
     type: "POST",
     url: path,
     data: "keyid="+keyid+"&lpg="+lpg+"&num="+num+"&ftr="+ftr+"&t="+new Date(),
     cache: true,
     success: function(msg){
       document.getElementById("ajkcm").innerHTML = msg; 
     }
   });
}

function creHope(path,No,hol,xDaysAfter,calName){
  $.ajax({
     type: "POST",
     url: path,
     data: "No="+No+"&hol="+hol+"&xDaysAfter="+xDaysAfter+"&calName="+calName,
     cache: false,
     success: function(msg){
       document.getElementById(calName).innerHTML = msg; 
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
       document.getElementById(calName).innerHTML = "[ 通信エラー ]";
     }
   });
}

function getCalMonthNext(path,fName,dName1,year,month,hol,xDaysAfter,calName,dName2){
  $.ajax({
     type: "POST",
     url: path,
     data: "fName="+fName+"&dName1="+dName1+"&year="+year+"&month="+month+"&hol="+hol+"&xDaysAfter="+xDaysAfter+"&calName="+calName+"&dName2="+dName2,
     cache: false,
     success: function(msg){
       document.getElementById(calName).innerHTML = msg; 
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
       document.getElementById(calName).innerHTML = "[ 通信エラー ]";
     }
   });
}


function getKcmListNext(path,typed,cap,ca1,ca2,sub,lpg,spg,kaizen,kaiin){
  $.ajax({
     type: "POST",
     url: path,
     data: "cap="+cap+"&ca1="+ca1+"&ca2="+ca2+"&lpg="+lpg+"&sub="+sub+"&typed="+typed+"&spg="+spg+"&kaizen="+kaizen+"&kaiin="+kaiin+"&t="+new Date(),
     cache: true,
     success: function(msg){
       document.getElementById("ajlst").innerHTML = msg; 
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
       document.getElementById("ajlst").innerHTML = "[ 通信エラー ]";
     }
   });
}

function openPostWindow(path){
  window.open(path,'post','scrollbars=yes,width=750,height=600');
}


function linkclickCount(SDIN,PDIN,KID,LTYPE,TURL){
  var MSEC = (new Date()).getTime();
  var EURL = 'http://plus.e-kyousei.tv/php/pss/ajctrl/linkdata_post.php';
  domain = location.hostname;
  SDIN  = escape(SDIN);
  PDIN  = escape(PDIN);
  KID   = escape(KID);
  LTYPE = escape(LTYPE);
  if(LTYPE == 1){
    if(TURL.indexOf(domain) != -1){LTYPE = 2;}
  }
  $.ajax({
     type: "POST",
     url: EURL,
     data: "SDIN="+SDIN+"&PDIN="+PDIN+"&KID="+KID+"&LTYPE="+LTYPE+"&LFMR="+top.location.href+"&LDTAN="+TURL+"&UAGENT="+navigator.userAgent+"&MSEC="+MSEC,
     cache: false,
     success: function(msg){
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
     }
   });
  setTimeout(function(){top.location.href = TURL;},100);
  return false;
}

function submitclickCount(SDIN,PDIN,KID,LTYPE,TURL,OBJFORM){
  var MSEC = (new Date()).getTime();
  var EURL = 'http://plus.e-kyousei.tv/php/pss/ajctrl/linkdata_post.php';
  domain = location.hostname;
  SDIN  = escape(SDIN);
  PDIN  = escape(PDIN);
  KID   = escape(KID);
  LTYPE = escape(LTYPE);
  $.ajax({
     type: "POST",
     url: EURL,
     data: "SDIN="+SDIN+"&PDIN="+PDIN+"&KID="+KID+"&LTYPE="+LTYPE+"&LFMR="+location.href+"&LDTAN="+TURL+"&UAGENT="+navigator.userAgent+"&MSEC="+MSEC,
     cache: false,
     success: function(msg){
     },
     error: function(XMLHttpRequest, textStatus, errorThrown){
     }
   });
  setTimeout(function(){OBJFORM.submit();},100);
  return false;
}

var click_count = 0;
function mls(mlid){
  if(click_count == 0){
    click_count++;
    $.ajax({
       type: "POST",
       url: "./mls.php",
       data: "mlid="+mlid,
       cache: false,
       success: function(msg){
       },
       error: function(XMLHttpRequest, textStatus, errorThrown){
       }
     });
  }
}
