// // 2000.10.16 - John Dalsgaard // Copyright (c) 2000,2001 Semaphor,John Dalsgaard // // These functions are specific to "Statens Museum for Kunst" (SMK) // Some of the functions are dependant on the cookies.js library with // standard cookie functions. // // Modifications: // 2001.01.29 - John Dalsgaard: Changed "location.replace()" to "location.href" to avoid strange "back" behaviour. // var cookieName = 'SMK_Language'; var cookieReturnName = 'SMK_Return'; var cookieDomain = ''; var cookiePath = '/'; var smkPages = '/Customers/Laboradoren/labradoren.nsf/docs/'; var nextPage = smkPages + 'Forside'; var firstPage = smkPages + 'Forside'; // Set cookie with chosen language and redirect to next page function redirectToLanguage(argLanguage) { var expSeconds = 60*60*24*365*2; saveCookie(document, cookieName, argLanguage, expSeconds, cookieDomain, cookiePath); if (document.cookie == '') { alert('Your browser does not allow cookies. The default language has been set to Danish') } window.location.href=nextPage; // Remove current page from browser's history } // Check if cookie has already been set and redirect page if so function redirectToStartPage() { if (document.cookie != '') { var val = loadCookie(document, cookieName); if (val != '') { // Redirect.... window.location.replace(nextPage); // Remove current page from browser's history } else { window.location.href=firstPage; // Remove current page from browser's history } } else { window.location.href=firstPage; // Remove current page from browser's history } } // Reset language selection function resetLanguage() { var expSeconds = 1; saveCookie(document, cookieName, '', expSeconds, cookieDomain, cookiePath); window.location.href=firstPage; // Remove current page from browser's history } // Remember return URL when submitting forms function setReturnURL(url) { var expSeconds = 60; saveCookie(document, cookieReturnName, url, expSeconds, cookieDomain, cookiePath); } // Open URL in Front1 window function openPopUp(windowURL) { var windowName = 'Front1'; var windowFeatures = 'width=402,height=402,toolbar=0,location=0,left=150,top=10,directories=0,status=0,menuBar=0,scrollbars=1,resizable=0'; popUpWin = window.open(windowURL, windowName, windowFeatures); } // Open URL in Front2 window function openPopUpCal(windowURL) { var windowName = 'Front2'; var windowFeatures = 'width=600,height=500,toolbar=0,location=0,left=150,top=10,directories=0,status=0,menuBar=0,scrollbars=1,resizable=0'; popUpWin = window.open(windowURL, windowName, windowFeatures); } // Open URL in Front3 window function openPopUpArt(windowURL) { var windowName = 'Front3'; var windowFeatures = 'width=740,height=500,toolbar=0,location=0,left=10,top=10,directories=0,status=0,menuBar=0,scrollbars=1,resizable=1'; popUpWin = window.open(windowURL, windowName, windowFeatures); } // Close browser window function done() { window.close() } // Define images and doRoll function to make rollover effect if(typeof(mGraphicPath) != 'undefined') { kontaktRoll=new Image(); sprogRoll=new Image(); copyrightRoll=new Image(); kontaktOrig=new Image(); sprogOrig=new Image(); copyrightOrig=new Image(); kontaktRoll.src=mGraphicPath+"kontakt-on.gif"; sprogRoll.src=mGraphicPath+"sprog-on.gif"; copyrightRoll.src=mGraphicPath+"copyright-on.gif"; kontaktOrig.src=mGraphicPath+"kontakt-off.gif"; sprogOrig.src=mGraphicPath+"sprog-off.gif"; copyrightOrig.src=mGraphicPath+"copyright-off.gif"; } var imgOffset = -1; function doRoll(divName, arrayNum,graphicName, type){ var suffix = (type == 0) ? 'Orig.src' : 'Roll.src'; var swapSrc = graphicName+suffix; if(document.layers) { // Netscape var div = ''; for (var k=0; k < document.layers.length; k++) { if (document.layers[k].id.toLowerCase() == divName.toLowerCase()) document.layers[k].document.images[arrayNum].src=eval(swapSrc); } } else { // Internet Explorer if(imgOffset == -1) { // Find number of images before the rollover images - but only the first time... var i = 0; while (i < document.images.length && imgOffset == -1) { if(document.images[i].src.toLowerCase() == kontaktOrig.src.toLowerCase()) imgOffset = i; // Found! - adjust to count instead of index i++ } } document.images[arrayNum+imgOffset].src=eval(swapSrc) } return true; }