context: function editMarkers(){		  // Display the Edit Form Div and Cancel Button	show('editmarkermenu');  show('editmarkerform');	show('editmarkercancel');	//if marker data exists	if ( typeof(bIMData) ) {	  	// We assume editMarkers has been called before and remove   	// any previously existing sets from the UI  	for (var a=0; a<bMSetData.length; a++) {  		if (bMSetData[a]!= null){    		var getElem = "markerset_"+bMSetData[a].set_id;    		if ( $(getElem) ) {        	var extraMarkerForm = $(getElem);    			$('editmarkerform').removeChild(extraMarkerForm);    		}			}  	}    	var newSetId;  	  	  	// add a new set UI for each marker set  	for (var b=0; b<bMSetData.length; b++) {  	if (bMSetData[b]!= null){									  	  		newSetId = bMSetData[b].set_id;  	  		// clone model set UI			var newMarkerSet = $('markerset_n').cloneNode(true);  		// give a new id to the new set UI  		newMarkerSet.id = "markerset_"+newSetId;  									  		// customize all the values of our new set UI this gets ugly...										  		setKids = newMarkerSet.childNodes;      for (var c=0; c<setKids.length; c++) {   			if (setKids[c].id == "editsetmenu_n"){  				setKids[c].id = "editsetmenu_"+newSetId;  				menuKids = setKids[c].childNodes;  			}  			if (setKids[c].id == "setform_n"){  				setKids[c].id = "setform_"+newSetId;    					  				setForm = setKids[c];  			}      }  					  		formKids = setForm.childNodes;      for (var d=0; d<formKids.length; d++) {  			if (formKids[d].id == "editmarkertable_n"){  				formKids[d].id = "editmarkertable_"+newSetId;  			}  			if (formKids[d].id == "allavailmarkers_n"){  				formKids[d].id = "allavailmarkers_"+newSetId;  				allMarkersForm = formKids[d];  			}  		}    		allMarkKids = allMarkersForm.childNodes;      for (var e=0; e<allMarkKids.length; e++) {  			if (allMarkKids[e].id == "addmarkertable_n"){  				allMarkKids[e].id = "addmarkertable_"+newSetId;  			}  		}    		// Update the set's menu      for (var f=0; f<menuKids.length; f++) {  			if (menuKids[f].id == "setid"){      		menuKids[f].innerHTML = bMSetData[b].name;  			}  			if (menuKids[f].id == "setstyle"){      		menuKids[f].innerHTML = bMSetData[b].style_id;  			}  			if (menuKids[f].id == "seticon"){      		menuKids[f].innerHTML = bMSetData[b].icon_id;  			}  			if (menuKids[f].id == "seteditmarkers"){      		menuKids[f].href = "javascript:editSet("+newSetId+");";  			}  			if (menuKids[f].id == "setaddmarkers"){      		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:removeMarkerSet('edit_markerset.php', "+bMSetData[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:expungeMarkerSet('edit_markerset.php', "+bMSetData[b].set_id+");";  			}  			if (menuKids[f].id == "setdesc"){      		menuKids[f].innerHTML = bMSetData[b].description;  			}      }							  					      // add form to set table  		$('editmarkerform').appendChild(newMarkerSet);  		show('markerset_'+newSetId);  	}		}		  	//for length of markers add form to setelement on matching set_id  	for (g=0; g<bIMData.length; g++) {			if (bIMData[g]!= null){				//add marker form...again a little ugly here				var formCont = $("editmarkertable_"+bIMData[g].set_id);  			formContKids = formCont.childNodes;        for (var n = 0; n < formContKids.length; n++) {  				if (formContKids[n].id == "markerform_n"){        			var newMarkerForm = formContKids[n].cloneNode(true);    					newMarkerForm.id = "markerform_"+g;							newMarkerForm.name = "markerform_"+g;							var nMFKids = newMarkerForm.childNodes;							for (var o=0; o<nMFKids.length; o++){							  if (nMFKids[o].id == "formdata_n"){									nMFKids[o].id = "formdata_"+g;									}							}							    					$('editmarkertable_'+bIMData[g].set_id).appendChild(newMarkerForm);							show('markerform_'+g);							break;					}			  }								// populate set form values				form = $('markerform_'+g);        form.set_id.value = bIMData[g].set_id;        form.marker_id.value = bIMData[g].marker_id;        form.title.value = bIMData[g].title;        form.marker_lat.value = bIMData[g].lat;        form.marker_lon.value = bIMData[g].lon;        form.edit.value = bIMData[g].data;        form.marker_labeltext.value = bIMData[g].label_data;        form.marker_zi.value = bIMData[g].zindex;        form.marker_array.value = bIMData[g].array;        form.marker_array_n.value = bIMData[g].array_n;								// just for a pretty button - js sucks it!				var linkParent = $('formdata_'+g);				var linkPKids = linkParent.childNodes;				for (var p=0; p<linkPKids.length; p++){						if (linkPKids[p].name == "save_marker_btn"){							 linkPKids[p].href = "javascript:storeMarker('edit_marker.php', document.markerform_"+g+");" ;						}						if (linkPKids[p].name == "locate_marker_btn"){							 linkPKids[p].href = "javascript:bIMData["+bIMData[g].array_n+"].marker.openInfoWindowHtml(bIMData["+bIMData[g].array_n+"].marker.my_html);" ;						}						if (linkPKids[p].name == "remove_marker_btn"){							 linkPKids[p].href = "javascript:removeMarker('edit_marker.php', document.markerform_"+g+");" ;						}						if (linkPKids[p].name == "expunge_marker_btn"){							 linkPKids[p].href = "javascript:expungeMarker('edit_marker.php', document.markerform_"+g+");" ;						}				}			}		}			}}
meta: 1713	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1713/4385306eabb6f10e6fc3999091d222d51de6c23c/formsubmit.js/clean/templates/formsubmit.js