// JavaScript Document

<!-- Desactivar el botó ENVIAR dels formularis
function deshabilitaComanda(form)
{
	if ((form.empresa.value != "") && (form.email.value != "") && (form.telf.value != "")) { 
		form.EnviarComanda.disabled = false;
	} else {
		form.EnviarComanda.disabled = true;
	}
}

<!-- Desactivar el botó ENVIAR dels formularis
function deshabilitaContacte(form)
{
	if ((form.contacto.value != "") && (form.email.value != "") && (form.empresa.value != "") && (form.telf.value != "")) { 
		form.EnviarContacte.disabled = false;
	} else {
		form.EnviarContacte.disabled = true;
	}
}
-->

<!-- Desactivar el botó ENVIAR dels formularis
	 function deshabilita(form)
	 {
	     if ((form.Usuari.value != "") && (form.Contrasenya.value != ""))
	     { form.EntrarUsuari.disabled = false; }
	
	     else { form.EntrarUsuari.disabled = true; }
	 }
-->


var miPopup
function abreVentana(URL){
    miPopup = window.open(URL,"miwin","width=1000,height=800,scrollbars=yes, resize=yes");
    miPopup.focus();
}

function ponImagen(arxiu){
    opener.document.FormProd.Img.value = arxiu;
    window.close();
} 

// ESBORRAR CONTINGUT
function esborrar(nomCamp){
	document.getElementById(nomCamp).value="";
	if (nomCamp=='IdProdPpal'){	   document.images['ImgIdProdPpal'].src = "../fotos/nofoto.jpg";	}
	if (nomCamp=='Img'){	   document.images['ImgIdProd'].src = "../fotos/nofoto.jpg";	}
	if (nomCamp=='Foto'){	   document.images['ImgIdProd'].src = "../fotos/nofoto.jpg";	}
}

function ponIdProdPpal(valor, imagen){
    opener.document.FormProd.IdProdPpal.value = valor;
    opener.document.images['ImgIdProdPpal'].src = imagen;
	 window.close();
}

function ponImg(valor){
    opener.document.getElementById('Img').value = valor;
    opener.document.images['ImgIdProd'].src = "../fotos/"+valor;
	 window.close();
}

function ponImatge(valor){
   document.getElementById('Nom').value = valor;
 	document.images['ImgIdFoto'].src = "../fotos/"+valor;
}


function cerrarVentana(){
	window.close()	;
}

// TANCAR FINESTRA I ESCRIURE VALOR A UN CAMP DETERMINAT DEL FORMULARI QUE DESITGEM
function escriuCamp(Camp, valor){
    opener.document.getElementById(Camp).value = valor;
	 window.close();
} 