var xhr; $(document).keyup(function (e) { if ($(".leit:focus") && (e.keyCode === 13)) { ajaxleit(); } var islStaf=[219,191,59,173]; /* ð þ æ ö */ var el=document.getElementById('leit'); el.value=el.value.toLowerCase(); el.value=el.value.replace(/[^a-záðéíóúýþæö \[\]\<\>\*\?]+/i, ''); }); //scroll í flettulista var ofs; var hid_valda; jQuery(function($) { $('#flettulisti').on('scroll', function() { if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { ofs=document.getElementById("offset").value; ofs=ofs+1; document.getElementById("offset").value=ofs; hid_valda=document.getElementById("leit").value; ajaxleit(void 0,void 0,"","","",ofs); } }) }); //ritskyggnir $("#setn").keyup(function(event){ alert(event.keyCode); if(event.keyCode == 13){ $("#ritskyggnistakki").click(); } }); function ajax(typa,divid,prop,urlid,parameter,cback,pushUrl,kill,cbackpar) { "use strict"; var server=window.location.href.substring(0,14); var dev=false; if ((server=="http://localho") || (server=="https://localh") || (server=="http://130.208") || (server=="https://130.20")) {dev=true;} if ((urlid!="/umsysla/endurbyggja.php") && (urlid!="/umsysla/eb.php")) { window.clearInterval(window.luppa); } if (document.getElementById("hornvalmynd")) { if (urlid!=="hornval.php") { document.getElementById("hornvalmynd").style.display="none"; } } if (document.getElementById("debug")) { document.getElementById("debug").remove(); } if (prop!="htmlplus") { $(window).bind('popstate', function(){ window.location.href = window.location.href; }); } var $this = $(this), data = $this.find('.firstInput').serialize(), method = $this.attr('method'), action = $this.attr('action'); if(xhr){ if(kill==1) { xhr.abort(); } } xhr=$.ajax({ type: typa, url: urlid, data: parameter, cache: false, function() { if (url.indexOf(substring) !=="greynir") { dataType: "html"; } else { dataType: "jsonp"; } }, beforeSend: function() { if(document.getElementById('kisa')) { if (prop=="kisa") { document.getElementById('kisa').style.display='block'; } else { document.getElementById('kisa').style.display='none'; } } }, success: function(svar){ if (divid!=="") { if (prop=='value') { /*alert("Divid="+divid);*/ $('#'+divid).value(svar); } else if (prop=='height') { $('#'+divid).height(svar); } else if (prop=='backgroundColor') { $('#'+divid).css("background-color",svar); } else if (prop=='display') { $('#'+divid).css("display",svar); } else if (prop=='color') { $('#'+divid).css("color",svar); } else if (prop=='disabled') { if (svar=='disabled') { $('#'+divid).attr('disabled','disabled'); } else { $('#'+divid).removeAttr('disabled'); } } else if (prop=='htmlplus') { var svar1=document.getElementById(divid).innerHTML; var svar2=svar1+svar; document.getElementById(divid).innerHTML=svar2; } else { if ((divid=="yfirkisa") && (svar.length>5)) { document.getElementById('yfirkisa').style.display="block"; } $('#'+divid).html(svar); } } if (typeof pushUrl !== "undefined") { if (pushUrl!=="") { var kaka=unescape(decodeURI(getCookie('sidasta'))); var pu=pussa(pushUrl); var r = /\\u([\d\w]{4})/gi; var pu = pu.replace(r, function (match, grp) {return String.fromCharCode(parseInt(grp, 16)); } ); pu = decodeURIComponent(pu); var puAnSlash=pu; pu="/"+pu; if (pu!==kaka) { var prefix=""; if (dev) { prefix="[D] "; } document.title=prefix+puAnSlash+" - Íslenskt orðanet"; history.pushState({url:puAnSlash},null,pu); setCookie("naestsidasta", getCookie.sidasta, 3650); setCookie("sidasta", pu, 3650); analyctics(); } } } }, complete: function(svar) { if (prop=="kisa") { document.getElementById('kisa').style.display='none'; } if (cback=="adgreina_nefnimyndir") { if (svar['responseText'].substring(0,11)!=="Engin samsv") { ajax('POST','haegri','','/umsysla/info_ogreint.php',parameter); } } else if (cback=="nyajaxleit") { skorun(divid); /*venn*/ nyajaxleit(divid,parameter); } else if (cback=='select_stepXnyajaxleit') { select_step(divid,parameter); nyajaxleit(divid,parameter); } else if (cback=='textayfirlit') { keyra('/umsysla/hjalparsidur.php','haegri'); } else if (cback=='endurbyggjaRefresh') { endurbyggjaRefresh(); } else if (cback=='ymsir_listar_scrolltop') { ymsir_listar_scrolltop(cpackpar); } else if (cback>'') { if (typeof(cbackpar)=="undefined") { window[cback](divid,parameter); } else { window[cback](divid,cbackpar); } } } }); } function ajaxleit(valinnFlid,valinFletta,nokill,hugtak,flipiNr,offs) { if (typeof flipiNr === "undefined") { flipiNr=-1; } var x; if (typeof valinFletta === "undefined") { //fletta ekki send yfir x=document.getElementById("leit").value; valinnFlid=-1; //leitað var eftir orði, ekki flid } else { x=valinFletta; } if (typeof offs === "undefined") { var offset=0; document.getElementById("offset").value=0; if (x=="") { alert("Ekkert slegið inn!"); return; } } else { //scroll var offset=offs; document.getElementById("offset").value=offs; } var par="str="+x+"&valinnFlid="+valinnFlid; par=par+"&offset="+offset; if (typeof nokill === "undefined") { if (x==="") { document.getElementById("leitardiv").className="leitardiv leitardivXL"; document.getElementById("leitarhjalp").className="leitarvjalp leitarhjalpXL cursorNohov"; document.getElementById("leitarvideo").className="leitarvideo leitarvideoXL"; document.getElementById("leit").className="leit leitXL"; document.getElementById("leitSenda").className="leitSenda leitSendaXL"; document.getElementById("leitarvideo").style.display="none"; document.getElementById("hovertexti").className="hjalparhoverXL"; document.getElementById("spurnhringur").className="flatmerkiXL"; document.getElementById("flettulisti").style.display="block"; } else { document.getElementById("leitardiv").className="leitardiv"; document.getElementById("leitarhjalp").className="leitarhjalp cursorNohov"; document.getElementById("leitarvideo").className="leitarvideo"; document.getElementById("leit").className="leit"; document.getElementById("leitSenda").className="leitSenda"; document.getElementById("leitarvideo").style.display="none"; document.getElementById("hovertexti").className="hjalparhover"; document.getElementById("spurnhringur").className="flatmerki"; document.getElementById("flettulisti").style.display="block"; } document.getElementById("haegri").innerHTML=""; ajax("POST","flettulisti","","/leit.php",par,"handvalinn","",1); } else { document.getElementById("leitardiv").className="leitardiv"; if (offset>0) { ajax("POST","flettulisti","htmlplus","/leit.php",par,"","",1); return; } else { ajax("POST","flettulisti","","/leit.php",par,"toppskroll","",""); } } if (hugtak=="hugtak") { var urlauki=document.getElementById('u'+valinnFlid).value; syna_nidurstodur(valinnFlid,urlauki,0,'#61BD6D'); } else if (flipiNr > -1) { var jlitur=new Array(); jlitur[0]="#61BD6D"; jlitur[1]="#2C82C9"; jlitur[2]="#54acd2"; jlitur[3]="#FB9016"; jlitur[4]="#1ABC9C"; jlitur[5]="#795899"; jlitur[6]="#FAC51C"; jlitur[7]="#475577"; jlitur[8]="#475577"; jlitur[9]="#475577"; syna_nidurstodur(valinnFlid,urlauki,flipiNr,jlitur[flipiNr]); } } function ajaxleitFraUrl(fletta,push) { //úrelt func? fletta=fletta.replace(/\s\s+/g, ' '); //eyðir tvöföldu stafabili document.getElementById("leit").value=fletta; var par="str="+fletta; if (push==1) { id=ajax("POST","flettulisti","","/leit.php",par,"",fletta,1); } else { ajax("POST","flettulisti","","/leit.php",par,"","",1); } } function ajaxvenslaleit(valinnFlid) { var x=document.getElementById("venslaleit").value; var par="str="+x+"&valinnFlid="+valinnFlid; ajax("POST","venslaleitarval","","/venslaleit.php",par); //document.getElementById("haegri").innerHTML=""; } function am() { window.location.href="http://arnastofnun.is/"; } function analyctics() { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-85167429-1', 'auto'); ga('send', 'pageview'); } function ath_ovirkur() { alert("Þetta er sýnidæmi – hnappurinn er ekki virkur.\n\nFlettu á næstu síðu til að sjá hvað gerist næst."); } function staekkaValinn(flid) { if (document.getElementsByClassName("valinFletta").length===1) { document.getElementsByClassName("valinFletta")[0].className='fletta'; } document.getElementById("p"+flid).className="valinFletta"; } function bjodaVensl(flid) { var i; var tags = document.getElementById("flettulisti").getElementsByTagName("p"); var total = tags.length; var el; for (i=0;i< total;i++) { tags[i].className='fletta'; /* tags[i].style.fontSize='1em'; tags[i].style.lineHeight='1em'; */ el=tags[i].id; if (el.charAt(0)=="p") { el=el.replace("p","bjoda"); $('#'+el).remove(); } } document.getElementById("p"+flid).style.fontSize="1.4em"; document.getElementById("p"+flid).style.lineHeight="1.4em"; //document.getElementById("p"+flid).style.backgroundColor="#fff2a8"; var par="flid="+flid; //ajax("POST","p"+flid,"htmlplus","bjodaVensl.php",par); } function drepa(pid) { par="drepa="+pid; ajax("POST","haegri","","/umsysla/pg_virkni.php",par); } function felaHjalp() { document.getElementById('overlay').style.display="none"; document.getElementById("hjalp").innerHTML=""; document.getElementById("hjalp").className="hjalpUti"; } function fylla_div(divid,strengur,closetakki) { var par="str="+strengur; var x; if (closetakki==1) { x="
\n"; x=x+"X\n"; x=x+"
\n"; strengur=x+strengur; } document.getElementById(divid).innerHTML=strengur; document.getElementById(divid).style.display=''; } function fylla_onload(divid,strengur,closetakki) { fylla_div(divid,strengur,closetakki); } function getCssValuePrefix() { var rtrnVal = '';//default to standard syntax var prefixes = ['-o-', '-ms-', '-moz-', '-webkit-']; // Create a temporary DOM object for testing var dom = document.createElement('div'); for (var i = 0; i < prefixes.length; i++) { // Attempt to set the style dom.style.background = prefixes[i] + 'linear-gradient(#000000, #ffffff)'; // Detect if the style was successfully set if (dom.style.background) { rtrnVal = prefixes[i]; } } dom = null; delete dom; return rtrnVal; } function getCookie(nafn) { var value = "; " + document.cookie; var parts = value.split("; " + nafn + "="); if (parts.length == 2) { return parts.pop().split(";").shift(); } } function handvalinn() { var fjoldi=document.getElementsByClassName("fletta").length+document.getElementsByClassName("valinFletta").length; if (fjoldi>0) { var divid=document.getElementsByClassName("valinFletta")[0].id; flid=divid.substr(1); var fletta=document.getElementById('s'+flid).value; var urlauki=document.getElementById('u'+flid).value; velja(flid,fletta,urlauki,-1); } toppskroll(); } function hasClass(element, cls) { return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; } function keyra(forrit,id,callback) { //document.getElementById('kisa').style.display='none'; if (typeof callback === 'undefined') { ajax("POST",id,"",forrit,""); } else { ajax("POST",id,"",forrit,"",callback); } } function keyraPlus(forrit,id) { ajax("POST",id,"kisa",forrit,""); } function leitarhjalp(x) { if (x==1) { document.getElementById('flettulisti').style.display='none'; document.getElementById('leitarvideo').style.display='block'; } else { document.getElementById('leitarvideo').style.display='none'; } } function loka(id) { document.getElementById(id).style.display="none"; if (id=="leitarvideo") { document.getElementById('flettulisti').style.display='block'; } } //leitað úr URL-i function nyajaxleit(divid,parameter) { var nyfletta=qsleit(parameter,"fletta"); var nyttflid=qsleit(parameter,"id"); var flipiNr=qsleit(parameter,"flipiNr"); ajaxleit(nyttflid,nyfletta,"nokill","",flipiNr); if (document.getElementById('p'+nyttflid)) { setTimeout("document.getElementById('p"+nyttflid+"').className='valinFletta';",400); } } function pussa(str) { //þ.e.a.s. pússa :) /*str=str.replace(/(<([^>]+)>)/ig,""); //strip_tags*/ str=str.replace(/\s\s+/g, ' '); //eyðir tvöföldu stafabili str=str.trim(); str=str.replace(new RegExp(" ", 'g'),"_"); //bil verður undirstrik return str; } function qsleit(qs,variable) { var vars = qs.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if (decodeURIComponent(pair[0]) == variable) { return decodeURIComponent(pair[1]); } } } function radaSkyldheitum(flid,rodun) { par="flid="+flid+"&radnumer=3&rod="+rodun+"&typ=skyldheiti"; ajax("POST","meginmal","","/utkoma_skyldheiti.php",par,"select_step"); } function radaGrannheitum(flid,rodun) { par="flid="+flid+"&radnumer=3&rod="+rodun+"&typ=grannheiti"; ajax("POST","meginmal","","/utkoma_grannheiti.php",par,"select_step"); } function rekja(frumflid,grannflid) { if (document.getElementById("rekja"+grannflid).style.display=="none") { //byrja á að loka öllum hinum gluggunum var node_listi = document.querySelectorAll('*[id^="rekja"]'); for (var i = 0; i < node_listi.length; ++i) { var item = node_listi[i]; // Calling myNodeList.item(i) isn't necessary in JavaScript item.style.display="none"; item.innerHTML=""; } var par="frumflid="+frumflid+"&grannflid="+grannflid; ajax("POST","rekja"+grannflid,"","/rekjaGrannheiti.php",par); document.getElementById("rekja"+grannflid).style.display=""; } else { document.getElementById("rekja"+grannflid).style.display="none"; } } function rsSkipta(id,key,linufjoldi) { var txt=document.getElementById("rs"+id+"-"+key).innerHTML; var linutexti=document.getElementById("x"+id).innerHTML; document.getElementById("x"+id).innerHTML=txt; for(var i=key;i>0;i--) { document.getElementById("rs"+id+"-"+i).innerHTML = document.getElementById("rs"+id+"-"+(i-1)).innerHTML; } document.getElementById("rs"+id+"-0").innerHTML=linutexti; var x=""; var y=""; for(i=0;i<(linufjoldi-1);i++) { x=document.getElementById("rs"+id+"-"+i).innerHTML; y=document.getElementById("rs"+id+"-"+(i+1)).innerHTML; if (x>y) { document.getElementById("rs"+id+"-"+(i+1)).innerHTML=x; document.getElementById("rs"+id+"-"+i).innerHTML=y; } } } function select_step(divid) { if (divid=="meginmal") { divid="haegri"; } if (divid=="ht_haegri_dalkur") { divid="haegri"; } jQuery('.select-step').each(function() { jQuery(this).selectStep({ incrementLabel: '+', decrementLabel: '-', divid: divid, onChange: function(value) { var strengur=value.value; var butur=strengur.split("|"); var prog=butur[0]; var div=butur[1]; var par=butur[2]; var cback2; if (butur.length==4) { cback2=butur[3]; } else { cback2=""; } ajax("POST",div,"",prog,par,cback2); } }); }); } function setCookie(nafn, gildi, dagar) { var d = new Date(); d.setTime(d.getTime() + (dagar*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = nafn + "=" + gildi + "; " + expires; } function skorun(divid,parameter) { if (document.getElementById('skorun')) { var str=document.getElementById('sets').innerHTML; str+="var str=document.getElementById('sets').innerHTML;"; str+="var litur1='#2C82C9';"; str+="var litur2='#54acd2';"; str+="var litur3='#FB9016';"; str+="var litur4='#1ABC9C';"; str+="var txlitur1='#07001f';"; str+="var txlitur2='#0f004f';"; str+="var txlitur3='#3f1f00';"; str+="var txlitur4='#005f00';"; str+="var litir = [litur1,litur3,litur4];"; str+="var txlitir = [txlitur1,txlitur3,txlitur4];"; //alert(str); //document.getElementById('skorun').innerHTML=sets; str+="var chart = venn.VennDiagram().width(580).height(300);"; str+="d3.select('#skorun').datum(sets).call(chart);"; str+="var tooltip = d3.select('body').append('div') "; str+=" .attr('class','venntooltip'); "; str+=" d3.selectAll('#skorun .venn-circle path')"; str+=" .style('fill-opacity', .6)"; str+=" .style('fill', function(d,i) { return litir[i]});"; str+=" d3.selectAll('#skorun .venn-circle text')"; str+=" .style('font-family', 'PT Sans')"; str+=" .style('font-size', '0.8em')"; str+=" .style('fill', function(d,i) { return txlitir[i]})"; //str+=" .style('stroke', function(d,i) { return litir[i]})"; str+=" .style('stroke-width', 0.1)"; str+=" .style('stroke-opacity', .8);"; var F=new Function(str)(); } } function sjaMeira(stafur) { document.getElementById('meira_'+stafur).style.display="block"; document.getElementById('sjameira').innerHTML="
Langsóttari vensl"; } function stadtolur() { document.getElementById("leitardiv").className="leitardiv"; document.getElementById("leit").className="leit"; ajax("POST","haegri","","/ajaxStadtolur.php"); } function strip_tags(txt) { txt=txt.replace(/(<([^>]+)>)/ig,""); return txt; } function synaHjalp(textaId,litnr) { //document.getElementById("hjalp").style.display="block"; //$("hjalp").toggleClass('trans'); if (document.getElementById("hjalp").className!=="hjalpInni"+litnr) { document.getElementById('overlay').style.display="block"; var par="textaId="+textaId; document.getElementById("hjalp").className="hjalpInni"+litnr; setTimeout("ajax('POST','hjalp','','/hjalp.php','"+par+"')",300); } else { document.getElementById('overlay').style.display="none"; document.getElementById("hjalp").innerHTML=""; document.getElementById("hjalp").className="hjalpUti"; } } function synaHT(hugtaksflid,adalflid,fjoldiTakka,numerTakka) { var par="hugtaksflid="+hugtaksflid+"&adalflid="+adalflid; //var x=document.getElementById("ht_mid_dalkur").innerHTML; for (var i=0;i< fjoldiTakka;i++) { if (i==numerTakka) { document.getElementById("callHTtakki"+i).className="takki graenn stor"; } else { document.getElementById("callHTtakki"+i).className="takki ljosgraenn stor"; } } ajax("POST","ht_vinstri_dalkur","","/fletturUndirHugtaki.php",par,"select_step"); ajax("POST","ht_mid_dalkur","","/fletturUndirPorumHugtaks.php",par,"select_step"); ajax("POST","ht_haegri_dalkur","","/tengdHugtok.php",par,"select_step"); } function syna_nidurstodur(flid,urlauki,flipiNr,litur,radnumer,mark,talning) { var erTil=false; var i=-1; for (i=-1;i< 9;i++) { erTil=document.getElementById("flipi"+i); if (erTil) { if (i==flipiNr) { document.getElementById("flipi"+i).className = "tab baklitur"+i; document.getElementById("meginmal").style.borderColor=litur; } else { document.getElementById("flipi"+i).className = "tab daufbaklitur"+i; } } } //breyta vefslóðinni var vefslod=window.location.href; var eining=vefslod.split("/"); var fletta=eining[3]; var typ=["hugtok","por","skyldheiti","grannheiti","metin_vensl","osamb","samsett","setngerd"]; var flettuhali=["/hugtök","/pör","/skyldheiti","/grannheiti","/metin_vensl","/orðastæður","/samsetningar","/setningargerð"]; //ekki viðbót í url ef yfirlitssíða if (flipiNr > -1) { if (urlauki>"") { fletta=fletta+urlauki; } fletta=fletta+flettuhali[flipiNr]; } typ[-1]="yfirlit"; var par="flid="+flid+"&typ="+typ[flipiNr]+"&radnumer="+radnumer+"&mark="+mark+"&talning="+talning; document.getElementById("meginmal").innerHTML=""; ajax("POST","meginmal","","/utkoma_"+typ[flipiNr]+".php",par,"select_step",fletta); } function synaOFL(id) { if (id!=="ht3n") { if (document.getElementById("ht3n")) { document.getElementById("ht3n").style.display="none"; } } if (id!=="ht3l") { if (document.getElementById("ht3l")) { document.getElementById("ht3l").style.display="none"; } } if (id!=="ht3s") { if (document.getElementById("ht3s")) { document.getElementById("ht3s").style.display="none"; } } if (id!=="ht3a") { if (document.getElementById("ht3a")) { document.getElementById("ht3a").style.display="none"; } } if (id!=="ht3f") { if (document.getElementById("ht3f")) { document.getElementById("ht3f").style.display="none"; } } document.getElementById(id).style.display="block"; } function toppskroll() { document.getElementById("flettulisti").scrollTop = 0; } function valmynd() { var v=document.getElementById("hornvalmynd"); if (v.style.display=="none") { ajax("POST","hornvalmynd","","/hornval.php"); v.style.display='block'; } else { v.style.display='none'; } } function valmynd_loka() { var v=document.getElementById("hornvalmynd"); if (v.style.display=="none") { ajax("POST","hornvalmynd","","/hornval.php"); v.style.display='block'; } else { v.style.display='none'; } } function velja(flid,fletta,urlauki,flipiNr) { if (typeof flipiNr === "undefined") { flipiNr=-1; } staekkaValinn(flid); document.getElementById('leitarvideo').style.display='none'; var leitarfletta=fletta; leitarfletta=leitarfletta.replace(/\s+/g," "); leitarfletta=leitarfletta.trim(); //Áður var leitarboxið uppfært með völdu svari ef það samsvaraði ekki fullkomlega leitarstreng //Með tilkomu algildistákna er því hætt. //document.getElementById('leit').value=leitarfletta; var urlfletta=leitarfletta; if (urlauki>"") { urlfletta=urlfletta+urlauki; } var par="id="+flid+"&start=-1&urlauki="+urlauki+"&flipiNr="+flipiNr; ajax("POST","haegri","","/utkoma.php",par,"skorun",urlfletta); } function velja_haegri(flid,fletta,urlauki,flipi,flipiNr) { if (typeof urlauki === "undefined") { urlauki=""; } if (typeof flipi === "undefined") { flipi=""; flipiNr=-1; } fletta=fletta.replace(/\s+/g," "); fletta=fletta.replace(/\s/g,"_"); fletta=fletta.trim(); var leitarfletta=fletta.replace(/_/g," "); document.getElementById('leitarvideo').style.display='none'; var urlpartur=fletta; if (urlauki>"") { urlpartur=urlpartur+urlauki; } if (flipi>"") { urlpartur=urlpartur+flipi; } document.getElementById('leit').value=leitarfletta; var par="id="+flid+"&start=-1&fletta="+fletta+"&urlauki="+urlauki+"&flipiNr="+flipiNr; ajax("POST","haegri","","/utkoma.php",par,"nyajaxleit",urlpartur); } function veljaHugtak(flid,fletta,urlauki,urelt) { staekkaValinn(flid); document.getElementById('leitarvideo').style.display='none'; var leitarfletta=fletta; leitarfletta=leitarfletta.replace(/\s+/g," "); leitarfletta=leitarfletta.trim(); document.getElementById('leit').value=leitarfletta; var urlfletta=leitarfletta; if (urlauki>"") { urlfletta=urlfletta+"/"+urlauki; } urlfletta=urlfletta+"/hugtök"; var par="id="+flid+"&start=0&fletta="+fletta+"&urlauki="+urlauki; ajax("POST","haegri","","/utkoma.php",par,"select_stepXnyajaxleit",urlfletta,0); //document.getElementById('leit').value=fletta; } function velja_ur_hjalp(flid,fletta) { valmynd_loka(); var divsToHide = document.getElementsByClassName("fancybox-overlay"); for(var i = 0; i < divsToHide.length; i++) { divsToHide[i].style.display="none"; } document.getElementById("leitardiv").className="leitardiv"; document.getElementById("leit").className="leit"; velja_haegri(flid,fletta); } function veljaMark(mark,fletta,urelt,stafrof) { var par="mark="+mark+"&flid=0&urlauki="; ajax("POST","haegri","","/utkoma.php",par,"",mark); } function veljaVensl(flid1, flid2, fletta2) { var par="flid1="+flid1+"&flid2="+flid2; var i; var tags = document.getElementById("venslaleitarval").getElementsByTagName("p"); var total = tags.length; var el; for (i=0;i< total;i++) { tags[i].style.fontSize='1em'; tags[i].style.lineHeight='1em'; } document.getElementById('venslaleit').value=fletta2; document.getElementById("p"+flid2).style.fontSize="1.4em"; document.getElementById("p"+flid2).style.lineHeight="1.4em"; ajax("POST","haegri","","/utkoma.php",par); } function vensl(flid) { var par="flid="+flid; ajax("POST","vinstri2","","/vensl.php",par); } function vixla(id) { if (document.getElementById(id).style.display=="none") { document.getElementById(id).style.display="block"; } else { document.getElementById(id).style.display="none"; } } function vixla_venn(skyldId,frumId,a,b,a_snid_b,a_fletta,b_fletta) { if (document.getElementById("felagar"+skyldId).style.display=="none") { //byrja á að loka öllum hinum gluggunum var node_listi = document.querySelectorAll('*[id^="felagar"]'); for (var i = 0; i < node_listi.length; ++i) { var item = node_listi[i]; // Calling myNodeList.item(i) isn't necessary in JavaScript item.style.display="none"; item.innerHTML=""; } document.getElementById("felagar"+skyldId).style.display=""; var divid=document.getElementById("felagar"+skyldId).id; var par="a="+a+"&b="+b+"&c="+a_snid_b+"&skyldId="+skyldId+"&frumId="+frumId; ajax("POST",divid,"","/felagar.php",par); } else { document.getElementById("felagar"+skyldId).style.display="none"; } }