window.onload = function (evt) {
roter();
roter2();
roter3();
roter4();
roter5();
roter6();
roter7();
roter8();}

function validate(){}
function roter(){} 
function roter2(){}
function roter3(){}
function roter4(){}
function roter5(){}
function roter6(){}
function roter7(){}
function roter8(){}

function stamdataCTRL()
{
	hidesAllCTRLs();
	stamdata.style.visibility="visible";
	stamdata.style.left=main.offset.getBoundingClientRect().left-5;
	stamdata.style.top=main.offset.getBoundingClientRect().top;
}

function profilCTRL()
{
	hidesAllCTRLs();
	profil.style.visibility="visible";
	profil.style.left=main.offset.getBoundingClientRect().left-5;
	profil.style.top=main.offset.getBoundingClientRect().top;
}

function rettighederCTRL()
{
	hidesAllCTRLs();
	rettigheder.style.visibility="visible";
	rettigheder.style.left=main.offset.getBoundingClientRect().left-5;
	rettigheder.style.top=main.offset.getBoundingClientRect().top;
}

function diverseCTRL()
{
	hidesAllCTRLs();
	diverse.style.visibility="visible";
	diverse.style.left=main.offset.getBoundingClientRect().left-5;
	diverse.style.top=main.offset.getBoundingClientRect().top;
}

function hidesAllCTRLs()
{
	stamdata.style.visibility="hidden";
	profil.style.visibility="hidden";
	rettigheder.style.visibility="hidden";
	diverse.style.visibility="hidden";
}

function loginBox()
{
	menu.style.visibility="visible";
	menu.style.left=main.ttt.getBoundingClientRect().left-650;
	menu.style.top=document.body.scrollTop+100;
	login.style.visibility="visible";
	login.style.left=main.ttt.getBoundingClientRect().left+15-650;
	login.style.top=document.body.scrollTop+275;
}

function welcomeBox()
{
	menu.style.visibility="visible";
	menu.style.left=main.ttt.getBoundingClientRect().left-650;
	menu.style.top=document.body.scrollTop+100;
	welcome.style.visibility="visible";
	welcome.style.left=main.ttt.getBoundingClientRect().left-630;
	welcome.style.top=document.body.scrollTop+275;

}

function clearCity()
{
	onclick=document.forms.main.elements['city'].value = 'Automatisk udfyld!';
}

//if(navigator.appName !="Microsoft Internet Explorer")
//{
//	alert("Du anvender følgende Browser:   "+navigator.appName+"\nVersion:"+navigator.appVersion+"\n\nDet er pt. kun muligt at anvende Microsoft Internet Explorer !\n\nFor at undgå problemer med at afvikle applikationen anbefales det, at du hente seneste version fra Internettet.\n\n http://www.microsoft.com/downloads/\n\n\n");
//	
//}

function fnDisableOptionsProfil()
{
	document.getElementById('oFunktion1').disabled=true;
	document.getElementById('oFunktion2').disabled=true;
	document.getElementById('oFunktion3').disabled=true;
//	document.getElementById('oBestyrelse').disabled=true;
	document.getElementById('oActiv').disabled=true;
	document.getElementById('oLevel').disabled=true;
	document.getElementById('oEactiv').disabled=true;
	document.getElementById('oKlubblad').disabled=true;
	document.getElementById('oklubhus').disabled=true;
//	document.getElementById('omemberShip').disabled=true;
	document.getElementById('oklubhus').disabled=true;
//	document.getElementById('omemberAddon').disabled=true;
	document.getElementById('otraeskibe').disabled=true;
//	document.getElementById('ojunjol').disabled=true;
//	document.getElementById('okapsejlads').disabled=true;
//	document.getElementById('osejlskole').disabled=true;
//	document.getElementById('omotorbaade').disabled=true;
//	document.getElementById('omaaler').disabled=true;
//	document.getElementById('omemberKat').disabled=true;
}

function fnDisableOptionsStamdata()
{
	document.getElementById('oMemnr').disabled=true;
}

function fnDisableOptionsRight()
{
	document.getElementById('oBest').disabled=true;
	document.getElementById('oAktiv').disabled=true;
	document.getElementById('oUdv').disabled=true;
	document.getElementById('oStae').disabled=true;
	document.getElementById('oBilled').disabled=true;
	document.getElementById('oMem').disabled=true;
//	document.getElementById('oLin').disabled=true;
	document.getElementById('oArtik').disabled=true;
	document.getElementById('oNews').disabled=true;
	document.getElementById('oEko').disabled=true;
	document.getElementById('oBan').disabled=true;
	document.getElementById('oCamps').disabled=true;
	document.getElementById('oCons').disabled=true;
	document.getElementById('oEmail').disabled=true;
	document.getElementById('oSms').disabled=true;
}

