if (self.location.host != top.location.host) {
	top.location.href = self.location.href;
}

function opna_glugga(url, nafn, w, h, r, sc) {
	if (isNaN(w))  { w=620; }
	if (isNaN(h))  { h=600; }
	if (isNaN(r))  { r=0; }
	if (isNaN(sc)) { sc=0; }
	gluggi = window.open(url,nafn,"width="+w+",height="+h+",toolbar=0,status=0,resizable="+r+",menubar=0,scrollbars="+sc);
	gluggi.focus();
}

function opna_nyjan(url) {
	gluggi = window.open(url);
	gluggi.focus();
}

function ekkert () {}

function hilite(im,state) { 
	if (im) { 
		im.src = '/img/'+im.id+'-'+state+'.gif'; 
	} 
}

//////////////////////////////////////////////
var lastEd = null;

function disped(t) {
	var e = window.event;
	var ey = (e.pageY ? e.pageY : e.y)
	var ex = (e.pageX ? e.pageX : e.x)

	if (t.id) {
		var di = t.id+'edit';
		document.all[di].style.left = ex;
		document.all[di].style.top = ey+parseInt(document.body.scrollTop);
		document.all[di].style.visibility = 'visible';
		if (null!=lastEd) {
			lastEd.style.visibility = 'hidden';
		}
		lastEd = document.all[di];
		event.cancelBubble = true;
	}
}

document.onclick = function() {
	if (null!=lastEd) {
			lastEd.style.visibility = 'hidden';
			lastEd = null;
	}
}