

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects="";
var rootdomain="http://"+window.location.hostname;
var bustcacheparameter="";

function ajaxpage(url, containerid){
//

var page_request = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
	page_request = new XMLHttpRequest();
else 
	if (window.ActiveXObject){ // if IE
		try {
			
				page_request = new ActiveXObject("Msxml2.XMLHTTP");
			}			 
		catch (e){
					try{
							page_request = new ActiveXObject("Microsoft.XMLHTTP");
						}
					catch (e){}
				}		
	}	
	else
		return false;
	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid);
	}
	if (bustcachevar) //if bust caching of external page
	bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
	//alert("asdadasdas");
	page_request.open('GET', url+bustcacheparameter, true);
	page_request.send(null);
}

function loadpage(page_request, containerid){
//alert('aaaabsss');

	
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
	//alert(page_request.responseText);
		if(containerid=="div_elig_imob"){
			//alert(page_request.responseText);
		//document.getElementById(containerid).innerHTML="asdasd <a href='asdasdas'>asdasdhassa</a><input name='check' type='checkbox'>	<table width=\"500\"><td onclick='alert(\"bubu\");'>asdasdasd</td></table>";
	document.getElementById(containerid).innerHTML = page_request.responseText;
		}
		else{
			//alert(containerid);
			document.getElementById(containerid).innerHTML=page_request.responseText;
		}
	}
}

