<!--

function viewDebug(i) {
	if (document.all('debug' + i).style.display == 'none') {
		document.all('debug' + i).style.display = '';
		eval('document.debugpila' + i).src = '/myndefni/pilanidur.gif';
	} else {
		document.all('debug' + i).style.display = 'none';
		eval('document.debugpila' + i).src = '/myndefni/pilahaegri.gif';
	}
}

function stats(i) {
	if (document.all('stats' + i).style.display == 'none') {
		document.all('stats' + i).style.display = '';
		eval('document.pila' + i).src = 'pilanidur.gif';
	} else {
		document.all('stats' + i).style.display = 'none';
		eval('document.pila' + i).src = 'pilahaegri.gif';
	}
}

function PlyInf(i) {
	if (document.getElementById('PlyInf' + i).style.display == 'none') {
		document.getElementById('PlyInf' + i).style.display = '';
		eval('document.PlyInfpila' + i).src = 'pilanidur.gif';
	} else {
		document.getElementById('PlyInf' + i).style.display = 'none';
		eval('document.PlyInfpila' + i).src = 'pilahaegri.gif';
	}
}

function Report(s, t) {
	if (document.getElementById(s).style.display == 'none') {
		document.getElementById(s).style.display = '';
		document.getElementById(t).src = '/myndefni/pilanidur.gif';
	} else {
		document.getElementById(s).style.display = 'none';
		document.getElementById(t).src = '/myndefni/pilahaegri.gif';
	}
}

// Formatar tölu með þúsundapunktum
function ThPunktur(Tala) {
	var s = new String(Tala);
	var FjoldiP = (s.length - s.length % 3) / 3;
	if (s.length % 3 == 0) FjoldiP -= 1;
	for (var I = 0; I < FjoldiP; I++) {
		s = s.substring(0, s.length-(FjoldiP-I)*3) + "." + s.substring(s.length-(FjoldiP-I)*3, s.length);
	}
	return s;
}

// Hækkar obj um upphead
function InputUp(obj, upphaed, iHighBound)
{
	var GomulUpphaed = eval(obj).value + "";
//	alert(GomulUpphaed);
	var TmpUpphaed = "";
	for (r=0;r<GomulUpphaed.length;r++)
	{
		if (GomulUpphaed.charAt(r)*1 == GomulUpphaed.charAt(r)) TmpUpphaed += GomulUpphaed.charAt(r)
	}
	
	var NyUpphaed = TmpUpphaed * 1 + upphaed
	
	if (NyUpphaed > iHighBound)
		NyUpphaed = iHighBound
	
	eval(obj).value = ThPunktur(NyUpphaed)
}

// Lækkar obj um upphead
function InputDown(obj, upphaed, iLowBound)
{
	var GomulUpphaed = eval(obj).value + "";
	var TmpUpphaed = "";
	for (r=0;r<GomulUpphaed.length;r++)
	{
		if (GomulUpphaed.charAt(r)*1 == GomulUpphaed.charAt(r)) TmpUpphaed += GomulUpphaed.charAt(r)
	}

	var NyUpphaed = TmpUpphaed * 1 - upphaed
	if (NyUpphaed < iLowBound)
		NyUpphaed = iLowBound

	eval(obj).value = ThPunktur(NyUpphaed)
}

function countChecks(f)
{
	var count = 0;
	var len = f.tm_id.length;
	for (var idx = 0; idx < max; idx++)
	{
		if (eval("f.ckbox[" + idx + "].checked") == true)
			count++;
	}

	return count;
}

//-->
