
var prinPortada=1;


function cambiaImagen(nImagen,elLado,src) {


	 var tempImgSrc = new Image();
	 tempImgSrc.src = src;

	laImagen=eval("document.all."+nImagen);

	if (elLado == "F"){
		laImagen.src=tempImgSrc.src;
	}
	else if (elLado == "B"){
		laImagen.src=tempImgSrc.src;
	}



}

	function fnCarrito (que,id) {

		if (que=="borraA"){
			if (confirm('¿Eliminar Producto?')){
				document.location='proto_Carrito.pl?cacc='+que+'&idA='+id;
			}
		}
		else if (que=="masA"){
			var temp=eval("document.all.cant"+id);
			document.location='proto_Carrito.pl?&cacc='+que+'&idA='+id+'&cnt='+temp.value;

		}
		else {
			document.location='proto_Carrito.pl?&cacc='+que+'&idA='+id;
		}
	}


	function fnAltaChk (elForm) {
		var pasa=0;
		var mail=0;
		if (altaP.CL_NOMBRE.value == "" || altaP.CL_APELLIDOS.value=="" ){
			alert('Por favor, rellene los datos de usuario.');
			return false;
		}
		var theStr = new String(altaP.CL_EMAIL.value);
		var index = theStr.indexOf("@");
		if (index > 0){
			var pindex = theStr.indexOf(".",index);
			if ((pindex > index+1) && (theStr.length > pindex+1)){
				mail=1;
			}
		}
		if (altaP.CL_PASSWORD.value == "" || altaP.CL_PASSWORD_CONFIRM.value == "" || altaP.CL_PASSWORD.value != altaP.CL_PASSWORD_CONFIRM.value){
			alert ('Por favor, compruebe la contraseña');
			return false;
		}
		if (altaP.CL_DIRECCION.value == "" || altaP.CL_LOCALIDAD.value == "" || altaP.CL_PROVINCIA.value == "" || altaP.CL_TELEFONO.value =="" || altaP.CL_CODIGOPOS.value==""){


			// altaP.CL_DIRECCION.value == "" || altaP.CL_LOCALIDAD.value == "" || altaP.CL_PROVINCIA.value == "" || altaP.CL_TELEFONO.value || altaP.CL_CODIGOPOS.value==""
			alert('Por favor, rellene los datos de contacto');
			return false;
		}


			if (mail==1){
				return true;
			}
			else {
				alert ('Por favor, compruebe su dirección E-Mail');
				return false;
			}

	}
function fnEnciendeRow(src,clrOver) {
	 if (!src.contains(event.fromElement)) {
		 src.style.cursor = 'hand';
		 src.bgColor = clrOver;
	 }
}

function fnApagaRow(src,clrIn) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'hand';
		src.bgColor = clrIn;
	}
}

function fnClickRow(url,param,val) {

	document.location=url+'?'+param+'='+val;
}
