// JavaScript Document

max_id = 0;

function setCurrentPic(pic_name)
{
  current_pic = pic_name;
}

function bigPic(current_pic)
{
  current_pic = 'http://www.aaareality.cz/img/photos/big/'+current_pic;
  l = (window.screen.availWidth-660)/2;
  t = (window.screen.availHeight-500)/2; 
  okno = window.open(current_pic,'obrazek','width=660,height=500,top='+t+',left='+l+',resizable=yes,toolbar=no,location=no,scrollbars=yes');
  okno.focus();
}

function pic(pic_name, width, height, alt)
{						
	current_pic = pic_name;
	
	var popup_photo = GID('popup_photo');
	
	var big_photo = GID('big_photo');
	var popis = GID('bigpopis');
	
  popis.innerHTML = alt;
	
  cesta = 'http://www.aaareality.cz/img/photos/mid/'+pic_name;
	
  big_photo.width = width;
	big_photo.alt = alt;
	big_photo.title = alt;
	big_photo.height = height;
  big_photo.src = cesta;
	
  return;
}

function GID(nazev)
{
  return document.getElementById(nazev);
}

function addPhoto()
{
	max_id++;
	var cislo = max_id+1;
	var vystup = GID('newPhoto').innerHTML;
	vystup += '<p class="mezera">\n';
  vystup += '<label class="mezera" for="form-photoText['+max_id+']" />Popis č. '+cislo+'</label>\n';
  vystup += '<input size="90" id="form-photoText['+max_id+']" type="input" name="photoText['+max_id+']" />\n</p>\n';
  vystup += '</p>\n';
	vystup += '<p>\n';
	vystup += '<label for="form-photo['+max_id+']" />Fotografie č. '+cislo+'</label>\n';
  vystup += '<input id="form-photo['+max_id+']" type="file" name="photoName['+max_id+']" />\n</p>\n';
  GID('newPhoto').innerHTML = vystup;
  return true;
}

