
function BloqueaBotonDerecho(laFrame) {
    laFrame.contentWindow.document.oncontextmenu = function(event) { return false };
}




	//Ajusta el tamaņo de una window a la iframe que contiene
function ajustaTamano(laFrame) {
    //    alert(laFrame.style.width + '1');
    //    alert(laFrame.contentWindow.document.documentElement.scrollWidth);
    //    alert(laFrame.src);
    //    alert(top.location.host);
    if (laFrame.src.indexOf(top.location.host) == -1) { // se trata de un link externo
        laFrame.style.height = '1000px';
        laFrame.style.width = '1024px';
        }
    else {
        //laFrame.contentWindow.document.documentElement.style.width = '600px';
        var h = laFrame.contentWindow.document.documentElement.scrollHeight;
        var w = laFrame.contentWindow.document.documentElement.scrollWidth;
//        alert(h);
//        alert(w);
        if (h < 600) h = 600;
        if (w < 800) w = 800;


        laFrame.style.height = h + 2 + 'px';
        laFrame.style.width = w + 'px';
        //        laFrame.style.width = '100%';
        
        //bloquea el boton derecho del raton
        BloqueaBotonDerecho(laFrame);
    }
}










//1.if (isFirefox){   
//2.  HTMLElement.prototype.__defineGetter__("innerText",function () { return(this.textContent); });   
//3.  HTMLElement.prototype.__defineSetter__("innerText",function (txt) { this.textContent = txt; });
//4.}
//var foo = bar.innerText || bar.textContent;

            //ejemplo de childnodes
            //                var nens = cols[j].childNodes;
            //                if (nens != null) {
            //                    for (var k = 0; k < nens.length; k++) {
            //                        alert(nens[k].tagName);

            //                        if (nens[k].tagName == 'INPUT' && nens[k].type == 'text') {
            //                            alert(nens[k].value);
            //                            coltxt = nens[k].value
            //                        }
            //                    }
    //                }


function CreateCsvSheet(latabla, elform) {
    var filas = latabla.rows;
    var tablaStr = "";
    var coltxt;
    var cols;

    for (var i = 0; i < filas.length; i++) {
        cols = filas[i].cells;

        for (var j = 0; j < cols.length; j++) {
            coltxt = cols[j].innerText || cols[j].textContent;
//            alert(typeof coltxt);
            if ((typeof coltxt) == "undefined") coltxt = "";
            tablaStr += coltxt + ";";
        }
        tablaStr += "\r";
    }
    elform.datos.value = tablaStr;
    elform.submit();
    return false;
}






function ChkNotas(laNota) {
    var cadenaOK = ',.1234567890';
    laNota.value = laNota.value.toUpperCase();
    var calif = laNota.value;
    if ((calif == '') | (calif == 'NP') | (calif == 'np') | (calif == 'CV') | (calif == 'cv') | (calif == 'EC') | (calif == 'ec')) {
    }
    else {
        for (var i = 0; i <= calif.length - 1; i++) {
            if (cadenaOK.indexOf(calif.charAt(i)) == -1) {
                alert(window.top.txt_Calif_no_valid);
                laNota.focus();
                return false;
            }
        }
    }
    doPOST(laNota.form, 'modNotas');
    laNota.style.color = '#00ff00'; 
    return true;
}

function NviaComent(elComent) {
    doPOST(elComent.form, 'modNotas');
    elComent.style.color = '#00ff00';
    return true;
}

