function showHide(b,c){if(getEle(b).checked)getEle(c).style.display="none";else getEle(c).style.display="block"}function hideShow(b,c){if(getEle(b).checked)getEle(c).style.display="block";else getEle(c).style.display="none"}function isEmpty(b){getEle(b)||alert("Missing "+b);return!/\S/.test(getEle(b).value)}function isTelephoneNumber(b){return/^\s*\d{8}\s*$/.test(getEle(b).value)}function isZip(b){return/^\s*\d{4}\s*$/.test(getEle(b).value)}
function isCustomerNumber(b){return/^\s*\d{12}\s*$/.test(getEle(b).value)}function isNumber(b,c){return(new RegExp("^\\s*\\d{"+c+"}\\s*$")).test(getEle(b).value)}function isEmail(b){var c=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2}|com|net|org|gov|mil|int|biz|pro|info|arpa|aero|coop|name|museum)(\]?)$/;return!/(@.*@)|(\.\.)|(,)|(@\.)|(\.@)|(^\.)|( )|([æøåÆØÅüöäÜÖÄ])/.test(getEle(b).value)&&c.test(getEle(b).value)?true:false}
function checkIfEmpty(b,c){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}}function checkIfTelephoneNumber(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isTelephoneNumber(b)){returnVal=false;returnString+=d+"\n"}}function checkIfCustomerNumber(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isCustomerNumber(b)){returnVal=false;returnString+=d+"\n"}}
function checkIfNumber(b,c,d,e){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isNumber(b,e)){returnVal=false;returnString+=d+"\n"}}function checkIfZip(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isZip(b)){returnVal=false;returnString+=d+"\n"}}function checkIfEmail(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isEmail(b)){returnVal=false;returnString+=d+"\n"}}var mf_numberRange=[],mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=2E7;
mf_tmpRange.end=31311E3;mf_numberRange[mf_numberRange.length]=mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=31313E3;mf_tmpRange.end=318E5;mf_numberRange[mf_numberRange.length]=mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=401E5;mf_tmpRange.end=421E5;mf_numberRange[mf_numberRange.length]=mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=501E5;mf_tmpRange.end=52E6;mf_numberRange[mf_numberRange.length]=mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=601E5;mf_tmpRange.end=6051E4;
mf_numberRange[mf_numberRange.length]=mf_tmpRange;mf_tmpRange=[];mf_tmpRange.start=606E5;mf_tmpRange.end=62E6;mf_numberRange[mf_numberRange.length]=mf_tmpRange;function isMobileNumber(b){var c=false;b=parseInt(getEle(b).value,10);for(var d=0;d<mf_numberRange.length;d++)if(b>=mf_numberRange[d].start&&b<=mf_numberRange[d].end)c=true;return c}
function openwin(b){var c=Math.floor(Math.random()*102548);window.open(b,c,"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+screen.availWidth+",height="+screen.availHeight+",left=0,top=0")}function popHelp(b){popup(b,"420","420","popHelp")}function popCallBack(b){popup("http://privat.tdc.dk/help/?id="+b,"430","420","popHelp")}
function popPrint(b){if(!b){b=document.URL;b=b.split("/");b=b[0]+"//"+b[2]+"/mf_print.php"}popup(b,"450","600","popPrint")}function checkIfYear(b,c,d){if(getEle(b).value.length==2)getEle(b).value="19"+getEle(b).value;if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isYear(b)){returnVal=false;returnString+=d+"\n"}}function isYear(b){return isNumber(b,4)}
function checkIfMonth(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isMonth(b)){returnVal=false;returnString+=d+"\n"}}function isMonth(b){return isNaN(getEle(b).value)||getEle(b).value>12||getEle(b).value<1?false:true}function checkIfDay(b,c,d){if(isEmpty(b)){returnVal=false;returnString+=c+"\n"}else if(!isDay(b)){returnVal=false;returnString+=d+"\n"}}function isDay(b){return isNaN(getEle(b).value)||getEle(b).value>31||getEle(b).value<1?false:true}
function checkIfDate(b,c,d,e){if(isYear(b)&&isMonth(c)&&isDay(d)){var a={};a.alertMsgNotValid=e;if(!isDate(b,c,d,a)){returnVal=false;returnString+=a.alertMsgNotValid+"\n"}}}function checkIfDayIsWeekday(b,c,d,e){b=parseInt(getEle(b).value,10);c=parseInt(getEle(c).value,10)-1;d=parseInt(getEle(d).value,10);if(!isWeekday(new Date(b,c,d))){returnVal=false;returnString+=e+"\n"}}
function checkIfDayIsWithinRange(b,c,d,e,a,f){b=parseInt(getEle(b).value,10);c=parseInt(getEle(c).value,10)-1;d=parseInt(getEle(d).value,10);d=new Date(b,c,d);b=new Date;b=new Date(b.getFullYear(),b.getMonth(),b.getDate());b.setTime(b.getTime()+e*24*60*60*1E3);e=new Date;e=new Date(e.getFullYear(),e.getMonth(),e.getDate());e.setTime(e.getTime()+a*24*60*60*1E3);if(d<=b||d>=e){returnVal=false;returnString+=f+"\n"}}
function checkIfDeliveryDate(b,c,d,e){b=parseInt(getEle(b).value,10);c=parseInt(getEle(c).value,10)-1;d=parseInt(getEle(d).value,10);d=new Date(b,c,d);b=new Date;b=new Date(b.getFullYear(),b.getMonth(),b.getDate());b.setTime(b.getTime()+1728E5);c=new Date;c=new Date(c.getFullYear(),c.getMonth(),c.getDate());c.setTime(c.getTime()+157248E5);if(d<=b||d>=c||!isWeekday(d)){returnVal=false;returnString+=e+"\n"}}function isWeekday(b){if(b.getDay()==0||b.getDay()==6)return false;return true}
function isDate(b,c,d,e){if(getEle(b).value==""||getEle(c).value==""||getEle(d).value=="")return false;b=parseInt(getEle(b).value,10);c=parseInt(getEle(c).value,10);d=parseInt(getEle(d).value,10);if((c==4||c==6||c==9||c==11)&&d==31){if(e)e.alertMsgNotValid+="\n - "+getMonthNiceName(c)+" måned har kun 30 dage";return false}var a=false;if((a=Math.floor(b/4)==b/4&&(Math.floor(b/100)!=b/100||Math.floor(b/400)==b/400)?true:false)&&c==2&&d>29){if(e)e.alertMsgNotValid+="\n - "+getMonthNiceName(c)+" måned har kun 29 dage i år "+
b+" (skudår)";return false}if(!a&&c==2&&d>28){if(e)e.alertMsgNotValid+="\n - "+getMonthNiceName(c)+" måned har kun 28 dage i år "+b;return false}return true}function getMonthNiceName(b){b=parseInt(b,10)-1;var c=new Array("Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December");return c[b]?c[b]:false}
function getAge(b,c,d){if(!isDate(b,c,d))return false;b=getEle(b).value;c=getEle(c).value;d=getEle(d).value;var e=new Date(b,c-1,d);b=new Date;c=new Date(b.getFullYear(),b.getMonth(),b.getDate());var a=b.getFullYear();d=b.getMonth();var f=b.getDate();b=e.getFullYear();c=e.getMonth();e=e.getDate();b=a-b;if(d>=c)c=d-c;else{b--;c=12+d-c}if(!(f>=e)){c--;c<0&&b--}return b}
function htmlDecode(b){var c="";if(b==null||b=="")return false;for(var d=b.length,e=0;e<d;e++){var a=b.charAt(e);if(a=="&"){var f=b.indexOf(";",e+1);if(f>0){e=b.substring(e+1,f);if(e.length>1&&e.charAt(0)=="#")a=e.charAt(1)=="x"||e.charAt(1)=="X"?String.fromCharCode(eval("0"+e.substring(1))):String.fromCharCode(eval(e.substring(1)));else switch(e){case "quot":a=String.fromCharCode(34);break;case "amp":a=String.fromCharCode(38);break;case "lt":a=String.fromCharCode(60);break;case "gt":a=String.fromCharCode(62);
break;case "nbsp":a=String.fromCharCode(160);break;case "iexcl":a=String.fromCharCode(161);break;case "cent":a=String.fromCharCode(162);break;case "pound":a=String.fromCharCode(163);break;case "curren":a=String.fromCharCode(164);break;case "yen":a=String.fromCharCode(165);break;case "brvbar":a=String.fromCharCode(166);break;case "sect":a=String.fromCharCode(167);break;case "uml":a=String.fromCharCode(168);break;case "copy":a=String.fromCharCode(169);break;case "ordf":a=String.fromCharCode(170);break;
case "laquo":a=String.fromCharCode(171);break;case "not":a=String.fromCharCode(172);break;case "shy":a=String.fromCharCode(173);break;case "reg":a=String.fromCharCode(174);break;case "macr":a=String.fromCharCode(175);break;case "deg":a=String.fromCharCode(176);break;case "plusmn":a=String.fromCharCode(177);break;case "sup2":a=String.fromCharCode(178);break;case "sup3":a=String.fromCharCode(179);break;case "acute":a=String.fromCharCode(180);break;case "micro":a=String.fromCharCode(181);break;case "para":a=
String.fromCharCode(182);break;case "middot":a=String.fromCharCode(183);break;case "cedil":a=String.fromCharCode(184);break;case "sup1":a=String.fromCharCode(185);break;case "ordm":a=String.fromCharCode(186);break;case "raquo":a=String.fromCharCode(187);break;case "frac14":a=String.fromCharCode(188);break;case "frac12":a=String.fromCharCode(189);break;case "frac34":a=String.fromCharCode(190);break;case "iquest":a=String.fromCharCode(191);break;case "Agrave":a=String.fromCharCode(192);break;case "Aacute":a=
String.fromCharCode(193);break;case "Acirc":a=String.fromCharCode(194);break;case "Atilde":a=String.fromCharCode(195);break;case "Auml":a=String.fromCharCode(196);break;case "Aring":a=String.fromCharCode(197);break;case "AElig":a=String.fromCharCode(198);break;case "Ccedil":a=String.fromCharCode(199);break;case "Egrave":a=String.fromCharCode(200);break;case "Eacute":a=String.fromCharCode(201);break;case "Ecirc":a=String.fromCharCode(202);break;case "Euml":a=String.fromCharCode(203);break;case "Igrave":a=
String.fromCharCode(204);break;case "Iacute":a=String.fromCharCode(205);break;case "Icirc":a=String.fromCharCode(206);break;case "Iuml":a=String.fromCharCode(207);break;case "ETH":a=String.fromCharCode(208);break;case "Ntilde":a=String.fromCharCode(209);break;case "Ograve":a=String.fromCharCode(210);break;case "Oacute":a=String.fromCharCode(211);break;case "Ocirc":a=String.fromCharCode(212);break;case "Otilde":a=String.fromCharCode(213);break;case "Ouml":a=String.fromCharCode(214);break;case "times":a=
String.fromCharCode(215);break;case "Oslash":a=String.fromCharCode(216);break;case "Ugrave":a=String.fromCharCode(217);break;case "Uacute":a=String.fromCharCode(218);break;case "Ucirc":a=String.fromCharCode(219);break;case "Uuml":a=String.fromCharCode(220);break;case "Yacute":a=String.fromCharCode(221);break;case "THORN":a=String.fromCharCode(222);break;case "szlig":a=String.fromCharCode(223);break;case "agrave":a=String.fromCharCode(224);break;case "aacute":a=String.fromCharCode(225);break;case "acirc":a=
String.fromCharCode(226);break;case "atilde":a=String.fromCharCode(227);break;case "auml":a=String.fromCharCode(228);break;case "aring":a=String.fromCharCode(229);break;case "aelig":a=String.fromCharCode(230);break;case "ccedil":a=String.fromCharCode(231);break;case "egrave":a=String.fromCharCode(232);break;case "eacute":a=String.fromCharCode(233);break;case "ecirc":a=String.fromCharCode(234);break;case "euml":a=String.fromCharCode(235);break;case "igrave":a=String.fromCharCode(236);break;case "iacute":a=
String.fromCharCode(237);break;case "icirc":a=String.fromCharCode(238);break;case "iuml":a=String.fromCharCode(239);break;case "eth":a=String.fromCharCode(240);break;case "ntilde":a=String.fromCharCode(241);break;case "ograve":a=String.fromCharCode(242);break;case "oacute":a=String.fromCharCode(243);break;case "ocirc":a=String.fromCharCode(244);break;case "otilde":a=String.fromCharCode(245);break;case "ouml":a=String.fromCharCode(246);break;case "divide":a=String.fromCharCode(247);break;case "oslash":a=
String.fromCharCode(248);break;case "ugrave":a=String.fromCharCode(249);break;case "uacute":a=String.fromCharCode(250);break;case "ucirc":a=String.fromCharCode(251);break;case "uuml":a=String.fromCharCode(252);break;case "yacute":a=String.fromCharCode(253);break;case "thorn":a=String.fromCharCode(254);break;case "yuml":a=String.fromCharCode(255);break;case "OElig":a=String.fromCharCode(338);break;case "oelig":a=String.fromCharCode(339);break;case "Scaron":a=String.fromCharCode(352);break;case "scaron":a=
String.fromCharCode(353);break;case "Yuml":a=String.fromCharCode(376);break;case "fnof":a=String.fromCharCode(402);break;case "circ":a=String.fromCharCode(710);break;case "tilde":a=String.fromCharCode(732);break;case "Alpha":a=String.fromCharCode(913);break;case "Beta":a=String.fromCharCode(914);break;case "Gamma":a=String.fromCharCode(915);break;case "Delta":a=String.fromCharCode(916);break;case "Epsilon":a=String.fromCharCode(917);break;case "Zeta":a=String.fromCharCode(918);break;case "Eta":a=
String.fromCharCode(919);break;case "Theta":a=String.fromCharCode(920);break;case "Iota":a=String.fromCharCode(921);break;case "Kappa":a=String.fromCharCode(922);break;case "Lambda":a=String.fromCharCode(923);break;case "Mu":a=String.fromCharCode(924);break;case "Nu":a=String.fromCharCode(925);break;case "Xi":a=String.fromCharCode(926);break;case "Omicron":a=String.fromCharCode(927);break;case "Pi":a=String.fromCharCode(928);break;case " Rho ":a=String.fromCharCode(929);break;case "Sigma":a=String.fromCharCode(931);
break;case "Tau":a=String.fromCharCode(932);break;case "Upsilon":a=String.fromCharCode(933);break;case "Phi":a=String.fromCharCode(934);break;case "Chi":a=String.fromCharCode(935);break;case "Psi":a=String.fromCharCode(936);break;case "Omega":a=String.fromCharCode(937);break;case "alpha":a=String.fromCharCode(945);break;case "beta":a=String.fromCharCode(946);break;case "gamma":a=String.fromCharCode(947);break;case "delta":a=String.fromCharCode(948);break;case "epsilon":a=String.fromCharCode(949);
break;case "zeta":a=String.fromCharCode(950);break;case "eta":a=String.fromCharCode(951);break;case "theta":a=String.fromCharCode(952);break;case "iota":a=String.fromCharCode(953);break;case "kappa":a=String.fromCharCode(954);break;case "lambda":a=String.fromCharCode(955);break;case "mu":a=String.fromCharCode(956);break;case "nu":a=String.fromCharCode(957);break;case "xi":a=String.fromCharCode(958);break;case "omicron":a=String.fromCharCode(959);break;case "pi":a=String.fromCharCode(960);break;case "rho":a=
String.fromCharCode(961);break;case "sigmaf":a=String.fromCharCode(962);break;case "sigma":a=String.fromCharCode(963);break;case "tau":a=String.fromCharCode(964);break;case "upsilon":a=String.fromCharCode(965);break;case "phi":a=String.fromCharCode(966);break;case "chi":a=String.fromCharCode(967);break;case "psi":a=String.fromCharCode(968);break;case "omega":a=String.fromCharCode(969);break;case "thetasym":a=String.fromCharCode(977);break;case "upsih":a=String.fromCharCode(978);break;case "piv":a=
String.fromCharCode(982);break;case "ensp":a=String.fromCharCode(8194);break;case "emsp":a=String.fromCharCode(8195);break;case "thinsp":a=String.fromCharCode(8201);break;case "zwnj":a=String.fromCharCode(8204);break;case "zwj":a=String.fromCharCode(8205);break;case "lrm":a=String.fromCharCode(8206);break;case "rlm":a=String.fromCharCode(8207);break;case "ndash":a=String.fromCharCode(8211);break;case "mdash":a=String.fromCharCode(8212);break;case "lsquo":a=String.fromCharCode(8216);break;case "rsquo":a=
String.fromCharCode(8217);break;case "sbquo":a=String.fromCharCode(8218);break;case "ldquo":a=String.fromCharCode(8220);break;case "rdquo":a=String.fromCharCode(8221);break;case "bdquo":a=String.fromCharCode(8222);break;case "dagger":a=String.fromCharCode(8224);break;case "Dagger":a=String.fromCharCode(8225);break;case "bull":a=String.fromCharCode(8226);break;case "hellip":a=String.fromCharCode(8230);break;case "permil":a=String.fromCharCode(8240);break;case "prime":a=String.fromCharCode(8242);break;
case "Prime":a=String.fromCharCode(8243);break;case "lsaquo":a=String.fromCharCode(8249);break;case "rsaquo":a=String.fromCharCode(8250);break;case "oline":a=String.fromCharCode(8254);break;case "frasl":a=String.fromCharCode(8260);break;case "euro":a=String.fromCharCode(8364);break;case "image":a=String.fromCharCode(8465);break;case "weierp":a=String.fromCharCode(8472);break;case "real":a=String.fromCharCode(8476);break;case "trade":a=String.fromCharCode(8482);break;case "alefsym":a=String.fromCharCode(8501);
break;case "larr":a=String.fromCharCode(8592);break;case "uarr":a=String.fromCharCode(8593);break;case "rarr":a=String.fromCharCode(8594);break;case "darr":a=String.fromCharCode(8595);break;case "harr":a=String.fromCharCode(8596);break;case "crarr":a=String.fromCharCode(8629);break;case "lArr":a=String.fromCharCode(8656);break;case "uArr":a=String.fromCharCode(8657);break;case "rArr":a=String.fromCharCode(8658);break;case "dArr":a=String.fromCharCode(8659);break;case "hArr":a=String.fromCharCode(8660);
break;case "forall":a=String.fromCharCode(8704);break;case "part":a=String.fromCharCode(8706);break;case "exist":a=String.fromCharCode(8707);break;case "empty":a=String.fromCharCode(8709);break;case "nabla":a=String.fromCharCode(8711);break;case "isin":a=String.fromCharCode(8712);break;case "notin":a=String.fromCharCode(8713);break;case "ni":a=String.fromCharCode(8715);break;case "prod":a=String.fromCharCode(8719);break;case "sum":a=String.fromCharCode(8721);break;case "minus":a=String.fromCharCode(8722);
break;case "lowast":a=String.fromCharCode(8727);break;case "radic":a=String.fromCharCode(8730);break;case "prop":a=String.fromCharCode(8733);break;case "infin":a=String.fromCharCode(8734);break;case "ang":a=String.fromCharCode(8736);break;case "and":a=String.fromCharCode(8743);break;case "or":a=String.fromCharCode(8744);break;case "cap":a=String.fromCharCode(8745);break;case "cup":a=String.fromCharCode(8746);break;case "int":a=String.fromCharCode(8747);break;case "there4":a=String.fromCharCode(8756);
break;case "sim":a=String.fromCharCode(8764);break;case "cong":a=String.fromCharCode(8773);break;case "asymp":a=String.fromCharCode(8776);break;case "ne":a=String.fromCharCode(8800);break;case "equiv":a=String.fromCharCode(8801);break;case "le":a=String.fromCharCode(8804);break;case "ge":a=String.fromCharCode(8805);break;case "sub":a=String.fromCharCode(8834);break;case "sup":a=String.fromCharCode(8835);break;case "nsub":a=String.fromCharCode(8836);break;case "sube":a=String.fromCharCode(8838);break;
case "supe":a=String.fromCharCode(8839);break;case "oplus":a=String.fromCharCode(8853);break;case "otimes":a=String.fromCharCode(8855);break;case "perp":a=String.fromCharCode(8869);break;case "sdot":a=String.fromCharCode(8901);break;case "lceil":a=String.fromCharCode(8968);break;case "rceil":a=String.fromCharCode(8969);break;case "lfloor":a=String.fromCharCode(8970);break;case "rfloor":a=String.fromCharCode(8971);break;case "lang":a=String.fromCharCode(9001);break;case "rang":a=String.fromCharCode(9002);
break;case "loz":a=String.fromCharCode(9674);break;case "spades":a=String.fromCharCode(9824);break;case "clubs":a=String.fromCharCode(9827);break;case "hearts":a=String.fromCharCode(9829);break;case "diams":a=String.fromCharCode(9830);break;default:a="";break}e=f}}c+=a}return c};
