/* Copyright 1997 G & S Sistemas de Información, S.L. */
/* Modificado por J.M.G.V. vida@gonvi.com 25/11/2005 */

var activo=1;

function clear() {
   window.status="";
}

function display(stuff) {
   window.status = stuff;
   /* Clear the display after 15 seconds, more or less
      1000 equals one second, you can change to suit yourself */
   setTimeout("clear()",30000);
}

function makearray(num) {
	this.length=num ;
}

function calclinfra() {
	return this.cantidad * this.precio ;
}

function escod(cod) {
	return this.codigo == cod ;
}

function linfra(cod,desc,pts) {
	this.codigo      = cod ;
	indicecantidad = parent.principal.estante.document.datos.cantidad.selectedIndex;
	this.cantidad    = parent.principal.estante.document.datos.cantidad.options[indicecantidad].text; 
	this.descripcion = desc ;
	this.precio      = pts ;
	this.calcula     = calclinfra ;
	this.escod       = escod ;
}

function totaliza() {
    var j ;
    var valor ;
    var cuantos = this.lineas.length ;
    var total = 0 ;

    for ( j=0 ; j<cuantos ; j++ ) {
	total += this.lineas[j].calcula() ;
    }
    return precisiondos(total) ;

}

function estacod(cod) {
	var i = 0;
	var j = this.lineas.length ;

	while ( i < j )
	  {
	    if ( this.lineas[i].codigo == cod ) 
	      {
	        this.lineas[i].cantidad++ ;
	        return true ;
	      }
	    i++ ;
	  }
	return false ;
}

function fra() {
	hoy = new Date();
	var num_ped = hoy.getTime()-101507000;
	this.pedido    = " "+hoy.getMonth()+hoy.getDate()+"-"+num_ped;
	//this.pedido    = " "+num_ped;
	this.nombre    = "" ;
	this.calle     = "" ;
	this.cp        = "" ;
	this.localidad = "" ;
	this.provincia = "" ;
	this.pais      = "" ;
	this.telefono  = "" ;
	this.email     = "" ;
	this.titular   = "" ;
	this.tarjeta   = "" ;
	this.caduca    = "" ; 
	this.lineas    = new makearray(0);
	this.totaliza = totaliza ;
	this.estacod   = estacod ;
}

function goHist(a) {
	parent.principal.estante.history.go(a);
}

function coger(nc,na,nt,sec,subsec,subsubsec,codigo,pagina) {
	// nc - numero de colores
	// na - numero de anchos
	// nt - numero de tallas
	var vcod ;
	var nuevalinea ;
    var mensaje = "" ;
	var talla ;
	var color ;
	var ancho ;
	var vform = parent.principal.estante.document.datos ;
	var vlin ;
	var indice;
	subsec=0+subsec;
	subsubsec=0+subsubsec;

	if ( parent.principal.estante.document.forms.length == 0 )
	  {
	    alert("No está visualizando un artículo") ;
	    return ;
	  } ;
	vcod = parent.principal.estante.document.datos.codigo.value;
	if ( nt==1 ) {
	    indice = parent.principal.estante.document.datos.talla.selectedIndex;
	    talla = parent.principal.estante.document.datos.talla.options[indice].text;
	} else {
		talla=0;
		indice=0;
	}
	if (nc==1) {
		for (i=0;i<5;i++) {
        	if (parent.principal.estante.document.datos.color[i].checked) { 
		   		color=parent.principal.estante.document.datos.color[i].value;
		   		i=5;
		 	} 
		}
	} else {
	color=parent.principal.estante.document.datos.color.value;
	}
/*	for (i=0;i<3;i++) {  */
/*        if (parent.principal.estante.document.datos.ancho[i].checked) {   */
/*		   ancho=parent.principal.estante.document.datos.ancho[i].value;  */
/*		   i=3;   */
/*		 }   */
/*	}   */

	if (na > 1) {	
		for (i=0;i<3;i++) {
        	if (parent.principal.estante.document.datos.ancho[i].checked) { 
		   		ancho=parent.principal.estante.document.datos.ancho[i].value;
		   		i=5;
		 	} 
		}
	} else {
		ancho = parent.principal.estante.document.datos.ancho.value ;
	}
	vcod=color+talla+ancho;
	 	
	if ( vfactura.estacod(vcod) ) 
	{ 
	 verfra(sec,subsec,subsubsec,codigo,pagina,0);
	 return;
	} ;
    mensaje = parent.principal.estante.document.datos.descripcion.value + " " + color + " " + talla + " " + ancho;
    display("Cargado "+mensaje);

	nuevalinea = vfactura.lineas.length ;
	vfactura.lineas.length++ ;
	//vfactura.lineas[nuevalinea] = new linfra(vcod,vform.descripcion.value + " " + talla + " " + ancho,vform.precio.value );
	//vfactura.lineas[nuevalinea] = new linfra(codigo,vform.descripcion.value + "  " + color + " " + talla + " " + ancho,vform.precio.value );
	var indice2=indice+1;
	var precio=eval('vform.precio'+indice2+ '.value');
	vfactura.lineas[nuevalinea] = new linfra(codigo,vform.descripcion.value + "  " + color + " " + talla + " " + ancho,precio);
	verfra(sec,subsec,subsubsec,codigo,pagina,0);	
}

