var root=putanja;


function prikaziBurze(koje){
	
	 var celije="<table cellpadding=0 cellspacing=0 border=0><tr>";
     var burzeIspis=koje.split(",");
    var i=0;
	for(var burza in burzeIspis){
	
	if(burzeIspis[burza] !=""){
	i++;
	var b=burzeIspis[burza].split("|");
	if(i==1){
		otvoriBurzuPratim(b[0]);
	  celije+="<td class='burzaPratimOver' id='"+b[0]+"' name='"+b[0]+"' onClick='otvoriBurzuPratim(this.id)' title='"+b[1]+"'>"+b[0]+"</td>";
	}else{
	 celije+="<td class='burzaPratimOut' id='"+b[0]+"' name='"+b[0]+"' onClick='otvoriBurzuPratim(this.id)' title='"+b[1]+"'>"+b[0]+"</td>";	
		
		}
	  }
	  }
	  celije+="</tr></table>";
	  
	  document.getElementById("otvB").innerHTML=celije;
	}
	
	
	function prikaziFondove(koje){
	
	 var celije="<table cellpadding=0 cellspacing=0 border=0><tr>";
     var fondoviIspis=koje.split(",");
    var i=0;
	for(var fond in fondoviIspis){
	
	if(fondoviIspis[fond] !=""){
	i++;
	var b=fondoviIspis[fond].split("|");
	if(i==1){
	  otvoriFondovePratim(b[0]);
	  celije+="<td class='fondoviPratimOver' id='"+b[0]+"' name='"+b[0]+"' onClick='otvoriFondovePratim(this.id)' title='"+b[1]+"'>"+b[1]+"</td>";
	}else{
	 celije+="<td class='fondoviPratimOut' id='"+b[0]+"' name='"+b[0]+"' onClick='otvoriFondovePratim(this.id)' title='"+b[1]+"'>"+b[1]+"</td>";	
		
		}
	  }
	  }
	  celije+="</tr></table>";
	  
	  document.getElementById("otvF").innerHTML=celije;
	}

function otvoriBurzuPratim(koji){
	
	var odabran=document.getElementById("odabranPratim").value;
	if(koji!=odabran){
	document.getElementById("div_"+koji).style.visibility="visible";
	document.getElementById("div_"+koji).style.display="block";
	
	document.getElementById("div_"+odabran).style.visibility="hidden";
	document.getElementById("div_"+odabran).style.display="none";
	
	document.getElementById(odabran).className="burzaPratimOut";
	document.getElementById(koji).className="burzaPratimOver";
	document.getElementById("odabranPratim").value=koji;
	}
	
	}
	
	
	function otvoriFondovePratim(koji){
	
	var odabran=document.getElementById("odabranFondPratim").value;
	if(koji!=odabran){
	document.getElementById("div_"+koji).style.visibility="visible";
	document.getElementById("div_"+koji).style.display="block";
	
	document.getElementById("div_"+odabran).style.visibility="hidden";
	document.getElementById("div_"+odabran).style.display="none";
	
	document.getElementById(odabran).className="fondoviPratimOut";
	document.getElementById(koji).className="fondoviPratimOver";
	document.getElementById("odabranFondPratim").value=koji;
	}
	
	}
	
	
	function prikaziID(koji,id,kojiFond){
	
	var odabran=document.getElementById("kojiID").value;
	document.getElementById(id).className="mjeseciOver";
	document.getElementById(odabran).className="mjeseciOut";
	
	document.getElementById("grafovi_"+odabran).style.visibility="hidden";
	document.getElementById("grafovi_"+odabran).style.display="none";
	document.getElementById("grafovi_"+id).style.visibility="visible";
	document.getElementById("grafovi_"+id).style.display="block";
	
	document.getElementById("kojiID").value=id;
	
	}
	
	
	
	
function zatvoriPratim(opcija){
	
	switch(opcija){
		
		case "0":
		document.getElementById("pratimSadrzaj").style.visibilitiy="hidden";
		document.getElementById("pratimSadrzaj").style.display="none";
		var link="<a href=javascript:zatvoriPratim('1') class=linkPratim>Otvori korisničke alate</a>";
		document.getElementById("linkOtvoriPratim").innerHTML=link;
		break;
		
		case "1":
		document.getElementById("pratimSadrzaj").style.visibilitiy="visible";
		document.getElementById("pratimSadrzaj").style.display="block";
		var link="<a href=javascript:zatvoriPratim('0') class=linkPratim>Zatvori korisničke alate</a>";
		document.getElementById("linkOtvoriPratim").innerHTML=link;
		break;
		
		}
	}
	
	function pratim(podrucje,id,akcija){
	ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija="+akcija+"&mjesto=pratim&podrucje="+podrucje+"&id="+id, "spremipromjene");	

	if(podrucje=="mirovinskiFondovi") var ikona="";
	if(podrucje=="fondovi") var ikona="";
	if(podrucje=="dionice") var ikona="dionice_";
	
	switch(akcija){
		case "add":
		var slika="<a href=javascript:pratim('"+podrucje+"','"+id+"','delete');><img src="+root+"images/nepromjenjivo/yes_pratim_ikona.png width=15 title=PRATIM (Kliknite za brisanje) border=0></a>";
		break;
		
		case "delete":
		var slika="<a href=javascript:pratim('"+podrucje+"','"+id+"','add');><img src="+root+"images/nepromjenjivo/"+ikona+"pratim_ikona.png title=PRATIM border=0 width=15></a>";
		break;
		
		}
		
		document.getElementById("pratim"+id).innerHTML=slika;
		}
/*var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")*/



function otvoriKartu(){
 var howz=367;
 var wowz=487;
 var winlowz = (screen.width - wowz) / 2;
 var wintowz = (screen.height - howz) / 2;
 var opcijeowz = 'height='+howz+',width='+wowz+',top='+wintowz+',left='+winlowz+',scrollbars=yes'
 var locowz=root+"images/nepromjenjivo/o_nama/karta.jpg";
 window.open(locowz,'',opcijeowz);
}


function kodOtvaranja(jezik){
	//newsletter
ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=otvori&disklajmer=&mjesto=newsletter&ime=ime i prezime&mail=e-mail", "newsletterUnesi");
//ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=otvori&mjesto=doLOGIN", "doLoginDIV");
	}



function podaci_o_fondu(podrucje,kojiFile,kojiFond){
//ajaxpage( root + "site_module/"+ jezik +"/fondovi/sites/fondovi_podaci/"+ kojiFile +".php?kojiFond="+ kojiFond, "openSite");	
		for(i=1;i<=4;i++){
			/*if(i==podrucje){
				document.getElementById("layer"+i).style.display = "block";
				document.getElementById("layer"+i).style.visibility = "visible";
				document.getElementById("idF_"+i).className="overF_"+i;
				document.getElementById("link_"+i).style.color = "#ffffff";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "10px center";
				document.getElementById("menuID").value = podrucje;
				
				}else{
				
				document.getElementById("idF_"+i).className="idF_"+i;
				document.getElementById("layer"+i).style.display = "none";
				document.getElementById("layer"+i).style.visibility = "hidden"; 
				document.getElementById("link_"+i).style.color = "#0091d2";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/svj_plava_strelica.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "10px center";
				
				

					}	*/
					
					
					
					if(i==podrucje){
				document.getElementById("layer"+i).style.display = "block";
				document.getElementById("layer"+i).style.visibility = "visible";
				document.getElementById("idF_"+i).className="overF_"+i;
				document.getElementById("link_"+i).style.color = "#ffffff";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "10px center";
				document.getElementById("menuID").value = podrucje;
				
				}else{
				
				document.getElementById("idF_"+i).className="idF_"+i;
				document.getElementById("layer"+i).style.display = "none";
				document.getElementById("layer"+i).style.visibility = "hidden"; 
				document.getElementById("link_"+i).style.color = "#ffffff";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "10px center";
				
				

					}
		}
		
		//alert("idF_"+podrucje);
}


	function promijeniBoju(id,kako){
		var aktivan=document.getElementById("menuID").value;
		if(kako=="1" && aktivan!=id){
		document.getElementById("idF_"+id).className="overF_"+id;	
		document.getElementById("idF_"+id).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";	
		document.getElementById("idF_"+id).style.backgroundRepeat = "no-repeat";
		document.getElementById("idF_"+id).style.backgroundPosition = "10px center";
		document.getElementById("link_"+id).style.color = "#ffffff";
		}
		
		if(kako=="0" && aktivan!=id){
		document.getElementById("idF_"+id).className="idF_"+id;	
		document.getElementById("idF_"+id).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
		document.getElementById("idF_"+id).style.backgroundRepeat = "no-repeat";
		document.getElementById("idF_"+id).style.backgroundPosition = "10px center";
		document.getElementById("link_"+id).style.color = "#ffffff";
		}
		
		}


function podaci_o_mirovinskom_fondu(podrucje,kojiFile,kojiFond){
//ajaxpage( root + "site_module/"+ jezik +"/fondovi/sites/fondovi_podaci/"+ kojiFile +".php?kojiFond="+ kojiFond, "openSite");	
		for(i=1;i<=3;i++){
			if(i==podrucje){
				document.getElementById("layer"+i).style.display = "block";
				document.getElementById("layer"+i).style.visibility = "visible";
				document.getElementById("idF_"+i).className="overF_"+i;
				document.getElementById("link_"+i).style.color = "#ffffff";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "30px center";
				document.getElementById("menuID").value = podrucje;
				}else{
				document.getElementById("idF_"+i).className="idF_"+i;
				document.getElementById("layer"+i).style.display = "none";
				document.getElementById("layer"+i).style.visibility = "hidden"; 
				document.getElementById("link_"+i).style.color = "#ffffff";
				document.getElementById("idF_"+i).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
				document.getElementById("idF_"+i).style.backgroundRepeat = "no-repeat";
				document.getElementById("idF_"+i).style.backgroundPosition = "30px center";
					}	
		}
		
		//alert("idF_"+podrucje);
}

