var hkr_studio = {
	open : function(keyword) {
		var connection = new cvhXHR(this.process, '/studio/page_info.php?keyword='+keyword, false);
	},
	process : function() {
		var text = this.XHR.responseText;
		var data = eval('('+text+')');
		switch (data.studio_type) {
			case 'popup':
				hkr_studio.popup(data.studio_url, data.studio_size);
				break;
			case 'iframe':
				hkr_studio.iframe(data.studio_url);
				break;
			case 'redirect':
				hkr_studio.redirect(data.studio_url);
				break;
		}
	},
	popup : function(url, size) {
		var optionString;
		var windowName;
		switch (size) {
			case 'large':
				windowName = '_blank';
				optionString = undefined;
			break;
			case 'small':
			default:
				optionString = 'width=560,height=410,scrollbars=no,statusbar=0';
				windowName = 'studio_popup';
		}
		if (optionString) {
			window.open(url, windowName, optionString);
		} else {
			window.open(url, windowName);
		}
	},
	redirect : function(url) {
		window.location = url;
	},
	iframe : function(url) {
		document.getElementById('studio_iframe').src = url;
		document.getElementById('iframe_div').style.visibility = 'visible';
	},
	hide_iframe : function() {
		document.getElementById('iframe_div').style.visibility = 'hidden';
		document.getElementById('studio_iframe').src = '';
	},
	on_air : function() {
		this.open('on_air');
	},
	diploma : function() {
		this.open('diploma');
	},
	clock : function() {
		this.open("clock");
	},
	feature : function() {
		this.open("feature");
	},
	microphone : function() {
		this.open("microphone");

	},
	now : function() {
		this.open("now");
	},
	next : function() {
		this.open("next");
	},
	left_monitor : function() {
		this.open("left_monitor");
	},
	right_monitor : function() {
		this.open("right_monitor");
	},
	click : function() {
		this.open("click");
	},
	dial_left : function() {
		this.open("dial_left");
	},
	dial_right : function() {
		this.open("dial_right");
	},
	phone : function() {
		this.open("phone");
	},
	radio : function() {
		this.open("radio");
	},
	info_box : function() {
		this.open('info_box');
	},
	headphones : function() {
		this.open("headphones");
	},
	fader1 : function() {
		this.open("fader1");
	},
	fader2 : function() {
		this.open("fader2");
	},
	fader3 : function() {
		this.open("fader3");
	},
	fader4 : function() {
		this.open("fader4");
	},
	fader5 : function() {
		this.open("fader5");
	},
	fader6 : function() {
		this.open("fader6");
	},
	fader7 : function() {
		this.open("fader7");
	},
	fader8 : function() {
		this.open("fader8");
	},
	fader9 : function() {
		this.open("fader9");
	},
	fader10 : function() {
		this.open("fader10");
	},
	fader11 : function() {
		this.open("fader11");
	},
	monitor1 : function() {
		this.open("monitor1");
	},
	monitor2 : function() {
		this.open("monitor2");
	},
	monitor3 : function() {
		this.open("monitor3");
	},
	monitor4 : function() {
		this.open("monitor4");
	},
	monitor5 : function() {
		this.open("monitor5");
	},
	monitor6 : function() {
		this.open("monitor6");
	},
	monitor7 : function() {
		this.open("monitor7");
	},
	monitor8 : function() {
		this.open("monitor8");
	},
	monitor9 : function() {
		this.open("monitor9");
	},
	monitor10 : function() {
		this.open("monitor10");
	},
	monitor11 : function() {
		this.open("monitor11");
	},
	book1 : function() {
		this.open("book1");
	},
	book2 : function() {
		this.open("book2");
	},
	book3 : function() {
		this.open("book3");
	},
	book4 : function() {
		this.open("book4");
	},
	book5 : function() {
		this.open("book5");
	},
	book6 : function() {
		this.open("book6");
	},
	book7 : function() {
		this.open("book7");
	},
	book8 : function() {
		this.open("book8");
	},
	book9 : function() {
		this.open("book9");
	},
	book10 : function() {
		this.open("book10");
	}
}
