   var item1 = 1;
   var item2 = 0;
   var item3 = 0;

   function recover(id)
    {
        if (id .style.display == 'none')
        {
            id.style.display = '';
         }else{
            id.style.display = 'none';
         }   
    }
    
    function colorB(id)
    {
        id.style.color='#ffffff';
        id.style.background='#9a0103'; 
    }
    
     function uncolorB(id)
    {
        id.style.color='#9a0103';
        id.style.background='#ffffff'; 
    }
    
	function loadLink(link){
		var load = window.open(link, '', 'scrollbars=yes,menubar=no,height=700,width=900,resizable=yes,toolbar=no,location=no,status=no' );
	}

    function openChild(file,window) {
        childWindow=open(file, window, 'scrollbars=yes,menubar=no,height=700,width=900,resizable=yes,toolbar=no,location=no,status=no');
        if (childWindow.opener == null) childWindow.opener = self;
    }
    
    function openChild(file,window) {
        childWindow=open(file, window, 'scrollbars=yes,menubar=no,height=700,width=900,resizable=yes,toolbar=no,location=no,status=no');
        if (childWindow.opener == null) childWindow.opener = self;
    }
    
    function updateParent(id) {
            if (id == 1)
            {
                opener.document.parentForm.termeni.checked = true;
            }else{
                opener.document.parentForm.termeni.checked = false;
            }
            
            self.close();
    return false;
   }
   
   function colorPlans(pId)
   {
      if (pId == 1)
      {
        document.getElementById('vext').style.color='#9a0103';
        document.getElementById('ppart').style.color='#585858';
        document.getElementById('pmans').style.color='#585858';
        item1 = 1;
        item2 = 0;
        item3 = 0;
      }else{
        if (pId == 2)
        {
          document.getElementById('vext').style.color='#585858';
          document.getElementById('ppart').style.color='#9a0103';
          document.getElementById('pmans').style.color='#585858';
          item1 = 0;
          item2 = 1;
          item3 = 0;
        }else{
          if (pId == 3)
          {
             document.getElementById('vext').style.color='#585858';
             document.getElementById('ppart').style.color='#585858';
             document.getElementById('pmans').style.color='#9a0103';
             item1 = 0;
             item2 = 0;
             item3 = 1;
          }   
        } 
      }      
   } 
   
  function uncolorOne(pId)
   {
      if ((pId == 1) && (item1!=1))
      {
        document.getElementById('vext').style.color='#585858';        
      }else{
        if ((pId == 2) && (item2!=1))
        {
          document.getElementById('ppart').style.color='#585858';
        }else{
          if ((pId == 3) && (item3!=1))
          {
             document.getElementById('pmans').style.color='#585858';
          }   
        } 
      }      
   } 
   
   function colorOne(pId)
   {
      if (pId == 1)
      {
        document.getElementById('vext').style.color='#9a0103';        
      }else{
        if (pId == 2)
        {
          document.getElementById('ppart').style.color='#9a0103';
        }else{
          if (pId == 3)
          {
             document.getElementById('pmans').style.color='#9a0103';
          }   
        } 
      }      
   } 
   
   
   function switchP(tId)
   {
        if (tId == 1)
        {
             document.parentForm.user_codr.disabled = true;
             document.getElementById("ucodr").style.backgroundColor = "#cdcdcd";
             document.parentForm.user_cont.disabled = true;
             document.getElementById("ucont").style.backgroundColor = "#cdcdcd";
             document.parentForm.user_banca.disabled = true;
             document.getElementById("ubanca").style.backgroundColor = "#cdcdcd";
        }else{
           if (tId == 2)
           {     
             document.parentForm.user_codr.disabled = false;
             document.getElementById("ucodr").style.backgroundColor = "#ffffff";
             document.parentForm.user_cont.disabled = false;
             document.getElementById("ucont").style.backgroundColor = "#ffffff";
             document.parentForm.user_banca.disabled = false;
             document.getElementById("ubanca").style.backgroundColor = "#ffffff";
           }  
        }
   }
  
   
   function changeText(idElement)
   {
       if(idElement==1){
          document.getElementById('element1').innerHTML ='Nume si Prenume:';
          document.getElementById('element2').innerHTML ='Cod Numeric Personal:';
       }else if(idElement==2){
             document.getElementById('element1').innerHTML ='Nume Firma:';
             document.getElementById('element2').innerHTML ='C.I.F.:';
       }
   }



   function recover(id)
    {
        if (id .style.display == 'none')
        {
            id.style.display = '';
         }else{
            id.style.display = 'none';
         }   
    }
    
    function colorB(id)
    {
        id.style.color='#ffffff';
        id.style.background='#9a0103'; 
    }
    
     function uncolorB(id)
    {
        id.style.color='#9a0103';
        id.style.background='#ffffff'; 
    }
	
	function updateParent(id) {
            if (id == 1)
            {
                opener.document.parentForm.termeni.checked = true;
            }else{
                opener.document.parentForm.termeni.checked = false;
            }
            
            self.close();
    return false;
 }  
 function showMessage(tId)
   {
        if (tId == 0)
        {
             
             document.getElementById("message").innerHTML="La platile ramburs se achita, la primirea proiectului, valoarea integrala a acestuia.";
			 var pretlei=document.getElementById("pretleiInit").innerHTML;
			 document.getElementById("pretlei").innerHTML=pretlei;
			 var tva=document.getElementById("tvaInit").innerHTML;
			 document.getElementById("tva").innerHTML=tva;
			 var total=document.getElementById("totalInit").innerHTML;
			 document.getElementById("total").innerHTML=total;
        }else{
           if (tId == 1)
           {     
             document.getElementById("message").innerHTML = "Valoarea afisata in lei, reprezinta avans 50%. Restul de 50% vor fi achitati la primirea proiectului.";
			 var pretlei=document.getElementById("pretleiMod").innerHTML;
			 document.getElementById("pretlei").innerHTML=pretlei;
			 var tva=document.getElementById("tvaMod").innerHTML;
			 document.getElementById("tva").innerHTML=tva;
			 var total=document.getElementById("totalMod").innerHTML;
			 document.getElementById("total").innerHTML=total;
           }  
        }
   }