function promijeniBojuM(id,kako){
		var aktivan=document.getElementById("menuID").value;
		if(kako=="1" && aktivan!=id){
		document.getElementById("idF_"+id).className="overF_"+id;	
		document.getElementById("idF_"+id).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";	
		document.getElementById("idF_"+id).style.backgroundRepeat = "no-repeat";
		document.getElementById("idF_"+id).style.backgroundPosition = "30px center";
		document.getElementById("link_"+id).style.color = "#ffffff";
		}
		
		if(kako=="0" && aktivan!=id){
		document.getElementById("idF_"+id).className="idF_"+id;	
		document.getElementById("idF_"+id).style.backgroundImage="url("+root+"images/nepromjenjivo/menu_plava_bijela_title.png)";
		document.getElementById("idF_"+id).style.backgroundRepeat = "no-repeat";
		document.getElementById("idF_"+id).style.backgroundPosition = "30px center";
		document.getElementById("link_"+id).style.color = "#ffffff";
		}
		
		}



function promijeniKocku(ime,br,koliko,nacin,naslov){
	switch(nacin){
		
		case "over":
			
			for(i=1;i<=koliko;i++){
				
				if((i==br)&&(document.getElementById(ime).value!=naslov)){
					document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/puna_kocka.png';
				}else{
					
					if(document.getElementById(ime).value!=naslov){
					document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/prazna_kocka.png';
					}
				}
			}
			
		break;


		case "out":
			
			for(i=1;i<=koliko;i++){
				
				if((i==br)&&(document.getElementById(ime).value!=naslov)){
					document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/prazna_kocka.png';
				}else{
					if(document.getElementById(ime).value==naslov){
					document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/puna_kocka.png';
					}
				}
			}
			
		break;
		
		}
	
	}
	
function potvrdiKocku(ime,br,koliko,nacin){
	
	document.getElementById(ime).value=nacin;
	document.getElementById("kako_kontaktirati").value=nacin;
	
	for(i=1;i<=koliko;i++){
	document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/prazna_kocka.png';
		}
	document.getElementById(ime + "_" + br).src= root + 'images/nepromjenjivo/puna_kocka.png';
		//promijeniKocku(ime,br,koliko,"out",nacin)
		//alert(ime + "_" + br);
	}

	function HideContent(d) {
		if(d.length < 1) { return; }
		document.getElementById(d).style.display = "none";
	}
	function ShowContent(d) {
		if(d.length < 1) { return; }
		document.getElementById(d).style.display = "block";
	}
	function ReverseContentDisplay(d) {
		if(d.length < 1) { return; }
		if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
		else { document.getElementById(d).style.display = "none"; }
	}


	function refresh()
	{
	  window.location.reload();
	} 

//printanje

	function printajMaluTecajnicu(jezik){


		window.open(root+'dokumenti/tecajnice/printajMaluTecajnicu.php','','');

	}

function printajMaluTecajnicuM(jezik){


		window.open(root+'dokumenti/tecajnice/printajMaluTecajnicu_mirovinski.php','','');

	}

	function printajVelikuTecajnicu(jezik){


		window.open(root+'dokumenti/tecajnice/printajVelikuTecajnicu.php','','');

	}
	function printajVelikuTecajnicuM(jezik){


		window.open(root+'dokumenti/tecajnice/printajVelikuTecajnicuMirovinski.php','','');

	}
	
	
//kraj printanja

function Kalkuliraj(){
var brUdjela=document.getElementById("INFObrUdjela").value;
		var urlP= root + "site_module/"+ jezik +"/fondovi/modules/fond_fhb_racunaj.php?brUdjela=" + brUdjela;
		//alert(urlP);
		document.getElementById("fhb").value=ajaxpage(urlP,"fhb");
}


//skripta za provjeru i upis u newsletter
	function provjeriNewsletter(jezik){
		
		var poruka="";
		var ime=document.getElementById("newsletterIme").value;
		var mail=document.getElementById("newsletterMail").value;
		var disk=document.getElementById("disklajmer").checked;
		ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promjeni&disklajmer="+ disk +"&mjesto=newsletter&mail="+ mail +"&ime=" + ime, "newsletterUnesi");
	  
		}

//KRAJ - skripta za provjeru i upis u  newsletter



//skripta za provjeru i upis u press newsletter
	function provjeri_PRESS_Newsletter(jezik){
		
		var poruka="";
		var ime=document.getElementById("press_newsletterIme").value;
		var mail=document.getElementById("press_newsletterMail").value;
		var disk=document.getElementById("press_disklajmer").checked;
		ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promjeni&disklajmer="+ disk +"&mjesto=newsletterPRESS&mail="+ mail +"&ime=" + ime, "newsletterUnesiPRESS");
		  
		}

//KRAJ - skripta za provjeru i upis u press newsletter


//Logiranje

	function doLogin(jezik){
		/*var u=document.getElementById("korisnickoIme").value;
		var p=document.getElementById("Lozinka").value; 
		var z=document.getElementById("zapamtiMe").checked; 
		ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?u="+ u +"&p="+ p +"&z="+z+"&akcija=login&mjesto=doLOGIN", "doLoginDIV");	*/
		
		//setTimeout("prebaci();",200);
		//window.location=root	+ "hr/fondovi/fondovi_0_0_0_0/||Korisnicki_menu/";
		document.logiranjeKorisnika.submit();
			
		}
		
		function prebaci(){
		var string=document.getElementById('doLoginDIV').innerHTML;
		if(string.indexOf("Dobrodo")!=-1) {
		window.location=root  + "hr/fondovi/fondovi_0_0_0_0/||Korisnicki_menu/"; 
		}
		
		 }
	
	function doLogOut(jezik){
		ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=logout&mjesto=doLOGIN", "doLoginDIV")
		setTimeout("window.location='"+root+"'",100);
		}
	
	function doLoginBack(jezik){
		ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=otvori&mjesto=doLOGIN", "doLoginDIV");
		}
//Kraj logiranja


//skripta za zaboravljena lozinka
function zaboravljena_lozinka(jezik,t){
	

var podaci_za_logiranje=document.getElementById("podaci_za_logiranje").value;

ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promijeni&mjesto=ZABORAVLJENA_LOZINKA&t="+t+"&podatak="+podaci_za_logiranje, "zaboravljenaLozinka");
  
	}

//KRAJ - skripta za zaboravljena lozinka


//skripta za provjeru i upis u press newsletter
function preporucite_nas(jezik){
	
var poruka="";
var ime=document.getElementById("ime").value;
var mail=document.getElementById("mail").value;
var email1=document.getElementById("email1").value;
var email2=document.getElementById("email2").value;
var email3=document.getElementById("email3").value;
var vPoruka=document.getElementById("vPoruka").value;
var moj=document.getElementById("moj").checked;
ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?email1="+email1+"&email2="+email2+"&email3="+email3+"&akcija=promjeni&mjesto=PREPORUCITE_NAS&mail="+ mail +"&ime=" + ime +"&vPoruka=" + vPoruka +"&moj=" + moj, "saljiPrijatelju");
  
	}

//KRAJ - skripta za provjeru i upis u press newsletter
function provjeriOsobniKontakt(){
	var podaci=new Array();
	podaci[0]=provjeriPolja("ime","2");
	podaci[1]=provjeriPolja("prezime","2");
	podaci[2]=provjeriEmail("email","2");
	podaci[3]=provjeriPolja("ulica","2");
	podaci[4]=provjeriPolja("pbr","2");
	podaci[5]=provjeriPolja("mjesto","2");
	podaci[6]=provjeriPolja("drzava","2");
	podaci[7]=provjeriPolja("telefon","2");
	podaci[8]=provjeriIdenticnost("sec_kod","kod");
	var values="";
	for( var i in podaci){
		if(podaci[i]==false){
		values="greska";
		}
				}
	
	if(values=="greska"){
		return false;
		}else{
			
			document.korsubmit.submit();
			
			}
	}

//pristup fondu


function potvrdiKockuForm(ime,br,koliko,nacin){
	
	document.getElementById(ime).value=nacin;
	
	
	
	for(i=1;i<=koliko;i++){

			document.getElementById(ime + "_" + i).src= root + 'images/nepromjenjivo/prazna_kocka.png';
		
		}
	document.getElementById(ime + "_" + br).src= root + 'images/nepromjenjivo/puna_kocka.png';
		
		//promijeniKocku(ime,br,koliko,"out",nacin)
	
	//alert(ime + "_" + br);
	}

function otvoriNapomenuTecajnice() {
document.getElementById("napomena").style.visibility = "visible";
document.getElementById("napomena").style.display = "block";
var string="<a href=javascript:zatvoriNapomenuTecajnice();  class=linkTecajnicaPristup2><b>Zatvori napomenu</b></a>";
document.getElementById("zatvori").innerHTML = string;
}

function zatvoriNapomenuTecajnice() {
document.getElementById("napomena").style.display = "none";
document.getElementById("napomena").style.visibility = "hidden";
var string="<a href=javascript:otvoriNapomenuTecajnice(); class=linkTecajnicaPristup2><b>Napomena uz tečajnicu</b></a>";
document.getElementById("zatvori").innerHTML = string;
}



