/*****************************
**         Gallery          **
******************************/

var widths      = new Array( 340, 276, 140 );
var heights     = new Array( 340, 274, 400 );
var ContactText = "info@richardpitts.com";
var ContactUrl  = "info@richardpitts.com";
var PageName    = "Richard Pitts";

function winName(file) {
   f = file.replace(/\//g,"_");
   f = f.replace(/\./g,"_");
   f = f.replace(/\-/g,"_");
   return f;
}
	
function openWindow(file, width, height) {
   unique = winName(file);
   Win = open( file, 'win' + unique, 'toolbar=0,location=0,directories=0, status=0, '+
                  'menubar=0, resizable=1, width=' + width + 
                  ',height=' + height + ',scrollbars=no' );
   Win.focus();
}

function windowOpen(the_url,x,y) {
  var cpanel = "width=" + x + ",height=" + y + ",toolbar=no,status=no,"+
               "directories=no,scrollbars=no,location=no,"+
               "resizable=no,menubar=no";
  window.open( the_url, "", cpanel );
}

function ShowScreen() {
   document.write( '<table cellpadding="0" cellspacing="0" border="0">' );
   ShowTopper();
   ShowHeader();
   ShowBody();
   ShowFooter();
   document.write( '</table>' );
}

function ShowTopper() {
   document.write( '<tr>');
   for (j=0; j<= widths.length-1; j++ ) { 
      document.write( '<td>');
      LaSpacer( widths[j], 1 );
      document.write( '</td>' );
   }
   document.write( '</tr>' );
}

function ShowHeader() {
   document.write( '<tr>' );
   document.write( '<td colspan="1" valign="bottom">' );
   document.write( '<img src="images/richard_pitts.gif" width="339" height="47" '+
                   'space="0" vspace="0" border="0" alt="Richard Pitts">' );
   document.write( '</td>' );
   document.write( '<td colspan="1" valign="top">' );
   ShowTopGrid();
   document.write( '</td><td>' );
   LaSpacer();
   document.write( '</td></tr>' );
}

function ShowBody() {
   document.write( '<tr bgcolor="#333333">' );
   document.write( '<td colspan="1" height="274px" align="center" valign="middle">' );
   document.write( '<img src="' + DefaultPic.src +'"  hspace="0" vspace="0" '+
                   'border="1" style="border-color: silver" alt="" name="image">' );
   document.write( '</td>' );
  
   document.write( '<td colspan="1">' );
   ShowGalleryGrid();
   document.write( '</td>' );
   document.write( '<td bgcolor="#666666" valign="top">' );
   ShowMenuSquare();
   document.write( '</td>' );
   document.write( '</tr>' );
}

function ShowFooter() {
   document.write( '<tr>');
   document.write( '<td valign="top" width="' + widths[0] +'">' );
   ShowCredits();
   document.write( '</td><td width="' + widths[1] +'">' );
   ShowBottomGrid();
   document.write( '</td><td width="' + widths[2] +'">' );
   LaSpacer();
   document.write( '</td></tr>' );
}

function ShowCredits() {
  document.write( '<div class="Credits">' );
  document.write( 'Web Design: <a href="mailto:yudean@hotmail.com" class="footer">'+
                  'Dean Yu</a><br>' );
  document.write( 'Photography: Osamu Nishihira<br>' );
  document.write( 'Book Design:<a href="mailto:nycla3@aol.com" class="footer">Michael Weinglass</a><br>' );
  document.write( 'Essay: Judd Tully <br>' );
  document.write( 'Interview: Ginnie Gardiner <br>' );
  document.write( '© 2002 RichardPitts.com' );
  document.write( '</div' );
}

/*****************************
**        Menu              **
******************************/

var MenuTitle1 = "Gallery"; 
var MenuTitle2 = "&nbsp;";
var MenuTitle3 = "&nbsp;";

function MenuRec(a,b,c) {
   this.Name = a;
   this.File = b;
}

aMenu    = new Array( 14 );
aMenu[0] = new MenuRec( "Painted Metal Sculpture",     "sculpture.html" ); 
aMenu[1] = new MenuRec( "Totems",     "totems.html" ); 
aMenu[2] = new MenuRec( "Prints",     "prints.html" ); 
aMenu[3] = new MenuRec( "Exhibition 55 Mercer 06", "mercer06.html" ); 
aMenu[4] = new MenuRec( "Exhibition 55 Mercer 04", "mercer004.html" ); 
aMenu[5] = new MenuRec( "Exhibition 55 Mercer 03", "mercer03.html" ); 
aMenu[6] = new MenuRec( "Gallery 2000-2002",       "gallery2k.html" ); 
aMenu[7] = new MenuRec( "Gallery 1990-2000",       "gallery1990.html" ); 
aMenu[8] = new MenuRec( "Gallery 1985-1993",       "gallery1985.html" ); 
aMenu[9] = new MenuRec( "Catalog",                 "catalog.html" ); 
aMenu[10] = new MenuRec( "News",                    "news.html" ); 
aMenu[11] = new MenuRec( "Exhibitions",                 "exhibitions.html" ); 
aMenu[12] = new MenuRec( "Contact",                 "contact.html" ); 
aMenu[13] = new MenuRec( "Press Release",                 "pressrelease.html" ); 
aMenu[14] = new MenuRec( "Links",                 "links.html" ); 


function ShowMenuSquare() {
   ShowMenuHeader();
   document.write( '<table cellpadding="0" cellspacing="0" border="0">' );
   document.write( '<tr><td>' );
   ShowMenu();
   document.write( '</td></tr></table>' );
}

function ShowMenu() {
   document.write( '<div class="Menu">' );
   for (j=0; j<= aMenu.length-1; j++ ) { MenuItem(j); }
   document.write( '</div>' );
}

function MenuItem( i ) {
   document.write( '<a href="' + aMenu[i].File +'" class="MenuItem" target="_parent">' );
   document.write( aMenu[i].Name +'</a><br>' );
}

function ShowMenuHeader() {
   document.write( '<div class="MenuTitle1">' + MenuTitle1 + '</div>' );
   document.write( '<div class="MenuTitle2">' + MenuTitle2 + '</div>' );
   document.write( '<div class="MenuTitle2">' + MenuTitle3 + '</div>' );
}

/*****************************
**        Gallery           **
******************************/

var Pic = new Array(24);

var DefaultPic = new Image;
DefaultPic.src = "images/adam_and_eva.jpg";

function GRec(a,b,c,d,e,f) {
  this.Pic           = new Image;
  this.Pic.src       = "images/" + a + ".jpg";
  this.SquareOff     = new Image;
  this.SquareOff.src = "images/" + b + ".jpg";
  this.SquareOn      = new Image;
  this.SquareOn.src  = "images/" + c + ".jpg";
  this.PopHtml       = d + ".html";
  this.PopWidth      = e;
  this.PopHeight     = f;
}

function ShowGalleryGrid() {
   document.write( '<table cellpadding="0" cellspacing="0" border="0"><tr>' );
   ShowWhiteVLine();
   for (i=0; i<=24; i++ ) { 
      if ((i==5) || (i==10) || (i==15) || (i==20)) { 
         document.write( '</tr>' );
         ShowWhiteHLine();
         document.write( '<tr>' );
         ShowWhiteVLine();
      }
      ShowSquare( i );
      ShowWhiteVLine();
  }
  document.write( '</tr></table>' );
}

function ShowWhiteVLine() {
   document.write( '<td bgcolor="#CCCCCC">' );
   LaSpacer( 1, 54 );
   document.write( '</td>' );
}

function ShowWhiteHLine() {
   document.write( '<tr><td bgcolor="#CCCCCC" colspan="11">' );
   LaSpacer( 1,1 );
   document.write( '</td></tr>' );
}

function ShowPicSquare( sqi ) {
   var PicInFocus  =  sqi;
   var PopWidth    =  Pic[ sqi ].PopWidth  + 30;
   var PopHeight   =  Pic[ sqi ].PopHeight + 50;

   document.write( '<a href="javascript:windowOpen(\'' + Pic[ PicInFocus ].PopHtml + '\', ' + 
                   PopWidth +',' +  PopHeight +');" '+
                   'onMouseover="document.square' + sqi + '.src=Pic[' + sqi +'].SquareOn.src; '+
                   'document.image.src=Pic['+sqi+'].Pic.src" '+
                   'onMouseout="document.square' + sqi + '.src=Pic[' + sqi + '].SquareOff.src; '+
                   'document.image.src=DefaultPic.src">');

   document.write( '<img src="' + Pic[ PicInFocus ].SquareOff.src +'" width="54" height="54" '+
                   'hspace="0" vspace="0" border="0" '+
                   'alt="click here for a bigger image" name="square'+sqi+ '"></a>' );
}

function ShowSquare( sqi ) {
   document.write( '<td>' );
   if ( Pic[sqi].PopWidth == -1 ) { LaSpacer(54,1); } else { ShowPicSquare( sqi ); } 
   document.write( '</td>' );
}

function ShowPopUp( Pic, Width, Height, Alt, Title, Text, Size, Year ) {
   document.write( '<table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">' );
   document.write( '<tr><td class="text_pop" valign="top" align="center"><br>' );
   document.write( '<a href="javascript:window.close()">' );
 
  
   document.write( '<img src="images/' + Pic + '.jpg" width="' + Width + 
                   '" height="' + Height +'" hspace="0" vspace="0" '+
                   'border="0" alt="' + Alt + '"></a>' );
   document.write( '</td></tr>' );
   document.write( '<tr><td><div class="PopText">');
   document.write( '&nbsp;&nbsp;<b>' +Title +'</b>' );
   if (Text=="") document.write( '&#149; ' + Text );
   document.write( ' &#149; ' + Size + ' &#149; ' + Year );
   document.write( '</div></td></tr></table>' );
}

/*****************************
**         Grids            **
******************************/

function ShowTopGrid() {
   document.write( '<table cellpadding="0" cellspacing="0" border="0">' );
   ShowGridRow(1);
   ShowGridRow(0);
   document.write( '</table>' );
}

function ShowBottomGrid() {
   document.write( '<table cellpadding="0" cellspacing="0" border="0">' );
   for (j=1; j<=5; j++ ) { ShowGridRow(1); }
   ShowGridRow(0);
   document.write( '</table>' );
}

function ShowGridRow( a ) {
   document.write( '<tr>' );
   ShowGridCell( 54, 54 );
   for (i=1; i<=4; i++ ) { ShowGridCell( 54, 01 ); }
   ShowGridLine(1,1);
   document.write( '</tr>' );
   if (a==1) { 
     ShowGridSpacer(); 
   }
}

function ShowGridLine( w, h ) {
  document.write( '<td bgcolor="#666666">' );
  LaSpacer( w, h );
  document.write( '</td>' );
}
  
function ShowGridCell( w, h ) {
  ShowGridLine( 1, h );
  document.write( '<td>' );
  LaSpacer( w, 1 );
  document.write( '</td>' );
}
 
function ShowGridSpacer() {
   document.write( '<tr>' );
   document.write( '<td bgcolor="#666666" colspan="11">' );
   LaSpacer( 1, 1 );
   document.write( '</td></tr>' );
}

function LaSpacer( w, h ) {
   document.write( '<img src="images/spacer.gif" width="' +w+
                   '" height="' +h+'" hspace="0" vspace="0" border="0" alt="">' );
}

/*************
**  EOF     **
*************/
