<!--
	// window.name = "new";
	function makePopup() {
		window.open( "", "popup", "width=500,height=450,toolbar,location,status,menubar,scrollbars,resizable");
	}
	
//  code by Alan Dix  © 2004   http://www.meandeviation.com/
//  you are free to use, copy, or distribute this code so long as this notice
//  is included in full and any modifications clearly indicated

function email_addr(name,host,isLink,otherName,subject) { //mod - added otherName for
	                                           //  when the link isn't the email address
                                                   // and optional subject variable
    var undefined;
	var email = name + "@" + host;
    var subj   = subject; // in format subject=text 
	if ( subj == undefined ) subj = "";
	if ( otherName == undefined ) otherName = "";
    if (  ! subj && otherName && otherName.match(/^subject=/) != null ) {
        subj = otherName;
        otherName = "";
    }
    if ( subj ) subj = "?" + subj;
    if (otherName)  { // mod - added this case
         isLink = 1; // must be live in this case  
         document.write("<a href=\"mailto:" + email + subj + "\">");
         document.write(otherName);
         document.write("</a>");
         document.close();
   }  else  {  //the rest is not modified
         if ( isLink ) document.write("<a href=\"mailto:" + email + subj + "\">");
         document.write(email);
         if ( isLink ) document.write("</a>");
         document.close();
   }
}



var popup=0;

function openWindow(URL,winName,params) { //v2.0
  popup=window.open(URL,winName,params);
  if (!popup.opener)
   { popup.opener=self; }
  popup.focus();  
}

function openImageWindow(imgurl,imgwidth,imgheight,title,width,height,winname,artist,work,photo,comment) {
    if ( ! imgurl.match(/^\w+:/) ) {   // should never happen, link.href makes urls absolute
		var myurl = location.href;
		var baseurl = myurl.replace(/\/[^\/]+$/,"/");
		imgurl = baseurl + imgurl;
	}
	var url = BASEURL + "info/imagedisplay.php?imgurl=" + escape(imgurl) + "&imgwidth=" + escape(imgwidth) + "&imgheight=" + escape(imgheight) + "&title=" + escape(title) + "&artist=" + escape(artist) + "&work=" + escape(work) + "&photo=" + escape(photo) + "&comment=" + escape(comment);
	openWindow(url,winname,'scrollbars=yes,resizable=yes,width=' + width + ',height=' + height); 
}

// tooltip script from http://lixlpixel.org/javascript-tooltips/ 
// position of the tooltip relative to the mouse in pixel //

var offsetx = 12;
var offsety =  8;
var tooltipVisible = true;

function tooltipVisibility (vis) {
	tooltipVisible = vis;
}

function newelement(newid)
{ 
    if(document.createElement)
    { 
        var el = document.createElement('div'); 
        el.id = newid;     
        with(el.style)
        { 
            display = 'none';
            position = 'absolute';
        } 
        el.innerHTML = '&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode && 
        	document.compatMode != 'BackCompat') ? 
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var lixlpixel_tooltip = document.getElementById('tooltip');
        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip = document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML = tip;
	if ( tooltipVisible ) {
    	lixlpixel_tooltip.style.display = 'block';
	}
    document.onmousemove = getmouseposition;
	//tooltipHover = true;
}
function exit()
{
    document.getElementById('tooltip').style.display = 'none';
	//tooltipHover = false;
}


//-->
