//--------------------------------------------------------------------------------------------------------------- // File: popup.js // Author: Urs Baumann, Inware AG // // // Public Interface: fnShowFlash(url, width, height) // Zoom() // // // Description: functions for handling popup windows // // //--------------------------------------------------------------------------------------------------------------- /*! * @function fnShowFlash * @abstract Shows a flash movie in a popup window * @param url string - url of the flash movie (relative to web root) * @param width integer - width of the flash movie in pixels * @param height integer - height of the flash movie in pixels */ function fnShowFlash(url, width, height) { MovieWin = window.open('','','width='+width+',height='+height+',scrollbars=no,menubar=no,status=no,resizable=yes,toolbar=no,dependent=yes'); MovieWin.moveTo((screen.width-width)/2,(screen.height-height)/2); MovieWin.document.open(); MovieWin.document.write(""); MovieWin.document.close(); MovieWin.focus(); } /*! * @function Zoom * @abstract Originally developed for freshpage, shows big version of an image (expecting an _g version) * @param imgname string - name of the image for which to show a big version. (e.g. kontakt_1.gif, shows * an image with name kontakt_1_g.gif, which must reside in the root images folder of the webserver) * @param print string - optional paramter, if set to 'print' then a print dialog is shown along with the image * @param useidentifier string - optional paramter, if set to 'no' then exactly the name given in imgname is used as src without _g modifier */ function Zoom() { var argv = Zoom.arguments; var argc = argv.length; var picname = argv[0]; var imgdom = 'http://' + window.location.hostname; if (argv[2] == 'no') { var identifier = ''; } else { var identifier = '_g'; } var wwidth = 640 var wheight = 480; var cOffsetWidth = 0; var cOffsetHeight = 0; var splitname = picname.split("."); var bigpicname = imgdom+splitname[0]+identifier+'.'+splitname[1]; var agt = navigator.userAgent.toLowerCase(); var is_major = parseInt(navigator.appVersion); var is_win = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1)); var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var is_mac = (agt.indexOf("mac")!=-1); var is_opera = (agt.indexOf("opera") != -1); var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)); var is_nav6up = (is_nav && (is_major >= 5)); if (is_win && (is_ie || is_opera)) { cOffsetWidth = 12; cOffsetHeight = 31; } if (is_win && is_nav6up) { cOffsetWidth = 21; cOffsetHeight = 41; } ShowWindow = window.open('','','width='+wwidth+',height='+wheight+',resizable=yes,scrollbars=no'); ShowWindow.moveTo((screen.width-wwidth)/2,(screen.height-wheight)/2); if (is_mac && is_nav) { ShowWindow.document.write("lowres = new Image(); lowres.src =\""+ picname +"\";"); } else { ShowWindow.document.write("lowres = new Image(); lowres.src =\""+ picname +"\";"); } ShowWindow.document.close(); if (argv[1] == 'print') { ShowWindow.print(); } }