////// popUp window /////
function popUp(strURL,strType,strWidth,strHeight,strTarget) {
	var strOptions="";
	if (strType=="console") strOptions="left=80,top=80,resizable,width="+strWidth+",height="+strHeight;
	if (strType=="fixed") strOptions="status,width="+strWidth+",height="+strHeight;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,width="+strWidth+",height="+strHeight;
	//window.open(strURL, 'newWin', strOptions);
	var newWindow = window.open(strURL, strTarget, strOptions);
	newWindow.focus();
	}
	
// the number you pass to initLeft doesn't matter since it will get
// changed onactivate
// menuid,direction,left,top,width,height
var myMenu1 = new ypSlideOutMenu("menu1", "down", 105, 131, 150, 80)
   
// for each menu, we set up the onactivate event to call repositionMenu with the amount offset from center, in pixels
myMenu1.onactivate = function() { repositionMenu(myMenu1, -199); }

// this function repositions a menu to the speicified offset from center
function repositionMenu(menu, offset)
{
// the new left position should be the center of the window + the offset
var newLeft = getWindowWidth() / 2 + offset;

// setting the left position in netscape is a little different than IE
menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
}
 
  // this function calculates the window's width - different for IE and netscape
function getWindowWidth() {return window.innerWidth ? window.innerWidth : document.body.offsetWidth;}	

ypSlideOutMenu.writeCSS();


function emailit(whoto,domainto,title,subject,displayname)
{
	if (domainto == null || domainto == '') {domainto = 'brooklynpubliclibrary.org';}
	var writeit = whoto + '@' + domainto;
	if (displayname == null || displayname == '') {displayname = writeit;}
	
	if (subject == null || subject == '') {
		document.write("<a href='mailto:"+writeit+"' title='"+title+"'>"+displayname+"</a>");
	}
	else {
		document.write("<a href='mailto:"+writeit+"?subject="+subject+"' title='"+title+"'>"+displayname+"</a>");
	}
}