function image_win(url, target, iw, ih)
{
  var win_settings = "width=" + (iw+40) + "," + "height=" + (ih+50) + ","
    + "location=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes,directories=no,status=yes"
  ;
  // alert(win_settings);
  var img_win = window.open(url, target, win_settings);
  return !img_win;
}


function napsat(email, params)
{
  email = unscramble_ea(email);
  window.location.href = "mailto:" + email + params;
}


function printea(email)
{
  email = unscramble_ea(email);
  document.write(email);
}


function unscramble_ea(email)
{
  return email.replace(/\//g,"@");
}


numOfAttachments = 1;
maxAttachments = 3;

function insertAttachment()
{
	numOfAttachments += 1;

  var tr = document.createElement('tr');
  var td1 = document.createElement('td');
	var td2 = document.createElement('td');
	var input = document.createElement('input');
	var txt1 = document.createElement('span');
	var txt2 = document.createElement('span');

	txt1.appendChild(document.createTextNode("Další příloha"));
	txt2.appendChild(document.createTextNode("Attachment " + numOfAttachments));
	txt2.setAttribute('style', 'font-style: italic');

	td1.appendChild(txt1);
	td1.appendChild(document.createElement('br'));
	td1.appendChild(txt2);

	input.setAttribute('name', 'userfile' + numOfAttachments);
	input.setAttribute('type','file');
	input.className = 'fileInput';
	td2.appendChild(input);

  tr.appendChild(td1);

	tr.appendChild(td2);

	var refNode = document.getElementById('insertAttachment');
  refNode.parentNode.insertBefore(tr, refNode);
	if (numOfAttachments == maxAttachments) refNode.style.display = "none";
}


// rotator obrazku
ir_doba = 1500;  // 1500
ir_curimage = 0;
ir_obrsrc = new Array();
ir_cesta = new Array();
ir_obrsrc[0] = "img_menu/lexx-partner-1.gif";
ir_cesta[0] = "http://www.missaerobik.cz/";
ir_obrsrc[1] = "img_menu/lexx-partner-2.gif";
ir_cesta[1] = "http://www.skbu.cz/";

function image_rotator()
{
  if (ir_curimage == ir_obrsrc.length) {ir_curimage = 0;}
  document.getElementById('rotimage').firstChild.firstChild.src = ir_obrsrc[ir_curimage];
  document.getElementById('rotimage').firstChild.href = ir_cesta[ir_curimage];
  ir_curimage++;
  window.setTimeout('image_rotator();', ir_doba);
}