function prikaziPravneUvjete(koji,mjesto) {
	if(mjesto!=""){
document.getElementById(koji).style.visibility = "visible";
document.getElementById(koji).style.display = "block";
var string="<a href=javascript:sakrijPravneUvjete('"+koji+"','"+mjesto+"');>pravne uvjete korištenja (Zatvori)</a>";
document.getElementById("zatvori").innerHTML = string;
	}
}

function sakrijPravneUvjete(koji,mjesto) {
document.getElementById(koji).style.display = "none";
document.getElementById(koji).style.visibility = "hidden";
var string="<a href=javascript:prikaziPravneUvjete('"+koji+"','"+mjesto+"');>pravne uvjete korištenja</a>";
document.getElementById("zatvori").innerHTML = string;
}


function prikaziZastoRegati() {

document.getElementById("zasto_regati").style.visibility = "visible";
document.getElementById("zasto_regati").style.display = "block";
var string="<a href=javascript:sakrijZastoRegati(); class=linkTekst>Zašto  se registrirati? (Zatvori)</a>";
document.getElementById("zr").innerHTML = string;

}

function sakrijZastoRegati() {
document.getElementById("zasto_regati").style.display = "none";
document.getElementById("zasto_regati").style.visibility = "hidden";
var string="<a href=javascript:prikaziZastoRegati(); class=linkTekst >Zašto  se registrirati?</a>";
document.getElementById("zr").innerHTML = string;
}

function prikaziPrednost(kako) {
switch (kako){
  case "1":
  document.getElementById("zasto_regati").style.visibility = "visible";
  document.getElementById("zasto_regati").style.display = "block";
  var string="(<a href=javascript:prikaziPrednost('0'); >Zatvori</a>)";
  document.getElementById("openClose").innerHTML = string;
  break;

  case "0":
  document.getElementById("zasto_regati").style.visibility = "hidden";
  document.getElementById("zasto_regati").style.display = "none";
  var string="(<a href=javascript:prikaziPrednost('1'); >Prikaži</a>)";
  document.getElementById("openClose").innerHTML = string;
  break;


  }


}




function provjeriPristupFizicka(koji,polje,value){
	
	switch(koji){
		
		
		case "1":
		//var tekst1='<input type=hidden name='+polje+' id='+polje+'  value='+value+'>';
		//var tekst2="";
		var tekst3="JMBG:";
		var tekst4="Ulica:";
		var tekst5="Podaci o ulagaeu:";
		break;
		
		case "0":
		//var tekst1='<strong>Tvrtka/Obrt:</strong>';
		//var	tekst2="<input type=text style='width: 150px; padding-top: 3px; padding-left: 3px;' id="+polje+" name="+polje+" class='inputPristup'  value="+value+">";
		var tekst3="MB tvrtke:"
		var tekst4="Sjedište tvrtke:";
		var tekst5="Podaci o ovlaštenoj osobi:";
		break;
		}
		
		//document.getElementById("tvtka_fiz1").innerHTML=tekst1;	
		//document.getElementById("tvtka_fiz2").innerHTML=tekst2;	
		document.getElementById("jmbg_osoba").innerHTML="<b>"+ tekst3 +"</b>";	
		document.getElementById("ul_sjed").innerHTML="<b>"+ tekst4 +"</b>";	
		document.getElementById("osoba_kakva").innerHTML="<b>"+ tekst5 +"</b>"; 
	}

function provjeriPristupFizicka_korak_1(koji,polje,value){
	
	switch(koji){

		case "1":
		var tekst="raeuna podnositelja";
		var tekst2='<input type=hidden name='+polje+' id='+polje+'  value='+value+'>';
		break;
		
		case "0":
		var tekst='trans. raeuna';
		var tekst2='<input type=hidden name='+polje+' id='+polje+'  value='+value+'>';
		break;
		}
	
	//document.getElementById("racuna").innerHTML=tekst;	
	//document.getElementById("osoba").innerHTML=tekst2;	
	}
	
	


function go_pristup(putanja) {
	var urlAction=putanja;
	document.pristup.action=urlAction;
	document.pristup.submit();
}

function promjeniFondPristup_1(koji,fond,http,ssl) {
	
var f=koji.split("#");
var fondId=f[0];
var fondURL=f[1];

document.getElementById('poljeFond').innerHTML=fond;
document.getElementById('fondId').value=fondId;

var urlAction=http + jezik + "/fondovi/fondovi_1_5_0_1/|Otvoreni_fondovi|Pristup_fondu_online|"+ fondId+"|"+fondURL+"|"+ ssl +"|2";
document.korak_1.action=urlAction;


var zaAlert="Fond:"+fond+"\n";
	zaAlert+="Fond ID:"+fondId+"\n";
	zaAlert+="Fond URL:"+fondURL+"\n";
	zaAlert+="Fond Action:"+urlAction+"\n";
//alert(zaAlert);
}
//kraj pristupu findu




//skripta za provjeru i upis kontakt formular
function kontaktirajte_nas(jezik){

var poruka="";
var tvrtka=document.getElementById("tvrtka").value;
var ime_i_prezime=document.getElementById("ime_i_prezime").value;
var ulica=document.getElementById("ulica").value;
var pbr=document.getElementById("pbr").value;
var grad_mjesto=document.getElementById("grad_mjesto").value;
var telefon=document.getElementById("telefon").value;
var gsm=document.getElementById("gsm").value;
var fax=document.getElementById("fax").value;
var mail_korisnika=document.getElementById("mail_korisnika").value;
var vPoruka=document.getElementById("vPoruka").value;
var kako_kontaktirati=document.getElementById("kako_kontaktirati").value;

ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promijeni&mjesto=KONTAKTIRAJTE_NAS&tvrtka="+tvrtka+"&ime_i_prezime="+ime_i_prezime+"&ulica="+ulica+"&pbr="+pbr+"&grad_mjesto="+grad_mjesto+"&telefon="+telefon+"&gsm="+gsm+"&fax="+fax+"&mail_korisnika="+mail_korisnika+"&vPoruka="+vPoruka+"&kako_kontaktirati="+kako_kontaktirati, "kontaktFormular");
	}
//KRAJ - skripta za provjeru kontakt formular


//skripta za provjeru i upis kontakt brokera
function kontaktirajte_brokera(jezik){

var poruka="";
var ime_i_prezime=document.getElementById("ime_i_prezime").value;
var telefon=document.getElementById("telefon").value;
var mail_korisnika=document.getElementById("mail_korisnika").value;
var vPoruka=document.getElementById("vPoruka").value;


ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promijeni&mjesto=KONTAKTIRAJTE_BROKERA&ime_i_prezime="+ime_i_prezime+"&telefon="+telefon+"&mail_korisnika="+mail_korisnika+"&vPoruka="+vPoruka, "kontaktFormular");
	}
//KRAJ - skripta za provjeru kontakt brokera

//skripta za provjeru i upis kontakt brokera
function kontaktirajte_brokera_portfelji(jezik){

var poruka="";
var ime_i_prezime=document.getElementById("ime_i_prezime").value;
var telefon=document.getElementById("telefon").value;
var mail_korisnika=document.getElementById("mail_korisnika").value;
var vrijeme=document.getElementById("vrijeme").value;
var vPoruka=document.getElementById("vPoruka").value;


ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promijeni&mjesto=KONTAKTIRAJTE_BROKERA_portfelji&ime_i_prezime="+ime_i_prezime+"&telefon="+telefon+"&mail_korisnika="+mail_korisnika+"&vrijeme="+vrijeme+"&vPoruka="+vPoruka, "kontaktFormular");
	}
//KRAJ - skripta za provjeru kontakt brokera


//skripta za provjeru i upis pitajte nas formular
function pitajte_nas(jezik){

var poruka="";
var ime_i_prezime=document.getElementById("ime_i_prezime").value;
var mail_korisnika=document.getElementById("mail_korisnika").value;
var vPoruka=document.getElementById("vPoruka").value;

ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=promijeni&mjesto=POSTAVITE_PITANJE&ime_i_prezime="+ime_i_prezime+"&mail_korisnika="+mail_korisnika+"&vPoruka="+vPoruka, "kontaktFormular");
	}
//KRAJ - skripta za provjeru pitajte nas formular




//akripta za anketu
function anketa(jezik,sto){
var glas=document.getElementById("anketa_odgovor").value;

if((glas=="") && (sto=='glasaj')) {
alert("Molimo Vas da odaberete jedan od odgovora.");	
	}else{
ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija="+ sto +"&mjesto=anketa&glas=" + glas, "anketaUnesi");
	}
	}
//kraj skripte za anketu


//kalkulator valuta

function kalkuliraj()
	{
	var tec_vri1=document.getElementById("tec1_vrijednost").value;
	var tec_vri2=document.getElementById("tec2_vrijednost").value;
	
	tec_vri1=tec_vri1.replace(',','.');
	var uk1=eval(tec_vri1);
	var uk2=eval(tec_vri1 * (vr1 / vr2));
	if(vr1==vr2)
	{
		document.getElementById("tec2_vrijednost").value=uk1.toFixed(2);
	}else{
		document.getElementById("tec2_vrijednost").value=uk2.toFixed(2);
		}
			}


//kraj kalkulaztora valuta

