function email( name, site ) {
	var address = name + "@" + site;
	document.write("<a href=\"mailto:" + address + "\">");
	document.write(address + "</a>");
}

function email_name( text, name, site ) {
	var address = name + "@" + site;
	document.write("<a href=\"mailto:" + address + "\">");
	document.write(text + "</a>");
}

function email_subject( name, site, subj ) {
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	document.write("<a href=\"mailto:" + address + subjectline + "\">");
	document.write(address + "</a>");
}

function email_subject_body( name, site, subj, body ) {
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	var bodyline = "&body=" + body;
	document.write("<a href=\"mailto:" + address + subjectline + bodyline + "\">");
	document.write(address + "</a>");
}

function email_name_subject( text, name, site, subj ) {
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	document.write("<a href=\"mailto:" + address + subjectline + "\">");
	document.write(text + "</a>");
}

function email_name_subject_body( text, name, site, subj, body ) {
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	var bodyline = "&body=" + body;
	document.write("<a href=\"mailto:" + address + subjectline + bodyline + "\">");
	document.write(text + "</a>");
}

/* new dropdown menu stuff */
/***********************************************
* Blm Multi-level Effect menu
* http://www.dynamicdrive.com/dynamicindex1/blmmenu/index.htm
***********************************************/
if(window.addEventListener){
    window.addEventListener("load",mladdevents,false);
}
else if(window.attachEvent){
    window.attachEvent("onload",mladdevents);
}
else{
	window.onload = mladdevents;
}
function mladdevents(){
	if(!window.mlrunShim){
		window.mlrunShim = false;
	}
	if(window.mlrunShim == true){
		var Iframe = document.createElement("iframe");
		Iframe.setAttribute("src","about:blank");
		Iframe.setAttribute("scrolling","no");
		Iframe.setAttribute("frameBorder","0");
	}
	var effects_a = new Array();
	var divs = document.getElementsByTagName('div');
	for(var j=0;j<divs.length;j++){
		if(divs[j].className.indexOf('mlmenu') != -1){
			divs[j].className = divs[j].className.replace('mlmenu','mlmenujs');
			divs[j].getElementsByTagName('ul')[0].className = divs[j].className;//just for reference
			var lis = divs[j].getElementsByTagName('li');
			for(var i =0;i<lis.length;i++){
				lis[i].onmouseover = mlover;
				lis[i].onmouseout = mloutSetTimeout;
				if(window.mlrunShim == true){
					lis[i].appendChild(Iframe.cloneNode(false));
				}
				if(lis[i].parentNode.getElementsByTagName('li')[0] == lis[i]){
					lis[i].getElementsByTagName('a')[0].className += 'first';
					if(lis[i].parentNode.className.indexOf('mlmenujs') != -1){
						lis[i].className += 'pixelfix';
					}
				}
				if(lis[i] == findLast(lis[i].parentNode)){
					lis[i].className += 'last';
				}
				if(lis[i].getElementsByTagName('ul').length > 0){
					lis[i].className += ' haschild';
					if(divs[j].className.indexOf('arrow') != -1){
						if(divs[j].className.indexOf('vertical') != -1 || lis[i].parentNode.parentNode.nodeName != 'DIV'){
							lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="vert"><font size=+1 color=#800080><b>&rarr;</b></font></span>';
						}
						else{
							lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="horiz"><font size=+1 color=#800080><b>&darr;</b></font></span>';
						}
					}
					else if(divs[j].className.indexOf('plus') != -1){
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="plus">+</span>';
					}
					else if(divs[j].className.indexOf('caret') != -1){
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="caret"> -></span>';
					}
				}
				else{
					if(divs[j].className.indexOf('arrow') != -1){
						//This accounts for a wierd IE-specific bug in horizontal menus. CSS will set visibility: hidden;. This keeps the menu level(in IE)
						lis[i].getElementsByTagName('a')[0].innerHTML += '<span class="noshow"><font size=+1 color=#800080><b>&darr;</b></font></span>';
					}
				}
				var uls = lis[i].getElementsByTagName('ul');
				for(var k=0;k<uls.length;k++){
					var found = 'no';
					for(var z=0;z<effects_a.length;z++){
						if(effects_a[z] == uls[k]){
							found = 'yes';
						}
					}
					if(found == 'no'){
						effects_a[effects_a.length] = uls[k];
						uls[k].style.zIndex = '100';
						mlEffectLoad(uls[k]);
					}
				}
			}
		}
	}
}
function mloutSetTimeout(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.toElement;
	if(reltg){
		var under = ancestor(reltg,this);
		if(under === false && reltg != this){
			window.mlLast = this;
			var parent = this.parentNode;
			while(parent.parentNode && parent.className.indexOf('mlmenujs') == -1){
				parent = parent.parentNode;
			}
			if(parent.className.indexOf('delay') != -1){
				window.mlTimeout = setTimeout(function(){mlout()},1000);
			}
			else{
				mlout();
			}
		}
	}
}
function mlout(){
	if(window.mlLast==null)return false;
	var links = window.mlLast.getElementsByTagName('a');
	for(var i = 0;i<links.length;i++){
		links[i].className = links[i].className.replace('hover','');
	}
	var uls = window.mlLast.getElementsByTagName('ul');
	var sib;
	for(var i=0;i<uls.length;i++){
		mlEffectOut(uls[i]);
		window.mlLast.className += ' hide';
		window.mlLast.className = window.mlLast.className.replace('hide hide','hide');
		if(window.mlrunShim == true){
			sib = uls[i];							
			while(sib.nextSibling && sib.nodeName != 'IFRAME'){
				sib = sib.nextSibling
			}
			sib.style.display = 'none';
		}
	}
	window.lastover = null;
	return true;
}
function mlover(e){
	if(!e){
		var the_e = window.event;
	}
	else{
		var the_e = e;
	}
	the_e.cancelBubble = true;
	if(the_e.stopPropagation){
		the_e.stopPropagation();
	}
	clearTimeout(window.mlTimeout);
	if(window.mlLast && window.mlLast != this && ancestor(this,window.mlLast) === false){
		mlout();
	}
	else{
		window.mlLast = null;
	}
	var reltg = (the_e.relatedTarget) ? the_e.relatedTarget : the_e.fromElement;
	var under = ancestor(reltg,this);
	if(under == false){
		var hovered = byClass(this.parentNode,'hover','a');
		for(var i=0;i<hovered.length;i++){
			if(ancestor(this,hovered[i].parentNode) == false){
				window.mlLast = hovered[i].parentNode;
				mlout();
			}
		}
		var ob = this.getElementsByTagName('ul');
		var link = this.getElementsByTagName('a')[0];
		link.className += ' hover';
		if(ob[0]){
			if(window.lastover != ob[0]){
				if(window.mlrunShim == true){
					var sib = ob[0];
					while(sib.nextSibling && sib.nodeName != 'IFRAME'){
						sib = sib.nextSibling
					}
					ob[0].style.display = 'block';
					sib.style.top = ob[0].offsetTop+'px';
					sib.style.left = ob[0].offsetLeft-2+'px';
					sib.style.width = ob[0].offsetWidth+2+'px';
					sib.style.height = ob[0].offsetHeight-2+'px';
					sib.style.display = 'block';
				}
				this.className = this.className.replace(/hide/g,'');
				mlEffectOver(ob[0],this);
				window.lastover = ob[0];
			}
		}
	}
}
function mlSetOpacity(ob,level){
	if(ob){
		var standard = level/10;
		var ie = level*10;
		ob.style.opacity = standard;
		ob.style.filter = "alpha(opacity="+ie+")"
	}
}
function mlIncreaseOpacity(ob){
	var current = ob.style.opacity;
	current = current * 10;
	var upone = current + 1;
	mlSetOpacity(ob,upone);
}
function mlIncreaseHeight(ob){
	var current = parseInt(ob.style.height);
	if(!isNaN(current)){
		var newh = current + 1;
		ob.style.height = newh+'px';
	}
}
function mlIncreaseWidth(ob){
	var current = parseInt(ob.style.width);
	if(!isNaN(current)){
		var newh = current + 1;
		ob.style.width = newh+'px';
	}
}
function mlShake(ob){
	var newp = '5px';
	var old = '';
	if(ob.style.paddingLeft==old){
		ob.style.paddingLeft=newp;
	}
	else{
		ob.style.paddingLeft=old;
	}
}
function mlEffectOver(ob,parent){
	switch(ob.className){
	case 'fade':
		ob.style.display = 'block';
		for(var i = 1;i<=10;i++){
			window.fadeTime = setTimeout(function(){mlIncreaseOpacity(ob)},i*50);
		}
		setTimeout(function(){ob.style.filter = ''},500);
		break;
	case 'shake':
		ob.style.display = 'block';
		var shake = setInterval(function(){mlShake(ob)},50);
		setTimeout(function(){clearInterval(shake)},510);
		break;
	case 'blindv':
		ob.style.display = 'block';
		if(ob.offsetHeight){
			var height = ob.offsetHeight
			ob.style.height = '0px';
			ob.style.overflow = 'hidden';
			for(var i=0;i<height;i++){
				setTimeout(function(){mlIncreaseHeight(ob)},i*3);
			}
			setTimeout(function(){ob.style.overflow='';ob.style.height='auto'},(height-1)*3)//-1 for IE
		}
		break;
	case 'blindh':
		ob.style.display = 'block';
		if(ob.offsetWidth){
			var width = ob.offsetWidth;
			ob.style.width = '0px';
			ob.style.overflow = 'hidden';
			for(var i=0;i<width;i++){
				setTimeout(function(){mlIncreaseWidth(ob)},i*3);
			}
			setTimeout(function(){ob.style.overflow='visible';},width*3)
		}
		break;
	default:
		ob.style.display = 'block';
		break;
	}
}
function mlEffectOut(ob){
	switch(ob.className){
	case 'fade':
		clearTimeout(window.fadeTime);
		mlSetOpacity(ob,0);
		ob.style.display = 'none';
		break;
	case 'shake':
		ob.style.paddingLeft = '';
		ob.style.display = 'none';
		break;
	default:
		ob.style.display = 'none';
		break;
	}
}
function mlEffectLoad(ob){
	var parent = ob.parentNode;
	while(parent.parentNode && parent.className.indexOf('mlmenu') == -1){
		parent = parent.parentNode;
	}
	if(parent.className.indexOf('fade') != -1){
		ob.style.display = 'none';
		ob.className = 'fade';
		mlSetOpacity(ob,0);
	}
	else if(parent.className.indexOf('shake') != -1){
		ob.className = 'shake';
	}
	else if(parent.className.indexOf('blindv') != -1){
		ob.className = 'blindv';
	}
	else if(parent.className.indexOf('blindh') != -1){
		ob.className = 'blindh';
	}
	else if(parent.className.indexOf('box') != -1){
		ob.className = 'box';
	}
	ob.style.display = 'none';
}
function ancestor(child, parent){
	try{
		if(child==null)return false;//Saves checking elsewhere
		for(; child.parentNode; child = child.parentNode){
				if(child.parentNode === parent) return true;
			}
		return false;
	}
	catch(error){
		//Mozilla bug, it  must be a text control which can not be in the menu so we will foolishly assume false
		return false;
	}
}
function byClass(parent,c,tag){
	var all = parent.getElementsByTagName(tag);
	var returna = new Array();
	for(var i=0;i<all.length;i++){
		if(all[i].className.indexOf(c) != -1){
			returna[returna.length] = all[i]
		}
	}
	return returna;
}
function findLast(ob){
	if(ob.lastChild.nodeType == 1){
		return ob.lastChild
	}
	return ob.lastChild.previousSibling;
}

