Index: schedule/function/SplitDelete.php
===================================================================
--- schedule/function/SplitDelete.php	(revision 16984)
+++ schedule/function/SplitDelete.php	(revision 17218)
@@ -1,11 +1,4 @@
-
 <script src="js/jquery-1.7.1.js"></script>
 <script language="javascript">
-
-var timeval = 0;
-var name = "";
-var hid = "";
-var opt = "";
-window.cnt=0;
 	function clearNode(node){
 		var child = node.childNodes[0];
@@ -17,12 +10,11 @@
 	}
 	
-	
 	function addRow(table){
-	    var targetView = table;
+		var targetView = table;
 		// CREATE ELEMENT	
 		var newtr = document.createElement("tr");
 		
 		var newtd_c1 = document.createElement("td");
-			newtd_c1.setAttribute("width","115");
+			newtd_c1.setAttribute("width","147");
 			newtd_c1.setAttribute("align","center");
 			newtd_c1.appendChild(
@@ -31,11 +23,14 @@
 				input_data.setAttribute("size","10"),
 				input_data.setAttribute("autofocus","true"),
-				input_data.setAttribute("hidden",true)
+				input_data.setAttribute("hidden","true")
 			);
 		var newtd_c2 = document.createElement("td");
-			newtd_c2.setAttribute("width","40");
+			newtd_c2.setAttribute("width","138");
 			newtd_c2.setAttribute("align","center");
 			newtd_c2.appendChild(
-				selection = document.createElement("select"),
+			
+
+
+			selection = document.createElement("select"),
 				<?php   
 				$selectm = mysql_query("SELECT * FROM measurement");
@@ -48,5 +43,8 @@
 			);
 			
-			//var newtd_c2 = document.createElement("td");
+			
+			
+			
+			
 			newtd_c2.setAttribute("width","115");
 			newtd_c2.setAttribute("align","center");
@@ -54,10 +52,10 @@
 				input_data = document.createElement("input"),
 				input_data.setAttribute("type","button"),
-				input_data.setAttribute("value","[ + ]"),
+				input_data.setAttribute("id","plus"),
+				input_data.setAttribute("value","+"),
 				input_data.onclick = function(){ return addRow(newtr); }
 			);
-		
 		var newtd_c3 = document.createElement("td");
-			newtd_c3.setAttribute("width","88");
+			newtd_c3.setAttribute("width","98");
 			newtd_c3.setAttribute("align","center");
 			newtd_c3.appendChild(
@@ -74,49 +72,49 @@
 			selection.setAttribute('id','measurement')
 			);
+			
+			
+			
 		var newtd_c4 = document.createElement("td");
-			newtd_c4.setAttribute("width","180");
+			newtd_c4.setAttribute("width","119");
 			newtd_c4.setAttribute("align","center");
 			newtd_c4.appendChild(
 				input_data = document.createElement("input"),
 				input_data.setAttribute("type","text"),
-				input_data.setAttribute("size","25"),
+				input_data.setAttribute("size","12"),
 				input_data.setAttribute("placeholder","Value")
 			);
 		var newtd_c5 = document.createElement("td");
-			newtd_c5.setAttribute("width","95");
+			newtd_c5.setAttribute("width","115");
 			newtd_c5.setAttribute("align","center");
 			newtd_c5.appendChild(
 				input_data = document.createElement("input"),
 				input_data.setAttribute("type","button"),
-				input_data.setAttribute("value","[ Delete ]"),
+				input_data.setAttribute("id","delete"),
+				input_data.setAttribute("value","Delete"),
 				input_data.onclick = function(){ return clearNode(newtr); }
 			);
 		
-		newtr.appendChild(newtd_c1);
 		newtr.appendChild(newtd_c2);
 		newtr.appendChild(newtd_c3);
 		newtr.appendChild(newtd_c4);
 		newtr.appendChild(newtd_c5);
-	//newtr.appendChild(newtd_c6);
 		
 		$(targetView).after(newtr);
-	
 	}
