function VerPanel(seccion, efecto) {
	var Visible = document.getElementById(seccion).style.display;
	switch (efecto) {
		case 'Slide':
				if (Visible == 'none') {
					//Effect.SlideDown(seccion,{queue:{scope:'myscope', position:'end', limit: 1}});
					$('#'+seccion).slideDown('normal');
				} else {
					//Effect.SlideUp(seccion,{queue:{scope:'myscope', position:'end', limit: 1}});
					$('#'+seccion).slideUp('normal');				
				}
			break;
		default:
			if(document.getElementById(seccion)) {
				if (document.getElementById(seccion).style.display == 'none') {
					document.getElementById(seccion).style.display = 'block';
				} else	{
					document.getElementById(seccion).style.display = 'none';
				}
			}
	}
}

/*********************************************************************************************************************************/

function OpenShadowbox(Titulo, Pagina, Ancho, Alto){
	Shadowbox.open({
        title:      Titulo,
        type:       'iframe',
        content:    Pagina,
        height:     Alto,
        width:      Ancho
    });
	//clearTimeout(TiempoEspera);	
}


function Television() {
	ow('/television.asp', 'Televisión', '531', '403');
}

function radioonline(media) {
	javascript:ow('/contenidos/radio.asp?media=' + media,'radio','280','270');	
}

function radio(valor) {
	document.write ('<object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" name=MC1 id=MC1 height=70 width=280 bbclient=1>');
	document.write ('<param name="FileName" value="'+ valor +'">');
	document.write ('<param name="AutoStart" value="True">');
	document.write ('<param name="ShowStatusBar" value="True">');
	document.write ('<param name="ShowGotoBar" value="False">');
	document.write ('<param name="TransparentAtStart" value="True">');
	document.write ('<embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/windows/windowsmedia/en/Download/default.asp?tcode=9#location2"');
	document.write ('src="'+ valor +'"');
	document.write ('name="MC1"');
	document.write ('height=45');
	document.write ('width=284');
	document.write ('autostart=True');
	document.write ('showstatusbar=True');
	document.write ('showgotobar=False');
	document.write ('transparentatstart=True');
	document.write ('bbclient=0>');
	document.write ('<noembed></noembed>');
	document.write ('</embed>');
	document.write ('</object>');
}

function radioRealPlayer(valor) {
	document.write ('<embed SRC="'+ valor +'" type="audio/x-pn-realaudio-plugin" CONTROLS="ControlPanel, StatusBar" HEIGHT="50" WIDTH="280" AUTOSTART="true"></embed>');
}

function radioQuicktime(valor) {
	document.write ('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="280" height="16">');
	document.write ('	<param name="src" value="'+ valor +'" />');
	document.write ('	<param name="autoplay" value="true" />');
	document.write ('	<param name="controller" value="true" />');
	document.write ('	<param name="pluginspage" value="http://www.apple.com/quicktime/download/" />');
	document.write ('	<param name="controller" value="true" />');
	document.write ('		<object data="'+ valor +'" width="280" height="16" type="video/quicktime">');
	document.write ('			<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />');
	document.write ('			<param name="controller" value="true" />');
	document.write ('		</object>');
	document.write ('</object>');
}

/*********************************************************************************************************************************/

function MensajeOK(request) {
	$('#IngresoNewsletter').show();
	$('#IngresoNewsletter').html(request);
}
function MensajeError() {
	$('#IngresoNewsletter').show();
	$('#IngresoNewsletter').html('<strong class="textor">Ha ocurrido<br>un error!</strong><br> Por favor intente<br>nuevamente.');
}
function Suscribirse(pTipoSuscripcion) {
	Formulario = document.getElementById('FormNewsletter');
	if (ValidaNewsletter(Formulario)) {
		$.ajax({
			url: '/includes/Newsletter.asp?Email='+ $('#EmailNewsletter').val() +'&TipoSuscripcion='+ pTipoSuscripcion,
			cache: false,
			error: MensajeError,
			success: MensajeOK
		});
	}
}
function ValidaNewsletter(theform) {
	if (!ValidateRequired(theform.EmailNewsletter) )
		{ alert('El campo «« Email »» ' + sMsg );
		theform.EmailNewsletter.focus();
	return (false); }
	
	if (!ValidateEmail(theform.EmailNewsletter) )
		{ alert('El campo «« Email »» ' + sMsg );
		theform.EmailNewsletter.focus();
	return (false); }
return true;
}



/*********************************************************************************************************************************/

function BuscarObjeto(pObjeto) {
	return document.getElementById(pObjeto);
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
		// otherwise, update 'characters left' counter
	else
		countfield.value = maxlimit - field.value.length;
}


/*********************************************************************************************************************************/