function fnDisableOptionsX()
{
	document.getElementById('oBest').disabled=true;
	document.getElementById('oAktiv').disabled=true;
	document.getElementById('oUdv').disabled=true;
	document.getElementById('oStae').disabled=true;
	document.getElementById('oBilled').disabled=true;
	document.getElementById('oMem').disabled=true;
	document.getElementById('oLin').disabled=true;
	document.getElementById('oArtik').disabled=true;
	document.getElementById('oNews').disabled=true;
	document.getElementById('oEko').disabled=true;
	document.getElementById('oFunktion1').disabled=true;
	document.getElementById('oBan').disabled=true;

	document.getElementById('oFunktion2').disabled=true;
	document.getElementById('oFunktion3').disabled=true;
	document.getElementById('oActiv').disabled=true;
	document.getElementById('oMemnr').disabled=true;
	document.getElementById('oKlubblad').disabled=true;

	document.getElementById('oklubhus').disabled=true;
	document.getElementById('otraeskibe').disabled=true;
	document.getElementById('ojunjol').disabled=true;
	document.getElementById('okapsejlads').disabled=true;
	document.getElementById('osejlskole').disabled=true;
	document.getElementById('omotorbaade').disabled=true;
	document.getElementById('omaaler').disabled=true;
	document.getElementById('omemberKat').disabled=true;
	document.getElementById('oBestyrelse').disabled=true;

	document.getElementById('omemberShip').disabled=true;
	document.getElementById('omemberAddon').disabled=true;
	document.getElementById('oEactiv').disabled=true;
//	document.getElementById('oMemType1').disabled=true;

//	document.getElementById('oMemType2').disabled=true;
//	document.getElementById('oMemType4').disabled=true;
//	document.getElementById('oMemType8').disabled=true;
//	document.getElementById('oMemAdd1').disabled=true;
//	document.getElementById('oMemAdd2').disabled=true;
//	document.getElementById('oMemAdd2a').disabled=true;
//	document.getElementById('oMemAdd3').disabled=true;
//	document.getElementById('oMemAdd3a').disabled=true;
//	document.getElementById('oKommentar').disabled=true;
	
}
function fnDisableLink()	
{
//	document.forms.main.elements['oArtikel'].value = '0';
	document.forms.main.elements['oLink'].value = 'Udfyldes automatisk!';
	document.getElementById('oLink').disabled=true;
}
function fnDisableLink_1()	
{
	document.forms.main.elements['oModule'].value = '0';
	document.forms.main.elements['oLink'].value = 'Udfyldes automatisk!';
	document.getElementById('oLink').disabled=true;
}
function fnDisableOptionsHusstand()
{
//	document.all.main.oMemType1.disabled=true;
//	document.all.main.oMemType2.disabled=true;
//	document.all.main.oMemType4.disabled=true;
	document.all.main.omemberShip.disabled=true;
	document.all.main.oAdresse1.disabled=true;
	document.all.main.oAdresse2.disabled=true;
	document.all.main.oZip.disabled=true;
}

function fnDisableOptions1()
{
	document.all.main.oActiv.disabled=true;
}
function fnDisableBanner()
{
	document.all.main.ban1.disabled=true;
	document.all.main.ban2.disabled=true;
	document.all.main.ban3.disabled=true;
	document.all.main.ban4.disabled=true;
	document.all.main.ban5.disabled=true;
	document.all.main.ban6.disabled=true;
	document.all.main.ban7.disabled=true;
	document.all.main.ban8.disabled=true;
}
function fnDisableStamdata()
{
	if(document.all.un.value!=0)
	{
		document.all.main.oName.disabled=true;
		document.all.main.oName.value="Disabled";
		document.all.main.oAdd.disabled=true;
		document.all.main.oAdd.value="Disabled";
		document.all.main.oEmail.disabled=true;
		document.all.main.oEmail.value="Disabled";
	}
	else
	{
		document.all.main.oName.disabled=false;
		document.all.main.oAdd.disabled=false;
		document.all.main.oEmail.disabled=false;
		document.all.main.oName.value="";
		document.all.main.oAdd.value="";
		document.all.main.oEmail.value="";
	}
}

