function Locate(url) {
  mynewwin=window.open(url,"linkout");
  if (mynewwin) return false;
  return true;
};

function Comment(parent,title) {
  document.getElementById('comments-form-id').style.display='block';
  document.form_comments.elements["form[parent]"].value=parent;
  if (title!==undefined) document.form_comments.elements["form[title]"].value=title;
  window.location='#newcomment';
  return false;
}

function Evaluation(article_id,eval){
	document.getElementById('feedback').style.visibility='visible';
	document.getElementById('feedback').style.display='block';
	document.getElementById('yes').disabled=true;
	document.getElementById('no').disabled=true;
	var source="art_eval.php?article="+article_id+"&value="+eval;
	document.getElementById('hframe').src=source;
    ConfusionSet('confusion'+article_id);
}

function getCookie(name) {
  if (document.cookie.length>0) {
    c_start=document.cookie.indexOf(name);
    if (c_start!=-1) {
      c_start=c_start + name.length+1; // zacatek + delka jmena + 1(za '=')
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) c_end=document.cookie.length;
      return unescape(document.cookie.substring(c_start,c_end));
    }
    return null;
  }
  return null;
}

function setCookie(name,value,expiredays) {
  var exdate=new Date();
  exdate.setDate(exdate.getDate()+expiredays);
  document.cookie=name+ "=" +escape(value)+
  ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function ConfusionSet(name) {
  setCookie(name,'hide',14);
}

function ConfusionCheck(article_id) {
  var str="confusion"+article_id;
  confus = getCookie(str);
  if (confus != null) {
  	document.getElementById('confusion').style.visibility='hidden';
  	document.getElementById('confusion').style.display='none';
  } else {
  	document.getElementById('confusion').style.visibility='visible';
    document.getElementById('confusion').style.display='block';
  }
}

