/*******************************************************************************************************************/ /*Opens a new browser window*/ /*******************************************************************************************************************/ 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 = 15000; var crossFadeDuration = 50; var Pic = new Array(); Pic[0] = '/fossumit/fossumit.nsf/w8.jpg' Pic[1] = '/fossumit/fossumit.nsf/w4.jpg' Pic[2] = '/fossumit/fossumit.nsf/w6.jpg' Pic[3] = '/fossumit/fossumit.nsf/w7.jpg' Pic[4] = '/fossumit/fossumit.nsf/w9.jpg' Pic[5] = '/fossumit/fossumit.nsf/w10.jpg' Pic[6] = '/fossumit/fossumit.nsf/w11.jpg' Pic[7] = '/fossumit/fossumit.nsf/w12.jpg' var t; var j = 0; var loop = 1; var p = Pic.length; loop = p*loop; 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.style.filter="progid:DXImageTransform.Microsoft.Pixelate(maxSquare=10,duration=1)"; document.images.SlideShow.style.filter="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=0.7, wipeStyle=0, motion='reverse',duration=5)"; document.images.SlideShow.filters[0].Apply(); } document.images.SlideShow.src = preLoad[j].src; if (document.all) { document.images.SlideShow.filters[0].Play(); } j = j + 1; //loop = loop - 1; //if (loop > 0){ if (j > (p - 1)) j = 0; t = setTimeout('runSlideShow()', slideShowSpeed); //} } function cOn(td){ td.style.backgroundColor="#404040"; } function cOut(td){ td.style.backgroundColor="#000000"; } function runLogoSlide() { var slogo = document.getElementById('slogo').style; var x = slogo.left; var y = slogo.top; // var slogo2 = document.getElementById('slogo2').style; // var x2 = slogo2.left; // var y2 = slogo2.top; x = parseInt(replacesubstring(x,'px',''))-1; y = parseInt(replacesubstring(y,'px',''))+1; slogo.left = x + 'px'; slogo.top = y + 'px'; //x2 = parseInt(replacesubstring(x2,'px',''))-1; //y2 = parseInt(replacesubstring(y2,'px',''))+1; //slogo2.left = x2 + 'px'; //slogo2.top = y2 + 'px'; //window.status = 'x: ' + slogo.left + ' y: '+slogo.top; if (x > -470) { t = setTimeout('runLogoSlide()', 50); } }