function salir(url) {
    parent.parent.top.document.location.href = url ;
}

function vaciar() {
    var doc ;
    vfactura = new fra() ;
	doc = parent.parent.top.document.location.href;
	parent.parent.top.document.clear() ;
	parent.parent.top.document.location.href = doc ;
}

function vaciar2() {
    var doc ;
    vfactura = new fra();
	//parent.parent.top.document.clear() ;
}

function convierteAEuros (ptas)
{

        var     TARIFA=166.386;
        var     PRECISION=2;

        var euros = (Math.floor (0.5+( (ptas*Math.pow(10, PRECISION))/TARIFA  ) ) / 
                                Math.pow (10, PRECISION)).toString();
		//alert (euros);

		if (euros.indexOf(".")!=-1) {
        	euros = euros.substring(0, euros.indexOf(".")) + "," + 
                                euros.substring(euros.indexOf(".")+1, euros.length);
		}

        return euros;

}

function convierteAPesetas (euros)
{

        var     TARIFA=166.386;
        var     PRECISION=0;

        var pesetas = (Math.floor (0.5+( (euros*Math.pow(10, PRECISION))*TARIFA  ) ) / 
                                Math.pow (10, PRECISION)).toString();
		//alert (euros);

//		if (euros.indexOf(".")!=-1) {
//        	euros = euros.substring(0, euros.indexOf(".")) + "," + 
//                                euros.substring(euros.indexOf(".")+1, euros.length);
//		}

        return pesetas;

}

function precisiondos (euros)
{

        var     TARIFA=1.0;
        var     PRECISION=2;

        var pesetas = (Math.floor (0.5+( (euros*Math.pow(10, PRECISION))*TARIFA  ) ) / 
                                Math.pow (10, PRECISION)).toString();
		//alert (euros);

//		if (euros.indexOf(".")!=-1) {
//        	euros = euros.substring(0, euros.indexOf(".")) + "," + 
//                                euros.substring(euros.indexOf(".")+1, euros.length);
//		}

        return pesetas;

}

function cambia(linea) {
    var vform = parent.principal.estante.document.factura ;

    vfactura.lineas[linea].cantidad = vform.elements[linea].value ;
	//    vform.elements[linea*2+1].value = vfactura.lineas[linea].calcula() ;
  //  vform.ctotal.value = vfactura.totaliza() ;

	verfra();
	vform.elements[linea].focus();
 //   vform.elements[linea*2+2].focus() ;
    return vfactura.lineas[linea].cantidad;
}

function cambiamas(linea,sec,subsec,subsubsec,codigo,pagina) {
    var vform = parent.principal.estante.document.factura ;

    vfactura.lineas[linea].cantidad = parseInt(vfactura.lineas[linea].cantidad)+1;
	
	var cm=vfactura.lineas[linea].cantidad;
	//    vform.elements[linea*2+1].value = vfactura.lineas[linea].calcula() ;
  //  vform.ctotal.value = vfactura.totaliza() ;

    verfra(sec,subsec,subsubsec,codigo,pagina,cm);
	
    return;
}

