result += '<td><input type="button" onclick="removeRecord('+r.id+');setTimeout(\'editDomain('+jsonData.domain.id+');\', 2500);" value="delete record" id="delete['+i+']"></td>'; 
result += '<td><input type="button" onclick="removeRecord('+r.id+', '+jsonData.domain.id+');setTimeout(\'editDomain('+jsonData.domain.id+');\', 2500);" value="delete record" id="delete['+i+']"></td>'; 
function editDomainWindow (request){		if (request.readyState==4)	{		if(request.responseText=='failed')		{			alert("The action you performed failed.");		}else		{			var jsonData = eval('('+request.responseText+')');						new Ajax.Request(baseurl+"?p=getOwners",        		{                		method:"get",                		asynchronous:true,                		onSuccess:changeOwnersSelect,                		onFailure:resultError        		});			var result  = '<p><table>';			result += '  <tr>';			result += '	<td><h1>Edit domain :: '+jsonData.domain.name+' ('+jsonData.records.length+')</h1></td>';			result += '  </tr>';			result += '  <tr>';			result += '	<td><table>';			result += '	<tr><td><b>name</b></td><td><b>type</b></td><td><b>content</b></td><td><b>prio</b></td><td><b>ttl</b></td><td>&nbsp;</td><td>&nbsp;</td></tr>';						for(i=0; i<jsonData.records.length; i++)			{				var r = jsonData.records[i];				result += '<tr>';				result += '<td><input type="text" value="'+r.name+'" id="name['+i+']"><input type="hidden" value="'+r.id+'" id="id['+i+']"></td>';				result += '<td><input type="text" size="4" value="'+r.type+'" id="type['+i+']"></td>';				result += '<td><input type="text" size="50" value="'+r.content+'" id="content['+i+']"></td>';				result += '<td><input type="text" size="2" value="'+r.prio+'" id="prio['+i+']"></td>';				result += '<td><input type="text" size="4" value="'+r.ttl+'" id="ttl['+i+']"></td>';				result += '<td><input type="button" onclick="removeRecord('+r.id+');setTimeout(\'editDomain('+jsonData.domain.id+');\', 2500);" value="delete record" id="delete['+i+']"></td>';				result += '<td><input type="button" onclick="javascript:saveRecord('+jsonData.domain.id+', document.getElementById(\'id['+i+']\').value, ';				result += 'document.getElementById(\'name['+i+']\').value, document.getElementById(\'type['+i+']\').value, ';				result += 'document.getElementById(\'content['+i+']\').value, document.getElementById(\'prio['+i+']\').value, ';				result += 'document.getElementById(\'ttl['+i+']\').value); setTimeout(\'editDomain('+jsonData.domain.id+');\', 2500);" id="save['+i+']" value="save"></td>';				result += '</tr>';			}						result += '	</table></td>';			result += '  </tr>';			result += '  <tr>';			result += '	<td><h1>Add a record</h1></td>';			result += '  </tr>';			result += '  <tr>';			result += '	   <td><table>';			result += '	   <tr><td><b>name</b></td><td><b>type</b></td><td><b>content</b></td><td><b>prio</b></td><td><b>ttl</b></td><td>&nbsp;</td></tr>';			result += '    <tr><td><input type="text" value="'+r.name+'" id="new[name]" /></td>';			result += '    <td><select id="new[type]"><option selected="selected" value="A">A</option>';			result += '    <option value="AAAA">AAAA</option><option value="CNAME">CNAME</option>';			result += '    <option value="HINFO">HINFO</option><option value="MX">MX</option>';			result += '    <option value="NAPTR">NAPTR</option><option value="NS">NS</option>';			result += '    <option value="PTR">PTR</option><option value="SOA">SOA</option>';			result += '    <option value="TXT">TXT</option><option value="URL">URL</option>';			result += '    <option value="SRV">SRV</option><option value="MBOXFW">MBOXFW</option></select></td>';			result += '	   <td><input type="content" size="50" value="" id="new[content]" /></td>';			result += '	   <td><input type="prio" size="2" value="0" id="new[prio]" /"></td>';			result += '	   <td><input type="ttl" size="4" value="3600" id="new[ttl]" /></td>';			result += '	   <td><input type="button" onclick="newRecord('+jsonData.domain.id+', document.getElementById(\'new[name]\').value, ';			result += 'document.getElementById(\'new[type]\').value, document.getElementById(\'new[content]\').value, ';			result += 'document.getElementById(\'new[prio]\').value, document.getElementById(\'new[ttl]\').value); setTimeout(\'editDomain('+jsonData.domain.id+');\', 2500);" id="new[save]" value="save" />';			result += '	</tr></table></td>';			result += '  </tr>';			if(userlevel >= 5)			{				result += '  <tr>';                        	result += '     <td><h1>Transfer domain</h1></td>';                        	result += '  </tr>';                        	result += '  <tr>';                        	result += '    <td>Transfer domain to <select id="owner"></select>';				result += ' <input type="button" onclick="transferDomain('+jsonData.domain.id+', document.getElementById(\'owner\').value);" value="transfer" /></td>';                        	result += '  </tr>';				result += '</table></p>';			}						document.getElementById('body').innerHTML = result;		}	}}
3798	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3798/5955ba3c59c3bd26b4ffb5a088c7ea74be77e3b5/freshdns.js/clean/trunk/js/freshdns.js