/* 
	miclubdefutbol.com JS General 
	© 2007 IntelyGenZ - www.intelygenz.com 
	version 0.07 [26.03.2008]
	
*/

var sAlternateFlashText = "Para ver correctamente esta página necesita actualizar el player de Flash. <a class='enlace2' href='https://www.macromedia.com/go/getflash/' target='_blank'>Consíguelo aquí</a>";

oIGZ.f_require ("i_marray");


var g_maMenuSup = new MArray(['Seccion','Nombre','Enlace']
	,[
	 ['inicio','Inicio',oIGZ.m_sRootPath+'default.aspx']
	,['como','Cómo funciona',oIGZ.m_sRootPath+'como_funciona.aspx']
	,['faqs','FAQs',oIGZ.m_sRootPath+'faqs.aspx']
	,['diselo','Díselo a un amigo',oIGZ.m_sRootPath+'diselo.aspx']
	,['registrate','Regístrate',oIGZ.m_sRootPath+'alta/usuario_add.aspx']
	,['blog','Blog','http://miclubdefutbol.blogspot.com/']
//	,['noticias','Noticias',oIGZ.m_sRootPath+'noticias.aspx']
	,['foro','Foro','http://foro.miclubdefutbol.com']
	]
)


if (typeof(oIGZ)!="undefined") 	{
	oIGZ.f_require ("i_core",0.789);
	oIGZ.f_require ("i_igz" ,0.739);
}else{
	alert ("Falta la libreria o el ID de 'i_core.js' o no existe 'i_igz.js'")
}


// ITEMS GENERICOS DEL WEB
oIGZ.m_maItems = [["nType", 	"sTagName"		, "sSrcOrValue"						, 	"sClassName", 		"nSizeX", "nSizeY", "sXtraAbs"]
				 ,[
				  	     1, 	"MAGIC"					, "pix/magic.gif"				,	  	 	"",		1,			 1,		""

				  ,	     1, 	"TABLAS_ORDEN"			, "pix/tablas/orden<OBJ>nOrden</OBJ>.gif",	"",		9,			 5,		""

				  ,	     1, 	"CAJA_TXT_ESQ_SUP_IZ"	, "pix/textos_esq1.gif" 		,			"",		9,			 9,		" border='0'"
				  ,	     1, 	"CAJA_TXT_ESQ_SUP_DC"	, "pix/textos_esq2.gif" 		,			"",		9,			 9,		" border='0'"
				  ,	     1, 	"CAJA_TXT_ESQ_INF_IZ"	, "pix/textos_esq3.gif" 		,			"",		9,			 9,		" border='0'"
				  ,	     1, 	"CAJA_TXT_ESQ_INF_DC"	, "pix/textos_esq4.gif" 		,			"",		9,			 9,		" border='0'"

				  ,	     1, 	"LISTADO_SUP_ESQ_IZ"	, "pix/listado_equipos_esq1.gif" 	,		"",		9,			11,		" border='0'"
				  ,	     1, 	"LISTADO_SUP_ESQ_DC"	, "pix/listado_equipos_esq2.gif" 	,		"",		9,			11,		" border='0'"
				  ,	     1, 	"LISTADO_INF_ESQ_IZ"	, "pix/listado_equipos_esq3.gif" 	,		"",		9,			11,		" border='0'"
				  ,	     1, 	"LISTADO_INF_ESQ_DC"	, "pix/listado_equipos_esq4.gif"	,		"",		9,			11,		" border='0'"
				  
				  ]
				 ];




function PrintMenuSup(sSecActiva) {  document.write( DrawMenuSup(sSecActiva) ) }
function DrawMenuSup(sSecActiva){
	var a_sHTML=[];

	a_sHTML.push ("	<DIV class='msupLogo'> ");
	a_sHTML.push ("		<A href='"+oIGZ.m_sRootPath+"default.aspx'><IMG src='"+oIGZ.m_sRootPath +"pix/logo.gif' title='miclubdefutbol.com' /></A> ");
	a_sHTML.push ("	</DIV> ");

	a_sHTML.push ("	<DIV class='msupMenu'> ");
	a_sHTML.push ("		<UL> ");

		for (var f=0; f<g_maMenuSup.f_length(); f++){
			var sClass  = "";
			var sClassFin = "";

			var sSeccion = g_maMenuSup.f_getVal("Seccion", f);
			var sNombre  = g_maMenuSup.f_getVal("Nombre", f);
			var sEnlace  = g_maMenuSup.f_getVal("Enlace", f);

			if (sSeccion==sSecActiva) sClass = " class='msmOn'";
			if (f==(g_maMenuSup.f_length()-1)) sClassFin = " class='msmFin'";
			
			a_sHTML.push ("<LI "+sClassFin+"><A "+sClass+" href='"+ sEnlace +"'>"+sNombre +"</A></LI>  ");
		}	
	
	a_sHTML.push ("		</UL> ");
	a_sHTML.push ("	</DIV> ");

	return (a_sHTML.join(""));

}