function cambiamenos(linea,sec,subsec,subsubsec,codigo,pagina) {
    var vform = parent.principal.estante.document.factura ;
	
	if (vfactura.lineas[linea].cantidad>0) {
    	vfactura.lineas[linea].cantidad = parseInt(vfactura.lineas[linea].cantidad)-1;
	}
	var cm=vfactura.lineas[linea].cantidad;
	//    vform.elements[linea*2+1].value = vfactura.lineas[linea].calcula() ;
  //  vform.ctotal.value = vfactura.totaliza() ;

    verfra(sec,subsec,subsubsec,codigo,pagina,cm);
	
    return;
}

function cambia2(linea) {
    var vform = parent.principal.estante.document.factura ;

    vfactura.lineas[linea].cantidad = vform.elements[linea*2].value ;
//    vform.elements[linea*2+1].value = vfactura.lineas[linea].calcula() ;
    vform.ctotal.value = vfactura.totaliza() ;

 //   vform.elements[linea*2+2].focus() ;
    return vfactura.lineas[linea].cantidad ;
}


function estavacio(campo) {
	var i = 0 ;

	if ( (campo.value == "") ) {
	  alert("Dato imprescindible: "+campo.name.substring(1,50));
	  campo.focus();
	  return false ; 
	 }
	else {
	  while ( i < campo.value.length ) {
		if ( campo.value.substring(i,i+1) != " " ) return true ;
		i++
	    }
		
	  alert("Dato imprescindible: "+campo.name.substring(0,50));
	  campo.focus();
	  return false ; 	   
	 }
	return false ;
	
}

function enviafra() {
	var vform = parent.principal.estante.document.factura ;
	var i = vfactura.lineas.length*2+1;

	if ( vfactura.totaliza() == 0 ) {
		alert("No hay nada que enviar.");
		return false ;
	}
	if (!estavacio(vform.elements[i]))	return false ;
	if (!estavacio(vform.elements[i+1]))	return false ;
	if (!estavacio(vform.elements[i+2]))	return false ;
	if (!estavacio(vform.elements[i+3]))	return false ;
	if (!estavacio(vform.elements[i+6]))	return false ;
	if ( vform.elements[i+8].value  != "" || 
	     vform.elements[i+9].value  != "" ||
	     vform.elements[i+10].value  != "" ) {
	     	if (!estavacio(vform.elements[i+8]))	return false ;
		if (!estavacio(vform.elements[i+9]))	return false ;
		if (!estavacio(vform.elements[i+10]))	return false ;
	} ;
	vform.submit() ;
	vfactura = new fra() ;
	return true ;
}

function formatok () {
}

function verfra(sec,subsec,subsubsec,codigo,pagina,distinta) {
	vhref=parent.principal.estante.location.href ;
    parent.principal.estante.location.href="factura.php?sec="+sec+"&subsec="+subsec+"&subsubsec="+subsubsec+"&codigo="+codigo+"&page="+pagina+"&elim="+distinta;
}

