
// ------------ ADD CAMPOS ----------------- //
var arrInput = new Array(3);
var arrInputValue = new Array(3);

function addInput() {
  //arrInput.push(createInput(arrInput.length));
  arrInput.push(arrInput.length);
  //arrInputValue.push(arrInputValue.length);
  arrInputValue.push("");
  display();
}

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

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

function createInput(id,value) {
  return "<input type=\"file\" name=\"foto[]\" id=\"foto_"+ id +"\" value=\""+ value +"\" /><br />";
}

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

function fotoDestaque(sid, foto, id) {
	var fotoDestaque = document.getElementById(id);
	fotoDestaque.src = "sistema/fotos/"+sid+"/"+foto;
}