function loadobjs(){
	if (!document.getElementById)
		return;
	for (i=0; i<arguments.length; i++){
		var file=arguments[i];
		var fileref="";
		if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1){ //If object is a js file
			fileref=document.createElement('script');
			fileref.setAttribute("type","text/javascript");
			fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1){ //If object is a css file
				fileref=document.createElement("link");
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
				}
		}	
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref);
			loadedobjects+=file+" "; //Remember this object as being already added to page
		}
	}
}
function getCautaCard(obj)
{
	var poststr = "nr_pagina=" + encodeURI(document.getElementById("nr_pagina").value) + "&tip_card=" + encodeURI( document.getElementById("tip_card").value ) + "&posesor=" + encodeURI( document.getElementById("posesor").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&alte_crit=" + encodeURI( document.getElementById("alte_crit").value ) + "&show=" + encodeURI( document.getElementById("show").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ); 
	//alert(poststr);
	ajaxpage('/forms/cauta-card.php?'+poststr, 'cautacard'); 
}

function getCalcCard()
{
	var poststr = "nr_pagina=" + encodeURI(document.getElementById("nr_pagina").value) + "&tip_card=" + encodeURI( document.getElementById("tip_card").value ) + "&posesor=" + encodeURI( document.getElementById("posesor").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&alte_crit=" + encodeURI( document.getElementById("alte_crit").value ) + "&show=" + encodeURI( document.getElementById("show").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ); 
	//alert(poststr);
	ajaxpage('/forms/cauta-card.php?'+poststr, 'cautacard'); 
}

function getCautaLeasing(obj)
{
	var poststr = "moneda=" + encodeURI( document.getElementById("moneda").value ) + "&pret_masina=" + encodeURI( document.getElementById("pret_masina").value ) + "&avans=" + encodeURI( document.getElementById("avans").value )+ "&tip_rezid=" + encodeURI( document.getElementById("tip_rezid").value ) + "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&tip_masina=" + encodeURI( document.getElementById("tip_masina").value )+ "&vechime_masina=" + encodeURI( document.getElementById("vechime_masina").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=Cauta"; 
	//alert(poststr);
	ajaxpage('/include/eligibil_leasing.php?'+poststr, 'form_cauta_leasing'); 
		
}

function getComparaPensii(obj)
{
	var checked="";
	var nr = document.formComparaPensii.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.formComparaPensii.check[i].checked){
	checked += "&check[]="+document.formComparaPensii.check[i].value;
		}
}

	var poststr = "submit=" + encodeURI( document.getElementById("submit").value ) + "&tip_fond=" + encodeURI( document.getElementById("tip_fond").value )  + checked;
	//alert(poststr);
      ajaxpage('/forms/compara_pensii.php?'+poststr, 'pensiiPrivate');
}

function comparaLeasing()
{
	var checked="";
	var nr_ch=0;
	var ch=document.getElementsByName('check');
	var nr = ch.length;
	//alert(nr);
	for(var i=0; i < nr; i++){
		if(ch[i].checked){
			checked += "&check[]="+ch[i].value;
			nr_ch++;
			}
		}
	//alert(checked);	
		if (nr_ch>1 && nr_ch<5)
		{			
			var poststr = "submit2=Compara" +checked; 
			//alert(poststr);
			//ajaxpage('/include/eligibil_auto.php?'+poststr, 'form_credite_auto'); 	
			ajaxpage('/forms/compara-auto.php?'+poststr, 'form_cauta_leasing');
		}
}

function getComparaLeasing()
{
	/*var checked="";
	var nr = document.form_comp_leasing.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.form_comp_leasing.check[i].checked){
			checked += "&check[]="+document.form_comp_leasing.check[i].value;
			}
		}	
	var poststr = "moneda=" + encodeURI( document.getElementById("moneda").value ) + "&pret_masina=" + encodeURI( document.getElementById("pret_masina").value ) + "&avans=" + encodeURI( document.getElementById("avans").value )+ "&tip_rezid=" + encodeURI( document.getElementById("tip_rezid").value ) + "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&tip_masina=" + encodeURI( document.getElementById("tip_masina").value )+ "&vechime_masina=" + encodeURI( document.getElementById("vechime_masina").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit2=" + encodeURI( document.getElementById("submit2").value )+ checked; 
	ajaxpage('/include/eligibil_leasing.php?'+poststr, 'form_cauta_leasing'); */
		
}

function getCalcAuto(obj)
{
	var poststr = "preliminar=" + encodeURI( document.getElementById("preliminar").value ) + "&pret_masina=" + encodeURI( document.getElementById("pret_masina").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&avans=" + encodeURI( document.getElementById("avans").value ) + "&tip_masina=" + encodeURI( document.getElementById("tip_masina").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&varsta=" + encodeURI( document.getElementById("varsta").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ); 
	
	//alert(poststr);
	ajaxpage('/include/eligibil_auto.php?'+poststr, 'form_credite_auto'); 
	
}

function getCompAuto()
{
	var checked="";
	var nr_ch=0;
	var ch=document.getElementsByName('check');
	var nr = ch.length;
	//alert(nr);
	for(var i=0; i < nr; i++){
		if(ch[i].checked){
			checked += "&check[]="+ch[i].value;
			nr_ch++;
			}
		}
		if (nr_ch>1 && nr_ch<5)
		{			
			var poststr = "preliminar=" + encodeURI( document.getElementById("preliminar").value ) + "&pret_masina=" + encodeURI( document.getElementById("pret_masina").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&avans=" + encodeURI( document.getElementById("avans").value ) + "&tip_masina=" + encodeURI( document.getElementById("tip_masina").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&varsta=" + encodeURI( document.getElementById("varsta").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit2=Compara" +checked; 
			//alert(poststr);
			//ajaxpage('/include/eligibil_auto.php?'+poststr, 'form_credite_auto'); 	
			ajaxpage('/forms/compara-auto.php?'+poststr, 'form_credite_auto');
		}
		else 
		{
			alert('Se pot alege intre 2 si 4 credite pentru comparare');
		}
	
}


function getCalcNevoi(obj)
{

	var poststr = "tip_credit=" + encodeURI( document.getElementById("tip_credit").value ) + "&valoare_credit=" + encodeURI( document.getElementById("valoare_credit").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ); 
	//"&varsta=" + encodeURI( document.getElementById("varsta").value )+ 
	//alert(poststr);

	ajaxpage('/include/eligibil_pers.php?'+poststr, 'nevoi'); 
	
}

function getCalcImobiliare(obj)
{
	//alert("asdadadas" );
	var poststr = "tip_credit=" + encodeURI( document.getElementById("tip_credit").value ) + "&destinatia=" + encodeURI( document.getElementById("destinatia").value ) + "&valoare_credit=" + encodeURI( document.getElementById("valoare_credit").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&varsta=" + encodeURI( document.getElementById("varsta").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ); 
	
	ajaxpage('/include/eligibil_imob.php?'+poststr, 'div_elig_imob'); 
	
}

function getCompImobiliare()
{
	var checked="";
	var nr_ch=0;
	var ch=document.getElementsByName('check');
	var nr = ch.length;
	//alert(nr);
	for(var i=0; i < nr; i++){
		if(ch[i].checked){
			checked += "&check[]="+ch[i].value;
			nr_ch++;
			}
		}	
		if (nr_ch>1 && nr_ch<5){	
		var poststr = "tip_credit=" + encodeURI( document.getElementById("tip_credit").value ) + "&destinatia=" + encodeURI( document.getElementById("destinatia").value ) + "&valoare_credit=" + encodeURI( document.getElementById("valoare_credit").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+ "&varsta=" + encodeURI( document.getElementById("varsta").value )+ "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit2=Compara"+checked; 
	//alert(poststr);
	//ajaxpage('/include/eligibil_imob.php?'+poststr, 'div_elig_imob'); 
	 ajaxpage('/forms/credite.php?'+poststr, 'div_elig_imob');	
		}
		else{
			alert('Se pot alege intre 2 si 4 credite pentru comparare');
		}
	
}

function getCalcNevoi1()
{
	var checked="";
	var nr_ch=0;
	var ch=document.getElementsByName('check');
	var nr = ch.length;
	//alert(nr);
	for(var i=0; i < nr; i++){
		if(ch[i].checked){
			checked += "&check[]="+ch[i].value;
			nr_ch++;
			}
		}	
		if (nr_ch>1 && nr_ch<5){	
		var poststr = "tip_credit=" + encodeURI( document.getElementById("tip_credit").value ) + "&valoare_credit=" + encodeURI( document.getElementById("valoare_credit").value ) + "&moneda=" + encodeURI( document.getElementById("moneda").value )+ "&perioada_de_rambursare=" + encodeURI( document.getElementById("perioada_de_rambursare").value )+  "&order=" + encodeURI( document.getElementById("order").value )+ "&sort=" + encodeURI( document.getElementById("sort").value ) + "&submit2=Compara"+checked; 
		//"&varsta=" + encodeURI( document.getElementById("varsta").value )+
	//alert(poststr);
	//ajaxpage('/include/eligibil_pers.php?'+poststr, 'nevoi'); 	
	ajaxpage('/forms/compara-nevoi.php?' + poststr, 'nevoi');
		}
		else{
			alert('Se pot alege intre 2 si 4 credite pentru comparare');
		}
	
}

function getComparaCard(obj)
{
	var checked="";
	var nr = document.getElementById("check").length;
	
	for(var i=0; i < nr; i++){
		if(document.form_compara.check[i].checked){
	checked += "&check[]="+document.form_compara.check[i].value;
		}
}

	var poststr = "submit=" + encodeURI( document.getElementById("submit").value ) + checked;
      ajaxpage('/forms/cauta-card.php?'+poststr, 'cautacard');
   
}


function getComparaDepozite(obj)
{
	var checked="";
	var nr = document.depoz.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.depoz.check[i].checked){
	checked += "&check[]="+document.depoz.check[i].value;
		}
}
	var poststr = "submit2=" + encodeURI( document.getElementById("submit2").value ) + checked+"&tip_depozit="+encodeURI(document.getElementById("tip_depozit").value);
      ajaxpage('/forms/cauta-depozite.php?'+poststr, 'aratadepoz');
   
}


function getComparaImob(obj)
{
	var checked="";
	var nr = document.imobiliare.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.imobiliare.check[i].checked){
			checked += "&check[]="+document.imobiliare.check[i].value;
		}
	}
//alert(checked);
	var poststr = "submit2=" + encodeURI( document.getElementById("submit2").value ) + checked;
      ajaxpage('/forms/credite.php?'+poststr, 'imob');
   
}

function getComparaAuto(obj)
{
	var checked="";
	var nr = document.credite_auto.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.credite_auto.check[i].checked){
	checked += "&check[]="+document.credite_auto.check[i].value;
		}
}
	//alert(checked);
	var poststr = "submit2=" + encodeURI( document.getElementById("submit2").value ) + checked;
	
      ajaxpage('/forms/compara-auto.php?'+poststr, 'div_compara_auto');
   
}