function HideKvartal(d) {
	document.getElementById(d).style.display = "none";
	document.getElementById(d).style.visibility = "hidden";
}
function HideKvartal_ponovo(d) {
	var string="<a href=javascript:ShowKvartal('"+d+"');>Otvori</a>";
	document.getElementById("open_"+d).innerHTML = string;
	document.getElementById(d).style.visibility = "hidden";
	document.getElementById(d).style.display = "none";
}

function ShowKvartal(d) {
	var string="<a href=javascript:HideKvartal_ponovo('"+d+"');>Zatvori</a>";
	document.getElementById("open_" + d).innerHTML = string;
	document.getElementById(d).style.visibility = "visible";
	document.getElementById(d).style.display = "block";
}

	
	
function prikaziUlagaca(d,t) {	
	
	if(t=="dokument"){
		if(d==0){
		document.getElementById("zakZast").style.display = "none";
		document.getElementById("zakZast").style.visibility = "hidden";
		//document.getElementById("punomoc").style.visibility = "none";
		//document.getElementById("punomoc").style.display = "hidden";
		/*document.getElementById("punomoc").style.visibility = "visible";
		document.getElementById("punomoc").style.display = "block";*/
		document.getElementById("vrstaDodatnog").value = ""; //punomoc
		
		
		for(var i = 1; i < 5; i++){

		document.getElementById("malodobne_form_"+i).style.display = "none";
		document.getElementById("malodobne_form_"+i).style.visibility = "hidden";
		
		}
		

		document.getElementById("identifikacijski_dokument").disabled = false;
		document.getElementById("identifikacijski_dokument_broj").disabled = false;
		document.getElementById("identifikacijski_dokument_izdavatelj").disabled = false;
		document.getElementById("identifikacijski_dokument_datum").disabled = false;
		document.getElementById("identifikacijski_dokument_broj").value=polje2;
		document.getElementById("identifikacijski_dokument_izdavatelj").value=polje3;
		document.getElementById("identifikacijski_dokument_datum").value=polje4;
		
                }else{
		
                document.getElementById("zakZast").style.visibility = "visible";
		document.getElementById("zakZast").style.display = "block";	
		//document.getElementById("punomoc").style.display = "none";
		//document.getElementById("punomoc").style.visibility = "hidden";
		document.getElementById("vrstaDodatnog").value = "zakZast";
		
		for(var i = 1; i < 5; i++){
		document.getElementById("malodobne_form_"+i).style.display = "block";
		document.getElementById("malodobne_form_"+i).style.visibility = "visible";
		}
		vrati_style("identifikacijski_dokument");
		vrati_style("identifikacijski_dokument_broj");
		vrati_style("identifikacijski_dokument_izdavatelj");
		vrati_style("identifikacijski_dokument_datum");

		document.getElementById("identifikacijski_dokument").disabled = true;
		document.getElementById("identifikacijski_dokument_broj").disabled = true;
		document.getElementById("identifikacijski_dokument_izdavatelj").disabled = true;
		document.getElementById("identifikacijski_dokument_datum").disabled = true;
		document.getElementById("identifikacijski_dokument_broj").value="";
		document.getElementById("identifikacijski_dokument_izdavatelj").value="";
		document.getElementById("identifikacijski_dokument_datum").value="";

		}
	}	

	if(t=="tvrtka"){
	/*	if(d==0){
		document.getElementById("zakZast").style.display = "none";
		document.getElementById("zakZast").style.visibility = "hidden";
		document.getElementById("punomoc").style.display = "visible";
		document.getElementById("punomoc").style.visibility = "block";				
		}else{
		document.getElementById("zakZast").style.visibility = "visible";
		document.getElementById("zakZast").style.display = "block";
		document.getElementById("punomoc").style.display = "none";
		document.getElementById("punomoc").style.visibility = "hidden";		
		}*/		
	}	
	
}




//crtanje grafova
function prikaziGrafickiPrikaz(jezik){
	var valuta=document.getElementById("valuta").value;
	var podaci=document.getElementById("start").value;
	window.location=root+jezik+"/fondovi/fondovi_1_5_0_1/|Otvoreni_fondovi|Grafi-ccki_prikaz_fondova|"+podaci+"|"+valuta;
	}
	
	function prikaziGrafickiPrikazMirovinski(jezik){
	var valuta=document.getElementById("valuta").value;
	var podaci=document.getElementById("start").value;
	window.location=root+jezik+"/fondovi/fondovi_0_0_0_0/||Grafi-ccki_prikaz_mirovinskih_fondova|"+podaci+"|"+valuta;
	}


var crtamInd=1;
var crtamGP=1;
var crtamodOsnutka=1;
var crtamMJ3=1;
var crtamMJ6=1;
var crtamMJ12=1;
var crtamOdabirRazdoblja=1;
var crtamOdabirDatuma=1;
var crtamOdabirFondova=1;
var crtamPIE1=1;
var crtamPIE2=1;
var crtamPIE3=1;
var crtamPIE4=1;
var crtamPIE5=1;

var crtamPIE1_0=1;
var crtamPIE2_0=1;
var crtamPIE3_0=1;
var crtamPIE4_0=1;
var crtamPIE5_0=1;
var crtamPIE1_1=1;
var crtamPIE2_1=1;
var crtamPIE3_1=1;
var crtamPIE4_1=1;
var crtamPIE5_1=1;
var crtamPIE1_2=1;
var crtamPIE2_2=1;
var crtamPIE3_2=1;
var crtamPIE4_2=1;
var crtamPIE5_2=1;
var crtamPIE1_3=1;
var crtamPIE2_3=1;
var crtamPIE3_3=1;
var crtamPIE4_3=1;
var crtamPIE5_3=1;

var crtamPIE1_1=1;
var crtamPIE2_1=1;
var crtamPIE3_1=1;
var crtamPIE4_1=1;
var crtamPIE5_1=1;
var crtamPIE6_1=1;
var crtamPIE7_1=1;
var crtamPIE8_1=1;
var crtamPIE9_1=1;


