rem: for (var r=0; r < 2; r++) { if (form.type.options[r].value == bILData[g].type){ form.type.options[r].selected=true; } }; 
context: function editPolylines(){	show('editpolylinemenu');  show('editpolylineform');	show('editpolylinecancel');		//if polyline data exists	if ( typeof(bILData) ) {	  	// We assume editPolylines has been called before and remove   	// any previously existing sets from the UI  	for (var a=0; a<bLSetData.length; a++) {  		if (bLSetData[a]!= null){    		var getElem = "polylineset_"+bLSetData[a].set_id;    		if ( $(getElem) ) {        	var extraPolylineForm = $(getElem);    			$('editpolylineform').removeChild(extraPolylineForm);    		}			}  	}    	var newSetId;  	  	  	// add a new set UI for each marker set  	for (var b=0; b<bLSetData.length; b++) {  	if (bLSetData[b]!= null){		  	  		newSetId = bLSetData[b].set_id;  	  		// clone model set UI			var newPolylineSet = $('polylineset_n').cloneNode(true);  		// give a new id to the new set UI  		newPolylineSet.id = "polylineset_"+newSetId;  									  		// customize all the values of our new set UI this gets ugly...										  		setKids = newPolylineSet.childNodes;      for (var c=0; c<setKids.length; c++) {   			if (setKids[c].id == "editpolylinesetmenu_n"){  				setKids[c].id = "editpolylinesetmenu_"+newSetId;  				menuKids = setKids[c].childNodes;  			}  			if (setKids[c].id == "polylinesetform_n"){  				setKids[c].id = "polylinesetform_"+newSetId;    					  				setForm = setKids[c];  			}      }  					  		formKids = setForm.childNodes;      for (var d=0; d<formKids.length; d++) {  			if (formKids[d].id == "editpolylinetable_n"){  				formKids[d].id = "editpolylinetable_"+newSetId;  			}  			if (formKids[d].id == "allavailpolylines_n"){  				formKids[d].id = "allavailpolylines_"+newSetId;  				allPolylinesForm = formKids[d];  			}  		}    		allPolyKids = allPolylinesForm.childNodes;      for (var e=0; e<allPolyKids.length; e++) {  			if (allPolyKids[e].id == "addpolylinetable_n"){  				allPolyKids[e].id = "addpolylinetable_"+newSetId;  			}  		}    		// Update the set's menu      for (var f=0; f<menuKids.length; f++) {  			if (menuKids[f].id == "polylinesetid"){      		menuKids[f].innerHTML = bLSetData[b].name;  			}  			if (menuKids[f].id == "polylinesetstyle"){      		menuKids[f].innerHTML = bLSetData[b].style_id;  			}  			if (menuKids[f].id == "seteditpolylines"){      		menuKids[f].href = "javascript:editPolylineSet("+newSetId+");";  			}  			if (menuKids[f].id == "setaddpolylines"){      		menuKids[f].href = "javascript:alert('feature coming soon');";  			}  			if (menuKids[f].id == "seteditstyle"){      		menuKids[f].href = "javascript:alert('feature coming soon');";  			}  			if (menuKids[f].id == "setremove"){      		menuKids[f].href = "javascript:removePolylineSet('edit_polylineset.php', "+bLSetData[b].set_id+", 'I');";  //this needs to be modified to account for I or S set type  			}  			if (menuKids[f].id == "setdelete"){      		menuKids[f].href = "javascript:expungePolylineSet('edit_polylineset.php', "+bLSetData[b].set_id+");";  			}  			if (menuKids[f].id == "setdesc"){      		menuKids[f].innerHTML = bLSetData[b].description;  			}      }							  					      // add form to set table  		$('editpolylineform').appendChild(newPolylineSet);  		show('polylineset_'+newSetId);  	}		}		  	//for length of polylines add form to setelement on matching set_id  	for (g=0; g<bILData.length; g++) {			if (bILData[g]!= null){				//add marker form...again a little ugly here				var formCont = $("editpolylinetable_"+bILData[g].set_id);  			formContKids = formCont.childNodes;        for (var n = 0; n < formContKids.length; n++) {  				if (formContKids[n].id == "polylineform_n"){        			var newPolylineForm = formContKids[n].cloneNode(true);    					newPolylineForm.id = "polylineform_"+g;							newPolylineForm.name = "polylineform_"+g;							var nLFKids = newPolylineForm.childNodes;							for (var o=0; o<nLFKids.length; o++){							  if (nLFKids[o].id == "polylineformdata_n"){									nLFKids[o].id = "polylineformdata_"+g;									}							}							    					$('editpolylinetable_'+bILData[g].set_id).appendChild(newPolylineForm);							show('polylineform_'+g);							break;					}			  }								// populate set form values				form = $('polylineform_'+g);        form.set_id.value = bILData[g].set_id;        form.polyline_id.value = bILData[g].polyline_id;        form.name.value = bILData[g].name;				        for (var r=0; r < 2; r++) {           if (form.type.options[r].value == bILData[g].type){              form.type.options[r].selected=true;           }        };        form.points_data.value = bILData[g].points_data;  //this might need to be a loop        form.border_text.value = bILData[g].border_text;        form.zindex.value = bILData[g].zindex;        form.polyline_array.value = bILData[g].array;        form.polyline_array_n.value = bILData[g].array_n;								// just for a pretty button - js sucks it!				var linkParent = $('polylineformdata_'+g);				var linkPKids = linkParent.childNodes;				for (var p=0; p<linkPKids.length; p++){						if (linkPKids[p].name == "save_polyline_btn"){							 linkPKids[p].href = "javascript:storePolyline('edit_polyline.php', document.polylineform_"+g+");" ;						}						if (linkPKids[p].name == "locate_polyline_btn"){							 linkPKids[p].href = "javascript:alert('feature coming soon');" ;						}						if (linkPKids[p].name == "remove_polyline_btn"){							 linkPKids[p].href = "javascript:removePolyline('edit_polyline.php', document.polylineform_"+g+");" ;						}						if (linkPKids[p].name == "expunge_polyline_btn"){							 linkPKids[p].href = "javascript:expungePolyline('edit_polyline.php', document.polylineform_"+g+");" ;						}						if (linkPKids[p].name == "polyline_assist_btn"){							 linkPKids[p].href = "javascript:addAssistant('polyline', " + g + ");" ;						}				}			}		}			}};
meta: 1713	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1713/5eaa27b59ea4f58041e7c5cd749a97ae3c8873e3/formsubmit.js/clean/templates/formsubmit.js