function ventana(url,n,w,h) {
    var posx = Math.round((screen.width-w)/2);
    var posy = Math.round((screen.height-h)/2);
    
    v = window.open(url,n,'scrollbars=yes,width='+w+',height='+h+',left='+posx+',top='+posy+',screenX='+posx+',screenY='+posy);
    mw = w + 6;
    mh = h + 72;
    iw = w + 30;
    ih = h + 90;
    if (navigator.appName == "Netscape") {
        if (h >= 600) {
            mw += 17;
        }
        v.resizeTo(mw,mh);
    } else {
        v.resizeTo(iw,ih);
    }
    v.focus();
	return false;
}

function add(element) {
    var oForm = element.parentNode.parentNode;
    oForm.submit();
    return false;
}

function add2(element) {
    var oForm = element.parentNode.parentNode.parentNode;
    oForm.submit();
    return false;
}

function eliminar_articulo(referencia) {
    oForm = document.forms['ref_'+referencia];
    oForm.elements['cantidad'].value = 0;
    oForm.submit();
    return false;
}

function confirmar_datos() {
    oForm = document.forms['pedido'];
    oForm.submit();
    return false;
}

function enter(oEvent,oForm) {
	if (oEvent.keyCode == 13) {
		oForm.submit();	
	}
}

function numeros(evt) {
	var keyPressed = (evt.which) ? evt.which : event.keyCode
	return !(keyPressed > 31 && (keyPressed < 48 || keyPressed > 57));
}

