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[3]='<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=["/graphics/arrowdown.gif", "/graphics/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

function amazonpopup() {
	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);
	setTimeout('closeWin(newWindow)', 5000);	// delay 5 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();
*/