/* end of new dropdown menu stuff */

/* start of newer dropdown menu stuff */
var hdNav = {
  myOffset: [], // Contains the distance to the left hand side
  mySec: [], // The width of the secondary navigation box
  myPrimary: [], // The width of the navigation button
  mySecOffset: [], //Values of c while looping
  
  myCount: function () {
  	
    var a = document.getElementById("hdNavTable").getElementsByTagName("td").length-1;
	
	var b = 0;
    var c = 0;
    for (i=0;i<=a;i++) {
        this.myOffset[i] = b;
        b = b + 0 + document.getElementById("hdNavTable").getElementsByTagName("td")[i].offsetWidth;
        this.mySec[i] = document.getElementById('hdMI' + i).offsetWidth;
        this.myPrimary[i] = document.getElementById("hdNavTable").getElementsByTagName("td")[i].offsetWidth;
        if (this.myPrimary[i] >= this.mySec[i]) {
          d = this.myPrimary[i];
          document.getElementById('hdMI' + i).style.width = d + "px";
          c = (this.myOffset[i]+((this.myPrimary[i]-d)/2)) - 12; // -12 is to offset for the padding in Secondary
        } else if (this.mySec[i] > this.myPrimary[i]) {
          c = (this.myOffset[i]-((this.mySec[i]-this.myPrimary[i])/2));
        }
		this.mySecOffset[i] = c;
		
        if (i == 0) {
          document.getElementById('hdMI' + i).style.left = "0px";
        } else if (i == a) {
          document.getElementById('hdMI' + i).style.left = (920 - this.mySec[i])+"px";
        } else {
          document.getElementById('hdMI' + i).style.left = c + "px";
        }
    }
    

  },
  show: function () {
    /* Show and display Product */
    obj = document.getElementById("hdHatSignIn");
    obj2 = document.getElementById("hdProducts");
    obj3 = document.getElementById("hdProducts2");
    if (obj.className == 'displayBlock' || obj.className == '') {
      obj.className = 'displayNone';
      obj2.className = 'displayNone';
      obj3.className = 'displayBlock';
    } else {
      obj.className = 'displayBlock';
      obj3.className = 'displayNone';
      obj2.className = 'displayBlock';
    }
  },
  up: function (myNumber) {
  	MyLocationClose('whatwhere');
  	if (hdNav.myOffset == "") {
    	hdNav.myCount(); // Needs to be called twice to get the math right
    	hdNav.myCount();
    }
    var a = document.getElementById("hdNavTable").getElementsByTagName("td").length-1;
    var b = 0;
    var c = 0;
    for (i=0;i<=a;i++) {
      this.down(i);
    }
      document.getElementById('hdMI' + myNumber).className = 'navSecond navSecondUp';
      if (hbBMDefault == ('hdM' + myNumber)) {
        document.getElementById('hdM' + myNumber).className = 'navSelected';
      } else {
        document.getElementById('hdM' + myNumber).className = 'navHovered';
      }
  },
  
  down: function (myNumber) {
      if (hbBMDefault == ('hdM' + myNumber)) {
        document.getElementById('hdM' + myNumber).className = 'navSelected';
      } else {
        document.getElementById('hdM' + myNumber).className = 'navNotSelected';
      }
      document.getElementById('hdMI' + myNumber).className = 'navSecond navSecondDown';
  }
};