function marqueeStop(){
	if (document.getElementById("marq"))
	{
		document.getElementById("marq").stop();	
	}
}

function marqueePlay(){
	if (document.getElementById("marq"))
	{
		document.getElementById("marq").start();
	}
}

function ocultar_todos(mascara) {
	document.getElementById('menu_socios').className = 'menu01';
	document.getElementById(obj + '_links').style.display = 'block';
}

function flash_banners(movie, w, h, flashvars, transparent) {
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ w +'" height="'+ h +'">');
	document.write ('	<param name="movie" value="'+ movie +'">');
	document.write ('	<param name="quality" value="high">');
	document.write ('	<param name="flashvars" value="'+ flashvars +'">');
	document.write ('	<param name="scale" value="exactfit">');
	document.write ('	<param name="menu" value="0">');
	document.write ('	<param name="wmode" value="'+ transparent +'">');
	document.write ('	<embed src="'+ movie +'" flashvars="'+ flashvars +'" wmode="'+ transparent +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed>');
	document.write ('</object>');
}

function flash(movie, w, h, flashvars, transparent) {
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ w +'" height="'+ h +'">');
	document.write ('	<param name="movie" value="'+ movie +'">');
	document.write ('	<param name="quality" value="high">');
	document.write ('	<param name="flashvars" value="'+ flashvars +'">');
	document.write ('	<param name="menu" value="0">');
	document.write ('	<param name="scale" value="noscale">');
	document.write ('	<param name="wmode" value="'+ transparent +'">');
	document.write ('	<embed src="'+ movie +'" flashvars="'+ flashvars +'" wmode="'+ transparent +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed>');
	document.write ('</object>');
}

function o(td) {
	td.style.backgroundColor='';
}
function h(td) {
	td.style.backgroundColor='F0F0F0'; td.style.cursor="pointer";
}

function hrf(url) {
	document.location.href = url;
}

function ow(page, name, w, h) {
  window.open(page,name,"resizable=0,width="+w+",height="+h+",left=10,top=10,scrollbars=no");
}

function ows(page, name, w, h) {
  window.open(page,name,"resizable=0,width="+w+",height="+h+",left=50,top=50,scrollbars=yes");
}

function hrf(url) {
	document.location.href = url;
}

function foco(obj) {
	if (obj) { obj.focus(); }
}

function confirmar(url, mensaje) {
	if ( confirm(mensaje) )
	document.location.href = url;
}

function clock() {

	var digital = new Date();
		var hours = digital.getHours();
		var minutes = digital.getMinutes();
		var seconds = digital.getSeconds();
		var amOrPm = "AM";
		if (hours > 11) amOrPm = "PM";
		if (hours > 12) hours = hours - 12;
		if (hours == 0) hours = 12;
		if (minutes <= 9) minutes = "0" + minutes;
		if (seconds <= 9) seconds = "0" + seconds;
		dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;

	var months = new Array(13);
		months[1]="Enero";
		months[2]="Febrero";
		months[3]="Marzo";
		months[4]="Abril";
		months[5]="Mayo";
		months[6]="Junio";
		months[7]="Julio";
		months[8]="Agosto";
		months[9]="Septiembre";
		months[10]="Octubre";
		months[11]="Noviembre";
		months[12]="Diciembre";

	var time = new Date();
		var lmonth=months[time.getMonth() + 1];
		var date=time.getDate();
		var year=time.getYear();
		if (year < 2000)    
		year = year + 1900;

	if(document.getElementById('pendule')) {
		document.getElementById('pendule').innerHTML = date + " de " + lmonth + " de " + year + " - " + dispTime;
		setTimeout("clock()", 1000);
	}
}

function cargar_combo(file, sql, name, value, cid, cnm, rq, sel, nuevo){
	var scriptTag = document.getElementById('loadScript');
	var head = document.getElementsByTagName('head').item(0);
	script		= document.createElement('script');
	script.src	= file+'?cid='+cid+'&cnm='+cnm+'&sql='+sql+'&sel='+sel+'&vl='+value+'&rq='+rq+'&name='+name+'&nuevo='+nuevo;
	script.type = 'text/javascript';
	script.id	= 'loadScript';
	head.appendChild(script);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function cargar_submenu(valor) {
	cargar_combo('/includes/rs.asp', 'sp_submenu', 'submenu', valor, 'id', 'name', '', 'Selecciones uno...', '');
}

function resize() {
	if (document.images[0]) window.resizeTo(document.images[0].width +10, document.images[0].height+35);
		self.focus();
	}

function encuesta_validar(form) {
	var f = form;
	var i;
	for(i=0;i<f.votes.length;i++) {
		if (f.votes[i].checked == true)
			return true;
	}
	alert('Debe seleccionar alguna opción!');
	return false;
}