function showComments(event,t)
{	
	hideActions();
	t.style.visibility = "visible";
	t.style.top=event.clientY+document.body.scrollTop;
	
	if(event.screenX<400)
	{
		t.style.left=event.screenX+10;
	}
	else	
	{
		t.style.left=event.screenX-400;
	}
	
	t.style.visibility = "visible";
	return false;

	
}

function fnDisableSvar()
{
	document.all.main.oSvar.disabled=true;
}

function fnNoCR()
{
	a=event.keyCode;
	if(a==13)
	{
	  event.returnValue=false;
	  alert("Tryk på 'søg'-knappen for at starte søgningen!");
	}
}


function fnSeek()
{
	seek.style.left=main.ttt.getBoundingClientRect().left+540-650;
	seek.style.top=document.body.getBoundingClientRect().top+60;
}

function fnEnableSeek()
{
	
	seek.style.visibility="visible";
}

function fnDispAdmin()
{
		one.style.left=main.ttt.getBoundingClientRect().left;
		one.style.top=document.body.getBoundingClientRect().top;

		two.style.left=main.ttt.getBoundingClientRect().left+110;
		two.style.top=document.body.getBoundingClientRect().top;

		tree.style.left=main.ttt.getBoundingClientRect().left+210;
		tree.style.top=document.body.getBoundingClientRect().top;
		
		four.style.left=main.ttt.getBoundingClientRect().left+310;
		four.style.top=document.body.getBoundingClientRect().top;

		five.style.left=main.ttt.getBoundingClientRect().left+410;
		five.style.top=document.body.getBoundingClientRect().top;

		six.style.left=main.ttt.getBoundingClientRect().left+510;
		six.style.top=document.body.getBoundingClientRect().top;

		eight.style.left=main.ttt.getBoundingClientRect().left+710;
		eight.style.top=document.body.getBoundingClientRect().top;

}
function fnDispAdminGecko()
{
		
		one.style.left=0;
		one.style.top=0;

		two.style.left=0;
		two.style.top=20;

		tree.style.left=0;
		tree.style.top=40;
		
		four.style.left=0;
		four.style.top=60;

		five.style.left=0;
		five.style.top=80;

		six.style.left=0;
		six.style.top=100;

		eight.style.left=0;
		eight.style.top=120;

}
function fnDispAdminHelp()
{
		one.style.left=50;
		one.style.top=50;
}
function displayDocument(uid, msFlag, sprog) { 
    var popUrl = 'viewDoc.php4?uid='+uid+'&msFlag='+msFlag+'&sprog='+sprog;
	str="height=450,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayAgreement(hdln) { 
    var popUrl = 'agreement.php4?hdln='+hdln;
	str="height=450,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayControlCifreInfo(which, hdln) { 
    var popUrl = 'controlcifre.php4?id='+which+'&hdln='+hdln;
	str="height=450,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayCam() { 
    var popUrl = 'livecam.php4';
	str="height=270,width=360,scrollbars=1,status=0,toolbar=0,resizable=0,left="+"10"+",top="+"10"+")";
	win=window.open(popUrl,"info",str);
}
function displayPhone() { 
    var popUrl = 'phone.php4?';
	str="height=300,width=645,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayContact(tlfnr,action) { 
    var popUrl = 'phone_con.php4?tlfnr='+tlfnr+'&action='+action;
	str="height=350,width=300,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"_blank",str);
}
function openPhoneDialog(callId) { 
    var popUrl = 'phone_dialog.php4?callId='+callId;
	str="height=350,width=500,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"_blank",str);
}
function openPhoneDialogs(konId) { 
    var popUrl = 'dialog.php4?konId='+konId;
	str="height=475,width=500,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"_blank",str);
}
function displayHelpInfo(which, hdln) { 
    var popUrl = 'hlpWindow.php4?id='+which+'&hdln='+hdln;
	str="height=600,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayDetails() { 
    var popUrl = 'admin/webcare_order_details.php4';
	str="height=600,width=725,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayHelpInfoAdmin(which, hdln) { 
    var popUrl = 'hlpWindow.php4?id='+which+'&hdln='+hdln;
	str="height=600,width=625,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayRute(which) { 
    var popUrl = 'ruteWindow.php4?domain='+which;
	str="height=260,width=220,scrollbars=0,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayFlashMovie(filename, hdln, x, y) {
    var popUrl = 'flashviewer.php4?filename='+filename+'&hdln='+hdln+'&x='+x+'&y='+y;
	x=x+40;y=y+40;
	str="height="+y+",width="+x+",scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayLog(aid) { 
    var popUrl = 'viewLog.php4?aid='+aid;
	str="height=450,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayRolatorLog(aid) { 
    var popUrl = 'viewRolatorLog.php4?aid='+aid;
	str="height=450,width=825,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function displayRolatorLogAll(aid) { 
    var popUrl = 'viewRolatorLogAll.php4?aid='+aid;
	str="height=450,width=962,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function fnSendMail(what,id) { 
    var popUrl = 'sendMail.php4?what='+what+'&id='+id;
	str="height=300,width=400,scrollbars=0,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function fnShowCSS(id, hdln) {
var popUrl = 'css_editor.php4?id='+id+'&hdln='+hdln;
str="height=400,width=558,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -558)/2+",top="+parseInt((screen.height -400)/3);
win=window.open(popUrl,"info",str);

}
function fnShowEditorCSS(id, hdln) {
var popUrl = 'css_editorE.php4?id='+id+'&hdln='+hdln;
str="height=400,width=558,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -558)/2+",top="+parseInt((screen.height -400)/3);
win=window.open(popUrl,"info",str);

}
function fnShowMailCSS(id, hdln) {
var popUrl = 'css_editorM.php4?id='+id+'&hdln='+hdln;
str="height=400,width=558,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -558)/2+",top="+parseInt((screen.height -400)/3);
win=window.open(popUrl,"info",str);

}
function fnShowSelector(id, hdln) {
var popUrl = 'file_selector.php4?id='+id+'&hdln='+hdln;
str="height=150,width=350,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -150)/3);
win=window.open(popUrl,"info",str);
}
function fnShowStamdata(id, hdln) {
var popUrl = 'file_selector.php4?id='+id+'&hdln='+hdln;
str="height=450,width=350,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -150)/3);
win=window.open(popUrl,"info",str);
}

