/*This function builds the link to the book lists on Amazon. The Harvard Square Library profit sharing code is embedded in the TheLinkStart variable. 
Please do not edit this function! */

			var TheLinkStart="http://www.amazon.com/gp/redirect.html?link_code=ur2&tag=harvardsquare-20&camp=1789&creative=9325&location=%2Fs%2Fref%3Dnb_ss_b%3Furl%3Dsearch-alias%253Dstripbooks%26field-keywords%3D"
			var TheLinkEnd="%26Go.x%3D0%26Go.y%3D0%26Go%3DGo"
			
			
			

TheSubject=document.title 
if (TheSubject.indexOf(":")!=0){
	TheSubject=TheSubject.slice(0,TheSubject.indexOf(":")) 
}
document.getElementById('TheAd').innerHTML="<strong><u>Click Here</u></strong> to view Supplemental Reading to "+TheSubject+" on Amazon.";
document.getElementById('TheAmazonLink').href=TheLinkStart+TheSubject.replace(/ /,"%20")+TheLinkEnd;
//document.getElementById('TheAmazonLink').target="new"
AddAd();

function AddHarvardBooksDiv(){
		var y=document.createElement('div')
		y.setAttribute("id","HarvardBooks");	
		//y.innerHTML='<div style=\"clear:both; height=:20px; min-height:20px; margin:2px;\" >findabletext</div>'
		//var y=document.createElement('div')			
		//y.innerHTML='<div class=\'HarvardBooks\'><a href=\'http://harvardsquarelibrary.org/HarvardPressBooks/politics.php\' class=\'BookLink\' title=\'A celebration of books published by the Harvard University Press\'><img src=\'http://harvardsquarelibrary.org/HarvardPressBooks/images/poli_ad.gif\' width=200 height=60 border=0 alt=\'Click here to view the Harvard Square Library selection of Politics and Law books from Harvard University Press\'></a></div>'
		//document.getElementById('AdContainer').insertBefore(y,document.getElementById('AdContainer').firstChild);

}
//AddHarvardBooksDiv()

function AddAd(){
		
		
		var y=document.createElement('div'); //for the top ad
		var yy=document.createElement('div'); //for the bottom ad
		y.setAttribute("id","NAU2");
		yy.setAttribute("id","NAU2a"); 
		yy.innerHTML="<a rel=\"nofollow\" href=\"http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FNotable-American-Unitarians-1936-1961-Herbert%2Fdp%2F0615147844%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1186254631%26sr%3D1-1&tag=harvardsquare-20&linkCode=ur2&camp=1789&creative=9325\"><img src=\"../images/NAU2_a.gif\" alt=\"Notable American Unitarians 2\" width=\"216\" height=\"77\" border=\"0\" style=\"margin-top:5px; \"></a><img src=\"http://www.assoc-amazon.com/e/ir?t=harvardsquare-20&amp;l=ur2&amp;o=1\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" />";
		y.innerHTML="<a href=\"http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FGod-Necessary-No-Yes%2Fdp%2F0615160468%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1195601171%26sr%3D1-1&tag=harvardsquare-20&linkCode=ur2&camp=1789&creative=9325\"><img src=\"ign.gif\" alt=\"Is God Necessary? NO! and YES!\" width=\"216\" height=\"77\" border=\"0\" style=\"margin-top:5px; \"></a><img src=\"http://www.assoc-amazon.com/e/ir?t=harvardsquare-20&amp;l=ur2&amp;o=1\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" />";
		
		document.getElementsByTagName('td')[0].style.position="relative";
		document.getElementsByTagName('td')[0].appendChild(y)
		document.getElementById('AdContainer').appendChild(yy)
	}