function FC_Rendered(DOMId){
		//alert(DOMId);
		//indexi
		if (DOMId=="chart50"&&crtamInd==1){
			crtamInd=0;
			prikaziGraphIndexi();
			return;
		}
				
		//graficki prikaz
		if ((DOMId=="grafickiPrikaz")&&(crtamGP==1)){
			crtamGP=0;
			traziGraf(DOMId);
			return;
		}
		
		if (DOMId=="odOsnutka"&&crtamodOsnutka==1){
			//crtamodOsnutka=0;
			OtvoriGrafodOsnutka(odOsnutka_start,odOsnutka_end);
			return;
		}
		
				
		if (DOMId=="mj3"&&crtamMJ3==1){
			//crtamMJ3=0;
			OtvoriGrafMali("mj3",tri_start,tri_end);
			return;
		}
		if (DOMId=="mj6"&&crtamMJ6==1){
			//crtamMJ6=0;
			OtvoriGrafMali("mj6",sest_start,sest_end);
			return;
		}
		if (DOMId=="mj12"&&crtamMJ12==1){
			//crtamMJ12=0;
			OtvoriGrafMali("mj12",dvanaest_start,dvanaest_end);
			return;
		}
		if (DOMId=="odabirRazdoblja"&&crtamOdabirRazdoblja==1){
			//crtamOdabirRazdoblja=0;
			
			OtvoriGrafodabirRazdoblja('2');
			return;
		}
		if (DOMId=="odabirRazdobljaM"&&crtamOdabirRazdoblja==1){
			//crtamOdabirRazdoblja=0;
			
			OtvoriGrafodabirRazdobljaM('2');
			return;
		}
		if (DOMId=="odabirDatuma"&&crtamOdabirDatuma==1){
			//crtamOdabirDatuma=0;
			OtvoriGrafodabirDatuma();
			return;
		}
		
		if (DOMId=="odabirDatumaM"&&crtamOdabirDatuma==1){
			//crtamOdabirDatuma=0;
			OtvoriGrafodabirDatumaM();
			return;
		}
		if (DOMId=="odabirFondovaM"&&crtamOdabirFondova==1){
			//crtamOdabirDatuma=0;
			OtvoriGrafodabirFondovaM();
			return;
		}
		if (DOMId=="odOsnutkaM"&&crtamodOsnutka==1){
			//crtamodOsnutka=0;
			OtvoriGrafodOsnutkaM(odOsnutka_start,odOsnutka_end);
			return;
		}
		
		if (DOMId=="odabirFondova"&&crtamOdabirFondova==1){
			//crtamOdabirDatuma=0;
			OtvoriGrafodabirFondova();
			return;
		}
		
		if (DOMId=="grafPIE_pogledaj1" && crtamPIE1==1){
			//crtamPIE1=0;
			otvoriPie(1,'');
		}
		if (DOMId=="grafPIE_pogledaj2" && crtamPIE2==1){
			//crtamPIE2=0;
			otvoriPie(2,'');
		}
		if (DOMId=="grafPIE_pogledaj3" && crtamPIE3==1){
			//crtamPIE3=0;
			otvoriPie(3,'');
		}
		if (DOMId=="grafPIE_pogledaj4" && crtamPIE4==1){
			//crtamPIE4=0;
			otvoriPie(4,'');
		}
		if (DOMId=="grafPIE_pogledaj5" && crtamPIE5==1){
			//crtamPIE4=0;
			otvoriPie(5,'');
		}
		
		if (DOMId=="ulagaci_grafPIE_pogledaj1" && crtamPIE1_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(1,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj2" && crtamPIE2_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(2,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj3" && crtamPIE3_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(3,'');
		}
		
		if (DOMId=="ulagaci_grafPIE_pogledaj4" && crtamPIE4_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(4,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj5" && crtamPIE5_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(5,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj6" && crtamPIE6_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(6,'');
		}
		
		
		if (DOMId=="ulagaci_grafPIE_pogledaj7" && crtamPIE7_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(7,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj8" && crtamPIE8_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(8,'');
		}
		if (DOMId=="ulagaci_grafPIE_pogledaj9" && crtamPIE9_1==1){
			//crtamPIE1=0;
			otvoriPieUlagaci(9,'');
		}
		
		
		
		
		
		if (DOMId=="grafPIE_pogledaj1_0" && crtamPIE1_0==1){
			//crtamPIE1=0;
			otvoriPie('1_0','');
		}
		if (DOMId=="grafPIE_pogledaj2_0" && crtamPIE2_0==1){
			//crtamPIE2=0;
			otvoriPie('2_0','');
		}
		if (DOMId=="grafPIE_pogledaj3_0" && crtamPIE3_0==1){
			//crtamPIE3=0;
			otvoriPie('3_0','');
		}
		if (DOMId=="grafPIE_pogledaj4_0" && crtamPIE4_0==1){
			//crtamPIE4=0;
			otvoriPie('4_0','');
		}
		if (DOMId=="grafPIE_pogledaj5_0" && crtamPIE5_0==1){
			//crtamPIE4=0;
			otvoriPie('5_0','');
		}
		
		if (DOMId=="grafPIE_pogledaj1_1" && crtamPIE1_1==1){
			//crtamPIE1=0;
			otvoriPie('1_1','');
		}
		if (DOMId=="grafPIE_pogledaj2_1" && crtamPIE2_1==1){
			//crtamPIE2=0;
			otvoriPie('2_1','');
		}
		if (DOMId=="grafPIE_pogledaj3_1" && crtamPIE3_1==1){
			//crtamPIE3=0;
			otvoriPie('3_1','');
		}
		if (DOMId=="grafPIE_pogledaj4_1" && crtamPIE4_1==1){
			//crtamPIE4=0;
			otvoriPie('4_1','');
		}
		if (DOMId=="grafPIE_pogledaj5_1" && crtamPIE5_1==1){
			//crtamPIE4=0;
			otvoriPie('5_1','');
		}
		
		if (DOMId=="grafPIE_pogledaj1_2" && crtamPIE1_2==1){
			//crtamPIE1=0;
			otvoriPie('1_2','');
		}
		if (DOMId=="grafPIE_pogledaj2_2" && crtamPIE2_2==1){
			//crtamPIE2=0;
			otvoriPie('2_2','');
		}
		if (DOMId=="grafPIE_pogledaj3_2" && crtamPIE3_2==1){
			//crtamPIE3=0;
			otvoriPie('3_2','');
		}
		if (DOMId=="grafPIE_pogledaj4_2" && crtamPIE4_2==1){
			//crtamPIE4=0;
			otvoriPie('4_2','');
		}
		
		if (DOMId=="grafPIE_pogledaj5_2" && crtamPIE5_2==1){
			//crtamPIE4=0;
			otvoriPie('5_2','');
		}
		
		if (DOMId=="grafPIE_pogledaj1_3" && crtamPIE1_3==1){
			//crtamPIE1=0;
			otvoriPie('1_3','');
		}
		if (DOMId=="grafPIE_pogledaj2_3" && crtamPIE2_3==1){
			//crtamPIE2=0;
			otvoriPie('2_3','');
		}
		if (DOMId=="grafPIE_pogledaj3_3" && crtamPIE3_3==1){
			//crtamPIE3=0;
			otvoriPie('3_3','');
		}
		if (DOMId=="grafPIE_pogledaj4_3" && crtamPIE4_3==1){
			//crtamPIE4=0;
			otvoriPie('4_3','');
		}
		if (DOMId=="grafPIE_pogledaj5_3" && crtamPIE5_3==1){
			//crtamPIE4=0;
			otvoriPie('5_3','');
		}
		
	}
	
	
	
//indexi

	function PromjeniGrafIndexa(koji){
		var opcijaDatum=document.getElementById("vrijemeIndex").value=koji;
		for(i=1;i<=8;i++){
			if(i==koji){
			document.getElementById("index_"+i).style.color="#9e0101";
			document.getElementById("index_"+i).style.fontWeight="bold";
			}else{
			document.getElementById("index_"+i).style.color="";
			document.getElementById("index_"+i).style.fontWeight="normal";
				}
		}
	    prikaziGraphIndexi();
}


	function promjeniGraf(koji){
		var opcijaDatum=document.getElementById("vrijemeIndex").value="2";
		var indexFond=document.getElementById("fondIndex").value=koji;
		PromjeniGrafIndexa(opcijaDatum);
	    //prikaziGraphIndexi();
}
//kraj grafova za indexe

//kod za iscrtavanje grafickog prikaza
	function OtvoriGrafickiPrikaz(valuta,start,end){
	var url=root + "grafovi/fond_graph_xml_usporedba.php?valuta=" + valuta + "&start=" + start +"&end=" + end;
	var chartObj = getChartFromId("grafickiPrikaz");
	chartObj.setDataURL(url);
	}
	
	function OtvoriGrafickiPrikazMirovinski(valuta,start,end){
	var url=root + "grafovi/fond_graph_xml_usporedba_mirovinski.php?valuta=" + valuta + "&start=" + start +"&end=" + end;
	var chartObj = getChartFromId("grafickiPrikaz");
	chartObj.setDataURL(url);
	}
//kraj koda za iscrtavanje grafickog prikaza

	
	
	function OtvoriGrafodOsnutka(ulazni_datum,izlazni_datum){
		
		var url=root + "grafovi/fondAndIndexGraphXml.php?graphBg=bg_od_osnutka&fondid="+idFonda+"&indexid="+indexid+"&start="+ulazni_datum+"&showmax=0&end="+izlazni_datum;
	var chartObj = getChartFromId("odOsnutka");
	chartObj.setDataURL(url);
	}
	
		function OtvoriGrafodOsnutkaM(ulazni_datum,izlazni_datum){
		
		var url=root + "grafovi/fondAndIndexGraphXmlMirovinski.php?graphBg=bg_od_osnutka&fondid="+idFonda+"&indexid="+indexid+"&start="+ulazni_datum+"&showmax=0&end="+izlazni_datum;
		//alert(url);
	var chartObj = getChartFromId("odOsnutkaM");
	chartObj.setDataURL(url);
	}
	
	
	
	function OtvoriGrafodabirRazdoblja(odabir){
		document.getElementById("izbornik_odabrano").value=odabir;
		
		for(i=1;i<=9;i++){
			
			if(i==odabir){
				
				document.getElementById("raz_"+i).style.color="#000000";
				document.getElementById("raz_"+i).style.fontWeight="normal";
				}else{
				document.getElementById("raz_"+i).style.color="#ffffff";
				document.getElementById("raz_"+i).style.fontWeight="normal";	
					
					}
			
			}
		
		
		var vrijeme=document.getElementById("izbornikMjeseci_"+odabir).value;
		var razdoblje=vrijeme.split("|");
		var koliko="&start="+ razdoblje[0]+"&end="+razdoblje[1];
		var url=root + "grafovi/fondAndIndexGraphXml.php?graphBg=bg_odabirRazdoblja&fondid="+idFonda+"&indexid="+indexid+koliko;
		var chartObj = getChartFromId("odabirRazdoblja");
		chartObj.setDataURL(url);
		
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunaj.php?nacin=1&fondID="+idFonda + koliko;
		//alert(url+"\n"+urlP);
		
		document.getElementById("posto1").value=ajaxpage(urlP,"posto1");
		
	}
	
	function OtvoriGrafodabirRazdobljaM(odabir){
		document.getElementById("izbornik_odabrano").value=odabir;
		
		for(i=1;i<=9;i++){
			
			if(i==odabir){
				
				document.getElementById("raz_"+i).style.color="#000000";
				document.getElementById("raz_"+i).style.fontWeight="normal";
				}else{
				document.getElementById("raz_"+i).style.color="#ffffff";
				document.getElementById("raz_"+i).style.fontWeight="normal";	
					
					}
			
			}
		
		
		var vrijeme=document.getElementById("izbornikMjeseci_"+odabir).value;
		var razdoblje=vrijeme.split("|");
		var koliko="&start="+ razdoblje[0]+"&end="+razdoblje[1];
		var url=root + "grafovi/fondAndIndexGraphXmlMirovinski.php?graphBg=bg_odabirRazdoblja&fondid="+idFonda+"&indexid="+indexid+koliko;
		var chartObj = getChartFromId("odabirRazdobljaM");
		chartObj.setDataURL(url);
		
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunajM.php?nacin=1&fondID="+idFonda + koliko;
		//alert(url+"\n"+urlP);
		
		document.getElementById("posto1").value=ajaxpage(urlP,"posto1");
		
	}
	
	function OtvoriGrafodabirDatuma(){
		
		var ulazni=document.getElementById("godina1").value + "-" + document.getElementById("mjesec1").value + "-" + document.getElementById("dan1").value;
		var izlazni=document.getElementById("godina2").value + "-" + document.getElementById("mjesec2").value + "-" + document.getElementById("dan2").value;
					
		var koliko="&start="+ ulazni+"&end="+izlazni;
		var url=root + "grafovi/fondAndIndexGraphXml.php?graphBg=bg_odabirDatuma&fondid="+idFonda+"&indexid="+indexid+koliko;
		var chartObj = getChartFromId("odabirDatuma");
	chartObj.setDataURL(url);
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunaj.php?nacin=2&fondID="+idFonda + koliko;
	
		document.getElementById("posto2").value=ajaxpage(urlP,"posto2");
		
		
	}
	
	
	function OtvoriGrafodabirDatumaM(){
		
		var ulazni=document.getElementById("godina1").value + "-" + document.getElementById("mjesec1").value + "-" + document.getElementById("dan1").value;
		var izlazni=document.getElementById("godina2").value + "-" + document.getElementById("mjesec2").value + "-" + document.getElementById("dan2").value;
					
		var koliko="&start="+ ulazni+"&end="+izlazni;
		var url=root + "grafovi/fondAndIndexGraphXmlMirovinski.php?graphBg=bg_odabirDatuma&fondid="+idFonda+"&indexid="+indexid+koliko;
		var chartObj = getChartFromId("odabirDatumaM");
	chartObj.setDataURL(url);
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunajM.php?nacin=2&fondID="+idFonda + koliko;
		document.getElementById("posto2").value=ajaxpage(urlP,"posto2");
	}
	
	
	
	function OtvoriGrafodabirFondova(){
		
		var ulazni=document.getElementById("godina12").value + "-" + document.getElementById("mjesec12").value + "-" + document.getElementById("dan12").value;
		var izlazni=document.getElementById("godina22").value + "-" + document.getElementById("mjesec22").value + "-" + document.getElementById("dan22").value;
		
		
		var fondID=new Array();
		fondID[1]=document.getElementById("fond1").value;
		fondID[2]=document.getElementById("fond2").value;
		fondID[3]=document.getElementById("fond3").value;
		id="";
		for(fondBrs in fondID){
			id=id + fondID[fondBrs] + ",";
		}
		idFonda2=idFonda + "," + id;
					
		var koliko="&start="+ ulazni+"&end="+izlazni;
		var url=root + "grafovi/fondAndIndexGraphXml.php?graphBg=bg_odabirFondova&fondid="+idFonda2+"&indexid="+indexid+koliko;
		var chartObj = getChartFromId("odabirFondova");
	chartObj.setDataURL(url);
		
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunaj.php?nacin=3&fondID="+idFonda2 + koliko;
		//alert(urlP);
		document.getElementById("posto3").value=ajaxpage(urlP,"posto3");
	}
	

function OtvoriGrafodabirFondovaM(){
		
		var ulazni=document.getElementById("godina12").value + "-" + document.getElementById("mjesec12").value + "-" + document.getElementById("dan12").value;
		var izlazni=document.getElementById("godina22").value + "-" + document.getElementById("mjesec22").value + "-" + document.getElementById("dan22").value;
		
		
		var fondID=new Array();
		fondID[1]=document.getElementById("fond1").value;
		fondID[2]=document.getElementById("fond2").value;
		fondID[3]=document.getElementById("fond3").value;
		id="";
		for(fondBrs in fondID){
			id=id + fondID[fondBrs] + ",";
		}
		idFonda2=idFonda + "," + id;
					
		var koliko="&start="+ ulazni+"&end="+izlazni;
		var url=root + "grafovi/fondAndIndexGraphXmlMirovinski.php?graphBg=bg_odabirFondova&fondid="+idFonda2+"&indexid="+indexid+koliko;
		//alert(url);
		var chartObj = getChartFromId("odabirFondovaM");
	chartObj.setDataURL(url);
		
		var urlP=root + "site_module/"+jezik+"/fondovi/modules/fond_racunajM.php?nacin=3&fondID="+idFonda2 + koliko;
		//alert(urlP);
		document.getElementById("posto3").value=ajaxpage(urlP,"posto3");
	}
	
	
	function OtvoriGrafMali(koji_div,ulazni_datum,izlazni_datum){
	
		var indexid="";
		var url=root + "grafovi/fondAndIndexGraphXml.php?graphBg=bg_"+koji_div+"&fondid="+idFonda+"&indexid="+indexid+"&start="+ulazni_datum+"&showmax=0&end="+izlazni_datum;
	var chartObj = getChartFromId(koji_div);
	chartObj.setDataURL(url);
		
	}

		function otvoriPie(kojiLayer,aktivan){
		
			var  file=document.getElementById("fileID_"+kojiLayer).value;
			var  podrucjeID=document.getElementById("podrucjeID_"+kojiLayer).value;
			var  bojaID=document.getElementById("bojaID_"+kojiLayer).value;
			var  kojaPutanja=document.getElementById("kojaPutanja_"+kojiLayer).value;
			var url=root+"grafovi/pie_id_fondova.php?kojaPutanja="+kojaPutanja+"&fileID="+file+"&podrucjeID="+podrucjeID+"&bojaID="+bojaID+"&aktivanID="+aktivan;
			//alert(url);
			var chartObj = getChartFromId("grafPIE_pogledaj"+kojiLayer);
			chartObj.setDataURL(url);
			return;
		
		}
		
		function otvoriPieUlagaci(kojiLayer,aktivan){
		
			var  file=document.getElementById("ulagaci_fileID_"+kojiLayer).value;
			var  podrucjeID=document.getElementById("ulagaci_podrucjeID_"+kojiLayer).value;
			var  bojaID=document.getElementById("ulagaci_bojaID_"+kojiLayer).value;
			var url=root+"grafovi/ulagaci.php?fileID="+file+"&podrucjeID="+podrucjeID+"&bojaID="+bojaID+"&aktivanID="+aktivan;
			//alert(url);
			var chartObj = getChartFromId("ulagaci_grafPIE_pogledaj"+kojiLayer);
			chartObj.setDataURL(url);
			return;
		
		}
//kraj koda za iscrtavanje grafickog prikaza




//funkcija za prikaz indexa po razdoblju i indexu
function prikaziGraphIndexi(){

	var opcijaDatum=document.getElementById("vrijemeIndex").value;
	document.getElementById("index_"+opcijaDatum).style.color="#9e0101";
	document.getElementById("index_"+opcijaDatum).style.fontWeight="bold";
	var indexFond=document.getElementById("fondIndex").value;
	var oduzmi=new Array("","7","30","91","182","365","730","1100");
	//alert (opcijaDatum+"/"+datum_za_grafove(oduzmi[opcijaDatum]) );
	
	if(opcijaDatum!=8){
	var url=root + "grafovi/index_graph_xml.php?graphBg=indexi_"+pozadina_grafa_indexa+"&fondid=" + indexFond + "&start=" + datum_za_grafove(oduzmi[opcijaDatum]) + "&end=" + datum_za_grafove('0');
	}else{
	var url=root + "grafovi/index_graph_xml.php?graphBg=indexi_"+pozadina_grafa_indexa+"&fondid=" + indexFond + "&start=&end=";	
		}
	//alert(url);
	var chartObj = getChartFromId("chart50");
	chartObj.setDataURL(url);
	return;
}
//kraj crtanja grafova




function datum_za_grafove(kolikoDana){
	var jedan_dan=1000*60*60*24;
	var mjeseci=new Array();
	mjeseci[0]="12";	
	for(mej=0;mej<=11;mej++){
	 mjeseci[mej]=mej;
				 }
	var datum= new Date();				 
	var zadnji_datum=new Date(datum.getFullYear(),(mjeseci[datum.getMonth()]),datum.getDate());			 
				 
	var preracunaj=new Date(zadnji_datum-(kolikoDana*jedan_dan));
	var dan=preracunaj.getDate();
	if((dan<10)){ dan="0"+dan; }
	var mjesec=mjeseci[preracunaj.getMonth()]+1;
	if(mjesec<10){ mjesec="0"+mjesec; }
		if(mjesec=="12"){ 
			var godina=(preracunaj.getFullYear()); 
		}else{ 
			var godina=preracunaj.getFullYear(); 
		}
	//alert (preracunaj.getFullYear());	
	var datumi=godina+"-"+mjesec+"-"+dan;
	return datumi; 
	}

//odabir linka kod dionica
function odabPozadinuDionice(koji,burza){
	document.getElementById("odab").value=koji;	
	var polja=new Array("","Up","Down","Promet");

	for(i=1;i<=3;i++){
		
		if("odab"+i==koji)
			{
			document.getElementById(koji).className= polja[i] + "_dionice_top_10_Over";
			ajaxpage( root + "site_module/"+ jezik +"/dionice/sites/open_top_10.php?burza="+ burza +"&koje="+ polja[i] , "izlistajTOP");
			}else{
			document.getElementById("odab"+i).className= polja[i] + "_dionice_top_10_out";
			
				}
		}
	}
	

function promPozadinuDioniceOver(koji,kako){
	document.getElementById(koji).className= kako + "_dionice_top_10_Over";
	}
	
function promPozadinuDioniceOut(koji,kako){
	var koja=document.getElementById("odab").value; 
		if(koji==koja){
		document.getElementById(koji).className= kako + "_dionice_top_10_Over";
		}else{
		document.getElementById(koji).className= kako + "_dionice_top_10_out";			
			}
	}	
//kraj odabira linka kod dionica


//ostale skripte
function neispunjeno_polje(koje){
			document.getElementById(koje).style.backgroundColor="#fcd5d5";
			document.getElementById(koje).style.borderColor="#7d271a";
			document.getElementById(koje).style.backgroundImage="url('"+root+"images/nepromjenjivo/_no_accept.gif')";
			document.getElementById(koje).style.backgroundRepeat="no-repeat";
			document.getElementById(koje).style.backgroundPosition = "center right";	
	}
	
	
function ispunjeno_polje(koje){
			document.getElementById(koje).style.backgroundColor="#ffffff";
			document.getElementById(koje).style.borderColor="#2c9a60";
			document.getElementById(koje).style.backgroundImage="url('"+root+"images/nepromjenjivo/_accept.gif')";
			document.getElementById(koje).style.backgroundRepeat="no-repeat";
			document.getElementById(koje).style.backgroundPosition = "center right";	
	}	
	
	
	
function prazno_polje(koje){
	vrati_style(koje);
	}		
	
	
	
function vrati_style(koje){
			document.getElementById(koje).style.backgroundColor="";
			document.getElementById(koje).style.borderColor="";
			document.getElementById(koje).style.backgroundImage="";
			document.getElementById(koje).style.backgroundRepeat="";
			document.getElementById(koje).style.backgroundPosition = "";
			document.getElementById(koje).className = "inputPristup";
	}		
	

function jumpScroll(left,top) {
	window.scroll(left,top); // horizontal and vertical scroll targets
}


function kreirajCookie(name,value,days) {
	if (days) {
		var datum = new Date();
		datum.setTime(datum.getTime()+(days*24*60*60*1000));
		var istekKukija = "; expires="+datum.toGMTString();
	}
	else var istekKukija = "";
	document.cookie = name+"="+value+istekKukija+"; path=/";
}

function citajCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

	function brisiCookie(name) {
		kreirajCookie(name,"",-1);
	}








//polja: 0=nista, 1=provjeri dva polja(barem jedno mora biti upisano) 2=usporedi dva polja
	function ispunjenoPolje(polje,polje2,polja,duzina,brojevi,cistiBrojevi){
	var greska="";	
	var vrijednostPolja=document.getElementById(polje).value;
	
			
			
			
			switch(polja){
				
				case "0":
					if(vrijednostPoljaFUNC(polje,duzina,brojevi,cistiBrojevi)!="") { 
						greska+=1; 
						neispunjeno_polje(polje);
					}else{
						ispunjeno_polje(polje); 
					}
				break;
				
				case "1":
				var vrijednostPolja2=document.getElementById(polje2).value;
				
					if((vrijednostPoljaFUNC(polje,duzina,brojevi,cistiBrojevi)!="")&&(vrijednostPoljaFUNC(polje2,duzina,brojevi,cistiBrojevi)!="")) { 
						greska+=1; 
						neispunjeno_polje(polje);
						neispunjeno_polje(polje2);
					}else{
						
						if(vrijednostPolja=="") { 
							vrati_style(polje);
							ispunjeno_polje(polje2);
						}	
						if(vrijednostPolja2=="") { 
							vrati_style(polje2); 
							ispunjeno_polje(polje);
							}	
						if((vrijednostPolja!="")&&(vrijednostPolja2!="")){
							ispunjeno_polje(polje);
							ispunjeno_polje(polje2);
							}
					}
				break;
				
				
				case "2":
					var vrijednostPolja2=document.getElementById(polje2).value;
						if(vrijednostPolja!=vrijednostPolja2) { 
						greska+=1;
						neispunjeno_polje(polje2);
					}else{
						ispunjeno_polje(polje2);	
					}
				break;
				
				
				}	
	
	return greska;	
		}



function vrijednostPoljaFUNC(polje,duzina,brojevi,cistiBrojevi){
var greska="";
var vrijednostPolja=document.getElementById(polje).value;	
	
		switch(polje){
			
			
						
			case "email":
				if(provjeriMail(vrijednostPolja)=="1"){ 
				greska+="1"; 
				}
				
			break;
			
			default:
			
				switch(brojevi){
					
					case "1":
					
											
						switch(duzina){
								case "0":
								
								if(vrijednostPolja==""){
									greska+="1";
									}else{
								
								
								
											if(cistiBrojevi==0){
											
												if(vrijednostPolja.indexOf(".")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\./g, "");	
												}
												if(vrijednostPolja.indexOf(",")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\,/g, "");	
												}
												
												if(vrijednostPolja.indexOf(" ")!= -1){
												vrijednostPolja=vrijednostPolja.replace(/ /g, "");
												}
												
												if(isNaN(vrijednostPolja)==true) { greska+="1"; }
											}
											
											if(cistiBrojevi==2){
												
												if(vrijednostPolja.indexOf(".")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\./g, "");	
												}
												if(vrijednostPolja.indexOf(",")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\,/g, "");	
												}
												if(vrijednostPolja.indexOf("+")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\+/g, "");	
												}
												
												if(vrijednostPolja.indexOf(" ")!= -1){
												vrijednostPolja=vrijednostPolja.replace(/\s+/g, '0');
												
												}
												if(vrijednostPolja.indexOf("(")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\(/g, "");	
												}
												if(vrijednostPolja.indexOf(")")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\)/g, "");	
												}
												if(vrijednostPolja.indexOf("-")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\-/g, "");	
												}
												if(vrijednostPolja.indexOf("/")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\//g, "");	
												}
												
												
												if((isNaN(vrijednostPolja)==true)&&(vrijednostPolja!="")) { greska+="1"; }
												
											}
											if(cistiBrojevi!=2 && cistiBrojevi!=0){
												if(isNaN(vrijednostPolja)==true) { greska+="1"; }
											}
											
											
									}
									
								break;
								
								
								
								default:
								
								if(vrijednostPolja.length < duzina){
									greska+="1";
									//alert(vrijednostPolja.length);
									}else{
								
								
								
											if(cistiBrojevi==0){
											
												if(vrijednostPolja.indexOf(".")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\./g, "");	
												}
												if(vrijednostPolja.indexOf(",")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\,/g, "");	
												}
												
												if(vrijednostPolja.indexOf(" ")!= -1){
												vrijednostPolja=vrijednostPolja.replace(/ /g, "");
												}
												
												if(isNaN(vrijednostPolja)==true) { greska+="1"; }
											}
											
											
											if(cistiBrojevi==2){
												
												if(vrijednostPolja.indexOf(".")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\./g, "");	
												}
												if(vrijednostPolja.indexOf(",")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\,/g, "");	
												}
												if(vrijednostPolja.indexOf("+")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\+/g, "");	
												}
												
												if(vrijednostPolja.indexOf(" ")!= -1){
												vrijednostPolja=vrijednostPolja.replace(/\s+/g, '0');												
												}
												
												if(vrijednostPolja.indexOf("(")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\(/g, "");	
												}
												
												if(vrijednostPolja.indexOf(")")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\)/g, "");	
												}
												
												if(vrijednostPolja.indexOf("-")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\-/g, "");	
												}
												if(vrijednostPolja.indexOf("/")!= -1){
													vrijednostPolja=vrijednostPolja.replace(/\//g, "");	
												}
												
												if((isNaN(vrijednostPolja)==true)&&(vrijednostPolja!="")) { greska+="1"; }
												
											}
											if(cistiBrojevi!=2 && cistiBrojevi!=0){
												if(isNaN(vrijednostPolja)==true) { greska+="1"; }
											}
											
											
									}
									
								break;
						}
						
					break;
					
					default:
					
							switch(duzina){
								case "0":
								
									if(vrijednostPolja=="") {
										greska+="1";
										
									}
									
								break;
								
								default:
									if(vrijednostPolja.length < duzina) {
										greska+="1";
										}
								
								break;
								
								
								
								}
					break;
					
					}
			
			
			break;
			
			}

