Index: schedule/function/SplitDelete.php
===================================================================
--- schedule/function/SplitDelete.php	(revision 16933)
+++ schedule/function/SplitDelete.php	(revision 16934)
@@ -1,11 +1,9 @@
 <script type="text/javascript">
  $(document).ready(function(){
- var name;
-var value;
+ var name='';
+var value='';
  var timeValue;
 var meas;
 var meas2;
-var x=0;
-var measurement=0;
 var getTableId;
 var is=0;
@@ -284,5 +282,4 @@
 getTableId =get;
 name="name"; value = '#table2';
-measurement = 0;
 						  meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
 						split2();    }else{   alert("please enter value for time to add measurement");   }
@@ -346,5 +343,5 @@
 					aa = $(this).val();
 					});
-			if(aa != ""){ timeValue =aa; name="name"; value=$(this).attr('name'); measurement = 1; meas = "hidden"; meas2 = true;  getTableId = $(this).attr('name');  split2();    }else{   alert("please enter value for time to add measurement");   }
+			if(aa != ""){ timeValue =aa; name="name"; value=$(this).attr('name');  meas = "hidden"; meas2 = true;  getTableId = $(this).attr('name');  split2();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -465,5 +462,5 @@
 getTableId =get;
 name="name"; value = '#table1';
-						measurement = 0;
+						
   meas = "class"; meas2 = "time";  //getTableId = $(this).attr('name'); 
 split2();    }else{   alert("please enter value for time to add measurement");   }
@@ -528,5 +525,5 @@
 					});
 			
-			if(aa != ""){ timeValue = aa; name="name"; value="#table1"; measurement=1; meas = "hidden"; meas2 = true;  getTableId = $(this).attr('name'); split2();    }else{   alert("please enter value for time to add measurement");   }
+			if(aa != ""){ timeValue = aa; name="name"; value="#table1"; meas = "hidden"; meas2 = true;  getTableId = $(this).attr('name'); split2();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -580,5 +577,5 @@
 			table.setAttribute('id',"table"+cnt);
 			table.setAttribute('width','100%');
-			if(measurement==1){ table.setAttribute(name,value); }
+			table.setAttribute(name,value);
 		var tr = document.createElement('tr');
 			tr.setAttribute('id','');
@@ -607,5 +604,5 @@
 			button.setAttribute('id','btnAddTime'),
 			button.setAttribute(meas,meas2),
-			button.setAttribute('name','table'+cnt),
+			button.setAttribute('name','#table'+cnt),
 			
 			button.onclick=function(){
@@ -614,7 +611,5 @@
 					aa = $(this).val();
 					});
-					
-					if(value == 'undefined'){  bb =  $(this).closest('table').attr('name'); }else{
-					 bb = value; }
+					bb =  $(this).closest('table').attr('name'); 
 			if(aa != ""){var splitting = aa.split(':'); var add = 01;   
 
@@ -635,5 +630,5 @@
 					var s = 0; var	get;
 						var nn;
-						nn = '#'+$(this).attr("name");
+						nn = bb;
 				$("table").each(function() {
 				if($(this).attr("name")==nn){
@@ -650,5 +645,5 @@
 
 name="name"; value = bb;
-meas = "class"; meas2 = "time";  getTableId = get; measurement =0;   split1();    }else{   alert("please enter value for time to add measurement");   }
+meas = "class"; meas2 = "time";  getTableId = get;   split1();    }else{   alert("please enter value for time to add measurement");   }
 
 				
@@ -707,24 +702,10 @@
 			button.setAttribute('name','#table'+cnt),
 			button.onclick=function(){
-		var aa,cc=0;
-		var bb,dd;
+		var aa;
+		var bb;
 			$('div#TableHolder #table'+cnt+' #Time').each(function(){
 					aa = $(this).val();
-					
-					
-					
 					});
-					 dd= $(this).attr('name');
-					//alert(dd);
-					if($('div#TableHolder '+dd+' #Time').is(':visible')){
-					cc=0;
-					//alert(cc);
-					}else{
-					cc=1;
-					}
-					//alert(value);
-					 x = 1;
-					if(meas2 == 'time' && measurement == 0 && cc != 1){  bb =  '#'+$(this).closest('table').attr('id'); }else{
-					 bb = value; } 
+		bb =  $(this).closest('table').attr('name'); 
 			if(aa != "")
 			{ 
@@ -736,6 +717,4 @@
 				meas2 = true;
 				getTableId = $(this).attr('name'); 
-				//alert(getTableId);
-				measurement = 1;
 				split1();    
 			}
@@ -793,5 +772,5 @@
 			table.setAttribute('id',"table"+cnt);
 			table.setAttribute('width','100%');
-				if(measurement==1){ table.setAttribute(name,value); }
+			table.setAttribute(name,value);
 		var tr = document.createElement('tr');
 			tr.setAttribute('id','');
@@ -818,5 +797,5 @@
 			button.setAttribute('id','btnAddTime'),
 			button.setAttribute(meas,meas2),
-			button.setAttribute('name','table'+cnt),
+			button.setAttribute('name','#table'+cnt),
 			
 			button.onclick=function(){
@@ -825,6 +804,5 @@
 					aa = $(this).val();
 					});
-						if(value == 'undefined'){  bb =  $(this).closest('table').attr('name'); }else{
-					 bb = value; }
+					bb =  $(this).closest('table').attr('name'); 
 			if(aa != ""){ var splitting = aa.split(':'); var add = 01;   
 
@@ -857,5 +835,5 @@
 				});
 
-				name="name"; value=bb;	measurement=0;	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");   }
 
 				
@@ -912,24 +890,15 @@
 			button.setAttribute('type','button'),
 			button.setAttribute('value','[+]'),
-			button.setAttribute('id','btnAddTimes'),
+			button.setAttribute('id','btnAddTime'),
 			button.setAttribute('name','#table'+cnt),
 			button.onclick=function(){
 		
-			var aa,cc=0;
-		var bb,dd;
+			var aa;
+		var bb;
 			$('div#TableHolder #table'+cnt+' #Time').each(function(){
 					aa = $(this).val();
-					
 					});
-					dd= $(this).attr('name');
-					if($('div#TableHolder '+dd+' #Time').is(':visible')){
-					cc=0;
-					//alert(cc);
-					}else{
-					cc=1;
-					}
-			 x=1;
-						if(meas2 == 'time' && measurement == 0 && cc!=1){  bb =  '#'+$(this).closest('table').attr('id'); }else{
-					 bb = value; }
+			
+						bb =  $(this).closest('table').attr('name'); 
 					
 			if(aa != "")
@@ -942,5 +911,4 @@
 				meas2 = true;
 				getTableId = $(this).attr('name'); 
-				measurement =1;
 				split1();    
 			}
