//alert("thisEssay.title= "+thisEssay.title);
/// colors for this thread
var baseRGB = hexToRGB( baseHEX );
var baseRGBdark = darkenRGB( baseRGB, 0.85 ); //getRGBdark(baseRGB);
var baseRGBstring = rgbToString( baseRGB );
var baseRGBdarkstring = rgbToString( baseRGBdark );

var baseRGBlight = screenFilterRAW( [255,255,255], 0.25, darkenRGB( baseRGB, 1.5 ) );//screenFilterRAW( [255,255,255], 0.7, baseRGB );
//var baseRGBlight = darkenRGB( baseRGB, 1.5 );//screenFilterRAW( [255,255,255], 0.7, baseRGB );
var baseRGBlightstring = rgbToString( baseRGBlight );


var baseRBGverydark = screenFilterRAW( [255,255,255], 0.15, darkenRGB( baseRGB, 0.2 ) )//darkenRGB( baseRGB, 0.1 );
//var baseRBGverydark = screenFilterRAW( baseRGB, 0.2, [0,0,0] )//darkenRGB( baseRGB, 0.1 );
var baseRBGverydarkstring = rgbToString( baseRBGverydark );

//alert("baseRGB= "+baseRGB + " baseRGBdark= " + baseRGBdark + " baseRGBlight= " + baseRGBlight)

var base0, base1, essay; // this is the div containing all of the construction
var description, desc_text, desc_date, desc_riposte; // predrawn divs

var xtends; // dynamically drawn div for "extensions"

/// positioning variables
//var essayY = 124;
var maxX = 0; // need to determine static width for outermost container.
var extendX = 649; // this is the right edge of text area.
//var ripX = 738; // this is the right edge of text area.
var baseY = 172; // top edge of text area


