

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function SelectAll() {
	for(var x=0;x<document.form.elements.length;x++) {
		var y=document.form.elements[x];
		if(y.name!='ALL') y.checked=document.form.ALL.checked;
	}
}

function MM_confirm(msg, url) { //v1.0
  if(confirm(msg)) location.replace(url);
}
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

 
 
 
 
 
 
 
 
 
 
 
 
 function addRow(action)
{
	var theAction = action;
  var table = document.getElementById('djlist');
  var theRows = table.rows.length;
  var inkrement = theRows;
  var row = table.insertRow(theRows);
	

	var cell0 = row.insertCell(0);
	var textNode = document.createTextNode('#' + inkrement);
	if(theAction=='edit') {
		var ele0 = document.createElement('input');
			ele0.setAttribute('type', 'hidden');
			ele0.setAttribute('name', 'dj_id[]');
			ele0.setAttribute('value', inkrement);
		cell0.appendChild(ele0);
	}
	cell0.appendChild(textNode);
	
	
	
	
	// mapname
  var cell1 = row.insertCell(1);
  var ele1 = document.createElement('input');
		ele1.setAttribute('type', 'text');
		ele1.setAttribute('name', 'dj_name[]');
		ele1.setAttribute('id', 'dj_name_' + inkrement);
		ele1.setAttribute('size', '35');
		ele1.className='form_off';
  cell1.appendChild(ele1);
   
 


   $("#dj_name_"+ inkrement).suggestion({url:"suggestion_dj.php?chars="});
   
 
	// create delete-selection for edit-function
	if(theAction=='edit') {
		var cell4 = row.insertCell(4);
		var ele4 = document.createElement('input');
			ele4.setAttribute('type', 'checkbox');
			ele4.setAttribute('name', 'delete['+inkrement+']');
			ele4.setAttribute('value', inkrement);
			ele4.className='form_off';
		cell4.appendChild(ele4);
	} else {
		var cell4 = row.insertCell(4);
	}
}

// function removeRow() ** removes the last row of a table
function removeRow()
{
  var table = document.getElementById('djlist');
  var theRows = table.rows.length;
  if (theRows != 1) table.deleteRow(theRows - 1);
}
