home *** CD-ROM | disk | FTP | other *** search
- // CREDITS:
- // Flying Popup Generator
- // by Urs Dudli and Peter Gehrig
- // Copyright (c) 2001 Peter Gehrig and Urs Dudli. All rights reserved.
- // Permission given to use the script provided that this notice remains as is.
- // Additional scripts can be found at http://www.24fun.com
- // info@24fun.com
- // 4/6/2001
-
- // IMPORTANT:
- // If you add this script to a script-library or script-archive
- // you have to add a link to http://www.24fun.com on the webpage
- // where this script Script will be running.
-
- // INSTRUCTIONS:
- // Got to http://www.24fun.com, open category 'utility' and
- // generate your own Flying Popup with the new Flying Popup Generator
-
- var popwindow
- var thistoolbar
- var thislocation
- var thisdirectories
- var thisstatus
- var thismenubar
- var thisscrollbars
- var thisresizable
- var thisurl
- var thiswidth
- var thisheight
- var thisdirection
- var thistopposition
- var thisleftposition
- var pause=20
- var stepfactor=20
- var stepx
- var stepy
-
- var marginpadding=23
-
- var startleft=0
- var endleft=0
- var starttop=0
- var endtop=0
-
- var marginleft=0
- var margintop=0
- var marginright
- var marginbottom
- var timer
-
-
- function configurepopupbylink(whatdirection) {
- thistoolbar=tistoolbar
- thislocation=tislocation
- thisdirectories=tisdirectories
- thisstatus=tisstatus
- thismenubar=tismenubar
- thisscrollbars=tisscrollbars
- thisresizable=tisresizable
- thisurl=tisurl
- thiswidth=tiswidth
- thisheight=tisheight
- thisdirection=whatdirection
- openpopup()
- }
-
- function configurepopupbyform() {
- thistoolbar=document.wizard.popuptoolbar[document.wizard.popuptoolbar.selectedIndex].value
- thislocation=document.wizard.popuplocation[document.wizard.popuplocation.selectedIndex].value
- thisdirectories=document.wizard.popupdirectories[document.wizard.popupdirectories.selectedIndex].value
- thisstatus=document.wizard.popupstatus[document.wizard.popupstatus.selectedIndex].value
- thismenubar=document.wizard.popupmenubar[document.wizard.popupmenubar.selectedIndex].value
- thisscrollbars=document.wizard.popupscrollbars[document.wizard.popupscrollbars.selectedIndex].value
- thisresizable=document.wizard.popupresizable[document.wizard.popupresizable.selectedIndex].value
- thisurl=document.wizard.popupurl.value
- thiswidth=document.wizard.popupwidth.value
- thisheight=document.wizard.popupheight.value
- thisdirection=document.wizard.popupdirection[document.wizard.popupdirection.selectedIndex].value
- makecode()
- openpopup()
- }
-
- function openpopup() {
-
- marginright=screen.width
- marginbottom=screen.height
-
- if (thisdirection=="horitop") {
- startleft=marginleft
- endleft=marginright-thiswidth-marginpadding
- starttop=marginpadding
- endtop=starttop
- stepx=stepfactor
- stepy=0
- }
- if (thisdirection=="horimiddle") {
- startleft=marginleft
- endleft=marginright-thiswidth-marginpadding
- starttop=Math.round((marginbottom-thisheight)/2)
- endtop=starttop
- stepx=stepfactor
- stepy=0
- }
- if (thisdirection=="horibottom") {
- startleft=marginleft
- endleft=marginright-thiswidth-marginpadding
- starttop=marginbottom-thisheight-2*marginpadding
- endtop=starttop
- stepx=stepfactor
- stepy=0
-
- }
- if (thisdirection=="vertileft") {
- startleft=marginleft
- endleft=startleft
- starttop=marginpadding
- endtop=marginbottom-thisheight-2*marginpadding
- stepx=0
- stepy=stepfactor
- }
- if (thisdirection=="vertimiddle") {
- startleft=Math.round((marginright-thiswidth)/2)
- endleft=startleft
- starttop=marginpadding
- endtop=marginbottom-thisheight-2*marginpadding
- stepx=0
- stepy=stepfactor
- }
- if (thisdirection=="vertiright") {
- startleft=marginright-thiswidth-marginpadding
- endleft=marginright-thiswidth-marginpadding
- starttop=marginpadding
- endtop=marginbottom-thisheight-2*marginpadding
- stepx=0
- stepy=stepfactor
- }
- popwindow=window.open("popupwindow.html", "newwindow", "toolbar="+thistoolbar+",location="+thislocation+",directories="+thisdirectories+",status="+thisstatus+",menubar="+thismenubar+",scrollbars="+thisscrollbars+",resizable="+thisresizable+",width="+thiswidth+",height="+thisheight+",top="+starttop+",left="+startleft+"")
- movewindow()
- popwindow.focus()
- }
-
- function movewindow() {
- if ((starttop<=endtop) && (startleft<=endleft)){
- popwindow.moveTo(startleft,starttop)
- startleft+=stepx
- starttop+=stepy
- timer=setTimeout("movewindow()",pause)
- }
- else {
- clearTimeout(timer)
- popwindow.moveTo(endleft,endtop)
- }
- }