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 gamla_showhide(tag) {
    var cont = document.getElementById('items');
    if (cont) {
        var childs = cont.childNodes;
        for (i=0; i<childs.length;i++) {
            if (childs[i].className && childs[i].className.indexOf('item')>-1) {
                var cn = childs[i].className;
                if (childs[i].className.indexOf(tag)>0) {
                    childs[i].style.display = 'block';
                } else {
                    childs[i].style.display = 'none';
                }
            }
        }       
    }
}

function showhide(tag) {
    var cont = document.getElementById('items');
    if (tag == '') {
        tag = 'item';
    }
    if (cont) {
        var childs = cont.childNodes;
        for (i=0; i<childs.length;i++) {
            if (childs[i].className && childs[i].className.indexOf('item')>-1) {
                var cn = childs[i].className;
                if (childs[i].className.indexOf(tag)>-1) {
                    childs[i].style.display = 'block';
                } else {
                    childs[i].style.display = 'none';
                }
            }
        }
    }
}

function ekkert () {}

function screener(){
	this.bottom = function(){
		if (document.body.scrollHeight) return document.body.scrollHeight;
	};

	this.height = function() {
		if (document.body.offsetHeight) return document.body.offsetHeight;
	};

	this.visHeight = function() {
		if (window.innerHeight) return window.innerHeight;
		if (document.body.clientHeight) return document.body.clientHeight;
	};

	this.width = function() {
		if (document.body.offsetWidth) return document.body.offsetWidth;
	};

	this.scrollTop = function() {
		if(document.body.scrollTop) return document.body.scrollTop
		if (window.pageYOffset) return window.pageYOffset;
		else return 0;
	};
}

var sc = new screener();
window.onresize = function() { };
function initt() {
	var vinstri = (parseInt(sc.width())-600)/2;
	haus.style.left = vinstri+'px';
	skrokkur.style.left = vinstri+'px';
	if (location.href.indexOf('/kaktus/') > -1) {haus.style.display = "none";}
}