return greska;

	}

function korespodencijaFUNC(br){
	
	switch (br){
		
		case "0":
		document.getElementById("korespodencija_ulica").value=document.getElementById("ulica").value;
		document.getElementById("korespodencija_kbr").value=document.getElementById("kbr").value;
		document.getElementById("korespodencija_pbr").value=document.getElementById("pbr").value;
		document.getElementById("korespodencija_mjesto").value=document.getElementById("mjesto").value;
		document.getElementById("korespodencija_drzava").value=document.getElementById("drzava").value;
		break;
		
		default:
		
		document.getElementById("korespodencija_ulica").value="";
		document.getElementById("korespodencija_kbr").value="";
		document.getElementById("korespodencija_pbr").value="";
		document.getElementById("korespodencija_mjesto").value="";
		document.getElementById("korespodencija_drzava").value="";
		
		break;
		
		}
	
	}

function provjeriMail(email) {
	
	var monky = email.indexOf("@");
	var poslijeMonkey = email.substring((monky + 1), email.length);
	var tockaPoslijeMonkey = poslijeMonkey.indexOf(".");
		
	
	if ((monky != -1)&&(email.length > 5)&&(poslijeMonkey.length > 3)&&(tockaPoslijeMonkey != -1) ) {
		 return "0";
		
	} else {
			//greška
			return "1";
	}
}



