// Open seperate window with variable size
	
	function openwin(URL,w,h,windowoptions) {
	
		showtoolbar = windowoptions.substring(0,1);
		showmenubar = windowoptions.substring(1,2);
		showscrollbar = windowoptions.substring(2,3);
		showstatus = windowoptions.substring(3,4);
		showresizable = windowoptions.substring(4);
		
		insertoptions = "toolbar="+showtoolbar+",menubar="+showmenubar+",scrollbars="+showscrollbar+",status="+showstatus+",resizable="+showresizable+",width="+w+",height="+h;
		
		thePage = window.open(URL,"mypopupwindow",insertoptions);
		thePage.focus();
	}
	
	
	function toggle_showbtn(mygraphic) {
		state = document.images[mygraphic].src;
		if (state.indexOf("btn-show.gif") > 0) {
			document.images[mygraphic].src = "my/library/img/btn-hide.gif";
		} else {
			document.images[mygraphic].src = "my/library/img/btn-show.gif";
		}
	}
	
	
	
// Layer functions

	function show_layer(id) {
		document.getElementById(id).style.visibility = 'visible';
	}
			
	function hide_layer(id) {
		document.getElementById(id).style.visibility = 'hidden';
	}
	
	
	function toggle_vis(id) {
		if (document.getElementById(id).style.visibility == 'hidden') {
			document.getElementById(id).style.visibility = 'visible';
		} else {
			document.getElementById(id).style.visibility = 'hidden';
		}
	}
	
	
	function toggle_collapse(id) {
		if (document.getElementById(id).style.display == 'block') {
			document.getElementById(id).style.display = 'none';
		} else {
			document.getElementById(id).style.display = 'block';
		}
	}

	function toggle_collapse2(id) {
		if (document.getElementById(id).style.display == 'none') {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
	
	function show_block(id) {
		document.getElementById(id).style.display = 'block';
	}

	function hide_block(id) {
		document.getElementById(id).style.display = 'none';
	}


// Formular

	function myform_submit(myform) {
		alert(document.forms[myform].email_navn.value);
		if (true) {
			document.forms[myform].submit();
		} else {
			alert("Alle felter markeret med * skal udfyldes.");
		}
		
	}


// EDITOR
/*
	function load_editor(site) {
		editor = parent.frames['options'].location.href;
		if (editor.indexOf('overview.php') < 0 && editor.indexOf('login.php') < 0) {
			parent.frames['options'].location.href = 'my/admin/overview.php?site='+site;
		}
	}
	
	function edit_article(value) {
		//alert("article="+value);
		document.getElementById('article_'+value).style.border = "dotted 1px #456";
	}
	
	function delete_article(page_id,id) {
		if (confirm("Du er ved at slette denne artikel. Er du nu helt sikker?")) {
			document.location.href = "my.php?page="+page_id+"&delete_article="+id;
		}
	}
*/


// PLUGINS

	function plugin_collapse(id) {
		if (document.getElementById(id).style.display == 'block') {
			document.getElementById(id).style.display = 'none';
		} else {
			document.getElementById(id).style.display = 'block';
		}
	}

	function list_open(id) {
		toggle_collapse('mylisttxt_'+id);
		toggle_showbtn('mylistimg_'+id);
	}



// calendar + events
	
	function dw_cal_showtopic(topic) {
		document.dw_cal.dw_cal_displaytopic.value=topic;
		document.dw_cal.submit();
	}
	
	function dw_cal_showID(id) {
		document.dw_cal.dw_cal_showID.value=id;
		document.dw_cal.submit();
	}
	
	function dw_cal_sort(sort,find) {
		document.dw_cal.dw_cal_find.value=find;
		document.dw_cal.dw_cal_sort.value=sort;
		document.dw_cal.submit();
	}
	



