var Soundcheck = Class.create({
	initialize: function() {
		this.popup = null;
	},
	
	getPopup: function() {
		if(this.popup == null || this.popup.closed) {
			this.popup = window.open('', 'soundcheck', 'width=291,height=117');
			if(!String(this.popup.location).match(/soundcheck\.html/)) {
				this.popup.location = '/soundcheck.html';
			}
		}
		return this.popup;
	},
	
	getFlash: function() {
		var win = this.getPopup();
		if (win.document['soundcheck']) {
			return win.document['soundcheck'];
		}
		if (!Prototype.Browser.IE) {
			if (win.document.embeds && win.document.embeds['soundcheck'])
				return win.document.embeds['soundcheck']; 
		} else {
			return win.document.getElementById('soundcheck');
		}
		return null;
	},
	
	volumeUp: function() {
		this.getFlash().lauter();
	},
	
	volumeDown: function() {
		this.getFlash().leiser();
	}
});