function getComparaLeasing(obj)
{
	var checked="";
	var nr_ch=0;
	var ch=document.getElementsByName('check');
	var nr = ch.length;
	//alert(nr);
	for(var i=0; i < nr; i++){
		if(ch[i].checked){
			checked += "&check[]="+ch[i].value;
			nr_ch++;
			}
		}	
	//alert(checked);
	var poststr = "submit2=Compara"  + checked;
	
      ajaxpage('/forms/compara-auto.php?'+poststr, 'div_compara_auto');
   
}


function getComparaNevoi(obj)
{
	var checked="";
	var nr = document.nevoi.check.length;
	
	for(var i=0; i < nr; i++){
		if(document.nevoi.check[i].checked){
	checked += "&check[]="+document.nevoi.check[i].value;
		}
}

	var poststr = "submit2=" + encodeURI( document.getElementById("submit2").value ) + checked;
	
      ajaxpage('/forms/compara-nevoi.php?'+poststr, 'nevoi');
   
}

function click_alterate()
{
	if(document.form2.alte_rate.checked)
		{
			document.form2.alte_credite.disabled=false;
		}
	else
		{
			document.form2.alte_credite.disabled=true;
		}
	document.form2.alte_credite.value="";
}

function click_alterate2()
{
	if(document.form2.alte_rate2.checked)
		{
			document.form2.alte_credite2.disabled=false;
		}
	else
		{
			document.form2.alte_credite2.disabled=true;
		}
	document.form2.alte_credite2.value="";
}

