/*========================================================================*\
|	das_absolute_popup.js - Author : Benedetto Rerat        neteye°° GmbH  |
|	                                                                       |
|	function windowOpen(url, name, x, y, px, py) 						   |
|	  																	   |
|	(	url  = adress from window input, 								   |
|		name = name of function, 										   |
|		x, y = width of window, height of window,						   |
|		px   = position of the window from left top						   |
|		px   = position of the window from right bottom					   |
|		 )					       										   |
|																		   |
|	10/2000                 	                                           |
|				   		  		 										   |
\*========================================================================*/

// Variable to distinguish from PC and Mac, one Browser from another ->
// and the embodiment from the different versionnummbers
var ns  = (document.all) ? false : true;
var ie  = (document.all) ? true : false;
var mac = (navigator.appVersion.indexOf("Mac") != -1) ? true : false;
if (ie) var ver = parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE") + 5,5));
if (ns) var ver = parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf("NN") + 1,4));

// Variable for the error field
var errorMsg = "";

// Popup browser select
// see in the top
function windowOpen(url, name, x, y, px, py) {

	if (typeof px == "undefined") px = 0;
	if (typeof py == "undefined") py = 0;
	
// The error field ( if you have forgot the parameter width and/or height)
	errorMsg = "";
	if (typeof x == "undefined") errorMsg = errorMsg + "- width\n";
	if (typeof y == "undefined") errorMsg = errorMsg + "- height\n";
	if (errorMsg != "") {
		errorMsg = errorMsg + "These parameters a missing";
		alert(errorMsg); 
	}
	
// the beginning of the selection
	if (mac) {
		if (ie && (ver < 4.6)) {	//macintosh Internet Explorer 4.50
			xt = (x - 16).toString();
			yt = (y - 14).toString();
		eval("var " + name + " = window.open('" + url + "'," + name + ",\"width=" + xt + ",height=" + yt + ",screenX=0,screenY=0,offsetX=0,offsetY=0,locationbar=no,menubar=no,resizable=no,status=no\");");
			
		} else {	
		
			if (ie) {				//macintosh Internet Explorer 5.00 - 5.01
				xt = (x - 16).toString();
				yt = (y - 16).toString();
				eval("var " + name + " = window.open('" + url + "'," + name + ",\"width=" + xt + ",height=" + yt + ",screenX=0,screenY=0,offsetX=0,offsetY=0,locationbar=no,menubar=no,resizable=no,status=no\");");
			}
		}
		if (ns) {					//macintosh Netscape 4.50 - 4.70 - 4.71 - 4.72
			xt = (x - 0).toString();
			yt = (y - 0).toString();
			eval("var " + name + " = window.open('" + url + "'," + name + ",\"width=" + xt + ",height=" + yt + ",screenX=0,screenY=0,offsetX=0,offsetY=0,locationbar=no,menubar=no,resizable=no,status=no\");");
		} 
		
	} else {
	
		if (ns) {					//microsoft windows Netscape 4.50 - 4.70 - 4.72 - 4.73
			xt = (x - 0).toString();
			yt = (y - 0).toString();
			eval("var " + name + " = window.open('" + url + "','" + name + "',\"width=" + xt + ",height=" + yt + ",screenX=0,screenY=0,offsetX=0,offsetY=0,locationbar=no,menubar=no,resizable=no,status=no\");");
		
		} else {					//microsoft windows Internet Explorer 5.00 - 5.01
			xt = (x - 0).toString();
			yt = (y - 0).toString();
			eval("var " + name + " = window.open('','" + name + "',\"width=" + xt + ",height=" + yt + ",screenX=0,screenY=0,offsetX=0,offsetY=0,locationbar=no,menubar=no,resizable=no,status=no\");");
			
		}
	}
	// .moveTo		= means the position of the window
	// .document	= means the URL (adress)
	// .focus		= means that you click on a button who open the window ->
	// ( these window is ever in front )
	eval(name + ".moveTo(" + px + "," + py + ")");
	eval(name + ".document.location.href = '" + url + "'");
	eval(name + ".focus();");
}