//Izraeun moje imovina

function promijeniTekst(koji){

if(koji=="uplata") {
tekst1="kupnje";
tekst3="uplate";
tekst2="kupljenih";
}
if(koji=="isplata") {
tekst1="prodaje";
tekst3="isplate";
tekst2="prodanih";
}

document.getElementById('te1').innerHTML=tekst1;
document.getElementById('te2').innerHTML=tekst2;
document.getElementById('te3').innerHTML=tekst3;

}

function prikaziSakrijTransakcije(kako,idijevi){
	var skriveno=new Array("hidden","visible");	
	var blok=new Array("none","block");	
	var fondovi=idijevi.split("|");
	//var fond="";
	for( var i in fondovi ){
			if(fondovi[i]!=""){
			transakcije(fondovi[i],kako);
			//fond+=kako+"|"+fondovi[i]+"\n";
			}
		}
		
		//alert(fond);
	}



function transakcije(id,sto){
	
	switch(sto){
		
		case "0":
		document.getElementById("transakcija_"+id).style.display = "none";
		document.getElementById("transakcija_"+id).style.visibility = "hidden";
		document.getElementById("trans_"+id).innerHTML='<a href=javascript:transakcije("'+id+'","1") class="prikaziSakrij">Prikaži</a>';
		break;
		
		case "1":
		document.getElementById("transakcija_"+id).style.display = "block";
		document.getElementById("transakcija_"+id).style.visibility = "visible";
		document.getElementById("trans_"+id).innerHTML='<a href=javascript:transakcije("'+id+'","0") class="prikaziSakrij">Sakrij</a>';
		break;
		
		}
	
	}