function click_codebit1()
{
	if(document.form2.click_codebitor1.checked)
		{
			document.form2.venit_codebitor1.disabled=false;
		}
	else
		{
			document.form2.venit_codebitor1.disabled=true;
		}
	document.form2.venit_codebitor1.value="";
}

function click_codebit2()
{
	if(document.form2.click_codebitor2.checked)
		{
			document.form2.venit_codebitor2.disabled=false;
		}
	else
		{
			document.form2.venit_codebitor2.disabled=true;
		}
	document.form2.venit_codebitor2.value="";
}

function masina_noua()
{
	if((document.getElementById("tip_masina")[1].selected) 
	|| (document.getElementById("tip_masina")[3].selected)
	|| (document.getElementById("tip_masina")[4].selected)
	|| (document.getElementById("tip_masina")[5].selected)
	)
		document.getElementById("vechime_masina").disabled=true;
	else document.getElementById("vechime_masina").disabled=false;
}
function calcAvans()
{
	var av = document.getElementById('avans').value;
	var pret = document.getElementById('pret_masina').value;
	var moneda = document.getElementById('moneda').value;
	var rez = (av*pret)/100;
	document.getElementById('avanss').innerHTML = rez +" "+ moneda;
}
	

var newwindow;
function poptastic(url,prop)
{
	newwindow=window.open(url,'name',prop);
	if (window.focus) {newwindow.focus()}
}

