//Includes code for member list page

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

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,styletype) {
	//Each line of pipearray is assumed to have the following form
	//  name(s)|affil(s)|title|year|abtract...
	var colonstyle = "colon" // yeilds string of form [author], [affil]: [title]
	// the above defines the only style types that are specifically defined. Any other styletype string will yeild the default (titleBRauth,affil) style.
	
	for (var i=startOn;i<=endOn;i++) {
		var items = pipearray[i].split("|")
		var numitems = items.length
		// var lastname = items[0]

		if (numitems>4){
			if (items[4]==""||!withjquery) {
				var s="<li>"
			} else {
				var s="<li><manifest>"
			}
		}
		if (styletype == colonstyle) {
			s = s + "<b>" + items[0] + "</b>, " + items[1] + ": "+items[2]
		} else { //use TitleBRAuth,Affil
			s = s + "<b>" + items[2] + "</b><br>"+items[0] + ", " + items[1]
		}
		
		if (numitems>4){
			if (items[4]==""||!withabstract) {
				s=s+ "</li>"
			} else {
				if (withjquery) {
					s=s+"<br></manifest><span class='latent'><p>"
					s=s+items[4]+"</p></span></li>"
				} else {
					s=s+"<br><p>"
					s=s+items[4]+"</p></li>"
				}
			}
		}
		document.write(s)
	}
}