/* end of newer dropdown menu stuff */

function email( name, site )
{
	var address = name + "@" + site;
	document.write("<a href=\"mailto:" + address + "\">");
	document.write(address + "</a>");
}

function email_name( text, name, site )
{
	var address = name + "@" + site;
	document.write("<a href=\"mailto:" + address + "\">");
	document.write(text + "</a>");
}

function email_subject( name, site, subj )
{
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	document.write("<a href=\"mailto:" + address + subjectline + "\">");
	document.write(address + "</a>");
}

function email_name_subject( text, name, site, subj )
{
	var address = name + "@" + site;
	var subjectline = "?Subject=" + subj;
	document.write("<a href=\"mailto:" + address + subjectline + "\">");
	document.write(text + "</a>");
}

function visit(newURL) {
//--If the selected file name isn't blank, send it to reader.
	if (newURL != "") {
		parent.location.href=newURL
	}
}

/* dropdown menu stuff */
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menuauthors=new Array()
menuauthors[0]='<a href=/authors.shtml>index</a>'
menuauthors[1]='<a href=/interviews>interviews</a>'
//menuauthors[2]='<a href=/authorsnotes.shtml>notes</a>'
menuauthors[2]='<a href=/podcast.shtml>podcast interviews</a>'

//Contents for menu 2
var menureviews=new Array()
menureviews[0]='<a href=/nonfiction.shtml>Nonfiction</a>'
menureviews[1]='<a href=/fiction.shtml>Fiction</a>'
menureviews[2]='<a href=/music.shtml>Music</a>'
menureviews[3]='<a href=/poetry.shtml>Poetry</a>'
menureviews[4]='<a href=/collections.shtml>Anthologies and Collections</a>'
menureviews[5]='<a href=/youngwomen.shtml>Books for Teen and Middle-Grade Girls</a>'