function taxaAuto(obj) {
      var poststr = "tipVehicul=" + encodeURI( document.getElementById("tipVehicul").value )+ "&capacitate=" + encodeURI( document.getElementById("capacitate").value ) + "&norma=" + encodeURI( document.getElementById("norma").value ) + "&vechime=" + encodeURI( document.getElementById("vechime").value ) + "&catalizator=" + encodeURI( document.getElementById("catalizator").value ) + "&submit=" + encodeURI( document.getElementById("submit").value ) ;
    //alert(poststr);  
      // makePOSTRequest('/module/taxa_inmatriculare.php', poststr);
     ajaxpage('/module/taxa_inmatriculare.php?' + poststr, 'div_taxa_auto');
   }
   
function getCalcDAE(obj) {
      var poststr = "imprumut=" + encodeURI( document.getElementById("imprumut").value )+ "&perioada=" + encodeURI( document.getElementById("perioada").value ) + "&dobanda=" + encodeURI( document.getElementById("dobanda").value ) + "&tiprata=" + encodeURI( document.getElementById("tiprata").value ) + "&comLunarFix=" + encodeURI( document.getElementById("comLunarFix").value ) + "&comLunar=" + encodeURI( document.getElementById("comLunar").value ) + "&tip_comision_lunar=" + encodeURI( document.getElementById("tip_comision_lunar").value ) +"&comAnualFix=" + encodeURI( document.getElementById("comAnualFix").value ) +"&comAnual=" + encodeURI( document.getElementById("comAnual").value ) +"&tip_comision_anual=" + encodeURI( document.getElementById("tip_comision_anual").value ) +"&acordareProcent=" + encodeURI( document.getElementById("acordareProcent").value ) +"&acordareFix=" + encodeURI( document.getElementById("acordareFix").value ) +"&analizaProcent=" + encodeURI( document.getElementById("analizaProcent").value ) +"&analizaFix=" + encodeURI( document.getElementById("analizaFix").value ) +"&submit=" + encodeURI( document.getElementById("submit").value ) ;
           
   // alert(poststr);  
      
     ajaxpage('/module/calculator_dae.php?' + poststr, 'div_calc_dae');
}

function contact(obj){
	var poststr = "name=" + encodeURI( document.getElementById("name").value ) + "&email=" + encodeURI( document.getElementById("email").value ) + "&message=" + encodeURI( document.getElementById("message").value )+ "&imgcheck=" + encodeURI( document.getElementById("imgcheck").value )+ "&newsletter=" + encodeURI( document.getElementById("newsletter").value )+   "&submit=" + encodeURI( document.getElementById("submit").value ) ;
	//alert(poststr);
	ajaxpage('/module/contact.php?' + poststr, 'div_compara');
}


function convertorCurs(obj){
	var poststr = "cat=" + encodeURI( document.getElementById("cat").value ) + "&valuta1=" + encodeURI( document.getElementById("valuta1").value ) + "&valuta2=" + encodeURI( document.getElementById("valuta2").value )+ "&zi=" + encodeURI( document.getElementById("zi").value )+ "&luna=" + encodeURI( document.getElementById("luna").value )+  "&an=" + encodeURI( document.getElementById("an").value )+ "&listeaza=" + encodeURI( document.getElementById("listeaza").value ) ;
	//alert(poststr);
	ajaxpage('/module/convertor.php?' + poststr, 'divConvertorCurs');
}

function comparaIMM(obj)
{
	var checked="";
	var nr = document.formComparaIMM.check.length;
	for(var i=0; i < nr; i++){
		if(document.formComparaIMM.check[i].checked){
	checked += "&check[]="+document.formComparaIMM.check[i].value;
		}
}
	var poststr = "submit2=" + encodeURI( document.getElementById("submit2").value ) + checked ;
	//alert(poststr);
      ajaxpage('/module/compara-imm.php?'+poststr, 'divComparaIMM');
   
}

function getComparaInternet(obj)
{
	var checked="";
	var sel = 0;
	var nr = document.formComparaInternet.check.length;
	
	
		for(var i=0; i < nr; i++){
			if(document.formComparaInternet.check[i].checked){
				checked += "&check[]="+document.formComparaInternet.check[i].value;
				sel++;
			}
		}
	if(sel==2){
		var poststr = "submit=" + encodeURI( document.getElementById("submit").value ) + checked;
		//alert(poststr);
	    ajaxpage('/forms/compara-internet.php?'+poststr, 'internet');
	}
	else{
			alert('Se pot alege doar doua produse internet banking pentru comparare');
			
	}
		
}

