// text counter sleduje dlzku textu pri textarea
function textCounter(field, countfield, maxlimit) {

if (field.value.length > maxlimit) {
// if too long...trim it!
temp1=field.value;
field.value="";
field.value = temp1.substring(0, maxlimit);
alert("(max. "+maxlimit+")");
}
// otherwise, update 'characters left' counter
else countfield.value = maxlimit - field.value.length;
}

//funkcia pre zvacsovanie obrazkov - zisti adresu a rozmer obrazka; prisposobenie okna je v popup.php
function Pop(loc,w,h) {
  iWidth = (screen.availWidth - w) /2;
  iHeight = (screen.availHeight - h) /2;
  window.open('image/popup.php?'+loc+'','','resizable=0, status=1, width=' +w+ ', height=' +h+ ', top=' +iHeight+ ', left=' +iWidth+ '');
};