//Contents for menu 3
var menureviewers=new Array()
menureviewers[0]='<a href=/reviewers/index.shtml#stars>Stars</a>'
menureviewers[1]='<a href=/reviewers/associates.shtml>Associates</a>'
menureviewers[2]='<a href=/reviewers/guests.shtml>Guests</a>'
//menureviewers[3]='<a href=/reviewers/index.shtml#editors>Editors</a>'

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
	document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
	if (ie4||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (menuwidth!=""){
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge"){
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	}
	else{
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
			if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
				edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}

function populatemenu(what){
	if (ie4||ns6)
		dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
		clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)

	if (ie4||ns6){
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}

	return clickreturnvalue()
}

function clickreturnvalue(){
	if (ie4||ns6) return false
		else return true
}

function contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}

function dynamichide(e){
	if (ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
		if (ie4||ns6)
			dropmenuobj.style.visibility="hidden"
	}
}

function delayhidemenu(){
	if (ie4||ns6)
		delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
	document.onclick=hidemenu
/* dropdown menu stuff */

//Rich HTML Balloon Tooltip: http://www.dynamicdrive.com/dynamicindex5/balloontooltip.htm
//Created: September 10th, 2006

var disappeardelay=250  //tooltip disappear delay (in miliseconds)
var verticaloffset=0 //vertical offset of tooltip from anchor link, if any
var enablearrowhead=1 //0 or 1, to disable or enable the arrow image
var arrowheadimg=["/pix/arrowdown.gif", "/pix/arrowup.gif"] //path to down and up arrow images
var arrowheadheight=11 //height of arrow image (amount to reveal)

/////No further editting needed

var ie=document.all
var ns6=document.getElementById&&!document.all
verticaloffset=(enablearrowhead)? verticaloffset+arrowheadheight : verticaloffset

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function showhide(obj, e){
	dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if (e.type=="mouseover")
		obj.visibility="visible"
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	if (whichedge=="rightedge"){
		edgeoffsetx=0
		var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffsetx=dropmenuobj.contentmeasure-obj.offsetWidth
		return edgeoffsetx
	}
	else{
		edgeoffsety=0
		var topedge=ie && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) //move up?
			edgeoffsety=dropmenuobj.contentmeasure+obj.offsetHeight+(verticaloffset*2)
		return edgeoffsety
	}
}

