<!-- 
var cgp = 5;
var browser = navigator.appName;
var verze = parseInt(navigator.appVersion);
var sirka = 1024;
var btyp = 0;
var typ2 = 1;
var typ = 1;
function getScreenType(){
  browser = navigator.appName;
  verze = parseInt(navigator.appVersion);
  if( browser == "Microsoft Internet Explorer" & verze >= 4 ){
    btyp = 1;
  }else if( browser == "Netscape" & verze >= 4 ){
    btyp = 2;
  }else{
    btyp = 2;
  }if( btyp > 0 ){
    sirka = screen.width;
    vyska = screen.height;
    // asirka = screen.availWidth;
    // avyska = screen.availHeight;
    // color = screen.colorDepth;
  }else{
    sirka = 1024; 
  }if( sirka >= 1280 ){ 
    typ = 2;
  }else{ 
    typ = 1;
  }if( vyska >= 1024 ){ 
    typ2 = 2;
  }else{ 
    typ2 = 1;
  }
  return typ;
}
function writeGallery( tphoto, w1,h1, w2,h2, w,h, title, allign ){
  document.write('<a href="javascript:viewPhoto(\''+tphoto+'\','+w+','+h+')">');
  if( typ==2 ){
    document.write('<img border="0" vspace="5" hspace="5" src="'+tphoto+'" width="'+w2+'" height="'+h2+'" title="'+title+'" align="'+allign+'" />');
  }else{
    document.write('<img border="0" vspace="3" hspace="3" src="'+tphoto+'" width="'+w1+'" height="'+h1+'" title="'+title+'" align="'+allign+'" />');
  }
  document.write('</a>');
}
function write2Gallery( tphoto, w,h, title, allign ){
  w1 = 168;
  h1 = Math.floor( h * ( w1 / w ) );
  if( h1 > 148 ){
    h1 = 148;
    w1 = Math.floor( w * ( h1 / h ) );
  } 
  w2 = Math.floor( 1.4 * w1 );
  h2 = Math.floor( 1.4 * h1 );
  document.write('<a href="javascript:viewPhoto(\''+tphoto+'\','+w+','+h+')">');
  if( typ==2 ){
    document.write('<img border="0" vspace="5" hspace="5" src="'+tphoto+'" width="'+w2+'" height="'+h2+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }else{
    document.write('<img border="0" vspace="3" hspace="3" src="'+tphoto+'" width="'+w1+'" height="'+h1+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }
  document.write('</a>');
}
function write3Gallery( tphoto, w,h, title, allign ){
  w1 = 168;
  h1 = Math.floor( h * ( w1 / w ) );
  if( h1 > 148 ){
    h1 = 148;
    w1 = Math.floor( w * ( h1 / h ) );
  } 
  w2 = Math.floor( 1.4 * w1 );
  h2 = Math.floor( 1.4 * h1 );
  gphoto = "photogallery/"+tphoto;
  vphoto = "photogallery/prev/"+tphoto;
  document.write('<a href="javascript:viewPhoto(\''+gphoto+'\','+w+','+h+')">');
  if( typ==2 ){
    document.write('<img border="0" vspace="5" hspace="5" src="'+vphoto+'" width="'+w2+'" height="'+h2+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }else{
    document.write('<img border="0" vspace="3" hspace="3" src="'+vphoto+'" width="'+w1+'" height="'+h1+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }
  document.write('</a>');
}
function write4Gallery( n, tphoto, w,h, title, allign ){
  n1 = Math.min( 1, 4/n );
  w1 = 168*n1;
  h1 = Math.floor( h * ( w1 / w ) );
  if( h1 > 148*n1 ){
    h1 = 148*n1;
    w1 = Math.floor( w * ( h1 / h ) );
  } 
  w2 = Math.floor( 1.4 * w1 );
  h2 = Math.floor( 1.4 * h1 );
  gphoto = "photogallery/"+tphoto;
  vphoto = "photogallery/prev/"+tphoto;
  document.write('<a href="javascript:viewPhoto(\''+gphoto+'\','+w+','+h+')">');
  if( typ==2 ){
    document.write('<img border="0" vspace="5" hspace="5" src="'+vphoto+'" width="'+w2+'" height="'+h2+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }else{
    document.write('<img border="0" vspace="3" hspace="3" src="'+vphoto+'" width="'+w1+'" height="'+h1+'" alt="'+title+'" title="'+title+'" align="'+allign+'" />');
  }
  document.write('</a>');
}
var pw;
function viewPhoto( photo, gw,gh ){

  if( gw > 860 ){
    gh = gh * (860 / gw);
    gw = 860;
  }if( gh > 640 ){
    gw = gw * (640 / gh);
    gh = 640;
  }

  w = Math.ceil(gw) +24;
  h = Math.ceil(gh) +26;                                                                 

  bC = true;
  if( ( btyp > 0 ) && (bC) ){
    xpos = (screen.width - w) / 2;
    if( typ==1 ){
      ypos = (screen.height - 2*h) / 2;
    }else{
      ypos = (screen.height - h) / 2;
    }
  }else{
    xpos = 10; 
    ypos = 10;
  }
  xpos = Math.max( 0, xpos );
  if( typ==1 ){
    ypos = Math.max(10, ypos );
  }else{
    ypos = Math.max( 0, ypos );
  }

  args = "width="+w+"," 
       + "height="+h+"," 
       + "location=0," 
       + "menubar=0,"
       + "resizable=1,"
       + "scrollbars=0,"
       + "status=0," 
       + "titlebar=0,"
       + "toolbar=0,"
       + "hotkeys=0,"
       + "screenx="+xpos+","
       + "screeny="+ypos+","
       + "left="+xpos+"," 
       + "top="+ypos;

  if( pw!=null ){ pw.close(); }
  pw = window.open( photo, null, args, true );
  pw.focus();
}
var iw;
function viewImage(file){
  args = "width=1014," 
       + "height=710," 
       + "location=0," 
       + "menubar=0,"
       + "resizable=1,"
       + "scrollbars=1,"
       + "status=0," 
       + "titlebar=0,"
       + "toolbar=0,"
       + "hotkeys=0,"
       + "screenx=0,"
       + "screeny=0,"
       + "left=0," 
       + "top=0";
  if( iw!=null ){ iw.close(); }
  iw = window.open( file, null, args, true );
  iw.focus();
}
// -->

/*
// <html>
// <body>
// -------
// <script language="JavaScript" src="viewPhoto.js"><!-- 
// writeGallery( "_photo_", w1024,h1024, w1280,h1280, "_title_", "_allign_" ); 
// --></script>
// -------
// </body>
// </html>
*/