-	
 	function deleteRow(tableID){
 		try{
-			var table=document.getElementById(tableID);
-			var rowCount=table.rows.length;
-			
-			for(var i=0;i<rowCount;i++){
-				var row=table.rows[i];
-				var chkbox=row.cells[0].childNodes[0];
-				if(null!=chkbox&&true==chkbox.checked){
-					if(rowCount<=1){
+			var table = document.getElementById(tableID);
+			var rowCount = table.rows.length;
+			
+			for(var i = 0; i < rowCount; i++){
+				var row = table.rows[i];
+				var chkbox = row.cells[0].childNodes[0];
+				if(null != chkbox && true == chkbox.checked){
+					if(rowCount <= 1){
 						alert("Cannot delete all the rows.");
 						break;
 					}
 					table.deleteRow(i);
-					rowCount--;i--;
+					rowCount--; i--;
 				}
 			}
@@ -137,17 +135,24 @@
 		newdiv.setAttribute("id","list_"+newlist);
 		newdiv.setAttribute("class","datalisting");
-		newdiv.setAttribute("style","margin:5px 0;");
+		newdiv.setAttribute("style","margin:30px 0;");
 	var newtable = document.createElement("table");
 		newtable.setAttribute("class","dataTable");
-		newtable.setAttribute("width","100%");
-		newtable.setAttribute("border","3");
+		newtable.setAttribute("width","900");
+		newtable.setAttribute("border","1");
 		newtable.setAttribute("cellspacing","0");
 		newtable.setAttribute("cellpadding","0");
+	var newInnertable = document.createElement("table");
+		newInnertable.setAttribute("class","dataTable");
+		newInnertable.setAttribute("width","600");
+		newInnertable.setAttribute("border","1");
+		newInnertable.setAttribute("cellspacing","0");
+		newInnertable.setAttribute("cellpadding","0");
 		
 	var newtr = document.createElement("tr");
 	
 	var newtd_c1 = document.createElement("td");
-		newtd_c1.setAttribute("width","115");
+		newtd_c1.setAttribute("width","160");
 		newtd_c1.setAttribute("align","center");
+		newtd_c1.setAttribute("valign","top");
 		newtd_c1.appendChild(
 			input_data = document.createElement("input"),
@@ -159,5 +164,6 @@
 			input_data = document.createElement("input"),
 			input_data.setAttribute("type","button"),
-			input_data.setAttribute("value","[ + ]"),
+			input_data.setAttribute("id","delete"),
+			input_data.setAttribute("value","+"),
 			input_data.onclick = function(){
 				addRowClone("list_"+newlist);
@@ -165,5 +171,5 @@
 		);
 	var newtd_c2 = document.createElement("td");
-		newtd_c2.setAttribute("width","40");
+		newtd_c2.setAttribute("width","118");
 		newtd_c2.setAttribute("align","center");
 		newtd_c2.appendChild(
@@ -181,5 +187,6 @@
 			);
 			
-//		var newtd_c6 = document.createElement("td");
+			
+			
 		newtd_c2.setAttribute("width","115");
 		newtd_c2.setAttribute("align","center");
@@ -187,11 +194,13 @@
 			input_data = document.createElement("input"),
 			input_data.setAttribute("type","button"),
-			input_data.setAttribute("value","[ + ]"),
-			input_data.onclick = function(){ return addRow(newtr); }
-		);
-		var newtd_c3 = document.createElement("td");
-			newtd_c3.setAttribute("width","98");
-			newtd_c3.setAttribute("align","center");
-			newtd_c3.appendChild(
+			input_data.setAttribute("id","plus"),
+			input_data.setAttribute("value","+"),
+			input_data.onclick = function(){ 
+			return addRow(newtr);
+			});
+	var newtd_c3 = document.createElement("td");
+		newtd_c3.setAttribute("width","98");
+		newtd_c3.setAttribute("align","center");
+		newtd_c3.appendChild(
 				selection = document.createElement("select"),
 		<?php
@@ -207,33 +216,62 @@
 			selection.setAttribute('id','measurement')
 		);
-		var newtd_c4 = document.createElement("td");
-			newtd_c4.setAttribute("width","180");
-			newtd_c4.setAttribute("align","center");
-			newtd_c4.appendChild(
-				input_data = document.createElement("input"),
-				input_data.setAttribute("type","text"),
-				input_data.setAttribute("size","25"),
-				input_data.setAttribute("placeholder","Value")
-			);
-		var newtd_c5 = document.createElement("td");
-			newtd_c5.setAttribute("width","95");
-			newtd_c5.setAttribute("align","center");
-			newtd_c5.appendChild(
-				input_data = document.createElement("input"),
-				input_data.setAttribute("type","button"),
-				input_data.setAttribute("value","[ Delete Main ]"),
-				input_data.onclick = function(){ return clearNode(newdiv); }
-			);
-
-	newtr.appendChild(newtd_c1);
+		
+		
+		
+	var newtd_c4 = document.createElement("td");
+		newtd_c4.setAttribute("width","119");
+		newtd_c4.setAttribute("align","center");
+		newtd_c4.appendChild(
+			input_data = document.createElement("input"),
+			input_data.setAttribute("type","text"),
+			input_data.setAttribute("size","12"),
+			input_data.setAttribute("placeholder","Value")
+		);
+	var newtd_c5 = document.createElement("td");
+		newtd_c5.setAttribute("width","100");
+		newtd_c5.setAttribute("align","center");
+		newtd_c5.setAttribute("width","115");
+		newtd_c5.setAttribute("align","center");
+		newtd_c5.appendChild(
+			input_data = document.createElement("input"),
+			input_data.setAttribute("type","button"),
+			input_data.setAttribute("id","delete"),
+			input_data.setAttribute("value","Delete"),
+			input_data.onclick = function(){ return clearNode(newtr);
+			}
+		);
 	newtr.appendChild(newtd_c2);
 	newtr.appendChild(newtd_c3);
 	newtr.appendChild(newtd_c4);
 	newtr.appendChild(newtd_c5);
-	//newtr.appendChild(newtd_c6);
-	
-	newtable.appendChild(newtr);
+	
+	newInnertable.appendChild(newtr);
+	var newtd_c6 = document.createElement("td");
+		newtd_c6.appendChild(newInnertable);
+
+	var newtd_c7 = document.createElement("td");
+		newtd_c7.setAttribute("width","115");
+		newtd_c7.setAttribute("align","center");
+		newtd_c7.setAttribute("valign","top");
+		newtd_c7.appendChild(
+			input_data = document.createElement("input"),
+			input_data.setAttribute("type","button"),
+			input_data.setAttribute("height","30"),
+			input_data.setAttribute("id","delete"),
+			input_data.setAttribute("value","Delete Main"),
+			input_data.onclick = function(){ return clearNode(newdiv); }
+		);
+
+	var newOutertr = document.createElement("tr");
+
+	//newOutertr.appendChild(newtd_c1);
+	//newOutertr.appendChild(newtd_c6);
+	//newOutertr.appendChild(newtd_c7);
+
+	newtable.appendChild(newtd_c1);
+	newtable.appendChild(newtd_c6);
+	newtable.appendChild(newtd_c7);
+
 	newdiv.appendChild(newtable);
-	
 	if(nextrow != null){	
 		var doc = document.getElementById(nextrow);
@@ -243,4 +281,5 @@
 	}
 }
+
 window.onload = function(){
 	addRowClone();
@@ -249,4 +288,55 @@
 </script>
 
+
+
+
+<style>
+#delete{
+	cursor: pointer;
+border-top: 1px solid #96d1f8;
+background: #65a9d7;
+background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
+background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
+background: -moz-linear-gradient(top, #3e779d, #65a9d7);
+background: -ms-linear-gradient(top, #3e779d, #65a9d7);
+background: -o-linear-gradient(top, #3e779d, #65a9d7);
+padding: 3px 6px;
+-webkit-border-radius: 6px;
+-moz-border-radius: 6px;
+border-radius: 6px;
+-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
+-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
+box-shadow: rgba(0,0,0,1) 0 1px 0;
+text-shadow: rgba(0,0,0,.4) 0 1px 0;
+color: white;
+font-size: 14px;
+font-family: 'Lucida Grande', Helvetica, Arial, Sans-Serif;
+text-decoration: none;
+vertical-align: middle;
+}
+#plus{
+	cursor: pointer;
+border-top: 1px solid #96d1f8;
+background: #65a9d7;
+background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
+background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
+background: -moz-linear-gradient(top, #3e779d, #65a9d7);
+background: -ms-linear-gradient(top, #3e779d, #65a9d7);
+background: -o-linear-gradient(top, #3e779d, #65a9d7);
+padding: 3px 6px;
+-webkit-border-radius: 6px;
+-moz-border-radius: 6px;
+border-radius: 6px;
+-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
+-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
+box-shadow: rgba(0,0,0,1) 0 1px 0;
+text-shadow: rgba(0,0,0,.4) 0 1px 0;
+color: white;
+font-size: 14px;
+font-family: 'Lucida Grande', Helvetica, Arial, Sans-Serif;
+text-decoration: none;
+vertical-align: middle;
+}
+</style>
 
 </head>
