/***** 
OPEN A  NEW WINDOW WITH SELECTED IMAGE
This js file was created on 2002-10-08 and
is to be used on all galleries for popups from now on

It's used in combination with a popupArrays.js file
that resides in the folder with the pages.
******/
  
function lrg(gal,i) {
window.onerror = null;

     PreView=window.open("","Preview","width=700,height=535,left=0,top=0,resizable=1,scrollbars=1");
     PreView.document.open();
     PreView.document.write("<HTML><HEAD>");
     PreView.document.write("<TITLE>Feheley Fine Arts</TITLE>");
     PreView.document.write("</HEAD><BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0 BGCOLOR=#333333 onBlur='self.close()'>");
     PreView.document.write("<TABLE BORDER='0' HEIGHT='100%' WIDTH='100%'><TR><TD ALIGN='center' VALIGN='middle'>");
     PreView.document.write("<IMG SRC='" + sel[gal][i] + "'>");
     PreView.document.write("</TD></TR></TABLE>");
     PreView.document.write("</BODY></HTML>");
     PreView.document.close();
     PreView.focus();
     
}


/**
*	WARREN: October 21, 2005
*	This is a new open window function (almost identical to original)
*	that removes the need for the additional javascript array file
*	that accompanies each exhibition
*/
function lrg2(image){

window.onerror = null;

     PreView=window.open("","Preview","width=900,height=800,left=60,top=0,resizable=1,scrollbars=1");
     PreView.document.open();
     PreView.document.write("<HTML><HEAD>");
     PreView.document.write("<TITLE>Feheley Fine Arts</TITLE>");
     PreView.document.write("</HEAD><BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0 BGCOLOR=#333333 onBlur='self.close()'>");
     PreView.document.write("<TABLE BORDER='0' HEIGHT='100%' WIDTH='100%'><TR><TD ALIGN='center' VALIGN='middle'>");
     PreView.document.write("<IMG SRC='" + image + "'>");
     PreView.document.write("</TD></TR></TABLE>");
     PreView.document.write("</BODY></HTML>");
     PreView.document.close();
     PreView.focus();
}


/**
*	Warren: March 29, 2006
*	Creation of new exhibitions was/is becoming unwieldly w/ having
*	to refer to graphics and html files in separate directories.
*	Therefore, in the spirit of encapsulation, and an ability to move
*	entire exhibtions in a single bound, graphics and html files will
*	be kept together in the same directory.
*
*	getThisDirectory() is necessary to grab the 'home' directory path
*	when popping up a large image; cause the popup doesn't seem to know
*	where it originates.
*/

function getThisDirectory(){
	str = new String(window.location);
	str = str.substring(0,str.lastIndexOf('\/'));
	return str;

}



function lrg3D(address){
     PreView=window.open(address,"Preview","width=700,height=535,left=0,top=0,resizable=1,scrollbars=0");
     PreView.focus();
}