function popup(mylink, windowname) {
 if (!window.focus) return true;

 var href;
 if (typeof(mylink) == 'string')
   href = mylink;
 else
   href = mylink.href;

 window.open(href, windowname, 'width=400,height=400,scrollbars=yes');
 return false;
}

function pagePrint(mylink) {
 if (!window.focus) return true;

 window.open(mylink,'Marjetica', 'width=200,height=200,scrollbars=yes');
 return false;
}


function insertFile(theFile) {
  var str = window.opener.document.selection.createRange().text;
  window.opener.document.all['block_value'].focus();
  var sel = window.opener.document.selection.createRange();
  sel.text = '[%{' + theFile + '}]';
  return true;
}

function confirmLink(theLink, theAction) {
  var is_confirmed = confirm('\n' + theAction + '         \n');
  return is_confirmed;
}

function switch_template(template) {
  window.location.href = 'switch_template.php?template=' + template;
  return true;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,l$
}
