index = (parent.getAsset().getTotalKidsLoaded()+index+1);
int mod = 0;  if (index >= 0) {  if (parent.getAsset().getTotalKidsLoaded() > 0) { mod = -1; } index = (parent.getAsset().getTotalKidsLoaded()+index+mod); }
	public void requestForNewAsset(NewAssetEvent evt) {		String typeCode       = evt.getTypeCode();		MatrixTreeNode parent = evt.getParentNode();		int index             = evt.getIndex();		String parentAssetid  = MatrixToolkit.rawUrlEncode(parent.getAsset().getId(), true);		index = (parent.getAsset().getTotalKidsLoaded()+index+1);		String xml = "<command action=\"get url\" cmd=\"add\" " +					 "parent_assetid=\"" + parentAssetid +					 "\" pos=\"" + index + "\" type_code=\"" +					 typeCode + "\" />";		Document response = null;		MatrixStatusBar.setStatus(Matrix.translate("asset_map_status_bar_requesting"));		try {			response = Matrix.doRequest(xml);		} catch (IOException ioe) {			Object[] transArgs = { ioe.getMessage() };			GUIUtilities.error(Matrix.translate("asset_map_error_request_failed", transArgs), Matrix.translate("asset_map_dialog_title_error"));			MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_error_request_failed"), 1000);			Log.log("Request for new Asset failed", MatrixTreeComm.class, ioe);			return;		}		MatrixStatusBar.setStatusAndClear(Matrix.translate("asset_map_status_bar_success"), 1000);		NodeList children = response.getDocumentElement().getChildNodes();		String url = null;		for (int i = 0; i < children.getLength(); i++) {			if (!(children.item(i) instanceof Element))				continue;			Element element = (Element) children.item(i);			if (element.getTagName().equals("url")) {				url = element.getFirstChild().getNodeValue();			}		}		try {			AssetMap.getURL(url);		} catch (MalformedURLException mue) {			Log.log("Could not load new asset interface in right pane", MatrixTreeComm.class, mue);		}	}