function displayballoontip(obj, e){ //main ballooon tooltip function
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	if (typeof dropmenuobj!="undefined") //hide previous tooltip?
		dropmenuobj.style.visibility="hidden"
	clearhidemenu()
//obj.onmouseout=delayhidemenu
	dropmenuobj=document.getElementById(obj.getAttribute("rel"))
	showhide(dropmenuobj.style, e)
	dropmenuobj.x=getposOffset(obj, "left")
	dropmenuobj.y=getposOffset(obj, "top")+verticaloffset
	dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
	dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	if (enablearrowhead)
		displaytiparrow()
}

function displaytiparrow(){ //function to display optional arrow image associated with tooltip
	tiparrow=document.getElementById("arrowhead")
	tiparrow.src=(edgeoffsety!=0)? arrowheadimg[0] : arrowheadimg[1]
	var ieshadowwidth=(dropmenuobj.filters && dropmenuobj.filters[0])? dropmenuobj.filters[0].Strength-1 : 0
//modify "left" value depending on whether there's no room on right edge of browser to display it, respectively
	tiparrow.style.left=(edgeoffsetx!=0)? parseInt(dropmenuobj.style.left)+dropmenuobj.offsetWidth-tiparrow.offsetWidth-10+"px" : parseInt(dropmenuobj.style.left)+5+"px"
//modify "top" value depending on whether there's no room on right edge of browser to display it, respectively
	tiparrow.style.top=(edgeoffsety!=0)? parseInt(dropmenuobj.style.top)+dropmenuobj.offsetHeight-tiparrow.offsetHeight-ieshadowwidth+arrowheadheight+"px" : parseInt(dropmenuobj.style.top)-arrowheadheight+"px"
	tiparrow.style.visibility="visible"
}