function PrintUltimos() {  document.write( DrawUltimos() ) }
function DrawUltimos(){
	
	var sTexto=[];

	if (GetType("maUltimosUsuarios",1)){
//Requiere:  <SCRIPT type='text/javascript' charset='iso-8859-1' src='libs/xbd/ultimos_usuarios_xbd.aspx'></SCRIPT> 
		for (var f=maUltimosUsuarios.f_length();f>0;f--){
			sTexto.push (maUltimosUsuarios.f_getVal("nick@Usuario",f-1))		
		}
		sTexto = sTexto.join(" - ");	
	}		
	sTexto += " - "

	var a_sHTML=[];	
		a_sHTML.push ("<DIV id='ultimos'> ");

	if (oSWF.installedVer.versionIsValid(oSWF.getAttribute("version"))){
		var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '
					+' width="185" height="60" id="ultimos" >'
      				+'<param name="movie" value="'+oIGZ.m_sRootPath+'swf/ultimos_inscritos.swf?'+new Date().getTime()+'">'
      				+'<param name="quality" value="high">'
					+'<param name="FlashVars" value="sTexto='+sTexto+'" /> '
      				+'<embed src="'+oIGZ.m_sRootPath+'swf/ultimos_inscritos.swf?'+new Date().getTime()+'" '
      				+' FlashVars="sTexto='+sTexto+'" '
      				+' quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" '
      				+' width="185" height="60" name="ultimos" ></embed>'
    				+'</object>';
    	a_sHTML.push (oeTags);
	} else {  // flash is too old or we can't detect the plugin
		a_sHTML.push (sAlternateFlashText);
	}
	
		a_sHTML.push ("</DIV> ");
	return (a_sHTML.join(""));	
	
}

function PrintCajaFinal() {  document.write( DrawCajaFinal() ) }
function DrawCajaFinal(){
	var a_sHTML=[];	
	
	a_sHTML.push ("<TABLE border='0'> ");
	a_sHTML.push ("<TR> ");
	a_sHTML.push ("	<TD><A href='mailto:contacto@miclubdefutbol.com?subject=cont&aacute;ctanos'>cont&aacute;ctanos</A> | ");
	a_sHTML.push ("		<A href='"+oIGZ.m_sRootPath+"politica_privacidad.html'>pol&iacute;tica de privacidad</A></TD> ");
	a_sHTML.push ("	<TD class='alignR'>© 2007 miclubdefutbol.com</TD> ");
	a_sHTML.push ("</TR> ");
	a_sHTML.push ("</TABLE> ");
	
	return (a_sHTML.join(""));
}

var g_nMasVotadosMin=5;
var g_nMasVotados=g_nMasVotadosMin;
function ReDrawMasVotados(){
	var oDiv = document.getElementById ('masvotados');
	if (oDiv){
		var nMax = 15
		if (g_nMasVotados<=g_nMasVotadosMin) g_nMasVotados=nMax
		else g_nMasVotados=g_nMasVotadosMin
		oDiv.innerHTML = DrawMasVotados()	
	}
}

function PrintMasVotados() {  document.write( DrawMasVotados() ) }
function DrawMasVotados(){
	var a_sHTML=[];	

	a_sHTML.push ("<TABLE border='0' cellpadding='0' cellspacing='0' width='185'>");
	a_sHTML.push ("<TR> ");
	a_sHTML.push (	"<TD class='valignT'>"+oIGZ.f_drawItem('LISTADO_SUP_ESQ_IZ')+"</TD>");
	a_sHTML.push (	"<TD class='alignR valignT'>"+oIGZ.f_drawItem('LISTADO_SUP_ESQ_DC')+"</TD>");
	a_sHTML.push ("</TR> ");
	a_sHTML.push ("<TR> ");
	a_sHTML.push (	"<TD colspan='2' class='celda1 alignC'> ");
	a_sHTML.push (		"<IMG src='"+oIGZ.m_sRootPath+"pix/listado_equipos_tit.gif' width='108' height='39' title='clubs más votados' /> ");
	a_sHTML.push (		"<OL> ");
	var sEXML = "<LI><BD>equipo@Equipo</BD></LI>";
	var nRegs = maEquiposPorVotos.f_maGetRegs()
	nRegs = Math.min (nRegs,g_nMasVotados)	
	for(var f=0; f<nRegs; f++){
		a_sHTML.push (ParseEXMLs (sEXML,"",maEquiposPorVotos,f))
	}
	a_sHTML.push (		"</OL>");

	var sTexto = "ver más"
	if (g_nMasVotados>g_nMasVotadosMin) {
		sTexto = "ver menos"
	}	
	a_sHTML.push (		"<P><A href='#' onclick='ReDrawMasVotados();return false;'>"+sTexto+"</A></P>");
	a_sHTML.push (	"</TD>");
	a_sHTML.push ("</TR>");
	a_sHTML.push ("<TR>");
	a_sHTML.push (	"<TD class='valignB'>"+oIGZ.f_drawItem('LISTADO_INF_ESQ_IZ')+"</TD>");
	a_sHTML.push (	"<TD class='alignR valignB'>"+oIGZ.f_drawItem('LISTADO_INF_ESQ_DC')+"</TD>");
	a_sHTML.push ("</TR> ");
	a_sHTML.push ("</TABLE> ");
	
	return (a_sHTML.join(""));
}