function fnShowMenuGenerator(hdln) {
var popUrl = 'menu_gen.php4?level=1&hdln='+hdln;
str="height=750,width=800,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -700)/2+",top="+parseInt((screen.height -750)/3);
win=window.open(popUrl,"info",str);
}

function fnShowKapMenuGenerator(hdln,id) {
var popUrl = 'kap_menu_gen.php4?level=1&hdln='+hdln+'&id='+id;
str="height=750,width=800,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -700)/2+",top="+parseInt((screen.height -750)/3);
win=window.open(popUrl,"info",str);
}

function fnShowAlias(hdln) {
var popUrl = 'alias_gen.php4?level=1&hdln='+hdln;
str="height=450,width=400,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -700)/2+",top="+parseInt((screen.height -750)/3);
win=window.open(popUrl,"info",str);
}

function fnShowTemplatesGenerator(hdln) {
var popUrl = 'template_gen.php4?level=1&hdln='+hdln;
str="height=850,width=700,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -700)/2+",top="+parseInt((screen.height -750)/3);
win=window.open(popUrl,"info",str);
}

function fnShowSprog(hdln) {
var popUrl = 'sprog_selector.php4?hdln='+hdln;
str="height=200,width=350,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -200)/3);
win=window.open(popUrl,"info",str);
}
function fnShowFieldChange(dbn, field, uid ) {
var popUrl = 'admin/field_change.php4?dbn='+dbn+'&field='+field+'&uid='+uid;
str="height=200,width=400,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -200)/3);
win=window.open(popUrl,"info",str);
}
function fnShowIcons(hdln) {
var popUrl = 'icons_selector.php4?hdln='+hdln;
str="height=280,width=450,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -200)/3);
win=window.open(popUrl,"info",str);
}
function fnShowGateway() {
var popUrl = 'gateway_config.php4';
str="height=280,width=425,scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -200)/3);
win=window.open(popUrl,"info",str);
}

function fnShowPic(billed,h,v) {
var popUrl = 'pic_viewer.php4?pic='+billed;
str="height="+v+",width="+h+",scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -h)/2+",top="+parseInt((screen.height -v)/3);
win=window.open(popUrl,"info",str);
}

