function OnTop() {
if (top.location != location) top.location.href = location.href;
}

var url="http://maxmagnusnorman.com/"
var title="MaxMagnusNorman.com"
function Ab(){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function openW(ur,nam,Dw,Dh,Dx,Dy){

Dw = (screen.width) ? (screen.width-Dx)/2 : 0;
//Dh = (screen.height) ? (screen.height-Dy)/2 : 0;
Dh=50;

//new window adapts its size to fit screen (c) Max Magnus Norman
Br = new Object()

Br.scr = screen;

MY=(Br.scr)?Br.scr.height:0
MX =(Br.scr)?Br.scr.width:0
if (Dx > MX){
Dx=(MX-30);
}
if (Dy > MY){
Dy=(MY-50);
}
popupW = window.open(ur,nam,"',width="+Dx+",height="+Dy+",left="+Dw+",top="+Dh+",resizable=1,scrollbars=1'")
}


function setCookie(name, value, expires, path, domain, secure) {
 var curCookie = name + "=" + escape(value) +
 ((expires) ? "; expires=" + expires.toGMTString() : "") +
 ((path) ? "; path=" + path : "") +
 ((domain) ? "; domain=" + domain : "") +
 ((secure) ? "; secure" : "");
 document.cookie = curCookie;
}
function t(date) {
var b = new Date(0);
var b = b.getTime();
if (b > 0)
date.setTime(date.getTime() - b);
}
var n = new Date();
t(n);
n.setTime(n.getTime() + 365 * 24 * 60 * 60 * 1000);
var v="0";
// uppl&ouml;sning och f&auml;rgdjup
colours = screen.colorDepth;
if (self.screen) { // NN4 and IE4
width = screen.width;
height = screen.height;
num = width-colours;
hum = width+height+num;
sum = width+height;
}
else
if (self.java) { // for NN3 with enabled Java
var jkit = java.awt.Toolkit.getDefaultToolkit();
var scrsize = jkit.getScreenSize();
width = scrsize.width;
height = scrsize.height;
num = width-colours;
hum = width+height+num;
sum = width+height;
}
v = hum+'B'+width+'B'+sum+'B'+height+'B'+colours+'B'+num;
setCookie("choklad", v, n);

function SP(url,name){
SPW = window.open(url,name, 'scrollbars,resizable,width=450,height=470,left=10,top=10')
}

if (document.images) {
Exo = new Image();
Exo.src = "E/tilted-exit.gif";
Exa = new Image();
Exa.src = "E/exit-closed.gif";
Headd = new Image();
Headd.src = "E/dangling-head.gif";
Heads = new Image();
Heads.src = "E/hangmans-head.gif";

}
function EcH() {
if (document.images) {
for (var i=0; i<EcH.arguments.length; i+=2) {
document[EcH.arguments[i]].src = eval(EcH.arguments[i+1] + ".src");
}
}
}


function Glidin(A, B) {
var i,j,tmLn,props,keyFrm,Q,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.P == null) SeK();
tmLn = document.P[A];
if (B == null) { B = ++tmLn.ID; firstTime=true;}
if (B == tmLn.ID) {
setTimeout('Glidin("'+A+'",'+B+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
Q = tmLn[i];
 if (Q.obj) {
numKeyFr = Q.keyFrames.length; firstKeyFr = Q.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= Q.keyFrames[numKeyFr-1]) {
keyFrm=1;
for (j=0; j<Q.L.length; j++) {
props = Q.L[j]; 
if (numKeyFr != props.length) {
if (props.prop2 == null) Q.obj[props.prop] = props[fNew-firstKeyFr];
else Q.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=Q.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==Q.keyFrames[keyFrm-1]) {
if (props.prop2 == null) Q.obj[props.prop] = props[keyFrm-1];
else Q.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } }
}
} }
}

function SeK() {

var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
document.P = new Array(1);
document.P[0] = new Array(2);
document.P["Ja"] = document.P[0];
document.P[0].MM_Name = "Ja";
document.P[0].fps = 15;
 
document.P[0][0] = new String("Q");
document.P[0][0].slot = 1;
if (ns4)
document.P[0][0].obj = document["pryl"];
else if (ns5)
document.P[0][0].obj = document.getElementById("pryl");
else
document.P[0][0].obj = document.all ? document.all["pryl"] : null;
document.P[0][0].keyFrames = new Array(1, 40, 100, 15);
document.P[0][0].L = new Array(3);
if (ns5)
document.P[0][0].L[0] = new Array("232px","211px","188px","158px","113px","74px","20px","-20px","-40px","-160px","-150px","-140px","-130px","-120px","-110px");
else
document.P[0][0].L[0] = new Array(232,211,188,158,113,74,20,-20,-40,-160,-150,-140,-130,-120,-110);
document.P[0][0].L[0].prop = "left";
if (ns5)
document.P[0][0].L[1] = new Array("319px","316px","305px","292px","277px","253px","215px","200px","200px","200px","200px","200px","200px","200px","200px");
else
document.P[0][0].L[1] = new Array(319,316,305,292,277,253,215,200,200,202,200,200,20,20,0);
document.P[0][0].L[1].prop = "top";
if (!ns4) {
document.P[0][0].L[0].prop2 = "style";
document.P[0][0].L[1].prop2 = "style";
}
document.P[0][0].L[2] = new Array("visible","visible","visible","visible");
document.P[0][0].L[2].prop = "visibility";
if (!ns4)
document.P[0][0].L[2].prop2 = "style";

document.P[0][1] = new String("Q");
document.P[0][1].slot = 2;
if (ns4)

document.P[0][1].obj = document["vertikal"];
else if (ns5)
document.P[0][1].obj = document.getElementById("vertikal");
else
document.P[0][1].obj = document.all ? document.all["vertikal"] : null;
document.P[0][1].keyFrames = new Array(1, 40, 100, 16);
document.P[0][1].L = new Array(3);
if (ns5)
document.P[0][1].L[0] = new Array("-180px","-170px","-160px","-140px","-115px","-80px","-50px","-30px","-21px","-15px","-10px","-6px","0px","5px","10px","15px");
else
document.P[0][1].L[0] = new Array(-180,-170,-160,-140,-115,-80,-50,-30,-21,-15,-10,-6,0,5,10,15);
document.P[0][1].L[0].prop = "left";
if (ns5)
document.P[0][1].L[1] = new Array("-300px","-300px","-300px","-245px","-205px","-165px","-135px","-105px","-85px","-65px","-45px","-25px","-15px","-5px","0px","5px");
else
document.P[0][1].L[1] = new Array(-300,-300,-300,-245,-205,-165,-135,-105,-85,-65,-45,-25,-15,-5,0,5);
document.P[0][1].L[1].prop = "top";
if (!ns4) {
document.P[0][1].L[0].prop2 = "style";
document.P[0][1].L[1].prop2 = "style";
}
document.P[0][1].L[2] = new Array("visible","visible","visible","visible");
document.P[0][1].L[2].prop = "visibility";
if (!ns4)
document.P[0][1].L[2].prop2 = "style";

for (i=0; i<document.P.length; i++) {
document.P[i].ID = null;
document.P[i].curFrame = 0;
document.P[i].delay = 1000/document.P[i].fps;
}}
