I've just found out a workaround.
It seems not posibile to check if windows exist from a page how doesn't is the windows.opener
but what is possible to do is to check if the popup is loading whit no content.
As I state in the above question, using this code you can call the windows if it is open, or load an empty popup:
var popup = window.open('','mypopup');
// now popup is know again
popup.document.getElementById("player").someFunction();
If I check if the re-called popup is empty I can then fit it again with the desired content. so my final code is:
var page_id = getURLParameter('pageID'),
popup_opened = readCookie('music_popup'),
popup_url = '?pageID=music_popup',
popup_name = 'musicPopup',
popup_wh = 'height=720,width=980',
musicPopup;
// open the popup if there isn't the popup_opened cookie
if(!popup_opened){
musicPopup = window.open( popup_url, popup_name, popup_wh);
};
$('.c_music').click(function(event) {
event.preventDefault();
//when the user click on a .c_music link check if popup is defined (I'm in the opener page)
if(musicPopup !== undefined) {
musicPopup.focus();
musicPopup.document.getElementById("start").click();
return false;
} else {
// I'm not in the opener page, so a call the popup again
var musicPopup = window.open('', popup_name, popup_wh) ;
// if popup doesn't exist a blank one would be opened
if(musicPopup.location == 'about:blank' ){
// load the desired content in the popup
musicPopup.location = popup_url;
return false;
}
// the popup still exist, so start the music again
musicPopup.document.getElementById("start").click();
};
});
This work fine for my needs and I hope it could be useful for others.