//ukupanPortfelj

function prikaziTransakcije(){
var vrij=document.getElementById("vrij").value; 
var transakcije=document.getElementById("ukTransakcije").value;
var zaradaKn=document.getElementById("ukZaradakn").value;
var zaradaPosto=document.getElementById("ukZaradaposto").value;
var imovinaKn=document.getElementById("ukImovina_kn").value;
var imovinaEuro=document.getElementById("ukImovina_eur").value;
var imovinaDolar=document.getElementById("ukImovina_dol").value;
var VaR_kn_ukupno=document.getElementById("VaR_kn").value;
var VaR_posto_ukupno=document.getElementById("VaR_posto").value;


	if(vrij=="down"){
	var slika='<img src="'+root+'images/nepromjenjivo/strelice/down.png">';
	var f1='<font color="red">';
	var f2='</font>';
	}
	
	if(vrij=="up"){
	var slika='<img src="'+root+'images/nepromjenjivo/strelice/up.png">';
	var f1='<font color="green">+';
	var f2='</font>';
	}
	if(vrij=="stand"){
	var slika='<img src="'+root+'images/nepromjenjivo/strelice/stand.png">';
	var f1='';
	var f2='';
	}



document.getElementById("ukupna_zarada_kn").innerHTML=f1 + zaradaKn + "" + f2;
document.getElementById("ukupna_VaR").innerHTML=VaR_kn_ukupno + " kn";
document.getElementById("ukupna_VaR_posto").innerHTML=VaR_posto_ukupno + " %";
document.getElementById("ukupna_zarada_posto").innerHTML=f1 + zaradaPosto + "" + f2;
document.getElementById("ukupna_transakcija").innerHTML=transakcije;
document.getElementById("ukupna_zarada_slicica").innerHTML=slika;
document.getElementById("ukupna_imovina_kn").innerHTML=imovinaKn + " kn";
document.getElementById("ukupna_imovina_eur").innerHTML=imovinaEuro + " €";
document.getElementById("ukupna_imovina_dol").innerHTML=imovinaDolar + " $";
prikaziImovinu('kn');	
	}
	
function prikaziImovinu(valuta){

var valute= new Array("kn","eur","dol");
var v= new Array("kn","€","$");
var linkovi="";

	for(var i in valute){
		if(valute[i]==valuta){
			linkovi+="<b>"+v[i]+"</b> | ";
			document.getElementById("ukupna_imovina_"+valuta).style.visibility="visible";
			document.getElementById("ukupna_imovina_"+valuta).style.display="block";
		}else{
			linkovi+="<a href=javascript:prikaziImovinu('"+valute[i]+"')><b>"+v[i]+"</b></a> | ";
			document.getElementById("ukupna_imovina_"+valute[i]).style.visibility="hidden";
			document.getElementById("ukupna_imovina_"+valute[i]).style.display="none";
			}	
		}

	document.getElementById("prikaziValute").innerHTML="&nbsp;&nbsp;&nbsp;"+linkovi;
	}	
	
/*function prikaziTransakcije(transakcije,imovina,zaradaKN,zaradaPosto,eur,dol){
	
var url="&imovina="+imovina+"&transakcije="+transakcije+"&zaradaKN="+zaradaKN+"&zaradaPosto="+zaradaPosto+"&euro="+eur+"&dolar="+dol;
ajaxpage( root + "site_module/"+ jezik +"/fondovi/modules/ajax_updates.php?akcija=otvori&mjesto=ukupanPortfelj"+url, "ukupanPortfelj");
	
	}*/
	
	
function brisiTransakciju(id,idPolja,form){
  var forma=form+idPolja;
  document.getElementById(forma).action.value="brisi"; 
  document.getElementById(forma).transakcijaID.value=id; 
  if(confirm("Jeste li sigurni da želite obrisati odabranu transakciju")){
  document.getElementById(forma).submit();
  }
}	

function promijeniTransakciju(id,idPolja,form){
  var forma=form+idPolja;
  document.getElementById(forma).action.value="promijeni"; 
  document.getElementById(forma).transakcijaID.value=id; 
  if(confirm("Jeste li sigurni da želite promijeniti odabranu transakciju")){
  document.getElementById(forma).submit();
  }
}	


function provjeriUnosImovine(){
	var poruka="";
	var now = new Date();

//if(document.getElementById("formular").action.value=="") document.getElementById("formular").action.value="uplata";
var nacinTransakcije=document.getElementById("formular").transakcija.value;
var fond=document.getElementById("formular").fonda.value;
var udjeli=document.getElementById("formular").brUdjela.value;
var uplata=document.getElementById("formular").iznosUplate.value;
var dana=document.getElementById("formular").dan.value;
var mjeseci=document.getElementById("formular").mjesec.value;
var godine=document.getElementById("formular").godina.value;

 if(fond=="") poruka+="Molimo Vas da odaberete fond\n";
 if((dana=="" || mjeseci=="" || godine=="") || (dana=="dd" || mjeseci=="mm" || godine=="gggg")) poruka+="Molimo Vas da unesete ispravan datum\n";
 if(mjeseci>12) poruka+="Neispravan unos mjeseci (maksimalno 12 mj)\n";
 if(godine>now.getFullYear()) poruka+="Neispravan unos godine (trenutno je "+ now.getFullYear() +" godina)\n";
 if(dana>danaUMjesecu(mjeseci,godine)) poruka+="Neispravan unos dana (upisani mjesec ima "+ danaUMjesecu(mjeseci,godine) +" dana)\n";
 
 if(udjeli.indexOf(',') != -1) {
	udjeli=udjeli.replace(/\./g, "");
    udjeli=udjeli.replace(/\,/g, ".");
}
  if(udjeli=="") poruka+="Molimo Vas da unesete broj udjela\n";
  if(isNaN(udjeli)==true) poruka+="Broj udjela mora biti broj!\n";
  
  if(uplata=="") poruka+="Molimo Vas da unesete iznos transakcije\n";
  uplata=uplata.replace(/\./g, "");
  uplata=uplata.replace(/\,/g, "");
  if(isNaN(uplata)==true) poruka+="Uplata mora biti broj!\n";
 
 if(poruka!=""){
	alert(poruka+"\n\nhrportfolio.com");
	 }else{
		
	document.getElementById("formular").submit();
	 }
	
	}
	
	
	function danaUMjesecu(mjesec,godina)
{
var startDate = new Date(godina, mjesec, 1);
timeDifference = startDate - 86400000;
var result = new Date(timeDifference);
return result.getDate();
}

function nemaPortfelja(){
document.getElementById("dodavanje_portfelja").style.display="none";
document.getElementById("dodavanje_portfelja").style.visibility="hidden";
document.getElementById("ukupanPortfelj").style.display="none";
document.getElementById("ukupanPortfelj").style.visibility="hidden";
document.getElementById("sve_transakcije").style.display="none";
document.getElementById("sve_transakcije").style.visibility="hidden";	
prikaziUnosNovogPortfelja();
	}
	
function imaPortfelja(){
document.getElementById("dodavanje_portfelja").style.display="block";
document.getElementById("dodavanje_portfelja").style.visibility="visible";
document.getElementById("ukupanPortfelj").style.display="block";
document.getElementById("ukupanPortfelj").style.visibility="visible";
document.getElementById("sve_transakcije").style.display="block";
document.getElementById("sve_transakcije").style.visibility="visible";	
sakrijUnosNovogPortfelja();
	}	

function prikaziUnosNovogPortfelja(){
document.getElementById("unos_portfelja").style.display="block";
document.getElementById("unos_portfelja").style.visibility="visible";
document.getElementById("naslovImovina").innerHTML="<b>Unos novog portfelja</b>";
document.getElementById("naslovImovina2").style.display="none";
document.getElementById("naslovImovina2").style.visibility="hidden";
	
	}
function sakrijUnosNovogPortfelja(){
document.getElementById("unos_portfelja").style.display="none";
document.getElementById("unos_portfelja").style.visibility="hidden";
document.getElementById("naslovImovina").innerHTML="<b>Dodavanje novog fonda u portfelj</b>";
document.getElementById("naslovImovina2").style.display="block";
document.getElementById("naslovImovina2").style.visibility="visible";
	}

function unesiImePortfelja(){
document.formular.action.value="unesiPortfelj";
var ime=document.formular.moj_portfelj.value;
var greska="";
if(ime=="" || ime.length<3) greska="Neispravno uneseno ime novog portfelja!\nNAPOMENA: Ime mora sadržavati min 3 znaka."; 
if(greska=="") document.formular.submit();
if(greska!="") alert(greska);
	}
//kraj izraeuna moje imovine



function openGmap(){
	
	
	window.open("/google_kontakt.php","","width=600,height=400,scrollbars=no");
	
	}


