var body = new Array();
var answer = "";
var bodySpolu = 0;

function unInfoPop() {
		var obj = (document.getElementById) ? document.getElementById('infoPop') : document.all['infoPop'];
		if (obj.style.display == "block") {
		   obj.style.display = "none";
		}
}

function infoPop() {
	var obj = (document.getElementById) ? document.getElementById('infoPop') : document.all['infoPop'];
	if (obj.style.display == "block") unInfoPop();
var skore = '<h2>'+bodySpolu+' bodů</h2>';
var topText = '<p id="infoHead">Vyhodnocení dotazníku -<br>navržená investiční strategie:</p>';
	var ok = '<div align="center"><br><a class="ok" href="javascript:unInfoPop()">OK</a><br></div>';
	var width = (document.body.offsetWidth-400)/2;
	var height = ((window.innerHeight) ? window.innerHeight-200 : document.body.offsetHeight-200)/2;
	if (window.innerWidth) obj.style.top = height;
	obj.style.left = width;
	obj.style.display = "block";
	obj.innerHTML = topText + skore +answer + ok;
	return(false);
}

function proc(obj) {
  body[obj.name] = obj.value;
}

function result() {
  bodySpolu = 0;
  for (var i = 0; i<6; i++) {
    if (typeof(body[i]) == "undefined") { alert("Chybí Vám ještě "+eval(i+1)+". otázka!"); return; }
    bodySpolu += temp = new Number(body[i]);
   }
  if (11 <= bodySpolu && bodySpolu <= 18) {
   answer = '<b><a href="/cz/products_and_services/ing_fondy/investicni_strategie.html#01">Spořicí strategie</a></b><br>100% ING Konto';
 }
  if (19 <= bodySpolu && bodySpolu <= 27) {
   answer = '<b><a href="/cz/products_and_services/ing_fondy/investicni_strategie.html#02">Konzervativní strategie</a></b><br>50% fond pěněžního trhu, 50% dluhopisový fond';
 }
  if (28 <= bodySpolu && bodySpolu <= 36) {
   answer = '<b><a href="/cz/products_and_services/ing_fondy/investicni_strategie.html#03">Vyvážená strategie</a></b><br>40% dluhopisový fond, 30% fond peněžního trhu, 30% akciový fond';
 }
  if (37 <= bodySpolu && bodySpolu <= 45) {
   answer = '<b><a href="/cz/products_and_services/ing_fondy/investicni_strategie.html#04">Světová dynamická strategie</a></b><br>70% akciový fond (v EUR), 30% akciový fond (v USD)';
 }
  infoPop();
}