function delayhidemenu(){
	delayhide=setTimeout("dropmenuobj.style.visibility='hidden'; dropmenuobj.style.left=0; if (enablearrowhead) tiparrow.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

function reltoelement(linkobj){ //tests if a link has "rel" defined and it's the ID of an element on page
	var relvalue=linkobj.getAttribute("rel")
	return (relvalue!=null && relvalue!="" && document.getElementById(relvalue)!=null && document.getElementById(relvalue).className=="balloonstyle")? true : false
}

function initalizetooltip(){
	var all_links=document.getElementsByTagName("a")
	if (enablearrowhead){
		tiparrow=document.createElement("img")
		tiparrow.setAttribute("src", arrowheadimg[0])
		tiparrow.setAttribute("id", "arrowhead")
		document.body.appendChild(tiparrow)
	}
	for (var i=0; i<all_links.length; i++){
		if (reltoelement(all_links[i])){ //if link has "rel" defined and it's the ID of an element on page
			all_links[i].onmouseover=function(e){
				var evtobj=window.event? window.event : e
				displayballoontip(this, evtobj)
			}
			all_links[i].onmouseout=delayhidemenu
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", initalizetooltip, false)
else if (window.attachEvent)
	window.attachEvent("onload", initalizetooltip)
else if (document.getElementById)
	window.onload=initalizetooltip

/****************************/
/* start of new popup stuff */
/****************************/
var expDays = 1; // number of days the cookie should last

//var page = "only-popup-once.html";
//var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){
	var count = GetCookie('count')
	if(count == null) {
		SetCookie('count','1')
		return 1
	}
	else {
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
	}
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

//function checkCount() {
function amazonpopup() {
	var count = GetCookie('count');
	if (count == null) {
		count=1;
		SetCookie('count', count, exp);
//		window.open(page, "", windowprops);
		amazonpopupwin();
	}
	else {
		count++;
		SetCookie('count', count, exp);
	}
}
/**************************/
/* end of new popup stuff */
/**************************/

/* start of balloon stuff */
function amazonpopup3() {
		thispage=document.location;
		thispage+="";
		indexwww=thispage.indexOf("http://www.storycirclebookreviews.org/reviews");
		indexnowww=thispage.indexOf("http://storycirclebookreviews.org/reviews");
	if ((thispage.indexOf("http://www.storycirclebookreviews.org/reviews") == -1) && (thispage.indexOf("http://storycirclebookreviews.org/reviews") == -1)) {
		popWin=window.open('','popwin',config='height=200,width=500,top=100,left=300');
		popWin.document.write("<html>");
		popWin.document.write("<head><title>You Have Not Been Here Before</title></head>");
		popWin.document.write("<body bgcolor='lightyellow' onblur='self.close()'>");
		popWin.document.write("<center>I will only popup once!<br><br><font size=-1>");
		popWin.document.write("<br>indexwww: \'" + indexwww + "\'<br>");
		popWin.document.write("<br>indexnowww: \'" + indexnowww + "\'<br>");
		popWin.document.write("<br>this page: \'" + thispage + "\'<br>");
		popWin.document.write("<a href='#' onClick='self.close()'>Close Me</a>");
		popWin.document.write("</font></center></body>");
		popWin.document.write("</html>"); 
		popWin.document.close();
		popWin.focus();
//		amazonpopupwin();
	}
}

function amazonpopupwin() {
	text =  "<html>\n<head>\n<title>Story Circle Book Reviews</title>\n<link href='/style.css' rel='stylesheet'>\n<body>\n";
	text += "<center>\n<br>";
	text += "<font class=darktextreg2>Buy books online through <a href='http://www.amazon.com/exec/obidos/redirect-home/storycirclenetwo' target=_new>amazon.com</a> by clicking on any book cover or title on a review page. Your purchase will support our work of encouraging all women to tell their stories.</font>";
	text += "</center>\n</body>\n</html>\n";
	setTimeout('windowProp(text)', 1000); 		// delay 1 second before opening
}

function windowProp(text) {
	newWindow = window.open('','newWin','width=300,height=150,left=300,top=300,screenX=500,screenY=0');
	newWindow.document.write(text);
	newWindow.focus();
	setTimeout('closeWin(newWindow)', 4000);	// delay 4 seconds before closing
}

function closeWin(newWindow) {
	newWindow.close();				// close small window and depart
}

/*Javascript for Bubble Tooltips by Alessandro Fulciniti
http://pro.html.it - http://web-graphics.com */

function enableTooltips(id){
	var links,i,h;
	if(!document.getElementById || !document.getElementsByTagName) return;
	AddCss();
	h=document.createElement("span");
	h.id="btc";
	h.setAttribute("id","btc");
	h.style.position="absolute";
	document.getElementsByTagName("body")[0].appendChild(h);
	if(id==null) links=document.getElementsByTagName("a");
	else links=document.getElementById(id).getElementsByTagName("a");
	for(i=0;i<links.length;i++){
		Prepare(links[i]);
	}
}

function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("title");
if(t==null || t.length==0) t="link:";
el.removeAttribute("title");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
s.appendChild(document.createTextNode(t));
tooltip.appendChild(s);
b=CreateEl("b","bottom");
l=el.getAttribute("href");
if(l.length>28) l=l.substr(0,25)+"...";
b.appendChild(document.createTextNode(l));
tooltip.appendChild(b);
setOpacity(tooltip);
el.tooltip=tooltip;
el.onmouseover=showTooltip;
el.onmouseout=hideTooltip;
el.onmousemove=Locate;
}

function showTooltip(e){
	document.getElementById("btc").appendChild(this.tooltip);
	Locate(e);
}

function hideTooltip(e){
	var d=document.getElementById("btc");
	if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
	el.style.filter="alpha(opacity:95)";
	el.style.KHTMLOpacity="0.95";
	el.style.MozOpacity="0.95";
	el.style.opacity="0.95";
}

function CreateEl(t,c){
	var x=document.createElement(t);
	x.className=c;
	x.style.display="block";
	return(x);
}

function AddCss(){
	var l=CreateEl("link");
	l.setAttribute("type","text/css");
	l.setAttribute("rel","stylesheet");
	l.setAttribute("href","/style.css");
	l.setAttribute("media","screen");
	document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
	var posx=0,posy=0;
	if(e==null) e=window.event;
	if(e.pageX || e.pageY){
		posx=e.pageX; posy=e.pageY;
	}
	else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
        }
    else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
        }
    }
	document.getElementById("btc").style.top=(posy+10)+"px";
	document.getElementById("btc").style.left=(posx-20)+"px";
}

/*
window.onload=function(){enableTooltips("tooltips")};amazonpopup();
window.onload=amazonpopup();
*/

/* end of balloon stuff */