function getComparaFonduri(obj)
{
	var checked="";
	var sel = 0;
	var nr = document.formComparaFonduri.check.length;
	
	
		for(var i=0; i < nr; i++){
			if(document.formComparaFonduri.check[i].checked){
				checked += "&check[]="+document.formComparaFonduri.check[i].value;
				sel++;
			}
		}
	if(sel==2){
		var poststr = "submit=" + encodeURI( document.getElementById("submit").value ) + checked;
		//alert(poststr);
	    ajaxpage('/forms/compara-fonduri.php?'+poststr, 'fonduriInvestitii');
	}
	else{
			alert('Se pot alege doar doua fonduri de investitii pentru comparare');
			
	}
		
}

function calculeaza(obj) {
      var poststr;
      
      if(document.getElementById("salariu")) poststr+="&salariu=" + encodeURI( document.getElementById("salariu").value );
      if(document.getElementById("sporuri")) poststr+="&sporuri=" + encodeURI( document.getElementById("sporuri").value );
      if(document.getElementById("pers")) poststr+="&pers=" + encodeURI( document.getElementById("pers").value );
     //makePOSTRequest('/rezolva.php', poststr);
      ajaxpage('/module/rezolva.php?' + poststr, 'div_venit_net');
   }
   
   function getCalcRandamentConturi(obj)
   {
   	 var poststr;
   	 poststr = "depozit=" + encodeURI(document.getElementById('depozit').value) + "&moneda=" + encodeURI(document.getElementById('moneda').value) + "&perioada=" + encodeURI(document.getElementById('perioada').value) + 
"&suma_lunara=" +  encodeURI(document.getElementById('suma_lunara').value) +"&submit=" +  encodeURI(document.getElementById('submit').value);
//+ "&bonificare_cand=" + encodeURI(document.getElementById('bonificare_cand').value) 
	//alert(poststr);
   	 ajaxpage('/forms/randament-conturi.php?' + poststr, 'randament_conturi');
   }
   
   function showhide(id)
 {
   if (document.getElementById(id).style.display != "none")
   {
      document.getElementById(id).style.display="none";
   } else {
     document.getElementById(id).style.display="block"; // or static, or fixed, or inline, whatever you like.
   } // end if;
 }
 function getCalcRandamentDepozite(obj)
   {
   	 var poststr;
   	 poststr = "beneficiari=" + encodeURI(document.getElementById('beneficiari').value) + "&moneda=" + encodeURI(document.getElementById('moneda').value) + "&perioada_dobanda=" + encodeURI(document.getElementById('perioada_dobanda').value) + 
"&depozit=" +  encodeURI(document.getElementById('depozit').value) + "&incasare_dobanda=" + encodeURI(document.getElementById('incasare_dobanda').value) +  "&capitalizare_dobanda=" + encodeURI(document.getElementById('capitalizare_dobanda').value) +  "&perioada=" + encodeURI(document.getElementById('perioada').value) + "&submit=" +  encodeURI(document.getElementById('submit').value);
	//alert(poststr);
   	 ajaxpage('/forms/randament-depozite.php?' + poststr, 'randament_depozite');
   }
   
   function getCalcRandamentProgresiv(obj)
   {
   	 var poststr;
   	 poststr ="moneda=" + encodeURI(document.getElementById('moneda').value) + "&perioada_dobanda=" + encodeURI(document.getElementById('perioada_dobanda').value) + 
"&depozit=" +  encodeURI(document.getElementById('depozit').value) + "&submit=" +  encodeURI(document.getElementById('submit').value);
	//alert(poststr);
   	 ajaxpage('/forms/randament-progresive.php?' + poststr, 'randament_progresive');
   }
   
