var Popup = {
	win : null,
	url : '',
	name : '',
	option : {},
	open : function() {
		var status = '';
		for(i in this.option) {
			if(status) status += ',';
			status += i + '=' + this.option[i];
		}
		this.win = window.open(this.url, this.name, status);
		this.win.focus();
		this.option = {
			left : 0,
			top : 0,
			scrollbars : 1,
			toolbar : 0
		}
		return this.win;
	},
	window : function(url, name, width, height, option) {
		this.url = url;
		this.name = name;
		this.option = {
			left : 0,
			top : 0,
			location : 0,
			resizable : 0,
			statusbar : 0,
			menubar : 0,
			scrollbars : 0,
			toolbar : 0
		}
		if(option) {
			for(var i in option) {
				this.conditions[i] = conditions[i];
			}
		}
		if(width) this.option['width'] = width;
		if(height) this.option['height'] = height;
		return this;
	},
	center : function() {
		this.option['left'] = (window.screen.availWidth-$parseInt(this.option['width']))/2;
		this.option['top'] = (window.screen.availHeight-$parseInt(this.option['height']))/2;
		return this;
	},
	full : function() {
		this.option['width'] = window.screen.availWidth;
		this.option['height'] = window.screen.availHeight;
		return this;
	},
	toolbar : function(value) {
		if(!value) value = 1;
		this.option['toolbar'] = value;
		return this;
	},
	scroll : function(value) {
		if(!value) value = 1;
		this.option['scrollbars'] = value;
		return this;
	}
}
