// JavaScript Document
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Husay :: http://www.communitxt.net */

var arrInput = new Array(0);
var arrInputValue = new Array(0);

var arrInput2 = new Array(0);
var arrInputValue2 = new Array(0);

function addInput() {

  arrInput.push(arrInput.length);
  arrInputValue.push("");

  arrInput2.push(arrInput2.length);
  arrInputValue2.push("");

  display();
}

function display() {
  document.getElementById('parah').innerHTML="";
  for (intI=0;intI<arrInput.length;intI++) {
    document.getElementById('parah').innerHTML+=createInput(arrInput[intI], arrInputValue[intI], arrInput2[intI], arrInputValue2[intI] );
  }
}

function saveValue(intId,strValue) {
  arrInputValue[intId]=strValue;
}
function saveValue2(intId,strValue) {
  arrInputValue2[intId]=strValue;
}



function createInput(id,value, id2, value2)
{

 var tr ='<table border="0" cellspacing="0" cellpadding="0" width="100%" >'

  tr = tr+"<tr><td class='namec'>&nbsp;Banca</td><td>"
  tr = tr+"<input type='text'  name='firm_banca_js[]'   onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'>";
  tr = tr+"</td></tr>"

  tr = tr+"<tr><td class='namec'>Cont banca&nbsp;</td><td>"
  tr = tr+"<input type='text'  name='firm_cont_banca_js[]'   onChange='javascript:saveValue2("+ id2 +",this.value)' value='"+ value2 +"'>";
  tr = tr+"</td></tr>"
  tr = tr +"</table>";

  return tr;

}

function deleteInput() {
  if (arrInput.length > 0) {
     arrInput.pop();
     arrInputValue.pop();
  }
  if (arrInput2.length > 0) {
     arrInput2.pop();
     arrInputValue2.pop();
  }
  display();
}

//////////////////////////
/////////////////////////////

function are_web(valoare, div)
{
	if (valoare != 'http://' && valoare != '' && valoare.length > 10)
    {
    	document.getElementById(div).style.display=''
        document.getElementById('firm_web_description').select();
    }
    else
       document.getElementById(div).style.display='none'

}
