shorten jquery code

shorten jquery code

Hi,

I am trying to change this massive code to have just 1 popup ONLY of 'availability doesnt match do you want to continue'  ok or cancel as the options. The code is part of a html code which just calls this code as part of a cakephp program.

I cant remove the extra dialogs after this notification.
Also the notification if the availability does match I want it to continue.
I really want to shorten this code to a few lines only but i cant .

How do I get 1 option only of this because when I did myself it would not work. All the code is here.

  1. var form = $('#LessonAddIndividualstudentForm');
    						$.ajax( {
    						  type: "POST",
    						  url: siteurl+'lessons/check_student_tutor_avalability',
    						  data: form.serialize(),
    						  success: function( response ) {
                                                          		
    						      LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
    						      LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
    						      LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
    								
                                                          jQuery('#tutor_email_noti').val('0');
                                                          jQuery('#LessonAddIndividualstudentForm').submit();
    						      jQuery( this ).dialog( "close" );
                                                          
                                                         /* 
    							 if(response==1){
    							 
    							      // if(confirm("availability is matched Do you want to continue?")){							   							         
    											
    											event.preventDefault();
    											  jQuery( "#notification_msg" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:150,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    										{
    									 text: "Ok",
    									"class": 'OKButtonClass btn btn-large btn-primary',
    									click: function() {
    
    										jQuery('#message').val('1');
    										jQuery( this ).dialog( "close" );
    										/////////===========
    										
    									LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
    									LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
    									LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
    													    
    							if(LessonScheduleRec==true){										
    										
    									      jQuery( "#notification_msg_msg" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_schedual').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    											  
    											  
    										
    									}else if(LessonScheduleMonthly==true){ 
    										
    										jQuery( "#notification_msg_msg_monthely" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_monthely').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    											  
    											  
    										}else if(LessonScheduleYearly==true){
    										
    										         
    												 
    											  jQuery( "#notification_msg_msg_yearly" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_yearly').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })								
    										
    										
    										}else{
    										
    										       jQuery( "#notification_msg_msg_oneoff" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_oneoff').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    										
    										
    										
    										
    										}	  
    										
    														//////////////=========
    													}
    												},
    												{
    													text: "Cancel",
    													"class": 'cancelButtonClass btn btn-large btn-danger',
    													click: function() {
    														jQuery('#tutor_email_noti').val('0');
    														jQuery('#message').val('0');
    														jQuery('#message_text').val(' ');
    														jQuery('#LessonAddIndividualstudentForm').submit();
    														jQuery( this ).dialog( "close" );
    													}
    												}
    											],
    											Cancel: function() {
    											  jQuery( this ).dialog( "close" );
    											}
    									  });
    								//}else{
    								
    								   //  return false;
    								
    								//}  
    						          
    									  
    						  }else{							   
    							   
    							   if(confirm("Availability Does Not Match Do you want to continue?")){
    							          
    												event.preventDefault();
    								  jQuery( "#notification_msg" ).dialog({
    								  resizable: false,
    								  dialogClass: "notification_popup",
    								  height:150,
    								  width:'auto',
    								  title: "SMS Notification",
    								  closeText: "X",
    								  modal: true,
    								  buttons: [
    					        {
    						text: "Ok",
    						"class": 'OKButtonClass btn btn-large btn-primary',
    						click: function() {
    
    							jQuery('#message').val('1');
    							jQuery( this ).dialog( "close" );
    							/////////===========
    							
    							    	LessonScheduleRec=document.getElementById('LessonScheduleRec').checked;
    									LessonScheduleMonthly=document.getElementById('LessonScheduleMonthly').checked;
    									LessonScheduleYearly=document.getElementById('LessonScheduleYearly').checked;
    													    
    							if(LessonScheduleRec==true){										
    										
    									      jQuery( "#notification_msg_msg" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_schedual').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    											  
    											  
    										
    									}else if(LessonScheduleMonthly==true){ 
    										
    										jQuery( "#notification_msg_msg_monthely" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_monthely').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    											  
    											  
    										}else if(LessonScheduleYearly==true){
    										
    										         
    												 
    											  jQuery( "#notification_msg_msg_yearly" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_yearly').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })								
    										
    										
    										}else{
    										
    										       jQuery( "#notification_msg_msg_oneoff" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "SMS Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																var ms =  jQuery('#noti_msg_oneoff').val();
    																jQuery('#message_text').val(ms);
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:260,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    												  jQuery( this ).dialog( "close" );
    												}
    											  })
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#message').val('0');
    																jQuery('#message_text').val(' ');
    																jQuery( this ).dialog( "close" );
    																jQuery( "#notification_tutor" ).dialog({
    											  resizable: false,
    											  dialogClass: "notification_popup",
    											  height:250,
    											  width:'auto',
    											  title: "Email Notification",
    											  closeText: "X",
    											  modal: true,
    											  buttons: [
    														{
    															text: "Ok",
    															"class": 'OKButtonClass btn btn-large btn-primary',
    															click: function() {
    																
    																	
    																jQuery('#tutor_email_noti').val('1');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														},
    														{
    															text: "Cancel",
    															"class": 'cancelButtonClass btn btn-large btn-danger',
    															click: function() {
    																jQuery('#tutor_email_noti').val('0');
    																jQuery('#LessonAddIndividualstudentForm').submit();
    																jQuery( this ).dialog( "close" );
    															}
    														}
    													],
    												Cancel: function() {
    													jQuery('#tutor_email_noti').val('0');
    												  jQuery( this ).dialog( "close" );
    												  
    												}
    											  })
    															}
    														}
    													],
    													Cancel: function() {
    														jQuery('#tutor_email_noti').val('0');
    													  jQuery( this ).dialog( "close" );
    													}
    											  })
    										
    										
    										
    										
    										}	
    								  
    								  
    								  
    							
    											//////////////=========
    										}
    									},
    									{
    										text: "Cancel",
    										"class": 'cancelButtonClass btn btn-large btn-danger',
    										click: function() {
    											jQuery('#tutor_email_noti').val('0');
    											jQuery('#message').val('0');
    											jQuery('#message_text').val(' ');
    											jQuery('#LessonAddIndividualstudentForm').submit();
    											jQuery( this ).dialog( "close" );
    										}
    									}
    								],
    								Cancel: function() {
    								  jQuery( this ).dialog( "close" );
    								}
    						        });
    											
    									  
    							   
    							   }else{
    							     
    								 
    							   //alert("Availability Does Not Match please check availability");
    							     return false;
    							   }
    						    }
    						   /// $('#tutoravaliablityresposnse').html(msg);
    						  }
                                                      
                                                      
                                                 
    					  });