/*******************************************************************************************************************/ /*Opens a new browser window*/ /*******************************************************************************************************************/ var gDiv; var newWindow; function openWindow(u) { var vinduWidth; var vinduHeight; var vinduLeft; var vinduTop; var temp1; var temp2; var windowSettings; var url = u; //Setter størrelse på det nye vinduet vinduWidth = parseInt((screen.width / 100) *60); vinduHeight = parseInt((screen.height/100)*74) ; //Plasserer det nye vinduet vinduLeft= parseInt((screen.width / 100) *37); vinduTop=parseInt((screen.height/100)*18); //Setter alle instillingene til det nye vinduet temp1 = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes"; temp2 = ",width="+vinduWidth+",height="+vinduHeight+",left="+vinduLeft+",top="+vinduTop; windowSettings = temp1+temp2; //Åpner det nye vinduet og gir det fokus. newWindow=window.open(url ,"nv",windowSettings); newWindow.focus(); } /*******************************************************************************************************************/ /*Opens new Window with parameters, except location.host (url = 'path/....?openDocument' /*Url = '/database.nsf/dir?openagent' /*Properties = 'resizable=no,scrollbars=no, status=no, width=100,height=100, top=50, left=50' /*******************************************************************************************************************/ function oWin(url,properties){ //alert('url: '+window.location.host+url); hurl = 'http://'+window.location.host+url; wwin = window.open( hurl, "newWindow", properties); } /*******************************************************************************************************************/ /*Replaces characters in text string*/ /*******************************************************************************************************************/ function replacesubstring(sourceList,fromList,toList) { for (var i=0; i when saving text from rich text field to text field*/ /*******************************************************************************************************************/ function replaceCR(sourceList) { for (var i=0; i'+sourceList.substring(i+1,sourceList.length) // } if (sourceList.charCodeAt(i) == 10) { sourceList = sourceList.substring(0,i)+'
'+sourceList.substring(i+1,sourceList.length) } } return sourceList } /*******************************************************************************************************************/ //COOKIE //----------------------------------------------------------------------------------------------------- function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function DeleteCookie (name) { var exp = new Date(); exp.setTime (exp.getTime() - 1); var cval = GetCookie (name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); } var expDays = 1; var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000)); function amt(){ var count = GetCookie('count') if(count == null) { SetCookie('count','1') return 1 } else { var newcount = parseInt(count) + 1; DeleteCookie('count') SetCookie('count',newcount,exp) return count } } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } //END COOKIES //------------------------------------------------------------------------------------------------------ var slideShowSpeed = 7000; var crossFadeDuration = 5; var Pic = new Array(); Pic[0] = '/pb/pb.nsf/0.jpg' Pic[1] = '/pb/pb.nsf/2.jpg' Pic[2] = '/pb/pb.nsf/1.jpg' Pic[3] = '/pb/pb.nsf/3.jpg' Pic[4] = '/pb/pb.nsf/5.jpg' Pic[5] = '/pb/pb.nsf/7.jpg' Pic[6] = '/pb/pb.nsf/8.jpg' var t; var j = 0; var p = Pic.length; var preLoad = new Array(); for (i = 0; i < p; i++) { preLoad[i] = new Image(); preLoad[i].src = Pic[i]; } function runSlideShow() { if (document.all) { document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"; document.images.SlideShow.filters.blendTrans.Apply(); } document.images.SlideShow.src = preLoad[j].src; if (document.all) { document.images.SlideShow.filters.blendTrans.Play(); } j = j + 1; if (j > (p - 1)) j = 0; t = setTimeout('runSlideShow()', slideShowSpeed); } function cOn(td){ td.style.backgroundColor="#f0f0f0"; } function cOut(td){ td.style.backgroundColor="#e0e0e0"; } function skiftDiv(del) { //alert('skiftDiv - del: ' + del); //gDiv = ''; gNiva = ''; cx = ''; cy = ''; if (del != "ingen") { //eval('cx = div'+del); eval('cy = div'+del); //cx = cx + 520; //cx = Math.round(Math.log(event.clientX))*100-300; var browseWidth, browseHeight; if (document.layers){ browseWidth=window.outerWidth; browseHeight=window.outerHeight; } if (document.all){ browseWidth=document.body.clientWidth; browseHeight=document.body.clientHeight; } cx = browseWidth/2 - 180; window.status = browseWidth; cy = cy * 36 + 200; } diver = document.forms[0].Diver.value.split("#"); var i = 0; if (diver != "") { for (i == 0; i < diver.length; i++) { if( diver[i] == del) { document.getElementById(del).style.visibility="visible"; document.getElementById(del).style.top=cy; document.getElementById(del).style.left=cx; } else { //eval('document.getElementById(diver[i]).style.visibility="hidden"'); document.getElementById(diver[i]).style.visibility="hidden"; } } } }