function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function openRostaWindow() {
	MM_openBrWindow("php/djsList.php", "rosta", "width=800,height=600,menubar=1,scrollbars=1");
}

function close_player() {
	var player = get_player();
	player.innerHTML = '';
	player.parentNode.style.display = 'none';
	player_open = false;
}

var player_curr_dj;

function open_player(id) {
	if(!id) {
		id = player_curr_dj;
	}
	var fvars = {
		playlist_url: '/php/player_xspf.php?dj=' + id,
		autoplay: 'true',
		autoload: 'true',
		repeat_playlist: 'true',
		player_title: 'Pure DJs music player',
		info_button_text: 'Contact us to find out more about booking this artist'
	}
	var html = '<object type="application/x-shockwave-flash" data="xspf_player_slim.swf" width="740" height="15">' +
			   '<param name="movie" value="xspf_player_slim.swf" />' +
			   '<param name="FlashVars" value="' + jQuery.param(fvars) + '" />' +
			   '<EMBED src="xspf_player_slim.swf" quality=high bgcolor=#FFFFFF  WIDTH="740" HEIGHT="15" NAME="index" ALIGN="" ' +
			   'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>' +
			   '</object>';
	var player = get_player();
	player.innerHTML = html;
	player.parentNode.style.display = 'block';
	player_curr_dj = id;
}

function get_player() {
	return document.getElementById('mp3_player').getElementsByTagName('div')[0];
}

function open_booking(dj_id) {
	var prms = {
		TB_iframe: 'true',
		width: 700,
		height: 520,
		modal: 'false'
	};
	var url = '/bookings/' + (dj_id ? dj_id : '') + '?' + jQuery.param(prms);
	tb_show('Pure DJs Booking Request Form', url ,null);
}


function open_video(dj_id, num_clips, title) {
	close_player();
	var prms = {
		pop: 1,
		TB_iframe: 'true',
		width: 500,
		height: (num_clips && (num_clips > 1)) ? 530 : 405,
		modal: 'false'
	};
    var url = '/videos/' + dj_id + '?' + jQuery.param(prms);
	tb_show(title || 'Pure DJs Artist Video Clips', url ,null);
}