/************************************
 * Datei      	:   newWindow.js
 * Projekt   	:   emisweb
 * Beschreibung	:	Fenster öffnen und positionieren
 * Author    	:   mario alves/511
 ************************************/

function newWindow(theURL,winName,the_x,the_y,pos,scrollbar,resizable) { //v2.0
	the_x -= 0;
	the_y -= 0;
	var how_wide = screen.availWidth;
	var how_high = screen.availHeight;
	
	if(resizable=='') resizable = 'no';
	
	if(pos == 1){top_pos=0;left_pos=0;}
	if(pos == 2){top_pos = 0;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 3){top_pos = 0;left_pos = how_wide - the_x;}
	if(pos == 4){top_pos = (how_high/2) - (the_y/2);left_pos = 0;}
	if(pos == 5){top_pos = (how_high/2) - (the_y/2);left_pos = (how_wide/2) - (the_x/2);}
	if(pos == 6){top_pos = (how_high/2) - (the_y/2);left_pos = how_wide - the_x;}
	if(pos == 7){top_pos = how_high - the_y;left_pos = 0;}
	if(pos == 8){top_pos = how_high - the_y;left_pos = (how_wide/2) -  (the_x/2);}
	if(pos == 9){top_pos = how_high - the_y;left_pos = how_wide - the_x;}
	
	var option = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars="+scrollbar+",resizable="+resizable+",width="+the_x+",height="+the_y+",top="+top_pos+",left="+left_pos;

	return window.open(theURL,winName,option);
}

