﻿function window_open(url, width, height, name, scroll_bar, location){

	_top = Math.ceil((screen.height - height)/2);
	_left = Math.ceil((screen.width - width)/2);

	if(scroll_bar != true){
		var scroll = 'no';
	}else{
		var scroll = 'yes';
	}
	if(typeof location != "undefined" && location == true){
		var location = 'yes';
	}else{
		var location = 'no';
	}

	if(name == undefined){
		name = Math.round(999999 * Math.random());
	}
	new_win = window.open(url, name , 'width=' + width + ',height=' + height + ',location='+ location +',status=no,toolbar=no,menubar=no,resizable=no,scrollbars=' + scroll + ',top=' + _top + ',left=' + _left);
	new_win.focus();
	return new_win;
}