var win = null;


function openVideoEsmasSkin(idnodo){
var url = "http://www.esmas.com/NASApp/portal/vidnt.jsp?id=" + idnodo;
	if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
		newWindow = window.open(url,'_blank',"resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,width=350,height=415,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'");
}

function openAudioEsmasSkin(idnodo){
var url = "http://www.esmas.com/NASApp/portal/audnt.jsp?id=" + idnodo;
	if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
		newWindow = window.open(url,'_blank',"resizable=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=no,width=350,height=415,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'");
} 



function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
	
	if(myname!="nosettings") {		
        	win = window.open(mypage,myname,settings)
	}
	else {
		win = window.open(mypage,myname)
        }        
}

function abreVentanaForo(clavePadre,path){
//	NewWindow('http://foros.esmas.com/loginForoEspecial.jsp?cvepadre=' + clavePadre + '&pth=' + path, '_blank','163','110','no');
	wforo= window.open('http://foros.esmas.com/loginForoEspecial.jsp?cvepadre=' + clavePadre + '&pth=' + path, 'foros','resizable,location,menubar,toolbar,status,scrollbars');
}

function abreVentanaChat(urlgotog,svr) {  
	NewWindow('http://chats.esmas.com/sitio/popupcs.jsp?room=' + urlgotog + '&svr=' + svr, 'chats','180','110','no');
}

function openVideoGal(url){
	NewWindow(url, 'galerias','468','505','no');
}

function writeSmallDate(){
	monthNames = new Array(
	"enero",
	"febrero",
	"marzo",
	"abril",
	"mayo",
	"junio",
	"julio",
	"agosto",
	"sept.",
	"octubre",
	"nov.",
	"dic."
	);
	theDate = new Date();
	document.write(theDate.getDate() + " de " + monthNames[theDate.getMonth()] + " de " + theDate.getFullYear());
}

function writeBanner(sit,chn,sub,w,h,pos) {

var bnrTxt = "";

bnrTxt = "";
bnrTxt += '	<IFRAME WIDTH="' + w + '" HEIGHT="' + h + '" MARGINWIDTH="0" MARGINHEIGHT="0" ';
bnrTxt += '		HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no" BORDERCOLOR="#000000" ';
bnrTxt += '		SRC="http://ads.esmas.com/html.ng/site=' + sit + '&canal=' + chn + '&subcanal=' + sub + '&adsize=' + w + 'x' + h + '&tile=' + pos + '">';
bnrTxt += '	<SCR' + 'IPT language="JavaScript1.1" ';
bnrTxt += '		SRC="http://ads.esmas.com/js.ng/Params.richmedia=yes&site=' + sit + '&canal=' + chn + '&subcanal=' + sub + '&adsize=' + w + 'x' + h + '&tile=' + pos + '">';
bnrTxt += '	</SCR' + 'IPT>';
bnrTxt += '	</IFRAME>';

document.write(bnrTxt);
}
	
				//Funcion que abre un PopUp que recoge los datos para el reproductor"
function reproducir(codigo){

	url= eval("'http://latam-web.buongiorno.com/mex/searcher/esmas_new/sonidov2.swf?Country="+bt.Country.value+"&Category="+bt.Category.value+"&Value="+codigo+"'");
	//alert (url);
	reproductor = window.open(url ,'reproductor', 'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=176,height=186,scrollbars=no');
	reproductor.focus();
	return;
}
//Funcion que abre un PopUp que recoge los datos para el reproductor desde la index. SE NECESITAN LOS · FORMUARIOS detMono, detPoli, detTrue"
function reproducirMono(codigo){

	url= eval("'http://latam-web.buongiorno.com/mex/searcher/esmas_new/sonidov2.swf?Country="+detMono.Country.value+"&Category="+detMono.Category.value+"&Value="+codigo+"'");
	
	reproductor = window.open(url ,'reproductor', 'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=200,height=100,scrollbars=no');
	reproductor.focus();
	return;
}
function reproducirPoli(codigo){

	url= eval("'http://latam-web.buongiorno.com/mex/searcher/esmas_new/sonidov2.swf?Country="+detPoli.Country.value+"&Category="+detPoli.Category.value+"&Value="+codigo+"'");
	
	reproductor = window.open(url ,'reproductor', 'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=200,height=100,scrollbars=no');
	reproductor.focus();
	return;
}
function reproducirTrue(codigo){

	url= eval("'http://latam-web.buongiorno.com/mex/searcher/esmas_new/sonidov2.swf?Country="+detTrue.Country.value+"&Category="+detTrue.Category.value+"&Value="+codigo+"'");
	
	reproductor = window.open(url ,'reproductor', 'location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=200,height=100,scrollbars=no');
	reproductor.focus();
	return;
}