function surfto(form) {
 var myindex=form.omrade.selectedIndex
 if (form.omrade.options[myindex].value != "0") {
 location=form.omrade.options[myindex].value;}
}

window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=70; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	if (d) {d.style.display='block';}
}

function move_box(an, box)
{
    var cleft = 300;
    var ctop = -300;
    var obj = an;

    while (obj.offsetParent)
    {
        cleft += obj.offsetLeft;
        ctop += obj.offsetTop;
        obj = obj.offsetParent;
    }

    box.style.left = cleft + 'px';

    ctop += an.offsetHeight + 8;

    // Handle Internet Explorer body margins,
    // which affect normal document, but not
    // absolute-positioned stuff.
    if (document.body.currentStyle &&
        document.body.currentStyle['marginTop'])
    {
        ctop += parseInt(
            document.body.currentStyle['marginTop']);
    }

    box.style.top = ctop + 'px';
}

// Shows a box if it wasn't shown yet or is hidden
// or hides it if it is currently shown
function show_hide_box(an, width, height, borderStyle)
{
    var href = an.href;
    var boxdiv = document.getElementById(href);

    if (boxdiv != null)
    {
        if (boxdiv.style.display=='none')
        {
            // Show existing box, move it
            // if document changed layout
            move_box(an, boxdiv);
            boxdiv.style.display='block';
        }
        else
            // Hide currently shown box.
            boxdiv.style.display='none';
        return false;
    }

    
    // Create box object through DOM
    boxdiv = document.createElement('div');

    // Assign id equalling to the document it will show
    boxdiv.setAttribute('id', href);

    
    boxdiv.style.display = 'block';
    boxdiv.style.position = 'absolute';
    boxdiv.style.width = width + 'px';
    //boxdiv.style.height = height + 'px';
    boxdiv.style.height = 'auto';
    boxdiv.style.border = borderStyle;
    boxdiv.style.textAlign = 'right';
    boxdiv.style.paddingTop = '10px';
	boxdiv.style.paddingLeft = '10px';
	boxdiv.style.paddingRight = '10px';
	boxdiv.style.paddingBottom = '30px';
	boxdiv.style.backgroundImage='url(../../images/bg_personal.gif)'
    //boxdiv.style.background = '#ffffff';
	boxdiv.style.font = 'normal bold 8pt Arial'
	boxdiv.style.color = '#cccccc'
    document.body.appendChild(boxdiv);

    var offset = 0;

    // Remove the following code if 'Close' hyperlink
    // is not needed.
    var close_href = document.createElement('a');
   close_href.href = 'javascript:void(0);';
    close_href.onclick = function()
    { show_hide_box(an, width, height, borderStyle); }
    close_href.appendChild(document.createTextNode('Stäng fönster'));
    boxdiv.appendChild(close_href);
    offset = close_href.offsetHeight;
    // End of 'Close' hyperlink code.

    var contents = document.createElement('iframe');
    contents.scrolling = 'no';
    contents.frameBorder = '0';
	contents.style.marginTop = '23px';
	contents.style.marginBottom = '38px';
    contents.style.width = width + 'px';
    contents.style.height = (height - offset) + 'px';
    //contents.style.height = 'auto';

    boxdiv.appendChild(contents);

    move_box(an, boxdiv);

    if (contents.contentWindow)
        contents.contentWindow.document.location.replace(
            href);
    else
        contents.src = href;

    // The script has successfully shown the box,
    // prevent hyperlink navigation.
    return false;
}

