Index: schedule/function/SplitDelete.php
===================================================================
--- schedule/function/SplitDelete.php	(revision 16895)
+++ schedule/function/SplitDelete.php	(revision 16899)
@@ -213,4 +213,5 @@
 		table.setAttribute('id',"table2");
 		table.setAttribute('width','100%');
+		table.setAttribute('name','#table2');
 	var tr = document.createElement('tr');
 		tr.setAttribute('id','');
@@ -224,5 +225,27 @@
 					input.setAttribute("max","24"),
 					input.setAttribute("min","1"),
-					input.setAttribute("required",true)
+					input.setAttribute("required",true),
+					input.onkeyup = function(){ 
+					
+					
+					
+			
+								if($('div#TableHolder #table2 #Time').val() <= 0  || $('div#TableHolder #table1 #Time').val() <=0){
+								
+								
+								}else{
+									if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){
+									alert('2nd row must be greater than 1st');
+									}
+								}
+							
+						  
+					
+					
+						
+					
+									}
+					
+					
 		);
 			td3.appendChild(
@@ -233,8 +256,9 @@
 			button.setAttribute('name','#table2'),
 			button.onclick=function(){
-var aa;
+					var aa;
 			$('div#TableHolder #table2 #Time').each(function(){
 					aa = $(this).val();
 					});
+					
 			if(aa != ""){ var splitting =aa.split(':'); var add = 01;   
 
@@ -254,18 +278,10 @@
 						var s = 0; var	get;
 						
-$("table").each(function() {
-				if($(this).attr("name")=='#table2'){
-				get = "#"+$(this).attr("id"); 
-				
-						s =1;
-				}else{
-				if(s==0){
-				get = '#table'+cnt;
-				}
-				}
-    });
+				$("table").each(function() { if($(this).attr("name")=='#table2'){ get = "#"+$(this).attr("id"); s =1; }else{ if(s==0){ get = '#table'+cnt; }
+				}
+				});
 getTableId =get;
-name="name"; value="";
-						name="name"; value="";  meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
+name="name"; value = '#table2';
+						  meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
 						split2();    }else{   alert("please enter value for time to add measurement");   }
 
@@ -381,5 +397,27 @@
 					input.setAttribute("max","24"),
 					input.setAttribute("min","1"),
-					input.setAttribute("required",true)
+					input.setAttribute("required",true),
+					input.onkeyup = function(){ 
+					
+					
+					
+							
+			
+								if($('div#TableHolder #table2 #Time').val() <= 0  || $('div#TableHolder #table1 #Time').val() <=0){
+								
+								
+								}else{
+									if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){
+									alert(' row must be greater than previous');
+									return false;
+									}
+								}
+							
+						  
+					
+					
+						
+					
+									}
 		);
 			td3.appendChild(
@@ -391,8 +429,8 @@
 			button.onclick=function(){
 			var aa;
-			$('div#TableHolder #table2 #Time').each(function(){
+			$('div#TableHolder #table1 #Time').each(function(){
 					aa = $(this).val();
 					});
-			if(aa !='') { var splitting  =aa.split(':'); var add = 01;   
+			if(aa !='') { var splitting =aa.split(':'); var add = 01;   
 
 			timeValue = pad((Number(splitting[0]) + Number(add)),2)+':'+splitting[1]; 
@@ -413,5 +451,5 @@
 						
 $("table").each(function() {
-				if($(this).attr("name")=='#table2'){
+				if($(this).attr("name")=='#table1'){
 				get = "#"+$(this).attr("id"); 
 				
@@ -419,12 +457,12 @@
 				}else{
 				if(s==0){
-				get = '#table'+cnt;
+				get = '#table1';
 				}
 				}
     });
 getTableId =get;
-name="name"; value="";
-						
-name="name"; value="";  meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
+name="name"; value = '#table1';
+						
+  meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
 split2();    }else{   alert("please enter value for time to add measurement");   }
 
@@ -483,4 +521,5 @@
 			button.setAttribute('name','#table1'),
 			button.onclick=function(){
+			var aa;
 			$('div#TableHolder #table1 #Time').each(function(){
 					aa = $(this).val();
@@ -532,5 +571,5 @@
 	function split2()
 	{
-	
+
 		cnt++;
 		var div= document.createElement("div");
@@ -553,5 +592,5 @@
 						input.setAttribute("id","Time"),
 						input.setAttribute("max","24"),
-						input.setAttribute("min","1"),
+						input.setAttribute("min",'1'),
 						input.setAttribute("required",true),
 						input.setAttribute(meas,meas2),
@@ -573,4 +612,5 @@
 					aa = $(this).val();
 					});
+					bb =  $(this).closest('table').attr('name'); 
 			if(aa != ""){var splitting = aa.split(':'); var add = 01;   
 
@@ -591,5 +631,5 @@
 					var s = 0; var	get;
 						var nn;
-						nn = $(this).attr('name');
+						nn = bb;
 				$("table").each(function() {
 				if($(this).attr("name")==nn){
@@ -605,5 +645,5 @@
 				});
 
-name="name"; value=$(this).attr('name');
+name="name"; value = bb;
 meas = "class"; meas2 = "time";  getTableId = get;   split1();    }else{   alert("please enter value for time to add measurement");   }
 
@@ -664,11 +704,14 @@
 			button.onclick=function(){
 		var aa;
+		var bb;
 			$('div#TableHolder #table'+cnt+' #Time').each(function(){
 					aa = $(this).val();
 					});
+		bb =  $(this).closest('table').attr('name'); 
 			if(aa != "")
 			{ 
 				name = "name";
-				value = "#table"+cnt;
+				value = bb;
+			//	alert('2'+bb);
 				timeValue = aa;
 				meas = "hidden"; 
@@ -723,5 +766,5 @@
 	function split1()
 	{
-	
+
 		cnt++;
 		var div= document.createElement("div");
@@ -743,8 +786,9 @@
 						input.setAttribute("id","Time"),
 						input.setAttribute("max","24"),
-						input.setAttribute("min","1"),
+						input.setAttribute("min",'1'),
 						input.setAttribute("required",true),
 						input.setAttribute(meas,meas2),
 						input.setAttribute("value",timeValue)
+						
 			);
 				td3.appendChild(
@@ -761,4 +805,5 @@
 					aa = $(this).val();
 					});
+					bb =  $(this).closest('table').attr('name'); 
 			if(aa != ""){ var splitting = aa.split(':'); var add = 01;   
 
@@ -777,5 +822,5 @@
 						var s = 0; var	get;
 						var nn;
-						nn = $(this).attr('name');
+						nn = bb;
 				$("table").each(function() {
 				if($(this).attr("name")==nn){
@@ -791,5 +836,5 @@
 				});
 
-				name="name"; value="";		meas = "class"; meas2 = "time";   getTableId = get; split1();    }else{   alert("please enter value for time to add measurement");   }
+				name="name"; value=bb;		meas = "class"; meas2 = "time";   getTableId = get; split1();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -850,8 +895,27 @@
 			button.onclick=function(){
 		
-			if($('#Time').val() != ""){ timeValue = $('#Time').val(); 				
-			name = "name"; value = $(this).attr('name');  meas = "hidden"; meas2 = true; getTableId = $(this).attr('name');   split1();    }else{   alert("please enter value for time to add measurement");   }
-
-				
+			var aa;
+		var bb;
+			$('div#TableHolder #table'+cnt+' #Time').each(function(){
+					aa = $(this).val();
+					});
+			
+						bb =  $(this).closest('table').attr('name'); 
+					
+			if(aa != "")
+			{ 
+				name = "name";
+				value = bb;
+				//alert(value);
+				timeValue = aa;
+				meas = "hidden"; 
+				meas2 = true;
+				getTableId = $(this).attr('name'); 
+				split1();    
+			}
+			else
+			{ 
+				alert("please enter value for time to add measurement");   
+			}
 			}
 		);
@@ -889,4 +953,23 @@
 	}
 	
+	//$('div#TableHolder #table'+cnt+' #Time')
+	
+	
+		// $('div#TableHolder table #Time').keyup(function(){
+			
+		// if($('div#TableHolder #table2 #Time').val() <= 0  || $('div#TableHolder #table1 #Time').val() <=0){
+		
+		
+		// }else{
+			// if($('div#TableHolder #table1 #Time').val() <= $('div#TableHolder #table2 #Time').val()){
+			// alert(cnt);
+			// }
+		// }
+		// });
+  
+	
+	
+	
+	
  });
  </script>
