function on_xx(id,count){
   	var count = Math.round(Number($('#count'+id).val()));
   	var buystore = Number($('#buystore'+id).val());
   	var schedule =Number($('#schedule'+id).val());
   	var total = buystore+schedule;
   	var urlbase = url+'/order/'+id+'/count/'+count+'.html';   	
   	if(count>0&&count<=buystore){
   	     window.location.href=urlbase;
   	}else if(count>buystore&&count<=total){
   	     alert('希望口数が在庫数を超えています');
   	     window.location.href=urlbase;	
   	}else if(count>total){
   		alert('予約上限口数を超えています');
   		window.location.href= url+'/order/'+id+'/count/'+total+'.html';	
   	}else{
   		alert('購入数が誤った');
   	}
   }

function GetHour(event){
	     var date=$("#date").attr("value");
	     var min=$("#mini").attr("value");
	     //var myDate = new Date();
	     //var hour = myDate.getHours();
	     var hour=$("#hour").attr("value");
	     
			 $.ajax({
			   type: "get",
			   url: url+"/gettime/"+hour+"/"+date+"/"+min+"/"+event.id,
			   beforeSend: function(XMLHttpRequest){
                         $("#divhour").html("<img src="+url+"/Public/images/ajaxloading.gif>");
			   },
			   dataType: 'json',
			   success: function(data){
			  //$("#divhour").html(data.hour);
              // $("#divmin").html(data.min);
              $("#hour option").remove(); 
              $("#mini option").remove(); 
              $("#hour").append(data.hour);
              $("#mini").append(data.min);
			   },
			   complete: function(XMLHttpRequest, textStatus){
			   },
			   error: function(){
			   }
			 });
}

function checkAge20(){

	if(document.getElementById('chkAge').checked){
		document.getElementById('sbnext').disabled = false;
	}else{
		document.getElementById('sbnext').disabled = true;
	}
}
function exchange(){
	var exchangeid=$("#exchangeid").attr("value");
	if("3"==exchangeid){
	    $("#spotID").hide();
	    $("#spotmsg").html("<td></td><td colspan='2'><font color='red'>* 郵送完了後のキャラ名変更及び再送は一切出来ません。お間違えのないようにご注意ください。 </font></td>");
	}else{
		$("#spotID").show();
	    $("#spotmsg").html("");
		
	}
}
function chkemail(){
	var nvalue=$("#uemail").attr("value");
	var search_str = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
	   if(!search_str.test(nvalue)){
          $("#diverr").html('<td align="right" width="123"></td><td colspan="2"><img style="vertical-align: middle;padding-right:3px" src="+url+"/Public/Rmtco/images/error.png" /><font color="red">メールアドレスの形式が正しくありません。再度入力してください。</font></td>');
          $("#dive").html('');
		  }else{
       	$("#dive").html('<img src=__PUBLIC__/Rmtco/images/success.png>');
		$("#diverr").html('');
       }
}
function chkreemail(){
	var mail=$("#uemail").attr("value");
	var remail=$("#uremail").attr("value");
	if(mail==remail&&mail.length>1){
		$("#divre").html('<img style="padding:3px 0px;" src=__PUBLIC__/Rmtco/images/success.png>');
        $("#divrerr").html('');
	}else{
		$("#divrerr").html('<td align="right" width="123"></td><td colspan="2"><img style="vertical-align: middle;padding:3px 0px;"  src="__PUBLIC__/Rmtco/images/error.png" /><font color="red">同一のメールアドレスを入力して下さい。</font></td>');
	    $("#divre").html('');
		}
}
function on_ss(id,count){
   	var count = Math.round(Number($('#count'+id).val()));
   	var salestore = Number($('#salestore'+id).val());
   	var urlbase = url+'/saleorder/'+id+'/count/'+count+'.html';   	
   	if(count>0&&count<=salestore){
   	     window.location.href=urlbase;
   	}else if(count>salestore){
   	     alert('希望口数が在庫数を超えています');
   		window.location.href= url+'/saleorder/'+id+'/count/'+salestore+'.html';	   	     
   	}else{
   		alert('購入数が誤った');
   	}
   }
