<<
p72modal Window
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
/*
pixelseventy2 Modal Window
opens a Modal Window - cannot blur back to the openning window
methods:
p72modalWindow
- params:
p72url - the url of the window to open
p72w - the width of the window to open
p72h - the height of the window to open
p72s - boolean to shoe or hide scollbars [optional default=no]
use:
p72modalWindow( "myurl.htm" , 300 , 200 )
platforms:
IE6+ PC - works
IE5+ Mac - untested
IE4+ - untested
NN4+ - untested
NS6+ - works
Moz - works
*/
var p72popup = null
function p72modalWindow(p72url,p72w,p72h,p72s){
try{
p72popup = open(p72url,"","width=" + p72w + ",height=" + p72h + ",status=no,resizable=no,scrollbars=" + p72s)
p72popup.resizeTo(p72w,p72h)
p72popup.moveTo( (screen.availWidth-p72w)/2 , (screen.availHeight-p72h)/2)
}
catch(e){
alert("Unable to open windownDo you have a Popup Stopper enabled?")
return
}
p72blurMe = function() {
if (!p72popup.closed) {
// self.blur()
p72popup.focus()
return false
}
}
window.onfocus = p72blurMe
document.onmousedown = p72blurMe
document.onkeydown = p72blurMe
p72onUnload = document.body.onunload
document.body.onunload = function() {
try{
p72onUnload();
if (!p72popup.closed) p72popup.close()
}
catch(e){}
}
}