function refinantare()
{
	var poststr;
 poststr = "tip_credit_initial=" + encodeURI(document.getElementById('tip_credit_initial').value) + 
		   "&moneda_credit_initial=" + encodeURI(document.getElementById('moneda_credit_initial').value) + 
		   "&credit_initial=" + encodeURI(document.getElementById('credit_initial').value) + 
		   "&dobanda_credit_initial=" + encodeURI(document.getElementById('dobanda_credit_initial').value) + 
		   "&comision_lunar_credit_initial=" + encodeURI(document.getElementById('comision_lunar_credit_initial').value) + 
		   "&tip_comision_lunar=" + encodeURI(document.getElementById('tip_comision_lunar').value) +
		   "&comision_anual_credit_initial=" + encodeURI(document.getElementById('comision_anual_credit_initial').value) +
		   "&sold_credit_initial=" + encodeURI(document.getElementById('sold_credit_initial').value) +
		   "&perioada_ramasa_credit_initial=" + encodeURI(document.getElementById('perioada_ramasa_credit_initial').value) +
   "&comision_rambursare_credit_initial=" + encodeURI(document.getElementById('comision_rambursare_credit_initial').value) +
   		   "&comision_emitere_scrisoare=" + encodeURI(document.getElementById('comision_emitere_scrisoare').value) +
   		   "&moneda_scrisoare=" +  encodeURI(document.getElementById('moneda_scrisoare').value) + 
   		   "&moneda_credit_refinantare=" + encodeURI(document.getElementById('moneda_credit_refinantare').value) +
   		   "&perioada_credit_refinantare=" + encodeURI(document.getElementById('perioada_credit_refinantare').value) +
   		   "&dobanda_credit_refinantare=" + encodeURI(document.getElementById('dobanda_credit_refinantare').value) +  		
   		   "&tip_dobanda_credit_refinantare=" + encodeURI(document.getElementById('tip_dobanda_credit_refinantare').value) +
   "&comision_acordare_credit_refinantare="+encodeURI(document.getElementById('comision_acordare_credit_refinantare').value)+
   "&alte_comisioane_credit_refinantare=" + encodeURI(document.getElementById('alte_comisioane_credit_refinantare').value)+ 
   "&comision_lunar_credit_refinantare=" + encodeURI(document.getElementById('comision_lunar_credit_refinantare').value)+
   "&tip_comision_credit_refinantare=" + encodeURI(document.getElementById('tip_comision_credit_refinantare').value) +
   "&comision_anual_credit_refinantare=" + encodeURI(document.getElementById('comision_anual_credit_refinantare').value) +
   "&tip_comision_anual_refinantare=" + encodeURI(document.getElementById('tip_comision_anual_refinantare').value) +
   "&comision_valuare_imobil=" + encodeURI(document.getElementById('comision_valuare_imobil').value) +
   "&calculeaza=Calculeaza";
   ajaxpage("/module/refinantare_credit.php?"+poststr, 'refinantare_credit')
}

function tipArticol(id)
{
	poststr = "id=" + id + "&select=" + encodeURI(document.getElementById('select').value);
	//alert(poststr);
	ajaxpage("/cp/articole/tip_articol.php?"+poststr, 'ta'+id)
}

function schimba_judet()
{
	window.location = "/sucursale-agentii/" + encodeURI(document.getElementById('judete').value) + "/";
}

function tip_credit()
{
	poststr = "tip_credit=" + encodeURI(document.getElementById('tip_credit').value) + "&moneda="  + encodeURI(document.getElementById('moneda').value);
	//alert(poststr);	
	ajaxpage("/include/topuri.php?"+poststr, 'top')
}
function tip_depozit()
{
	poststr = "tip_depozit=" + encodeURI(document.getElementById('tip_depozit').value) + "&moneda_depozit="  + encodeURI(document.getElementById('moneda_depozit').value);
	//alert(poststr);	
	ajaxpage("/include/topuri.php?"+poststr, 'top_d')
}
