var cell;

function getAtlases(string, state, cellp){
	cell = cellp - 1;
	
	var value = "/atlas_list.php?c=" + string + "&s=" + state;
	makePointer(string);
	getText(value, '', display_data, 1);

	
}


function display_data(ar){
	
	var num = ar['AtlasList']['Total'];
	document.getElementById('atlaslist').innerHTML = "";
	// size of the cell
	var numb = cell * 19;
	makePointer(numb);
	document.getElementById('par').style.paddingTop = numb;
	
	for(i=1; i<=num; i++){
		var el = ar['AtlasList']['Atlases']['atlas'][i];
		var name = el['name'];
		var id = el['id'];
		str = "<a href=/Browse/Atlas/"+id+"/>" + name + "</a><br />";
		document.getElementById('atlaslist').innerHTML += str; 
	}
	
}


function makePointer(num){
	
	document.getElementById("ptr").style.paddingTop = num;
	document.getElementById("pointer").innerHTML = '>>>';
	
}

function dumpProps(obj, parent) {
   // Go through all the properties of the passed-in object
   for (var i in obj) {
      // if a parent (2nd parameter) was passed in, then use that to
      // build the message. Message includes i (the object's property name)
      // then the object's property value on a new line
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      // Display the message. If the user clicks "OK", then continue. If they
      // click "CANCEL" then quit this level of recursion
      if (!confirm(msg)) { return; }
      // If this property (i) is an object, then recursively process the object
      if (typeof obj[i] == "object") {
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
      }
   }
}