//--------------------------------------------------------------------------------------------------------------- // 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 parameter, if set to 'print' then a print dialog is shown along with the image * @param useidentifier string - optional parameter, if set to 'no' then exactly the name given in imgname is used as src without _g modifier * @param width string - optional parameter, if set than this is assumed to be the width of the big picture * @param height string - optional parameter, if set than this is assumed to be the height of the big picture * @param closeonclick string - optional parameter, if set to 'yes' than window is closed on click. default is 'no' */ function Zoom() { var argv = Zoom.arguments; var argc = argv.length; var picname = argv[0]; var undefined; var imgdom = 'http://' + window.location.hostname; if (argv[2] == 'no') { var identifier = ''; } else { var identifier = '_g'; } if(argv[3] != undefined && argv[4] != undefined){ var wwidth = argv[3]; var wheight = argv[4]; } else { 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_win = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1)); var is_mac = (agt.indexOf("mac")!=-1); var is_opera = (agt.indexOf("opera") != -1); var is_firefox = (agt.indexOf("firefox") != -1); var is_ie6 = (agt.indexOf("msie 6.0") != -1); var is_ie7 = (agt.indexOf("msie 7.0") != -1); var is_safari = (agt.indexOf("safari") != -1); var is_netscape = (agt.indexOf("netscape") != -1); if (is_ie6) { cOffsetHeight = 32; cOffsetWidth = 12; } if (is_ie7) { cOffsetHeight = 83; cOffsetWidth = 12; } if (is_firefox) { if(is_mac){ cOffsetWidth = 0; cOffsetHeight = 18; } else { cOffsetHeight = 56; cOffsetWidth = 8; } } if (is_safari) { if(is_mac){ cOffsetWidth = 0; cOffsetHeight = 23; } else { cOffsetWidth = 4; cOffsetHeight = 25; } } if (is_opera) { cOffsetHeight = 49; cOffsetWidth = 10; } if (is_netscape) { cOffsetHeight = 36; cOffsetWidth = 8; } if(argv[5] != undefined && argv[5] == 'yes'){ var closestr = "onclick='window.close()'"; } else { var closestr = ""; } ShowWindow = window.open('','','width='+wwidth+',height='+wheight+',left='+(screen.width-wwidth)/2+',top='+(screen.height-wheight)/2+',resizable=yes,scrollbars=no,status=no'); ShowWindow.document.write("lowres = new Image(); lowres.src =\""+ picname +"\";"); ShowWindow.document.close(); if (argv[1] == 'print') { ShowWindow.print(); } }