var mod_tabell={"teller":[],"sortert":null,"sort":{"current":null,"flip":false,"rente":{"type":"numeric","data":2,"dir":"up"},"nedbetalingstid":{"type":"numeric","data":4,"dir":"down"},"etableringsgebyr":{"type":"numeric","data":5,"dir":"up"},"termingebyr":{"type":"numeric","data":6,"dir":"up"},"aldersgrense":{"type":"numeric","data":8,"dir":"up"}},"grupper":["1","2"],"vurdering":"http://refinansiering.com/forbrukslån/refinansiering-*","cols":[{"type":0,"css":"sprite sin"},{"type":3,"data":0,"a":{"href":"vurdering","data":1},"css":"k_navn"},{"type":2,"data":2,"html":"* %<br /><span class=\"rentetekst\">65000 o/5 år<br />tot. eval,-</span>","eval":"Math.round((65000 * (Math.pow(Math.pow(1+parseFloat(d[c.data])/100,1/12),5*12)) * (Math.pow(1+parseFloat(d[c.data])/100,1/12)-1) / ((Math.pow(Math.pow(1+parseFloat(d[c.data])/100,1/12),5*12))-1))*5*12)","kode":{"fra":["-1"],"til":["<span class=\"sprite avtale\" title=\"Settes etter kredittvurdering\"></span>"]}},{"type":2,"data":3,"html":"* kr","format":"valuta"},{"type":2,"data":4,"html":"* år","kode":{"fra":["-30"],"til":["30 dager"]}},{"type":2,"data":5,"html":"*","format":"mix valuta","kode":{"fra":["-1"],"til":["<span class=\"sprite avtale\" title=\"Settes etter avtale\"></span>"]}},{"type":2,"data":6,"html":"* kr"},{"type":2,"data":7,"html":"* kr","format":"valuta","kode":{"fra":["-1"],"til":["Fast inntekt"]}},{"type":2,"data":8,"html":"* år"},{"type":3,"data":0,"a":{"href":"vurdering","data":1},"html":"<span class=\"sprite lupe\" title=\"Vurdering av * forbrukslån\"></span>"},{"type":0,"css":"sprite dx"}]};var i=null,j=!1;window.set_filter=k;window.set_sort=l;window.set_terskel=m;window.set_terskel_enter=o;window.set_profil=q;window.mod_tabell_reset=r;window.mod_tabell_render=s;window.mod_tabell_filtrer=t;function k(a){a=document.getElementById(a.name);if(a!=i)a.checked=!a.checked,t()}function l(a){if(u(mod_tabell.sort,a))document.getElementById("sortering").value=a,s()}
function m(a){var b=parseInt(a.value,10);if(NaN!=b){if(b==mod_tabell.c[a.id].state)return;mod_tabell.c[a.id].state=b}else mod_tabell.c[a.id].state=i;t()}function o(a,b){return 13==(window.event?window.event.keyCode:a.which)?(m(b),j):!0}function q(a){if(u(mod_tabell.b,a.value)){if(a.value==mod_tabell.b.state)return;mod_tabell.b.state=a.value}else mod_tabell.b.state=i;t()}
function r(a){a.form.reset();if(u(mod_tabell,"profiler"))mod_tabell.b.state=i;for(var b in mod_tabell.c)mod_tabell.c[b].state=i;mod_tabell.sort.current=i;s()}
function s(){var a=document.getElementById("sortering").value,b=document.getElementById("h_"+a),d=j;if(mod_tabell.sort.current!=a){if(0!=mod_tabell.sort.current&&mod_tabell.sort.current!==i)document.getElementById("h_"+mod_tabell.sort.current).className="sorterbar";mod_tabell.sortert=i;mod_tabell.sort.current=a;mod_tabell.sort.flip=j;0!=a&&(b.className+=" sortert sortert"+mod_tabell.sort[a].dir)}else if(0!=a){var d=!0,a=mod_tabell.sort[a].dir,c="up";mod_tabell.sort.flip&&(a="up"==a?"down":"up");"up"==a&&(c="down");mod_tabell.sort.flip=!mod_tabell.sort.flip;b.className=b.className.replace("sortert"+a,"sortert"+c)}if(mod_tabell.sortert===i||d){if(mod_tabell.sortert===i)if(mod_tabell.sortert=[],0==mod_tabell.sort.current)for(b=0;b<mod_tabell.grupper.length;b++){mod_tabell.sortert[b]=[];for(d=0;d<mod_tabell_data[b].length;d++)mod_tabell.sortert[b][d]=d}else{a=mod_tabell.sort[mod_tabell.sort.current];for(b=0;b<mod_tabell.grupper.length;b++){mod_tabell.sortert[b]=[];c=[];for(d=0;d<mod_tabell_data[b].length;d++)c[d]=[d,mod_tabell_data[b][d][a.data]];"numeric"==a.type&&("up"==a.dir?c.sort(function(a,b){return a[1]-b[1]}):c.sort(function(a,b){return b[1]-a[1]}));for(d=0;d<c.length;d++)mod_tabell.sortert[b][d]=c[d][0]}}a=w();c=document.getElementById("mod_tabell_tbody");for(b=0;b<mod_tabell.sortert.length;b++)if(mod_tabell.sort.flip)for(d=mod_tabell.sortert[b].length-1;0<=d;d--)a.appendChild(x(b,mod_tabell.sortert[b][d]));else for(d=0;d<mod_tabell.sortert[b].length;d++)a.appendChild(x(b,mod_tabell.sortert[b][d]));c.parentNode.replaceChild(a,c)}t()}function w(){var a=document.createElement("tbody");a.id="mod_tabell_tbody";return a}
function x(a,b){var d=mod_tabell_data[a][b],c,e=document.createElement("tr"),f,h,g;e.id="r_"+a+"_"+b;for(var p=0;p<mod_tabell.cols.length;p++){c=mod_tabell.cols[p];f=document.createElement("td");if(u(c,"css"))f.className=c.css;if(0<c.type)if(1==c.type)f.innerHTML=c.html;else{if(y(c.data)){g=c.html;for(var n=0;n<c.data.length;n++)h=d[c.data[n]],g=z(c,h,g,n)}else{h=d[c.data];g=i;if(u(c,"html"))g=c.html;g=z(c,h,g,i);if(u(c,"replace"))for(var v in c.replace)g=g.replace("{"+v+"}",c.replace[v][h-1])}u(c,"eval")&&(g=g.replace("eval",eval(c.eval)));u(c,"a")?(h=document.createElement("a"),c=c.a,h.href="/number"==typeof c.href?d[c.href]:mod_tabell[c.href].replace("*",d[c.data]),h.innerHTML=g,f.appendChild(h)):f.innerHTML=g}e.appendChild(f)}return e}
function z(a,b,d,c){var e=j,f;f=c===i?"*":"*"+(c+1).toString();if("string"==typeof b&&0==b.length)return"-";u(a,"kode")&&(e=A(b,a.kode.fra));if(e!==j){if(c===i)return a.kode.til[e];b=a.kode.til[e]}else u(a,"format")&&("valuta"==a.format&&3<b.length?(a=b.length-3,b=b.slice(0,a)+" "+b.substr(a)):"mix valuta"==a.format&&(b=parseFloat(b),b=1>b&&0<b?(100*b).toString()+" %":b+" kr"));return d=d!==i?d.replace(f,b):b}
function t(){var a,b,d;for(d in mod_tabell.filter)if(a=mod_tabell.filter[d],"match"==a.type){b=document.getElementById("filter").elements[d];mod_tabell.filter[d].state=[];for(a=0;a<b.length;a++)if(b[a].checked)mod_tabell.filter[d].state[a]=b[a].value}else if(b=document.getElementById(d),"bool"==a.type)mod_tabell.filter[d].state=b.checked;b=document.getElementById("mod_tabell_tbody");d=b.cloneNode(!0);for(var c=0,e=0,f=0;f<mod_tabell.grupper.length;f++){for(var h=mod_tabell.teller[f]=0;h<mod_tabell.sortert[f].length;h++){(a=B(f,mod_tabell.sortert[f][h]))&&mod_tabell.teller[f]++;var g="g_"+mod_tabell.grupper[f];1==mod_tabell.teller[f]&&(g+=" firstrow");a||(g+=" noshow");d.childNodes[c].className=g;c++}e+=mod_tabell.teller[f]}b.parentNode.replaceChild(d,b);document.getElementById("ad_txt").style.visibility=mod_tabell.teller[0]?"visible":"hidden";document.getElementById("tomtabell").style.display=e?"none":"block";document.getElementById("tabellen").className=e?"":"noshow"}
function B(a,b){if(u(mod_tabell,"profiler")&&mod_tabell.b.state!=i&&A(b,mod_tabell.b[mod_tabell.b.state][a])===j)return j;var d=mod_tabell_data[a][b],c,e,f;for(e in mod_tabell.filter){c=mod_tabell.filter[e];if("match"==c.type&&c.state.length){for(var h=0;h<c.state.length;h++)if(e=d[c.data],u(c,"transform")&&(f=A(e,c.transform.d),f!==j&&(e=c.transform.e[f])),y(e)){if(A(c.state[h],e)!==j)return C(a,b)}else if(e==c.state[h])return C(a,b);return j}if("bool"==c.type&&c.state&&(!d[c.data]||!parseInt(d[c.data],10)))return j}return C(a,b)}function C(a,b){if(!u(mod_tabell,"terskel"))return!0;var d=mod_tabell_data[a][b],c,e;for(e in mod_tabell.c)if(c=mod_tabell.c[e],c.state!=i&&"max"==c.type&&d[c.data]>c.state)return j;return!0}function A(a,b){for(var d=0;d<b.length;d++)if(b[d]==a)return d;return j}function y(a){return"object"==typeof a&&a instanceof Array}function u(a,b){return"undefined"!=typeof a[b]}s();
