﻿function lomo(s) {
window.status=s;
return true;
}

function FC(sField,iMax) {
var iC = document.getElementById(sField).value.length;
var iCC = iMax-iC;
var oC = document.getElementById(sField+'_c');
oC.innerHTML = iCC;
}

function validate(string2,caption,lengthmin,lengthmax) {
if (string2.length < lengthmin) {
alert('Fältet "' + caption + '" måste innehålla minst '+lengthmin+' tecken.');
return false;
}
if (string2.length > lengthmax) {
alert('Fältet "' + caption + '" får max innehålla '+lengthmax+' tecken.');
return false;
}
return true;
} 

function del(href,sQ) {
if (confirm(sQ)) {
location.href=href;
}
}

function ks(el) {
if (event.ctrlKey && 13 == event.keyCode) {
vd();
return false; 
}
}

function pop(file,name,options) {
w = window.open(fileName,name,options);
w.focus;
}

function pa(t, i, u) {
    if (confirm('Är du säker på att du vill rapportera detta inlägg till Helgon crew?')) {
        newwindow = window.open('/abuse/?t=' + t + '&i=' + i + '&u=' + u, 'popab', 'height=300,width=500');
        if (window.focus) { newwindow.focus() }
        return false;
    }
}

function ET(param1, param2, flag) {
    if (flag == true) {
        document.getElementById(param1).style.display = 'none';
        if (param2 != '') {
            document.getElementById(param2).style.display = 'block';
        }
    }
    else {
        document.getElementById(param1).style.display = 'block';
        if (param2 != '') {
            document.getElementById(param2).style.display = 'none';
        }
    }
}