

// openClose

var oldDivId;
oldDivId = "";
var tag = "";
var setColor = "#f5b0b0";
var defColor = "#f5b0b0";

function openClose(tg,divId)
{
	if(document.getElementById)
	{
    if (oldDivId == "") {
			document.getElementById(divId).style.display="block";
		    	oldDivId = divId;
			tag = tg;
		} else {
		  	if (oldDivId == divId) {
				document.getElementById(oldDivId).style.display="none";
				oldDivId = "";
			} else {
				document.getElementById(oldDivId).style.display="none";
				document.getElementById(divId).style.display="block";
			    	oldDivId = divId;
				tag = tg;
			}
		}
	}
	else if(document.all)
	{
		if (oldDivId == "") {
			document.all[divId].style.display="block";
			tag = tg;
		    	oldDivId = divId;
		} else {
		  	if (oldDivId == divId) {
				document.all[oldDivId].style.display="none";
				oldDivId = "";
			} else {
				document.all[oldDivId].style.display="none";
				document.all[divId].style.display="block";
			    	oldDivId = divId;
				tag = tg;
			}
		}
	}
	else
	{

	}
}

function popup(url, width, height)
{
      var options = "toolbar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+";"
      popupWindow=window.open(url,"_blank",options);
}

function anketa(val)
{
  kukiny = document.cookie.split("; ");
  for (i in kukiny){
    jednaKukina = kukiny[i].split("=");
    if (jednaKukina[0] == "chemiciAnketa") volba=jednaKukina[1];
  }
  if (typeof(volba) == "undefined") {
    document.anketatop.poll.value=val;
    var date = new Date();
		date.setDate(date.getDate()+ 1);
		var expires = "; expires="+date.toGMTString();
    var cookie_string = "chemiciAnketa=ok; " + expires + "; path=/";
    document.cookie = cookie_string;
    document.anketatop.submit();
  }
  else {
    alert("Ľutujem, ale už ste hlasovali.");
  }
}
function newPage(page)
{
  old = document.chpage.action;
  var target = old+"&page="+page+"";
  document.chpage.action = target;
  document.chpage.submit();
}
function sendform(vala,valb)
{
  document.detailForm.akcia.value = vala;
  document.detailForm.uprava.value = valb;
  document.detailForm.submit();
}
/*
function writeFlash(text)
{
  document.write(text);
}*/