/////////////////----------- RIPOSTES
function Rip (i,a,depth){
/// a = [wordstring, author(s), title, date, year, blurb, uri, current, rgb, ripostes!!!]
	this.index = i;
	this.elem; /// my base "div"
	this.wordDiv; /// wordstring "div"
	this.authorDiv; /// author "div"
	this.titleDiv; /// title "div"
	///
	this.wordstring = a[0]; /// - text
	this.author = a[1]; /// - text
	this.title = a[2]; /// - text
	this.date = a[3]; /// - text
	this.year = a[4]; /// - text
	this.blurb = a[5]; /// - html text - construct this, include riposte
	this.uri = a[6];
	this.current = a[7];
	this.rgb = a[8];
	this.ripostes = a[9];
	this.depth = depth;
	//this.relRGB = rgbToString( darkenRGB( [109,109,80], 1-((this.rel-1)*0.1) ) );
	//
	this.rgb = baseRGB;//threadObjects[this.affil].rgb;/// determined by primary affiliation
	this.rgbString = baseRGBstring;//threadObjects[this.affil].rgbString;
	this.rgbDark = baseRGBdark;//rgbToString( darkenRGB(this.rgb,0.75) );
	this.rgbDarkString = baseRGBdarkstring;//threadObjects[this.affil].rgbString;
	this.y = 16*i;
	this.x = 68*(this.depth+1);
	//this.x = 67*(i+1);
	//this.x = extendX + 67*i;
	this.h = 14;
	this.w = 181; /// does this need to be the total width? hard-wired or calculated?
	this.init();
	this.draw();
	if(!this.current) this.addHandlers();
}
Rip.prototype.init = function(){
	//alert(this.ripostes.length);
	if(this.ripostes != null){
		for(var i=0; i< this.ripostes.length; i++){
			var num = ripNum;
			ripNum++;
			//var num = ripObjects.length;
			ripObjects[num] = new Rip(num,this.ripostes[i],this.depth+1);
		}
	}
/**/
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
Rip.prototype.draw = function(){
	this.elem = makeElement("div",[["position","absolute"],["left",this.x +"px"],["top",this.y +"px"],
      ["width",this.w +"px"],["height",this.h +"px"]],null);
	if(!this.current) this.elem.style.cursor = "pointer";
	if(this.current) this.elem.style.color = "#ffffff";
//	base0.appendChild(this.elem);
	riposteBase.appendChild(this.elem);
	/// wordstring
	this.wordDiv = makeElement("div",[["position","absolute"],["left","0px"],["top","0px"],
        ["clip","rect(0px 67px "+ this.h+"px 0px)"],["width","64px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["backgroundColor",this.rgbString]],null);
	if(this.current) this.elem.style.color = "#ffffff";
	var txt = document.createTextNode(this.wordstring);
	this.wordDiv.appendChild(txt);
	this.elem.appendChild(this.wordDiv);	
	/// author
	this.authorDiv = makeElement("div",[["position","absolute"],["left","68px"],["top","0px"],
        ["clip","rect(0px 113px "+ this.h+"px 0px)"],["width","110px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["backgroundColor",this.rgbDarkString]],null);
	var txt = document.createTextNode(this.author);
	this.authorDiv.appendChild(txt);
	this.elem.appendChild(this.authorDiv);
	/// author
	this.titleDiv = makeElement("div",[["position","absolute"],["left","182px"],["top","0px"],
        ["clip","rect(0px 243px "+ this.h+"px 0px)"],["width","240px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["display","none"],["backgroundColor",this.rgbDarkString]],null);
	var txt = document.createTextNode(this.title);
	this.titleDiv.appendChild(txt);
	this.elem.appendChild(this.titleDiv);
	/////////////////// current
	if(this.current){
		this.gray0 = makeElement("div",[["position","absolute"],["left",-1*(this.depth*67 +20)+"px"],["top","0px"],
        ["width",67*this.depth + 20+ "px"],["height",this.h + "px"],
        ["backgroundColor","#686850"]],null);
		this.elem.appendChild(this.gray0);
		this.gray1 = makeElement("div",[["position","absolute"],["left",-1*(this.depth*67 +20+this.h)+"px"],["top",-1*(16*this.index)+"px"],
        ["width", this.h + "px"],["height", (16*this.index+14) + "px"],
        ["backgroundColor","#686850"]],null);
		this.elem.appendChild(this.gray1);
		this.gray2 = makeElement("div",[["position","absolute"],["left",-1*(this.depth*67 +20+this.h+56)+"px"],["top",-1*(16*this.index)+"px"],
        ["width", "60px"],["height", this.h + "px"],
        ["backgroundColor","#686850"]],null);
		this.elem.appendChild(this.gray2);		
	}
	
	
/// there seems to be a bug in IE mac on G4 powerbook where the fontSize style from the css is ignored in built divs???
/////// REMEMBER: substring long titles!!! ???? or is clipping enough????
	
	//// why do i have to apply a background color in order to handle rollover events smoothly??? i.e., child vs. parent events
  this.elem.style["backgroundColor"] = "#686850";
}

Rip.prototype.addHandlers = function(){
	this.elem.obj = this;
	this.elem.onmouseover = function(){this.obj.over(this);};
	this.elem.onmouseout = function(){this.obj.out();};	
	this.elem.onclick = function(){document.location.href = this.obj.uri;};
}
Rip.prototype.over = function(who){
	description.style.display = "block";
	this.showDescription(who);
	this.authorDiv.style.color = "#ffffff";
	this.wordDiv.style.color = "#ffffff";
	this.titleDiv.style.display = "block";
	this.titleDiv.style.color = "#ffffff";
	window.status = "go to: "+this.title; return true;
}
Rip.prototype.out = function(){
/////////// should i use a timeout and/or call this func. when new item is shown?
	window.status = "";
	description.style.display = "none";
	this.authorDiv.style.color = "#000000";
	this.wordDiv.style.color = "#000000";
	this.titleDiv.style.display = "none";
}


Rip.prototype.showDescription = function(who){
	description.style.top = parseInt(who.style.top) + 14 + "px";
	description.style.left = parseInt(who.style.left)  + "px";
	desc_date.innerHTML = "<span style='padding-left:2px;'>"+this.date+"</span>";
	desc_text.innerHTML = "<b class='desc_title'>"+this.title+"</b><br />";
	desc_text.innerHTML += this.blurb;
	if(this.isRiposte){
		desc_riposte.innerHTML = "A RIPOSTE TO ";
		desc_riposte.innerHTML += "<b class='desc_riposte_text'>"+this.riposteText+"</b>";
	} else {
		desc_riposte.innerHTML = "";
	}
}

////////////////////////////////--------------- GLOSSES


Gloss = function(i,elem, glossBase){
	this.index = i;
	this.elem = document.getElementById(elem);
	
	//document.getElementById("debug0").innerHTML += "<br />"+elem + ", ";	
	
	this.trigger = document.getElementById(elem + "_link");
	this.glossBase = glossBase;
	this.init();
}
Gloss.prototype.init = function(){
	//this.glossBase.style.top = "120px"
	this.addHandlers();
	
}
Gloss.prototype.addHandlers = function(){
	this.elem.obj = this;
	this.trigger.obj = this;
	this.trigger.onmouseover = function(){this.obj.over();};
	this.trigger.onmouseout = function(){this.obj.out();};	
	this.trigger.onclick = function(){this.obj.click();return false;};
}

var nada = "nada";
Gloss.prototype.click = function(){
	alert("glossBase= "+ this.glossBase +"glossBase.y= "+ this.glossBase.style.top +" || pgY= "+ pgY + " nada = "+ nada);
	//this.glossBase.style.top =  pgY + "px";
	//alert("Gloss: "+ this.elem.id);
}
Gloss.prototype.over = function(){
	this.glossBase.style.top =  getElementPosition(this.trigger.id).top - baseTop + "px";
	//this.glossBase.style.top =  (pgY - baseTop) + "px";
	/* parseInt(this.trigger.style.top)  + "px";*/
	this.elem.style.display = "block";	
	//document.getElementById("debug").innerHTML = getElementPosition(this.trigger.id).top;
	//document.getElementById("debug").innerHTML = "trigger position: "+ getElementPosition(this.trigger) +" calc: " +pgY - baseTop;
}
Gloss.prototype.out = function(){
	this.elem.style.display = "none";
}

function makeGlosses(){
	for(var i=0; i < glosses.length; i++){
		glossObjects[i] = new Gloss(i,glosses[i],glossBase);
	}
	//alert("makeGlosses glossObjects.length= "+ glossObjects.length);
}

////////////////////////////// ------------ related essays
function Related (i,a){
/// a = [score, url, wordstring, author(s?), title, blurb ]
	this.index = i;
	this.elem; /// my base "div"
	this.wordDiv; /// wordstring "div"
	this.authorDiv; /// author "div"
	this.titleDiv; /// title "div"
	///
	this.score = a[0]; /// - text
	this.url = a[1]; /// - text
	this.wordstring = a[2]; /// - text
	this.author = a[3]; /// - text
	this.title = a[4];
	this.blurb = a[5]; /// - html text - construct this, include riposte
	//this.relRGB = rgbToString( darkenRGB( [109,109,80], 1-((this.rel-1)*0.1) ) );
	//
	this.color = a[6];
	this.rgb = hexToRGB( a[6] );
	this.date = a[7];
	
	//this.rgb = baseRGB;//threadObjects[this.affil].rgb;/// determined by primary affiliation

	this.rgbString = rgbToString( this.rgb );//baseRGBstring;//threadObjects[this.affil].rgbString;
	this.rgbDark = darkenRGB( this.rgb, 0.85 );//baseRGBdark;//rgbToString( darkenRGB(this.rgb,0.75) );
	this.rgbDarkString = rgbToString( this.rgbDark );//baseRGBdarkstring;//threadObjects[this.affil].rgbString;
	this.y = (17*i)+18;
	this.x = 12 + (67 * (this.score-1));
	this.h = 14;
	this.w = 181; /// does this need to be the total width? hard-wired or calculated?
	this.draw();
	//if(!this.current) 
	this.addHandlers();
}

Related.prototype.draw = function(){
	this.elem = makeElement("div",[["position","absolute"],["left",this.x +"px"],["top",this.y +"px"],
      ["width",this.w +"px"],["height",this.h +"px"]],null);
	if(!this.current) this.elem.style.cursor = "pointer";
	if(this.current) this.elem.style.color = "#ffffff";
	//xtends.appendChild(this.elem);
	relatedBase.appendChild(this.elem);
	/// wordstring
	this.wordDiv = makeElement("div",[["position","absolute"],["left","0px"],["top","0px"],
        ["clip","rect(0px 67px "+ this.h+"px 0px)"],["width","64px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["backgroundColor",this.rgbString]],null);
	if(this.current) this.elem.style.color = "#ffffff";
	var txt = document.createTextNode(this.wordstring);
	this.wordDiv.appendChild(txt);
	this.elem.appendChild(this.wordDiv);	
	/// author
	this.authorDiv = makeElement("div",[["position","absolute"],["left","68px"],["top","0px"],
        ["clip","rect(0px 113px "+ this.h+"px 0px)"],["width","110px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["backgroundColor",this.rgbDarkString]],null);
	var txt = document.createTextNode(this.author);
	this.authorDiv.appendChild(txt);
	this.elem.appendChild(this.authorDiv);
	/// author
	this.titleDiv = makeElement("div",[["position","absolute"],["left","182px"],["top","0px"],
        ["clip","rect(0px 243px "+ this.h+"px 0px)"],["width","240px"],["height",this.h + "px"],
        ["padding","0px 0px 0px 3px"],["display","none"],["backgroundColor",this.rgbDarkString]],null);
	var txt = document.createTextNode(this.title);
	this.titleDiv.appendChild(txt);
	this.elem.appendChild(this.titleDiv);
	/////////////////// current
	
/// there seems to be a bug in IE mac on G4 powerbook where the fontSize style from the css is ignored in built divs???
/////// REMEMBER: substring long titles!!! ???? or is clipping enough????
	
	//// why do i have to apply a background color in order to handle rollover events smoothly??? i.e., child vs. parent events
  this.elem.style["backgroundColor"] = "#686850";
}

Related.prototype.addHandlers = function(){
	this.elem.obj = this;
	this.elem.onmouseover = function(){this.obj.over(this);};
	this.elem.onmouseout = function(){this.obj.out();};	
	this.elem.onclick = function(){document.location.href = this.obj.url;};
}
Related.prototype.over = function(who){
	description.style.display = "block";
	this.showDescription(who);
	this.authorDiv.style.color = "#ffffff";
	this.wordDiv.style.color = "#ffffff";
	this.titleDiv.style.display = "block";
	this.titleDiv.style.color = "#ffffff";
	window.status = "go to: "+this.title; return true;
}
Related.prototype.out = function(){
/////////// should i use a timeout and/or call this func. when new item is shown?
	window.status = "";
	description.style.display = "none";
	this.authorDiv.style.color = "#000000";
	this.wordDiv.style.color = "#000000";
	this.titleDiv.style.display = "none";
}


Related.prototype.showDescription = function(who){
	description.style.top = parseInt(who.style.top) + 14 + "px";
	description.style.left = parseInt(who.style.left)  + "px";
	desc_date.innerHTML = "<span style='padding-left:2px;'>"+this.date+"</span>";
	desc_text.innerHTML = "<b class='desc_title'>"+this.title+"</b><br />";
	desc_text.innerHTML += this.blurb;
}




function makeBasic(){
	//??? where is thisEssay being defined??
	/// header elements of essay
	thisEssay.elem = makeElement("div",[["position","absolute"],["left","0px"],["top","0px"],
      ["width","648px"],["height","14px"],["backgroundColor",baseRGBdarkstring]],null);
	base0.appendChild(thisEssay.elem);
	// wordstring
	thisEssay.wordDiv = makeElement("div",[["position","absolute"],["left","162px"],["top","0px"],
//        ["clip","rect(0px 68px 14px 0px)"],["width","65px"],["height","14px"],
        ["clip","rect(0px 108px 14px 0px)"],["width","105px"],["height","14px"],
        ["padding","0px 0px 0px 3px"],["color","#ffffff"],["backgroundColor",baseRGBstring]],null);
	var txt = document.createTextNode(thisEssay.wordstring);
	thisEssay.wordDiv.appendChild(txt);
	thisEssay.elem.appendChild(thisEssay.wordDiv);	
	// author
// Disabled EB Feb 20 07
//	thisEssay.authorDiv = makeElement("div",[["position","absolute"],["left","231px"],["top","0px"],
//        ["clip","rect(0px 113px 14px 0px)"],["width","110px"],["height","14px"],
//        ["padding","0px 0px 0px 3px"],["color","#ffffff"],["backgroundColor",baseRGBstring]],null);
//	var txt = document.createTextNode(thisEssay.author);
	//var txt = document.createTextnode('  ');
//	thisEssay.authorDiv.appendChild(txt);
//	thisEssay.elem.appendChild(thisEssay.authorDiv);	
	// title
//	thisEssay.titleDiv = makeElement("div",[["position","absolute"],["left","345px"],["top","0px"],
//        ["clip","rect(0px 303px 14px 0px)"],["width","300px"],["height","14px"],
//        ["padding","0px 0px 0px 3px"],["color","#ffffff"],["backgroundColor",baseRGBstring]],null);
//	var txt = document.createTextNode(thisEssay.title);
	//var txt = document.createTextNode('  ');
//	thisEssay.titleDiv.appendChild(txt);
//	thisEssay.elem.appendChild(thisEssay.titleDiv);	
	
	///// "extensions" navigation
	if(ripostes[0] != null){
		//alert("ripostes != null "+ripostes);
	}
	
	xtendsNav = makeElement("div",[["position","absolute"],["left","0px"],["top","-14px"],
      ["width","400px"],["height","14px"],["backgroundColor","#000000"],["color","#666666"],["fontSize","8px"]],null);
	xtends.appendChild(xtendsNav);
	var txt = document.createTextNode("EXTENSIONS:");
	xtendsNav.appendChild(txt);
	// authors button 
	xtendsNav.authors = makeElement("div",[["position","absolute"],["left","60px"],["top","0px"],
      ["width","40px"],["height","14px"],["backgroundColor","#000000"],["color","#999966"],["fontSize","8px"],["cursor","pointer"]],null);
	xtendsNav.appendChild(xtendsNav.authors);
	var txt = document.createTextNode("AUTHORS");
	xtendsNav.authors.appendChild(txt);
	
	var xLeft = 101;
	// related texts button
	if(related[0] != null){
		xtendsNav.related = makeElement("div",[["position","absolute"],["left","101px"],["top","0px"],["textAlign","center"],
	  ["width","40px"],["height","14px"],["backgroundColor","#000000"],["color","#999966"],["fontSize","8px"],["cursor","pointer"]],null);
		xtendsNav.appendChild(xtendsNav.related);
		var txt = document.createTextNode("TEXT");
		xtendsNav.related.appendChild(txt);
		/// actions
		xtendsNav.related.onclick = function(){ 
			if(xtendVis != relatedBase && xtendVis != null){ xtendVis.style.display = "none";}
			xtendVis = relatedBase; 
			relatedBase.style.display = "block"; 
		};		
		xtendsNav.related.onmouseover = function(){ this.style.color = "#ffffff";  };
		xtendsNav.related.onmouseout = function(){ if(xtendVis != relatedBase)  this.style.color = "#999966";  };
		/////// color bars in "related" extension
		var aa = makeElement("div",[["position","absolute"],["left","0px"],["top","0px"],
		  ["width","79px"],["backgroundColor","#6d6f4e"],["height",baseHeight +"px"]],null);
		relatedBase.appendChild(aa);
		var ab = makeElement("div",[["position","absolute"],["left","79px"],["top","0px"],
		  ["width","67px"],["backgroundColor","#5b5b42"],["height",baseHeight +"px"]],null);
		relatedBase.appendChild(ab);	
		var ac = makeElement("div",[["position","absolute"],["left","146px"],["top","0px"],
		  ["width","67px"],["backgroundColor","#4c4c38"],["height",baseHeight +"px"]],null);
		relatedBase.appendChild(ac);	
		var ad = makeElement("div",[["position","absolute"],["left","213px"],["top","0px"],
		  ["width","67px"],["backgroundColor","#41412e"],["height",baseHeight +"px"]],null);
		relatedBase.appendChild(ad);	
		var at = makeElement("div",[["position","absolute"],["left","0px"],["top","0px"],
		  ["width","400px"],["backgroundColor","#6d6f4e"],["height","14px"]],null);
	
		relatedBase.appendChild(at);		
		xLeft += 41;
	}
	// ripostes texts button
	
	if(ripostes[0] != null){	
		xtendsNav.ripostes = makeElement("div",[["position","absolute"],["left",xLeft+"px"],["top","0px"],
	  ["width","40px"],["height","14px"],["backgroundColor","#000000"],["color","#999966"],["fontSize","8px"],["cursor","pointer"]],null);
		xtendsNav.appendChild(xtendsNav.ripostes);
		var txt = document.createTextNode("RIPOSTE");
		xtendsNav.ripostes.appendChild(txt);	
		
		xtendsNav.ripostes.onclick = function(){ 
			if(xtendVis != riposteBase && xtendVis != null){ xtendVis.style.display = "none";}
			xtendVis = riposteBase; 
			riposteBase.style.display = "block"; 
		};		
		xtendsNav.ripostes.onmouseover = function(){ this.style.color = "#ffffff";  };
		xtendsNav.ripostes.onmouseout = function(){ if(xtendVis != riposteBase)  this.style.color = "#999966";  };
		
		xLeft += 41;
	}
	// "off" button
	xtendsNav.offBtn = makeElement("div",[["position","absolute"],["left",xLeft+"px"],["top","0px"],
  ["width","40px"],["height","14px"],["backgroundColor","#000000"],["color","#999966"],["fontSize","8px"],["cursor","pointer"]],null);
	xtendsNav.appendChild(xtendsNav.offBtn);
	var txt = document.createTextNode("OFF");
	xtendsNav.offBtn.appendChild(txt);	
	
	//////// actions
	xtendsNav.authors.onclick = function(){ 
		if(xtendVis != authorBase && xtendVis != null){ xtendVis.style.display = "none";}
		xtendVis = authorBase; 
		authorBase.style.display = "block"; 
	};

	xtendsNav.offBtn.onclick = function(){ 
		xtendVis.style.display = "none"
	};	
	
	xtendsNav.authors.onmouseover = function(){ this.style.color = "#ffffff"; };
	xtendsNav.offBtn.onmouseover = function(){ this.style.color = "#ffffff";  };

	xtendsNav.authors.onmouseout = function(){ if(xtendVis != authorBase)  this.style.color = "#999966";  };
	xtendsNav.offBtn.onmouseout = function(){ if(xtendVis != riposteBase)  this.style.color = "#999966";  };
	/*
	xtendsNav.authors.onmouseout = function(){ if(xtendVis != authorBase) authorBase.style.display = "none"; };
	xtendsNav.related.onmouseout = function(){ if(xtendVis != relatedBase) relatedBase.style.display = "none"; };
	xtendsNav.ripostes.onmouseout = function(){ if(xtendVis != riposteBase) riposteBase.style.display = "none"; };

	var txt = document.createTextNode("RELEVANCE:");
	xtendsNav.appendChild(txt);
	*/
	
	
}


//////////////////////////////------------- INITS
var ripObjects = new Array();
var ripNum = 0;
function makeRips(){
	for(var i=0; i< ripostes.length; i++){
		var num = ripNum;
		ripNum++;
		//var num = ripObjects.length;
		ripObjects[num] = new Rip(num,ripostes[i],0);
		// old, pre-nested children::: //>> ripObjects[i] = new Rip(i,ripostes[i]);
	}
	
	/*
		for(var i=0; i< this.ripostes.length; i++){
		var num = ripObjects.length;
		ripObjects[m] = new Rip(m,this.ripostes[i]);
	}*/
}

// related essays
var relatedObjects = new Array();
function makeRelated(){
	for(var i=0; i< related.length; i++) relatedObjects[i] = new Related(i,related[i]);
}

/////////////////////////////////////////
var authorBase, relatedBase, riposteBase, xtendsNav;
var baseHeight;

var xtendVis = null; // currently visible extension

function init(){

	base0 = document.getElementById("base0");
	base1 = document.getElementById("base1");
	essay = document.getElementById("essay");
	
	xtends = document.getElementById("xtends");	
	authorBase = document.getElementById("author_div");
	relatedBase = document.getElementById("related_div");
	riposteBase = document.getElementById("riposte_div");
	
	description = document.getElementById("description");
	desc_date = document.getElementById("desc_date");
	desc_text = document.getElementById("desc_text");
	desc_riposte = document.getElementById("desc_riposte");	
	
	baseHeight = base1.offsetHeight;
	xtends.style.height = baseHeight - 14 + "px";

	authorBase.style.height = baseHeight - 14 + "px"
	authorBase.style.borderTopStyle = "solid";
	authorBase.style.borderTopWidth = "14px";
	authorBase.style.borderTopColor = baseRGBdarkstring;
	
	//base0.style.backgroundColor = baseRBGverydarkstring;
	//base1.style.backgroundColor = baseRGBstring;
	//essay.style.backgroundColor = baseRGBlightstring;
	makeBasic();
	makeRips();
	///////////////////////////////////////////////////////>>>>>>>>>>>>> 
	makeRelated();
	//alert(getEStyle("essay","height","height"));
	/////////---- GLOSS STUFF
	////////////////////// eventOnload();	
	baseTop = 172;	
	if(document.getElementById("glosses") != null){
		glossBase = document.getElementById("glosses");
		glossBase.style.top = "200px";
		makeGlosses();
	}
	initThreads();
}
var glossBase, baseTop, baseBottom;

window.onload = function() { init();};
