function decodeXor(s) {
    var t = "";
    for (i = 0; i < s.length; i++) {
        t += String.fromCharCode(s.charCodeAt(i) - 1);
    }
    return t;
}

function openMailLink(codedEmail) {
    location.href = "mailto:" + decodeXor(codedEmail);
}

function printCodedEmail(codedEmail) {
    document.write(decodeXor(codedEmail));
}

function checkInFrame() {
/*  if (window == top) {
        location.replace("/index.html?url=" + location.pathname + escape(location.search));
    }
*/
}
function checkFields() {
        if (document.forms["add_computer_form"].elements["namn"].value== "") {
            alert("Du måste ange namnet");
            document.forms["add_computer_form"].elements["namn"].value.focus();
            return false;
        }
        if (document.forms["add_computer_form"].elements["ipnr"].value== "") {
            alert("Du måste ange IP-nummer");
            document.forms["add_computer_form"].elements["ipnr"].value.focus();
            return false;
        }
        if (document.forms["add_computer_form"].elements["macadress"].value== "") {
            alert("Du måste ange MAC-adress");
            document.forms["add_computer_form"].elements["macadress"].value.focus();
            return false;
        }
        return true;
    }


function submitForm() {
  document.quickNavig.submit();
}