<!--
	function VerifyLogin()
	{

	if (document.LoginForm.MemberID.value == '')
		{alert('Husk at indtaste medlemsnr.');
		return false;}
	/*	
	if (isNumeric(document.LoginForm.MemberID.value) == 0)
		{alert('Det indtastede medlemsnr. er ikke korrekt');
		return false;}
	*/	
	if (document.LoginForm.BirthDate.value == '')
		{alert('Husk at indtaste fødselsdato.')
		return false;}
		
	if (isNumeric(document.LoginForm.BirthDate.value) == 0)
		{alert('Den indtastede fødselsdato er ikke korrekt');
		return false;}
		
	}
	
	
	function CheckSortOrder(formobj)
	{
		var succes;
		var tmplen;

		tmplen = formobj.length;
		if (typeof tmplen == "undefined"){
			return true;
		}else{
			//make array containing sortorder-numbers
			arrSortOrderNos = new Array(formobj.length);
		}
				
		var i
		for (i=0; i < formobj.length; i++)
		{
			//fill array
			arrSortOrderNos[i] = parseInt(formobj[i].value, 10);
			
			//Check for empty inputfields or inputs that aren't numeric
			if (formobj[i].value == '' | isNumeric(formobj[i].value) == 0) 
			{
				alert("Alle felter med sorteringsværdier skal være udfyldte og være af typen tal");
				succes = false;
				break
			}
			else
			{
				succes = true;
			}
			
			//Check for inputted values that aren't within length of the array
			if (formobj[i].value > 0 & formobj[i].value <= arrSortOrderNos.length)
			{
				succes = true;
			}
			else
			{
				alert("Indtastede sorteringsværdier skal være mellem 1 og "+arrSortOrderNos.length+"\nSorteringsværdien, "+formobj[i].value+" kan ikke godkendes.")			
				succes = false;
				break			
			}
		}
		
		if (succes == true)
		{
			arrSortOrderNos.sort(Numsort);
			
			for (i=0; i < arrSortOrderNos.length; i++)
			{
				if (arrSortOrderNos[i] == arrSortOrderNos[i-1])
				{
					alert("Indtastede sorteringsværdier må ikke være ens\nTallet, "+arrSortOrderNos[i]+" blev indtastet flere gange");
					succes = false;
				 	break
				}
				else
				{
					succes = true;
				}
			}
		} 
		
		if (succes == true)
		{
			return true;
		}
		else
		{
			return false;
		}
	
	}
	
	function Numsort(a,b)
	{ 
		return a-b;
	}

	
	function isNumeric(str)
	// returns true if str is numeric
	// that is it contains only the digits 0-9
	// returns false otherwise
	// returns false if empty
	{
	  var len= str.length;
	  if (len==0)
	    return false;
	  //else
	  var p=0;
	  var ok= true;
	  var ch= "";
	  while (ok && p<len)
	  {
	    ch= str.charAt(p);
	    if ('0'<=ch && ch<='9')
	      p++;
	    else
	      ok= false;
	  }
	  return ok;
	}
	
	function getallkeywordids(objSelect, objArrayKeyIds, objArrayKeyNames, objForm){
		var intSize = objSelect.options.length;
		var strIDs = "";
		var strNames = "";
		for (var i=0; i < intSize; i++) {
		  strIDs = strIDs + objSelect.options[i].value + ";";
		  strNames = strNames + objSelect.options[i].text + ";";
		}
		if(strIDs.length > 0){strIDs = strIDs.substr(0,(strIDs.length-1));}
		if(strNames.length > 0){strNames = strNames.substr(0,(strNames.length-1));}
		objArrayKeyIds.value = strIDs;
		objArrayKeyNames.value = strNames;
		objForm.submit();
	}

	function moveselected(objSelect, objLstIds, objLstNames, movetype){
		var intSize = objSelect.options.length;
		var sidx = objSelect.options.selectedIndex;
		
		if (sidx != "-1"){
			var idstr = objLstIds.value;
			var idsplit= idstr.split(";");
			var namestr = objLstNames.value;
			var namesplit = namestr.split(";");
			var tmpidx = idsplit[sidx];
			var tmpname = namesplit[sidx];
			var tidx = "";

			if ((movetype == "0") && (sidx > "0")){
				//moving one up//
				tidx = sidx-1
			}else if ((movetype == "1") && (sidx < (intSize-1))){
				//moving one down
				tidx = sidx+1
			}
			//Switch values
			idsplit[sidx] = idsplit[tidx];
			namesplit[sidx] = namesplit[tidx];
			idsplit[tidx] = tmpidx;
			namesplit[tidx] = tmpname;
			objSelect.options[tidx].value = idsplit[tidx];
			objSelect.options[tidx].text = namesplit[tidx];
			objSelect.options[sidx].value = idsplit[sidx];
			objSelect.options[sidx].text = namesplit[sidx];
			objSelect.options.selectedIndex = tidx;
			//Rebuild list
			var strIDs = "";
			var strNames = "";
			for (var i=0; i < intSize; i++) {
			  strIDs = strIDs + idsplit[i] + ";";
			  strNames = strNames + namesplit[i] + ";";
			}
			if(strIDs.length > 0){strIDs = strIDs.substr(0,(strIDs.length-1));}
			if(strNames.length > 0){strNames = strNames.substr(0,(strNames.length-1));}
			objLstIds.value = strIDs;
			objLstNames.value = strNames;
			//alert("ListOfParagraphIds: " + strIDs + "\nListOfParagraphNames: " + strNames)
		}
	}	



	//show preview of paragraphtext
	function previewdlg(){
		var prewnd;
		prewnd = window.open('Preview.asp', 'previewwnd', 'toolbar=0,scrollbars=yes,location=0,status=0,menubar=0,resizable=yes,width=470,height=400,left=100,top=100');
		prewnd.location.reload();
	}

	//show paragraph
	function showparagraph(p_id){
		var shwwnd;
		shwwnd = window.open('Preview.asp?pid='+p_id, 'showwnd', 'toolbar=0,scrollbars=yes,location=0,status=0,menubar=0,resizable=yes,width=470,height=400,left=100,top=100');
		//shwwnd.location.reload();
	}

	//print paragraph
	function PrintParagraph(a_id, c_id, p_id, p_type){
		if ((p_id != '') || (p_type != '')) {
			var printwnd;
			printwnd = window.open('Print.asp?AreaID='+a_id+'&ChapterID='+c_id+'&ParagraphID='+p_id+'&show='+p_type, 'printwnd', 'toolbar=0,scrollbars=yes,location=0,status=0,menubar=0,resizable=yes,width=470,height=400,left=100,top=100');
			//printwnd.location.reload();
		}
	}


	function changefont(fonttype)
	{
		//window.document.styleSheets
		if (!window.document.styleSheets) return;
		var theRules = new Array();
		var currstylesheet = window.document.styleSheets.length - 1
		//alert(document.styleSheets.length);

		if (window.document.styleSheets[0].cssRules)
			theRules = window.document.styleSheets[0].cssRules
		else if (window.document.styleSheets[0].rules)
			theRules = window.document.styleSheets[0].rules
		else return
		//alert(theRules.length);

		var rfsize = "";
		var pfsize = "";
		if (fonttype == "Verdana, Arial, Helvetica, sans-serif") {
			rfsize = -20;
			pfsize = -2
		} else {
			rfsize = 20;
			pfsize = 2
		}
		
		var currfont = "";
		var currfontsize = "";
		for (var i=0; i < theRules.length; i++) {
			currfont = theRules[i].style.fontFamily
			if (currfont.length > 0) {
				theRules[i].style.fontFamily = fonttype;
			}
			currfont = theRules[i].style.fontSize
			if (currfont.indexOf("%") != "-1"){
				theRules[i].style.fontSize = eval(parseInt(currfont) + rfsize) + "%";
			}
			if (currfont.indexOf("px") != "-1"){
				theRules[i].style.fontSize = eval(parseInt(currfont) + pfsize) + "px";
			}
		}
	}	
	
	function changeIt(frmobj,ftype)
	{
		var formobj = eval("window.document.forms['"+frmobj+"']");
		//window.document.styleSheets
		if (!window.document.styleSheets) return;
		var theRules = new Array();
		var currstylesheet = window.document.styleSheets.length - 1
		//alert(document.styleSheets.length);

		if (window.document.styleSheets[0].cssRules)
			theRules = window.document.styleSheets[0].cssRules
		else if (window.document.styleSheets[0].rules)
			theRules = window.document.styleSheets[0].rules
		else return
		//alert(theRules.length);

		//var fsize = window.document.forms[0].currfontsize.value;
		var fsize = formobj.currfontsize.value;
		var asize =	0;
		var rsize =	0;

		if (ftype == "1") {
			fsize = eval(fsize) + 1;
			asize = 1;
			rsize = 10;
		} else if (ftype == "-1") {
			fsize = eval(fsize) - 1;
			asize = -1;
			rsize = -10;
		}
		if ((fsize < 1) || (fsize > 6)) return;
		//window.document.forms[0].currfontsize.value = fsize;
		formobj.currfontsize.value = fsize;

		var leftval = "";
		var currfont = "";
		var newsize = "";
		for (var i=0; i < theRules.length; i++) {
			leftval = theRules[i].selectorText
			leftval = leftval.substr(0,1)
			if (leftval != "A"){

				currfont = theRules[i].style.fontSize
				//alert(currfont);
				if (currfont.indexOf("%") != "-1"){
					theRules[i].style.fontSize = eval(parseInt(currfont) + rsize) + "%";
					//alert("procent: " + theRules[i].style.fontSize);
				}
				if (currfont.indexOf("px") != "-1"){
					theRules[i].style.fontSize = eval(parseInt(currfont) + asize) + "px";
					//alert("pixel: " + theRules[i].style.fontSize);
				}
			}	
		}
	}


	function selectdeselectparagraphs(formobj){
		var intSize;
		intSize = formobj.ParagraphSelect.length;
		for (var i=0; i < intSize; i++) {
			formobj.ParagraphSelect[i].checked = true;
		}
	}


	//Enable/Disable Select ReleaseDate
	function EnableSelectReleaseDate(formobj,objcheckbox) {
		if (objcheckbox == true){
			formobj.udgiv_dd.disabled = true;
			formobj.udgiv_mm.disabled = true;
			formobj.udgiv_aaaa.disabled = true;
			formobj.udgiv_timer.disabled = true;
			formobj.udgiv_minut.disabled = true;
		}else{
			formobj.udgiv_dd.disabled = false;
			formobj.udgiv_mm.disabled = false;
			formobj.udgiv_aaaa.disabled = false;
			formobj.udgiv_timer.disabled = false;
			formobj.udgiv_minut.disabled = false;
		}
	}

	//Set ModifiedDate to Now
	function SetModifiedDateToNow(formobj) {
		var d = new Date();
		var intSize = formobj.opret_dd.options.length;
		//alert(d.getDate() + "-" + d.getMonth() + "-" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds());

		for (var i=0; i < intSize; i++) {
			if (formobj.opret_dd.options[i].value == d.getDate()) {
				formobj.opret_dd.options.selectedIndex = i;
			}
		}

		intSize = formobj.opret_mm.options.length;
		for (var i=0; i < intSize; i++) {
			//alert("Value: " + formobj.opret_mm.options[i].value + "\nMonth: " + (d.getMonth()+1));
			if (formobj.opret_mm.options[i].value == (d.getMonth()+1)) {
				formobj.opret_mm.options.selectedIndex = i;
			}
		}

		intSize = formobj.opret_aaaa.options.length;
		for (var i=0; i < intSize; i++) {
			if (formobj.opret_aaaa.options[i].value == d.getFullYear()) {
				formobj.opret_aaaa.options.selectedIndex = i;
			}
		}

		intSize = formobj.opret_timer.options.length;
		for (var i=0; i < intSize; i++) {
			if (formobj.opret_timer.options[i].value == d.getHours()) {
				formobj.opret_timer.options.selectedIndex = i;
			}
		}
	}
	
	
	//check if date is valid
	function isDate(formobj, datetype){
		if (datetype == "modify"){var dtStr = formobj.opret_mm.options[formobj.opret_mm.options.selectedIndex].value + '-' + formobj.opret_dd.options[formobj.opret_dd.options.selectedIndex].value + '-' + formobj.opret_aaaa.options[formobj.opret_aaaa.options.selectedIndex].value;
		}
		if (datetype == "release"){var dtStr = formobj.udgiv_mm.options[formobj.udgiv_mm.options.selectedIndex].value + '-' + formobj.udgiv_dd.options[formobj.udgiv_dd.options.selectedIndex].value + '-' + formobj.udgiv_aaaa.options[formobj.udgiv_aaaa.options.selectedIndex].value;
		} 
		var dtCh= "-";
		var minYear=1900;
		var maxYear=2100;
		var daysInMonth = DaysArray(12);
		var pos1=dtStr.indexOf(dtCh);
		var pos2=dtStr.indexOf(dtCh,pos1+1);
		var strMonth=dtStr.substring(0,pos1);
		var strDay=dtStr.substring(pos1+1,pos2);
		var strYear=dtStr.substring(pos2+1);
		strYr=strYear;
		if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1);
		if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1);
		for (var i = 1; i <= 3; i++) {
			if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1);
		}
		month=parseInt(strMonth);
		day=parseInt(strDay);
		year=parseInt(strYr);
		if (pos1==-1 || pos2==-1){
			alert("Vælg venligst dato formatet : dd-mm-aaaa");
			return false;
		}
		if (strMonth.length<1 || month<1 || month>12){
			alert("Vælg venligst en gyldig måned");
			return false;
		}
		if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
			alert("Vælg venligst en gyldig dag");
			return false;
		}
		if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
			alert("Vælg venligst et gyldigt gyldigt årstal");
			return false;
		}
		if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
			alert("Vælg venligst en gyldig dato");
			return false;
		}
	return true;
	}
	function isInteger(s){
		var i;
	    for (i = 0; i < s.length; i++){   
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9"))) return false;
	    }
	    // All characters are numbers.
	    return true;
	}
	function stripCharsInBag(s, bag){
		var i;
	    var returnString = "";
	    // Search through string's characters one by one.
	    // If character is not in bag, append to returnString.
	    for (i = 0; i < s.length; i++){   
	        var c = s.charAt(i);
	        if (bag.indexOf(c) == -1) returnString += c;
	    }
	    return returnString;
	}
	function daysInFebruary (year){
		// February has 29 days in any year evenly divisible by four,
	    // EXCEPT for centurial years which are not also divisible by 400.
	    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
	}
	function DaysArray(n) {
		for (var i = 1; i <= n; i++) {
			this[i] = 31;
			if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
			if (i==2) {this[i] = 29}
	   } 
	   return this;
	}

//-->
