//Includes code for member list page

function doAll(pipearray,withabstract,withjquery) {
	var p=pipearray.length
	var s=0
	var e=p-1
	dotalks(pipearray,s,e,withabstract,withjquery)
}

function doOneThird(pipearray,m) {
	var the_divisor = 3
	var p=pipearray.length
	var n=Math.floor(p/the_divisor)
	var s=n*(m-1)
	var e=(n*m)-1
	if (m==the_divisor){e=pipearray.length-1}
	doblock(pipearray,s,e)
}

function doOneHalf(pipearray,m) {
	var the_divisor = 2
	var p=pipearray.length
	var n=Math.floor(p/the_divisor)
	var s=n*(m-1)
	var e=(n*m)-1
	if (m==the_divisor){e=pipearray.length-1}
	doblock(pipearray,s,e)
}

function doOneNth(pipearray,m,n) {
	// m = which column to do; n = number of columns total
	var p=pipearray.length
	var n=Math.floor(p/n)
	var s=n*(m-1)
	var e=(n*m)-1
	if (m==n){e=pipearray.length-1}
	doblock(pipearray,s,e)
}

function doofficers(pipearray,startOn,endOn) {
	//Each line of pipearray is assumed to have the following form
	//  blahblah
	for (var i=startOn;i<=endOn;i++) {
		var items = pipearray[i].split("|")
		var numitems = items.length
		// var lastname = items[0]
		var s = "<p>"
		for (var j=0;j<numitems;j++) {
		s = s + items[j]
		if (j<numitems-1){s = s+  "<br />"}
		}
		s= s+"</p>"
		document.write(s)
	}
}

function dotalks(pipearray,startOn,endOn,withabstract,withjquery) {
	//Each line of pipearray is assumed to have the following form
	//  sortName|name(s)|affil(s)|title|year|abtract...
	for (var i=startOn;i<=endOn;i++) {
		var items = pipearray[i].split("|")
		var numitems = items.length

		if (numitems>5){
			if (items[5]==""||!withjquery) {
				var s="<li>"
			} else {
				var s="<li><manifest>"
			}
		}
		s = s + "<b>" + items[3] + "</b><br>"+items[1] + ", " + items[2]
		if (numitems>5){
			if (items[5]==""||!withabstract) {
				s=s+ "</li>"
			} else {
				if (withjquery) {
					s=s+"<br></manifest><span class='latent'><p>"
					s=s+items[5]+"</p></span></li>"
				} else {
					s=s+"<br><p>"
					s=s+items[5]+"</p></li>"
				}
			}
		}
		document.write(s)
	}
}

