﻿//<![CDATA[
function getCenteredLeft(width) {
    var sw = screen.availWidth;
	if (sw > 0) return (Math.floor((sw - width) / 2));
	else return (0);
}

function getCenteredTop(height) {
	var sh = screen.availHeight;
	if (sh > 0) return (Math.floor((sh - height) / 2));
	else return (0);
}

function popUpWindow2(url, name, width, height) {
	var left; 
	var top; 
	left = getCenteredLeft('789') - 5;
	top = getCenteredTop('545') - 12;

	// Build the param string.
	var params = "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0";
	params += ",width=" + width;
	params += ",height=" + height;
	params += ",left=" + left;
	params += ",top=" + top;
	params += ",screenX=" + left; // for Netscape.
	params += ",screenY=" + top;
	// Open the window. Set the opener property if it's missing. And return the window handle.
		
	var wh = window.open(url, name, params);
	return wh;

	//if (wh.opener == null) wh.opener = window;
}
	
function OpenMyRadio(PlaylistID)
{
    window.open('http://myradio2.batanga.com/Player/player.aspx?PlaylistID='+PlaylistID+"&amp;q=<%=strTitle_entity%>",'LaunchPlayerAndPlaylist','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,width=650,height=600');
}
										
function CallPlayList(StationID,idioma)
{
    var Format='wm';
	if(getCookie('AudioSpeed')!='')
	{var AudioSpeed=getCookie('AudioSpeed');}
	else{var AudioSpeed='2';}
		
	window.open('http://radio.batanga.com/'+idioma+'/LaunchPlaylistEM.asp?StationID='+StationID+'&amp;Format='+Format+'&amp;Speed='+AudioSpeed+'&amp;context=','LaunchPlayerAndPlaylist','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,width=470,height=426');
}
//]]>