function comprar(sec,subsec,subsubsec,codigo,pagina) {
	var i = 0 ;
	var j = 0 ;
	var h= 0 ;
	var nart=0;
	var pos ;
	var cuantos = vfactura.lineas.length ;
	for (h=0;h<cuantos;h++) {
		nart=nart+vfactura.lineas[h].cantidad;
	}
	
	if (nart==0) {
		if (pagina==2) {
			parent.principal.estante.location.href="main.php?sec="+sec+"&subsec="+subsec+"&subsubsec="+subsubsec+"&COD="+codigo;
		} else {
			parent.principal.estante.location.href="main.php?sec="+sec+"&subsec="+subsec+"&subsubsec="+subsubsec+"&COD="+codigo;
		}
	} else {	
//	var url = parent.principal.estante.location.href;
 
//	parent.principal.estante.document.close() ;

	parent.principal.estante.document.writeln("<html>");
	parent.principal.estante.document.writeln("<head><title>gonvi.com -&gt; Datos de su Pedido</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head>");
	parent.principal.estante.document.writeln("<body><div align='left'>");
	parent.principal.estante.document.writeln("<form name='factura' method='post' action='factura1.php'>");
	parent.principal.estante.document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='670'><tr><td width='590' colspan='8'></td></tr><tr><td width='25' colspan='2' valign='middle'></td>" 
     + "<td width='500' colspan='2' valign='middle'><img src='imagenes/pedido1.gif' width='300'" 
	 + " height='17' alt='Detalles de su Pedido'><img src='imagenes/blank.gif' width='160'"
     + "height='1'></td><td width='50' colspan='2' align='right' valign='middle'></td>" 
	 + "<td width='44' colspan='2' align='right' valign='middle'><img src='imagenes/logo-gonvi2.gif' width='89' height='93'></td></tr>");
	parent.principal.estante.document.writeln("<tr><td width='590' colspan='8'><img src='imagenes/blank.gif' width='1' height='40'></td>" 
	+ "</tr><tr><td width='590' colspan='8'></td></tr><tr>" 
    + "<td width='25'><img src='imagenes/blank.gif' width='50' height='1'></td>" 
    + "<td colspan='4' width='450'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><strong>En la tabla inferior se encuentran los artículos que usted ha añadido a su carrito de la " 
    + "compra. Puede cambiar la cantidad de cualquier artículo, haciendo click sobre los iconos <img src='imagenes/boton+.gif'> &oacute; <img src='imagenes/boton-.gif'> en cada l&iacute;nea "
	+ "de la factura. Tambi&eacute;n puede cancelar su pedido, volver a la tienda o tramitar su pedido</strong><br>" 
    + "</font></td>");
	parent.principal.estante.document.writeln("<td width='50' colspan='2'><img src='imagenes/blank.gif' width='40' height='1'></td>" 
    + "<td width='150'><font face='Arial, Geneva, Helvetica, sans-serif' size='1'>Si tiene alguna pregunta póngase en contacto con nosotros en el e-mail: <a href='mailto:info@gonvi.com'>info@gonvi.com</a><br>" 
    + "o llame al teléfono <br><b>902 10 45 39</b></font></td></tr>" 
    + "<tr><td width='25'></td><td colspan='2'><img src='imagenes/blank.gif' width='1' height='15'></td>" 
    + "<td colspan='4'></td><td></td></tr><tr><td width='25'></td>");
	parent.principal.estante.document.writeln("<td colspan='2'><img src='imagenes/blank.gif' width='1' height='15'></td>" 
	+ "<td colspan='4'></td><td></td></tr></table></div>" 
	+ "<table WIDTH='656' CELLSPACING='0' CELLPADDING='0' BORDER='0'><tr VALIGN='top' ALIGN='left'>" 
	+ "<td WIDTH='20' NOWRAP></td><td COLSPAN='3' BGCOLOR='#000000' WIDTH='1'><img SRC='imagenes/blank.gif' WIDTH='1'" 
	+ "HEIGHT='1' ALT BORDER='0'></td></tr><tr VALIGN='top' ALIGN='left'><td WIDTH='20' NOWRAP></td>" 
	+ "<td BGCOLOR='#000000' WIDTH='1'><img SRC='imagenes/blank.gif' WIDTH='1' HEIGHT='1' BORDER='0'></td>");
	parent.principal.estante.document.writeln("<td WIDTH='578' bgcolor='#009D00' height='5'><table WIDTH='654' CELLSPACING='0'" 
	+ "CELLPADDING='0' BORDER='0'><tr VALIGN='top' ALIGN='left'><td WIDTH='50' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td> " 
	+ "<td WIDTH='270' align='center' bgcolor='#009D00' colspan='2' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Artículo</b></font></td>" 
	+ "<td WIDTH='5' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='5' HEIGHT='1'></td>" 
	+ "<td WIDTH='60' align='center' bgcolor='#009D00' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Precio</b></font></td>" 
 	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>" 
    + "<td WIDTH='40' align='center' bgcolor='#009D00' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Cantidad</b></font></td>");
	parent.principal.estante.document.writeln("<td WIDTH='20' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>" 
	+ "<td WIDTH='70' align='center' bgcolor='#009D00' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Subtotal Euros</b></font></td>" 
	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>" 
	+ "<td WIDTH='70' NOWRAP bgcolor='#009D00' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Subtotal Ptas</b></font></td>" 
	+ "<td WIDTH='9' NOWRAP bgcolor='#009D00' valign='middle'><SPACER TYPE='BLOCK' WIDTH='19' HEIGHT='1'></td>" 
	+ "</tr>");
	parent.principal.estante.document.writeln("<input type='hidden' name='pedido' value='"+(vfactura.pedido)+"'>");
	parent.principal.estante.document.writeln("<input type='hidden' name='cuantos' value='"+cuantos+"'>");
	parent.principal.estante.document.writeln("<input type='hidden' name='sec' value='"+sec+"'>");
	parent.principal.estante.document.writeln("<input type='hidden' name='subsec' value='"+subsec+"'>");
	parent.principal.estante.document.writeln("<input type='hidden' name='subsubsec' value='"+subsubsec+"'>");	
	parent.principal.estante.document.writeln("<input type='hidden' name='pagina' value='"+pagina+"'>");	
	parent.principal.estante.document.writeln("<input type='hidden' name='codigo' value='"+codigo+"'>");	
	for ( i=0 ; i<cuantos ; i++ ) {
	  j++;
	  var subtotal1 = vfactura.lineas[i].cantidad * vfactura.lineas[i].precio ;
	  subtotal1=precisiondos(subtotal1);
	  if (vfactura.lineas[i].cantidad>0) {
		parent.principal.estante.document.writeln("<tr VALIGN='top' ALIGN='left'><td COLSPAN='12' HEIGHT='5' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='1' HEIGHT='5'></td>" 
		+ "</tr><tr VALIGN='top' ALIGN='left'><td BGCOLOR='#999966' HEIGHT='1' COLSPAN='12' NOWRAP></td></tr>");
		parent.principal.estante.document.writeln("<!-- ITEM -->");
		parent.principal.estante.document.writeln("<tr BGCOLOR='#ffffcc' VALIGN='top' ALIGN='left'><td WIDTH='50' valign='middle'>" 
		+ "<img src='http://www.gonvi.com/imagenes/articulos/ico/"+(vfactura.lineas[i].codigo).substring(0,10)+".jpg' width='50'></td><td WIDTH='40' valign='middle' bgcolor='#ffffcc'><img src='imagenes/beig.gif' width='40' height='38'></td>");
		parent.principal.estante.document.writeln("<td WIDTH='230' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'> #"+vfactura.lineas[i].codigo+ " " + vfactura.lineas[i].descripcion 
		+ "</font></td><input type='hidden' name='articulo["+i+"]' value='"+vfactura.lineas[i].codigo+" "+vfactura.lineas[i].descripcion+"'>");
		parent.principal.estante.document.writeln("<td WIDTH='5' NOWRAP valign='middle'><SPACER TYPE='BLOCK' WIDTH='5' HEIGHT='1'></td>" 
	    + "<td WIDTH='60' align='right' valign='middle'>"	
		+ "<font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'>"+vfactura.lineas[i].precio+"  &euro;</font>");
		parent.principal.estante.document.writeln("<INPUT TYPE='hidden' NAME='precio["+i+"]' value='"+vfactura.lineas[i].precio+"'>");
		parent.principal.estante.document.writeln("</td>");
		parent.principal.estante.document.writeln("<td WIDTH='30' NOWRAP valign='middle'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
		+ "<td WIDTH='40' ALIGN='center' valign='middle'><a href=\"javascript:parent.parent.control.cambiamenos("+i+","+sec+","+subsec+","+subsubsec+",'"+codigo+"',"+pagina+");\"><img src='imagenes/boton-.gif' border='0'></a><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'>");
		parent.principal.estante.document.writeln(vfactura.lineas[i].cantidad+" </font><a href=\"javascript:parent.parent.control.cambiamas("+i+","+sec+","+subsec+","+subsubsec+",'"+codigo+"',"+pagina+");\"><img src='imagenes/boton+.gif' border='0'></a></td>");	
		parent.principal.estante.document.writeln("<INPUT TYPE='hidden' NAME='cantidad["+i+"]' value='"+vfactura.lineas[i].cantidad+"'><td WIDTH='10' NOWRAP valign='middle'><SPACER TYPE='BLOCK' WIDTH='10' HEIGHT='1'></td>"
		+ "<td WIDTH='70' align='right' valign='middle'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'>"
		+ subtotal1 + " &euro;</font></td>"
		+ "<td WIDTH='20' NOWRAP valign='middle'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
		+ "<td WIDTH='70' NOWRAP valign='middle'><font SIZE='1' COLOR='#000000' FACE='Arial,Geneva,Helvetica,Sans-serif'>"
		+ convierteAPesetas(subtotal1) + " Ptas</font></td>"
		+ "<td WIDTH='9' NOWRAP valign='middle'><SPACER TYPE='BLOCK' WIDTH='19' HEIGHT='1'></td></tr>");
		}
	}
	parent.principal.estante.document.writeln("<!-- SUBTOTAL TABLE -->\n"
	+ "<tr VALIGN='top' ALIGN='left'><td WIDTH='50' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
	+ "<td WIDTH='270' HEIGHT='5' NOWRAP bgcolor='#009D00' colspan='2'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
    + "<td WIDTH='5' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='5' HEIGHT='1'></td>"
	+ "<td WIDTH='70' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
	+ "<td WIDTH='30' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
	+ "<td WIDTH='70' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
	+ "<td WIDTH='70' VALIGN='top' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='50' HEIGHT='1'></td>"
	+ "<td WIDTH='9' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='19' HEIGHT='1'></td>"
	+ "</tr>");
	parent.principal.estante.document.writeln("<tr VALIGN='top' ALIGN='left'><td WIDTH='50' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='9' HEIGHT='1'></td>"
	+ "<td COLSPAN='6' VALIGN='top' ALIGN='right' bgcolor='#009D00'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'><b>Subtotal Factura</b></font></td>"
	+ "<td WIDTH='20' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='20' HEIGHT='1'></td>"
	+ "<td COLSPAN='3' VALIGN='top' bgcolor='#009D00' align='center'><font SIZE='1' FACE='Arial,Geneva,Helvetica,Sans-serif'>"
	+ vfactura.totaliza() + " &euro;&nbsp;&nbsp;&nbsp;&nbsp;" + convierteAPesetas(vfactura.totaliza()) +" Ptas</font></td>"
	+ "<td WIDTH='9' NOWRAP bgcolor='#009D00'><SPACER TYPE='BLOCK' WIDTH='19' HEIGHT='1'></td>"
	+ "</tr><tr VALIGN='top' ALIGN='left'><td HEIGHT='5' COLSPAN='12' NOWRAP bgcolor='#009D00'><img SRC='imagenes/blank.gif' WIDTH='1' HEIGHT='1' ALT BORDER='0'>"
	+ "<!-- /SUBTOTAL TABLE --></td></tr></table></td>");
	parent.principal.estante.document.writeln("<td BGCOLOR='#000000' WIDTH='1'><img src='imagenes/blank.gif' width='1' height='1'></td>"
	+ "</tr><tr VALIGN='top' ALIGN='left'><td WIDTH='20' NOWRAP></td><td COLSPAN='3' BGCOLOR='#000000' WIDTH='1'><img src='imagenes/blank.gif' width='655' height='1'></td>"
	+ "</tr></table><div align='left'>");
	parent.principal.estante.document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='610'>"
	+ "<tr><td></td><td valign='middle' colspan='3'><img src='imagenes/blank.gif' width='1' height='15'></td>"
	+ "</tr><tr><td></td><td colspan='3'><img src='imagenes/blank.gif' width='1' height='15'></td>"
	+ "</tr><tr><td width='50'></td>");
	if (pagina==2) {
		parent.principal.estante.document.writeln("<input type='hidden' name='pagina' value='2'>");
		parent.principal.estante.document.writeln("<td><a href='main.php?sec="+sec+"&subsec="+subsec+"&subsubsec="+subsubsec+"&COD="+codigo+"' target='estante'><image src='imagenes/boton-volver.gif' border='0'></a>");
	}	
	if (pagina==1) {
		parent.principal.estante.document.writeln("<td><a href='main.php?sec="+sec+"&subsec="+subsec+"&subsubsec="+subsubsec+"&COD="+codigo+"' target='estante'><image src='imagenes/boton-volver.gif' border='0'></a>");
		parent.principal.estante.document.writeln("<input type='hidden' name='pagina' value='1'>");	
	}	
	parent.principal.estante.document.writeln("</font></td>");
	parent.principal.estante.document.writeln("<td align='center'><a href='javascript:parent.parent.control.vaciar();'><img src='imagenes/boton-cancelacion.gif' border='0'></a></td>");
	parent.principal.estante.document.writeln("<td align='right'><input type='image' name='continuar' src='imagenes/botoncontinuar.gif' width='167' height='17' border='0' alt='Continuar compra' onclick='submit()'></td>"
	+ "</tr></table></div><br>");
	parent.principal.estante.document.writeln("<br></form>");
	parent.principal.estante.document.writeln("</center>"
		+"</BODY></HTML>") ;
	}	  
}





