OK, this one works for me...
Put this code in your head tags...
Code:
<script language="JavaScript" src="pop-up.js"></script>
Save this code as pop-up.js...
Code:
function popupWindow(win,winWidth,winHeight,place,winName){
leftPos = 0; topPos = 0;
if (screen){
if (winWidth>screen.width){
winWidth = screen.width;
}
if (winHeight>screen.height){
winHeight = screen.height - 55;
}
if (winWidth <= 0){
winWidth = screen.width;
}
if (winHeight <= 0){
winHeight = screen.height - 55;
}
if (place == 'centre'){ // centres window
leftPos = screen.width/2 - winWidth/2;
topPos = screen.height/2 - winHeight/2;
}
}
newWindow = window.open(win,winName,'toolbar=no,location=no,scrollbars=yes,
resizable=no,width='+winWidth+',height='+winHeight+',left='+leftPos+',top='+topPos+'');
// newWindow = window.open(win,winName,'alwaysRaised=yes,titlebar=no,toolbar=no,
location=no,scrollbars=auto,resizable=no, width='+winWidth+',height='+winHeight+',
left='+leftPos+',top='+topPos+'');
newWindow.focus();
}
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, right click is not available on this page");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
And then use this link, replacing TARGET-URL for the filename of the target, WIDTH and HEIGHT for the pixel value size of the window.
There's a no-right-click function in there you can rid of if you need to
Hope that helps...