function fnShowCV(billed,h,v) {
var popUrl = 'CV_viewer.php4?pic='+billed;
str="height="+v+",width="+h+",scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -h)/2+",top="+parseInt((screen.height -v)/3);
win=window.open(popUrl,"info",str);
}

function fnShowPicStaevne(billed,h,v) {
var popUrl = 'picStaevne_viewer.php4?pic='+billed;
str="height="+v+",width="+h+",scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -h)/2+",top="+parseInt((screen.height -v)/3);
win=window.open(popUrl,"info",str);

}
function fnShowPicMatchrace(billed,h,v) {
var popUrl = 'picMatchrace_viewer.php4?pic='+billed;
str="height="+v+",width="+h+",scrollbars=1,status=o,toolbar=0, location=0, resizable=1,left="+(screen.width -h)/2+",top="+parseInt((screen.height -v)/3);
win=window.open(popUrl,"info",str);

}

function fnShowCategories(id, hdln) {
var popUrl = 'categorySelector.php4?id='+id+'&hdln='+hdln;
str="height=600,width=570,scrollbars=1,status=0,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -150)/3);
win=window.open(popUrl,"info",str);
}

function fnShowCat(id, hdln) {
var popUrl = 'categoryContactSelector.php4?id='+id+'&hdln='+hdln;
str="height=600,width=540,scrollbars=1,status=0,toolbar=0, location=0, resizable=1,left="+(screen.width -350)/2+",top="+parseInt((screen.height -150)/3);
win=window.open(popUrl,"info",str);
}

