// fotogalerie
var myTWin = window.myTWin;
    
    function OpenMyWin(link,format) {
	  if (format==high) {
		  vyska = 600; sirka = 450; winvyska = 520; winsirka = 646;
	  }
	  else {
		  vyska = 450; sirka = 600; winvyska = 680; winsirka = 555;
	  }
	  
      var retValue=true;
      if (myTWin!=null && !myTWin.closed)
      {
        myTWin.focus();
        myTWin.location.href=link.href;
      }
      else
      {
        myTWin=window.open(link.href,winName,'width='+winsirka+',height='+winvyska+',scrollbars=0,resizable=0,toolbar=0');
        myTWin.document.open('text/html');
        myTWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
        myTWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml">\n');
        myTWin.document.write('<head>\n');
        myTWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />\n');
        myTWin.document.write('<meta name="Description" content="Pavučina: fotografie" />\n');
        myTWin.document.write('<meta http-equiv="imagetoolbar" content="no" />\n');
        myTWin.document.write('<meta name="autosize" content="off" />\n');
		myTWin.document.write('<title>Pavučina</title>\n');
        myTWin.document.write('<link rel="stylesheet" type="text/css" media="screen" href="~styles/photo.css" />\n');
        myTWin.document.write('</head>\n');
        myTWin.document.write('<body>\n');
		myTWin.document.write('<div id="photo-popup">\n');
        myTWin.document.write('<a title=\"Kliknutím zavřete\"  href=\"javascript:window.close(\'close\')\">\n');
        myTWin.document.write('<img alt=\"Kliknutím zavřete\" src=\"'+link.href+'\"');
        myTWin.document.write(' width=\"'+sirka+'\" height=\"'+vyska+'\" alt="Pavučina: fotografie" /></a>\n');
		myTWin.document.write('<p class="photo-label"><span>Pavučina, http://pavucina.volny-cas.cz/</span></p>\n');
		myTWin.document.write('</div>\n');
        myTWin.document.write('</body>\n');
        myTWin.document.write('</html>');        
        myTWin.document.close();
        if (myTWin==null || typeof(myTWin)=="undefined")
          retValue=false;
        else
        {
          link.target=winName;
          myTWin.focus();
        }
      }
      return retValue;
    }

// rozbalovací položky

function pack (){
 for (i = 0; i < 30; i++) { 
	 document.getElementById('p' + i).style.display = 'none';
 }
}
function prepni (n){
picnum = ('packimg' + n);
id = ('p' + n );
h4 = ('hp' + n);
	if (document.getElementById(id).style.display == 'none') {
	    document.getElementById(id).style.display = 'block';
		document.images[picnum].src='~images/arrow-packup.gif';
		document.images[picnum].title='zabalit';
		document.getElementById(h4).style.color = '#87A821';
	}
	else {
	    document.getElementById(id).style.display = 'none';
		document.images[picnum].src='~images/arrow-unpack.gif';
		document.images[picnum].title='rozbalit';
		document.getElementById(h4).style.color = '#000000';
	}
	}
function ShowAll (){
 for (i = 0; i < 30; i++) { 
   if (document.getElementById('p' + i)) {
     document.getElementById('p' + i).style.display = 'block';
	 document.images['packimg'+i].src='~images/arrow-packup.gif';
	 document.images['packimg'+i].title='zabalit';
	 document.getElementById('hp'+i).style.color = '#000000';
   }
 }
}
function HideAll (){
 for (i = 0; i < 30; i++) { 
   if (document.getElementById('p' + i)) {
     document.getElementById('p' + i).style.display = 'none';
	 document.images['packimg'+i].src='~images/arrow-unpack.gif';
	 document.images['packimg'+i].title='rozbalit';
	 document.getElementById('hp'+i).style.color = '#000000';
   }
 }
}
