function show(obj,url) {
	showNoDivs();
	showHide(obj);
	visaDiv(url);
}

function showHide(obj) {
    object = document.getElementById(obj);
    var disp = object.style.display

    if (disp == "none") {
        disp = "block";
    }
    else {
        disp = "none";
        //if (!document.all) location.reload();
    }
    object.style.display = disp;
}

function showHideMenu(obj) {
    object = document.getElementById(obj);
    var disp = object.style.display

    if (disp == "none") {
        disp = "block";
    }
    else {
        disp = "none";
        //if (!document.all) location.reload();
    }
    object.style.display = disp;
}

function open_win(str) 
{
	window.open(str);
}


function visaDiv(url) {
    var myIframe = document.getElementById('hiddenframe');
    myIframe.src = url;
    return;
}

function init() {
    var iframeObject = document.createElement("iframe");
    document.getElementById('main').appendChild(iframeObject);
    iframeObject.setAttribute('id', "hiddenframe");
    iframeObject.setAttribute('scrolling', "auto");
    iframeObject.setAttribute('frameBorder', "0");
	iframeObject.style.height = "600px";
	iframeObject.style.width = "78%";
	/*iframeObject.style.marginwidth = "0";*/
	/*iframeObject.style.padding-left = "10px";*/
	showNoDivs();
	/*document.getElementById('menu_utbildning').style.display="none";*/
    show('menu_hem','hem/hem_index.html');
    return;
}

function visaDivArkiv(url) {
    var myIframe = document.getElementById('arkivHiddenFrame');
    myIframe.src = url;
    return;
}

function initArkiv() {
    var iframeObject = document.createElement("iframe");
    document.getElementById('middle').appendChild(iframeObject);
    iframeObject.setAttribute('id', "arkivHiddenFrame");
    iframeObject.setAttribute('scrolling', "auto");
	iframeObject.style.height = "600px";
	iframeObject.style.width = "100%";
    iframeObject.setAttribute('frameBorder', "0");
	/*iframeObject.style.marginwidth = "0";*/
	/*iframeObject.style.padding-left = "10px";*/
	/*document.getElementById('menu_utbildning').style.display="none";*/
    return;
}

function showNoDivs() {
	document.getElementById('menu_hem').style.display="none";
	document.getElementById('menu_aktuellt').style.display="none";
	document.getElementById('menu_utbildning').style.display="none";
	document.getElementById('menu_service').style.display="none";
	document.getElementById('menu_forsaljning').style.display="none";
	document.getElementById('menu_musik').style.display="none";
	document.getElementById('menu_kursanmalan').style.display="none";
	document.getElementById('menu_boka').style.display="none";
	document.getElementById('menu_kontakt').style.display="none";
    return;
}

 function sendDataByMail(epostadress){
	alert('Formuläret skickas nu till ' + epostadress);
 	var obj = document.getElementById('frm');
    return obj.action="mailto:"+epostadress;
}