function PrintRegistrateCaja() {  document.write( DrawRegistrateCaja() ) }
function DrawRegistrateCaja(){
	var a_sHTML=[];	
	a_sHTML.push ("<A href='"+oIGZ.m_sRootPath+"alta/usuario_add.aspx'><IMG src='"+oIGZ.m_sRootPath+"pix/registrate_home.gif' width='185' height='123' border='0' title='regístrate aquí'  /></A>")
	return (a_sHTML.join(""));
}


function PrintRegistrateBig() {  document.write( DrawRegistrateBig() ) }
function DrawRegistrateBig(){
	var a_sHTML=[];	
	a_sHTML.push ("<P class='alignC'> ");
	a_sHTML.push ("<A href='"+oIGZ.m_sRootPath+"alta/usuario_add.aspx'><IMG src='"+oIGZ.m_sRootPath+"pix/registrate_big.gif' width='297' height='65' border='0' title='Regístrate gratis aquí' /></A> ");
	a_sHTML.push ("</P> ");
	return (a_sHTML.join(""));
}


function PrintBlog() {  document.write( DrawBlog() ) }
function DrawBlog(){
	var a_sHTML=[];	
	a_sHTML.push ("<A href='http://miclubdefutbol.blogspot.com/' target='_blank'><IMG src='"+oIGZ.m_sRootPath+"pix/blog_banner.jpg' width='185' height='74' border='0' title='Entra en nuestro Blog' /></A>")
	return (a_sHTML.join(""));
}

/*
function PrintNoticias() {  document.write( DrawNoticias() ) }
function DrawNoticias(){
	var a_sHTML=[];	
	a_sHTML.push ("<A href='"+oIGZ.m_sRootPath+"noticias.aspx'><IMG src='"+oIGZ.m_sRootPath+"pix/noticias_banner.jpg' width='185' height='75' border='0' title='Últimas Noticias' /></A>")
	return (a_sHTML.join(""));
}
*/

function PrintForo() {  document.write( DrawForo() ) }
function DrawForo(){
	var a_sHTML=[];	
	a_sHTML.push ("<A href='http://foro.miclubdefutbol.com' target='_blank'><IMG src='"+oIGZ.m_sRootPath+"pix/foro_banner.jpg' width='185' height='74' border='0' title='¡Visita el Foro!' /></A>")
	return (a_sHTML.join(""));
}



function PrintSomos(sTexto) {  document.write( DrawSomos(sTexto) ) }
function DrawSomos(sTexto){
	var a_sHTML=[];	
	//a_sHTML.push ("<IMG src='"+oIGZ.m_sRootPath+"pix/yasomos.jpg' width='185' height='71' border='0' /> ");
	
	if (oSWF.installedVer.versionIsValid(oSWF.getAttribute("version"))){

		var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '
					+' width="185" height="71" id="somos" >'
      				+'<param name="movie" value="'+oIGZ.m_sRootPath+'swf/somos_box.swf?'+new Date()+'">'
      				+'<param name="quality" value="high">'
					+'<param name="FlashVars" value="sTexto='+sTexto+'" /> '
      				+'<embed src="'+oIGZ.m_sRootPath+'swf/somos_box.swf?'+new Date()+'" '
      				+' FlashVars="sTexto='+sTexto+'" '
      				+' quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" '
      				+' width="185" height="71" name="somos" ></embed>'
    				+'</object>';
    	a_sHTML.push (oeTags);
	} else {  // flash is too old or we can't detect the plugin
		a_sHTML.push (sAlternateFlashText);
	}
	
	return (a_sHTML.join(""));
}



function PrintBanners(bSponsor){
	document.write (DrawBanners(bSponsor))
}
function DrawBanners(bSponsor){
	var sHtml = ""

	if (bSponsor){
		sHtml += "<A href='mailto:comunicacion@miclubdefutbol.com?subject=Queremos conocer más detalles'><IMG src='pix/sponsor.gif' vspace='4' width='185' height='168' border='0' title='buscamos sponsor' /></A>"
	}
	
/*	
	var oSwf = new SWFObject("swf/cobalto.swf", "mymovie", "185", "86", "8", "#FFFFFF");
	sHtml += oSwf.getSWFHTML();
*/

	return sHtml	
}