function displayPSWInfo() { 
	setTimeout('window.close()',5000);
    var popUrl = 'PSWhlpWindow.php';
	str="height=600,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}

function displayPSWCheck() { 
	var popUrl = 'PSWCheckWindow.php';
	str="height=600,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}

function calcPrice()
{

	main.tota.value = main.per1.value * main.p1.value;
	main.totb.value = main.per2.value * main.p2.value;
	main.totc.value = main.per3.value * main.p3.value;

	main.totalt.value = main.per1.value * main.p1.value + main.per2.value * main.p2.value + main.per3.value * main.p3.value + main.price.value*1;
}

function fnNoReadMsg(n)
{
	
	alert("Denne udskrift indeholder stamdata over de medlemmer, som endnu ikke har læst e-mailen.\n\n Ialt "+n+" medlemmer er fundet.\n\nUdskriften er i et format, som direkte kan anvendes som data-fil i Microsoft Word's flette-funktion.\n\nSådan gemmes filen på disken:\n1.) Vælg 'Save as...' i 'File' menuen.\n2.) Angiv et filnavn og en lokation.\n\nFilen kan nu direkte anvendes i Microsoft Words flettefunktion.\n\n");
}

function fnNoReadMsgX(n)
{
	
	alert("Denne udskrift indeholder stamdata over de medlemmer, som ikke har adgang til e-mail og derfor ønsker at modtage information pr. brevmail.\n\n Ialt "+n+" medlemmer er fundet.\n\nUdskriften er i et format, som direkte kan anvendes som data-fil i Microsoft Word's flette-funktion.\n\nSådan gemmes filen på disken:\n1.) Vælg 'Save as...' i 'File' menuen.\n2.) Angiv et filnavn og en lokation.\n\nFilen kan nu direkte anvendes i Microsoft Words flettefunktion.\n\n");
}

function fnNoReadMsgY(n)
{
	
	alert("Denne udskrift indeholder fakturadata over udvalgte medlemmer.\n\n Ialt "+n+" poster er fundet.\n\nUdskriften er i et format, som direkte kan anvendes som data-fil i Microsoft Word's flette-funktion.\n\nSådan gemmes filen på disken:\n1.) Vælg 'Save as...' i 'File' menuen.\n2.) Angiv et filnavn og en lokation.\n\nFilen kan nu direkte anvendes i Microsoft Words flettefunktion.\n\n");
}

function displayPosteringer(which) { 
    var popUrl = 'posWindow.php4?uniq_id='+which;
	str="height=600,width=625,scrollbars=1,status=0,toolbar=0,resizable=0,left="+(screen.width -625)/2+",top="+parseInt((screen.height -600)/3);
	win=window.open(popUrl,"info",str);
}
function CheckTab(el) {
/* Copyright 2000 SiteExperts.com/ InsideDHTML.com, LLC
   This code can be reused as long as the above copyright notice
   is not removed */
  // Run only in IE
  // and if tab key is pressed
  // and if the control key is pressed
  if ((document.all) && (9==event.keyCode)) {
    // Cache the selection
    el.selection=document.selection.createRange(); 
    setTimeout("ProcessTab('" + el.id + "')",0)
  }
}

function ProcessTab(id) {
  // Insert tab character in place of cached selection
  document.all[id].selection.text=String.fromCharCode(9)
  // Set the focus
  document.all[id].focus()
}

function SPAW_image_insert_click(editor, sender){

//	window.showModalDialog("index.php4","dialogHeight: 200px; dialogWidth: 400px; dialogTop: ; dialogLeft:; center: Yes; help: No; resizable: No; status: No;");
	var imgSrc = showModalDialog("spaw/dialogs/img_library.php",window, "dialogHeight:420px; dialogWidth:420px; resizable:no; status:no");

//	if(imgSrc != null)
//		this[editor+'_rEdit'].document.execCommand('insertimage', false, imgSrc);

	
}

// Title: Timestamp picker
// Description: See the demo at url
// URL: http://us.geocities.com/tspicker/
// Script featured on: http://javascriptkit.com/script/script2/timestamp.shtml
// Version: 1.0
// Date: 12-05-2001 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>; <tspicker@yahoo.com>
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations

function show_calendar(str_target, str_datetime,x,y) { 
	
	if(y>600)y=y-250; if(x>600)x=x-200;
	var arr_months = ["Januar", "Februar", "Marts", "April", "Maj", "Juni",
		"Juli", "August", "September", "Oktober", "November", "December"];
	var week_days = ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"];
	var n_weekstart = 1; // day week starts from (normally 0 or 1)

	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt(str_datetime));
	
	var dt_prev_month = new Date(dt_datetime);
	dt_prev_month.setMonth(dt_datetime.getMonth()-1);

	var dt_prev_year = new Date(dt_datetime);
	dt_prev_year.setFullYear(dt_datetime.getFullYear()-1);

	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);

	var dt_next_year = new Date(dt_datetime);							
	dt_next_year.setFullYear(dt_datetime.getFullYear()+1);
	
	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var str_buffer = new String (
		"<html>\n"+
		"<head>\n"+
		"	<title>Kalender</title>\n"+
		"</head>\n"+
		"<body onload=self.focus(); bgcolor=\"White\">\n"+
		"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
		"<tr><td bgcolor=\"#4682B4\">\n"+
		"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
		"<tr>\n	<td bgcolor=\"#4682B4\" valign=\"bottom\"><a href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_month)+"'+document.cal.time.value);\">"+
		"<img src=\"images/back.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Forrige Måned\"></a></td><td bgcolor=\"#4682B4\" valign=\"bottom\"><a href=\"javascript:window.opener.show_calendar('"+
				str_target+"', '"+ dt2dtstr(dt_prev_year)+"'+document.cal.time.value);\">"+
				"<img src=\"images/prevY.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Forrige År\"></a></td>\n"+
		"	<td bgcolor=\"#4682B4\" colspan=\"3\" align=middle>"+
		"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\"><b>"
		+arr_months[dt_datetime.getMonth()]+"<br><b>"+dt_datetime.getFullYear()+"</font></td>\n"+
		"<td bgcolor=\"#4682B4\" valign=\"bottom\" align=\"right\" ><a href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_year)+"'+document.cal.time.value);\">"+
		"<img src=\"images/nextY.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Næste År\"></a></td>	<td bgcolor=\"#4682B4\" valign=\"bottom\" align=\"right\"><a href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_month)+"'+document.cal.time.value);\">"+
		"<img src=\"images/forward.gif\" width=\"16\" height=\"16\" border=\"0\""+
		" alt=\"Næste Måned\"></a></td>\n</tr>\n"
	);

	var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#87CEFA\">"+
		"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\">"+
		week_days[(n_weekstart+n)%7]+"</font></td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row heder
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				if (dt_current_day.getDate() == dt_datetime.getDate() &&
					dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
					str_buffer += "	<td bgcolor=\"#FF0000\" align=\"right\">";
				else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td bgcolor=\"#DBEAF5\" align=\"right\">";
				else
					// print working days of current month
					str_buffer += "	<td bgcolor=\"white\" align=\"right\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:window.opener."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close();\">"+
					"<font color=\"black\" face=\"tahoma, verdana\" size=\"2\" style=\"text-decoration: none\">";
				else 
					// print days of other months
					str_buffer += "<a href=\"javascript:window.opener."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'+document.cal.time.value; window.close(); \">"+
					"<font color=\"gray\" face=\"tahoma, verdana\" size=\"2\" style=\"text-decoration: none\">";
				if(dt_current_day.getDate()>9){var tt=dt_current_day.getDate();}else{var tt="0"+dt_current_day.getDate();}
				str_buffer += tt +"</font></a></td>\n";
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
	}
	// print calendar footer
	str_buffer +=
		"<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#87CEFA\">"+
		"<font color=\"White\" face=\"tahoma, verdana\" size=\"2\">"+
		"<input type=\"hidden\" name=\"time\" value=\""+
		"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n";
	
	var vWinCal = window.open("", "Calendar", 
		"width=200,height=220,status=no,resizable=yes,top="+y+",left="+x);
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) {
	var re_date = /^(\d+)\-(\d+)\-(\d+)+$/;
	if (!re_date.exec(str_datetime))
		return alert("Invalid Datetime format: "+ str_datetime);
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1, RegExp.$4, RegExp.$5, RegExp.$6));
}
function dt2dtstr (dt_datetime) {
		if(dt_datetime.getDate()>9){var tt=dt_datetime.getDate();}else{var tt="0"+dt_datetime.getDate();}
		if((dt_datetime.getMonth()+1)>9){var mm=(dt_datetime.getMonth()+1);}else{var mm="0"+(dt_datetime.getMonth()+1);}
		if(dt_datetime.getFullYear()!=100) {yy= dt_datetime.getFullYear()}else{yy=2000}
		return (new String (
			tt+"-"+mm+"-"+yy+""));
			
}
function dt2tmstr (dt_datetime) {
	return (new String (
			dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}

function setxypos()
{
	
	document.all.main.screenXbox.value = window.event.screenX;
	document.all.main.screenYbox.value = window.event.screenY;
}	

function change_pcs()
{
	if(main.price.value)
	{
		main.price.value = main.price.value.replace(/,/,".");	
		main.adv_k.value = Math.round(main.price.value * main.pcs.value - main.kostpris.value * main.pcs.value);
		main.adv_p.value = Math.round((main.adv_k.value *100) / (main.kostpris.value * main.pcs.value));
	}
}

function change_price()
{	
	if(main.pcs.value)
	{
		main.price.value = main.price.value.replace(/,/,".");
		main.adv_k.value = Math.round(main.price.value * main.pcs.value - main.kostpris.value * main.pcs.value);
		main.adv_p.value = Math.round((main.adv_k.value *100) / (main.kostpris.value * main.pcs.value));
		
	}
}

function shop_change_pcs()
{
	if(main.shop_price.value)
	{	
		if(main.shop_kostpris.value = '0') main.shop_kostpris.value='1';
		main.shop_price.value = main.shop_price.value.replace(/,/,".");	
		main.shop_adv_k.value = Math.round(main.shop_price.value * main.shop_pcs.value - main.shop_kostpris.value * main.shop_pcs.value);
		main.shop_adv_p.value = Math.round((main.shop_adv_k.value *100) / (main.shop_kostpris.value * main.shop_pcs.value));
	}
}

function shop_change_price()
{	
	if(main.shop_pcs.value)
	{	
		if(main.shop_kostpris.value = '0') main.shop_kostpris.value='1';
		main.shop_price.value = main.shop_price.value.replace(/,/,".");
		main.shop_adv_k.value = Math.round(main.shop_price.value * main.shop_pcs.value - main.shop_kostpris.value * main.shop_pcs.value);
		main.shop_adv_p.value = Math.round((main.shop_adv_k.value *100) / (main.shop_kostpris.value * main.shop_pcs.value));
	}
}

function change_adv_k()
{
	if(main.pcs.value && main.price.value )
	{
		main.price.value = (parseFloat(main.kostpris.value * main.pcs.value) + parseFloat(main.adv_k.value))/main.pcs.value;
		main.adv_p.value = Math.round((main.adv_k.value *100) / (main.kostpris.value * main.pcs.value));
	}	
}

function change_adv_p()
{
	if(main.pcs.value && main.price.value )
	{
		main.adv_k.value = Math.round(main.kostpris.value * main.pcs.value * main.adv_p.value/100);
		main.price.value = parseFloat(main.adv_k.value/main.pcs.value) + parseFloat(main.kostpris.value);
	}	
}

