////////////////////////////////////////////////////////////////////////////////////
//  JS_NEWWIN.JS
//  
//  Thank you for using this javascript!
//  
//  This code is distributed WITHOUT ANY WARRANTY
//  ALL Warranties, expressed or implied are hereby disclaimed.
//  The RESELLING of this code is STRICTLY PROHIBITED.
//  This script was created for my personal usage from the start but then it
//  became so popular. It's that version you're using now. Since this is free
//  please don't try to sell this solution to a company claiming it is yours.
//  
//  File:          js_newwin.js
//  Revision:      1.2
//  Author:        Alexander Boehmer
//  Email:         alex.boehmer@micronnect.de
//  URL:           http://www.micronnect.de
//  Created:       13.03.2000
//  Last Modified: --.--.----
//  
//  © 2000 by Alexander Böhmer - All rights reserved
////////////////////////////////////////////////////////////////////////////////////

var win = null;

function NewWindow(mypage,myname,w,h,scroll,loc,menu,tool,pos){

if(pos=="random"){
LeftPosition=(screen.width)?Math.floor(Math.random()*((screen.width-w)-75)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
}

if(pos=="center"){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;
}

else if( (pos!="center" && pos!="random") || pos==null){
LeftPosition=0;
TopPosition=20
}

settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location='+loc+',menubar='+menu+',toolbar='+tool+',resizable';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}
}

