//alert("mostrar_interstitial: "+mostrar_interstitial);
//alert("comprueba_popups: "+comprueba_popups);

if (typeof(domain) == "undefined") var domain='';
function valor_galleta (offset){var endstr=document.cookie.indexOf(";",offset);if (endstr == -1) endstr = document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}
function leer_galleta(name){var arg = name + "=";var alen = arg.length;var clen = document.cookie.length;var i = 0;while (i < clen){var j = i + alen;if (document.cookie.substring(i, j) == arg)return valor_galleta (j);i=document.cookie.indexOf(" ", i) + 1;if (i == 0) break;}return null;}
function poner_galleta(name, value){var argv = poner_galleta.arguments;var argc = poner_galleta.arguments.length;var expdate = new Date();var expdate2 = new Date();expdate.setTime (expdate.getTime() + (12 * 60 * 60 * 1000));expdate2.setTime (expdate2.getTime() + argv[2]);var expires = (argc > 2) ? expdate2 : expdate;var path = (argc > 3) ? argv[3] : "/";var domain = (argc > 4) ? argv[4] : null;var secure = (argc > 5) ? argv[5] : false;document.cookie = name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" + expires.toGMTString()))+((path == null) ? "" : ("; path=" + path))+((domain == null) ? "" : ("; domain=" + domain))+((secure == true) ? "; secure" : "");}
function AbrirPopUp (pUrl,pNomWin,pWidth,pHeight,pXpos,pYpos){return AbrirPopUp=window.open(pUrl,pNomWin,"width="+pWidth+",height="+pHeight+", menubar=no,locationbar=no,toolbar=no,status=no,scrollbars=no,scroll=no,resizable=no,marginwidth=0,marginheigth=0,screenX="+pXpos+",screenY="+pYpos+",top="+pYpos+",left="+pXpos);} 
function Comprueba_Nada(i){i=i-1;if (valornada==null){return true;}else{var posicion = valornada.charAt(i);if (posicion == "X"){return false;}else{return true;}}}
function OtroNada(i){i=i-1;if(valornada==null){valornada="123456789012345678901234567890123456789";}var primer_trozo=valornada.substring(0,i);var resto=valornada.substring(i+1,valornada.length);valornada=primer_trozo + 'X' + resto;poner_galleta('PMX_Nada',valornada);}
/*
function Abrir_Interstitial () {
	var ancho = screen.width-10;
	var alto = screen.height-60;
	Interstitial=AbrirPopUp (''+domain+'/publicidad/uip/teamamerica/flotant_interstitial.html','Interstitial',ancho,alto,0,0);
}
*/

function PMX_Promo(){poner_galleta('PMX_Promo','Abierta');
	PMX_Promo = AbrirPopUp(''+domain+'/publicidad/uip/promo.htm','PMX_Promo',505,415,100,1);}

var valornada = leer_galleta('PMX_Nada');
var llamada_a_servidor_banners = 0;
var aparicion_interstitial = 0;
function checkPopUps () {
var abiertoHoyPromo = leer_galleta('PMX_Promo');

// Secciones sin popups
if (
(window.location.href.indexOf('/cine/casadecera/')!=-1) ||
(window.location.href.indexOf('/semenlapelicula/')!=-1) ||
(window.location.href.indexOf('/cine/semenlapelicula/')!=-1) ||
(window.location.href.indexOf('/chenoa/')!=-1) ||
(window.location.href.indexOf('/davidbisbal/')!=-1) ||
(window.location.href.indexOf('/fanmix/')!=-1) ||
(window.location.href.indexOf('/foros/')!=-1) ||
(window.location.href.indexOf('/lagranja/')!=-1) ||
(window.location.href.indexOf('/lossims/')!=-1) ||
(window.location.href.indexOf('/rosa/')!=-1) ||
(window.location.href.indexOf('/triunfo/emocion/')!=-1)) {}

// Secciones de triunfo
else if ((window.location.href.indexOf('/triunfo/')!=-1) || 			     			    		
(window.location.href.indexOf('/davidbustamante/')!=-1) || 			
(window.location.href.indexOf('/manutenorio/')!=-1) ||    
(window.location.href.indexOf('/beth/')!=-1) ||
(window.location.href.indexOf('/ainhoa/')!=-1) ||
(window.location.href.indexOf('/manuelcarrasco/')!=-1)) {
	if (Comprueba_Nada(14)==true) 			OtroNada(14);
	else if (Comprueba_Nada(15)==true)	OtroNada(15);
	else if (Comprueba_Nada(16)==true)	OtroNada(16);
}	 
// Secciones home de Portalmix y resto
else {	
	
	if ((Comprueba_Nada(1)==true) && ((window.location.pathname=='/index.php') || (window.location.pathname=='/'))) 	OtroNada(1);
	else if ((Comprueba_Nada(2)==true) && ((window.location.pathname=='/index.php') || (window.location.pathname=='/'))) OtroNada(2);
	
	else if (Comprueba_Nada(5)==true)	OtroNada(5);
	else if (Comprueba_Nada(6)==true)	OtroNada(6);

	//else if (abiertoHoyCronicasTonos == null) 	CronicasTonos(); 

}
}

function Destacados(){document.writeln('<select class="SEL_SERVICIOS" name="menu2" onChange="MM_jumpMenu(\'parent\',this,1);" style="width:130px"><option  value="#"><strong>Top Portalmix</strong></option><option  value=""><strong></strong></option><option value="'+domain+'http://www.operaciontriunfo.com/">Operación Triunfo 09</option><option value="'+domain+'http://www.famaabailar.tv">Fama ¡A bailar!</option><option  value="'+domain+'http://www.losmejoresaños.com">Los Mejores Años</option><option value="'+domain+'http://www.granhermano.com">Gran Hermano</option><option  value="'+domain+'http://www.bustamanteunodelosnuestros.com/">Bustamante</option><option  value="'+domain+'http://www.cuestiondepeso.es/">Cuestión de Peso</option><option  value="'+domain+'http://www.venacenarconmigo.com/">Ven a cenar conmigo</option><option  value="'+domain+'/estacasaeraunaruina/">Esta casa era una...</option><option  value="'+domain+'/fotos/">Fotos de humor</option><option  value="'+domain+'/ahora/">Chic@s sexys</option><option  value="'+domain+'/webs/erosports/">EroSport</option><option  value="'+domain+'/tv/noticias/">Noticias de TV</option><option value="'+domain+'/cine/noticias/">Noticias de cine</option><option  value="'+domain+'/fanmix/noticias/">Noticias de música</option><option value="'+domain+'/fanmix/enimagenes/muerte_bien/">La muerte os sienta bien</option><option  value="'+domain+'/fanmix/enimagenes/sex/">SEX La carne vende</option><option value="'+domain+'/famosos/noticias/">Lo que hay que oír</option><option  value="'+domain+'/zapping/">Zapping</option><option  value="'+domain+'http://www.portalmix.net/lossims/">Los Sims</option></select>');}
function Areas(){document.writeln('<select class="SEL_SERVICIOS" name="menu1" onChange="MM_jumpMenu(\'parent\',this,1);" style="width:95px"><option  value="#"><b>Las Áreas</b></option><option  value=""><strong></strong></option><option  value="'+domain+'/animaciones/">Animaciones</option><option  value="'+domain+'/cine/">Cine</option><option  value="'+domain+'/comerybeber/">Comer y Beber</option><option  value="'+domain+'/curiosidades/">Curiosidades</option><option  value="'+domain+'/especiales/">Especiales</option><option  value="'+domain+'/famosos/">Famosos</option><option  value="'+domain+'/humor.shtml">Humor</option><option  value="'+domain+'/juegos/">Juegos</option><option  value="'+domain+'/misterios/">Misterios</option><option  value="'+domain+'/motogp/">MotoGP</option><option  value="'+domain+'/fanmix/">Música Fanmix</option><option  value="'+domain+'/picante/">Picante</option>	<option  value="'+domain+'/tv/">TV</option><option  value="'+domain+'/viajes/">Viajes TMG</option><option  value="'+domain+'/videos/">Videos</option><option  value="'+domain+'/videojuegos/">Videojuegos</option></select>');}
function Servicios(){document.writeln('<select class="SEL_SERVICIOS" name="menu3" onChange="MM_jumpMenu(\'parent\',this,1);" style="width:105px"><option value="#"><b>Los Servicios</b></option><option value=><strong></strong></option><option value="'+domain+'/servicios.shtml">Servicios</option><option value="'+domain+'/club/">Club</option><option value="'+domain+'/comunidad.shtml">Comunidad</option><option value="http://tienda.portalmix.com">Tienda</option><option value="'+domain+'/moviles/">Móviles</option><option value="'+domain+'/novapop/">Novapop</option><option value="'+domain+'/postales.shtml">Postales</option><option value="'+domain+'/portal10/">Portal 10</option><option value="'+domain+'/wallpapers/">Wallpapers</option><option value="'+domain+'/servicios/viajes/">Vacaciones</option><option value="'+domain+'/palabras_google.shtml">Lo + buscado</option><option value="http://www.maimai.com/?SyndicateContent=portalmix">Clasificados</option><option value="'+domain+'/mixplorer/">Mixplorers</option><option value="'+domain+'/correo.shtml">Correo</option><option value="'+domain+'/comunicacion.shtml">Medios</option><option value="'+domain+'/portales.shtml">Portales</option><option value="'+domain+'/servicios/calcular.shtml">Calculadoras</option></select>');}
function drawFoot(){drawFootTexto();}
function drawFootTexto(){
	// control per ensenyar la publicitat de google
	if ((typeof(mostrado_google) == "undefined")&&(typeof(google_picante) == "undefined")) {
	
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000000">');
		document.write('<tr>');
		document.write('<td width="50%" height="100"><img src="/img/tb.gif" width="1" height="100" border="0" alt="0"></td>');
		document.write('<td width="770" height="100"><img src="/img/tb.gif" alt="" width="700" height="1" border="0"><br>');
		document.write('<iframe width="770" height="100" noresize scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="/lib/cabes/google.htm"></iframe>');
		document.write('</td>');
		document.write('<td width="50%" height="100"><img src="/img/tb.gif" width="1" height="1" border="0" alt="0"></td>');
		document.write('</tr>');
		document.write('</table>');

	}
	/*
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000000">');
	document.write('<tr>');
	document.write('<td width="50%" height="250"><img src="/img/tb.gif" width="1" height="100" border="0" alt="0"></td>');
	document.write('<td width="300" height="250" bgcolor="red" style="padding-top:10px;padding-bottom:10px;"><img src="/img/tb.gif" alt="" width="300" height="250" border="0">');
	document.write('</td>');
	document.write('<td width="50%" height="250"><img src="/img/tb.gif" width="1" height="1" border="0" alt="0"></td>');
	document.write('</tr>');
	document.write('</table>');
	*/

	// control per ensenyar el check m8
	//if (typeof(varcm8cat) != "undefined") document.writeln('<scr'+'ipt language="JavaScri'+'pt1.2">var cm8cat="'+varcm8cat+'";</scr'+'ipt><SCR'+'IPT LANGUAGE="JavaScr'+'ipt" src="http://adserver.terra.es/multiplescr'+'ipt/checkm8_init_1.js"></SCR'+'IPT>');

	// el peu
	//document.writeln('<STYLE>.PIEFOOT {color : White; font-family : Verdana; font-size : 10px; font-weight : normal;}</STYLE><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1" height="35" bgcolor=#000000><img src="/img/tb.gif" width=1 height=35 border=0 alt=""></td><td ALIGN=center class="PIEFOOT" bgcolor="Black"><a href="'+domain+'/" target="_top"><span class="PIEFOOT">Inicio</span></A> |  <a href="'+domain+'/humor.shtml" target="_top"><span class="PIEFOOT">Humor</span></a> | <a href="'+domain+'/juegos/" target="_top"><span class="PIEFOOT">Juegos</span></a> | <a href="'+domain+'/cine/" target="_top"><span class="PIEFOOT">Cine</span></a>  | <a href="'+domain+'/musica/" target="_top"><span class="PIEFOOT">Música</span></a> | <a href="'+domain+'/moviles/" target="_top"><span class="PIEFOOT">Móviles</span></a> | <a href="'+domain+'/tv/" target="_top"><span class="PIEFOOT">TV</span></a> | <a href="'+domain+'/famosos/" target="_top"><span class="PIEFOOT">Famosos</span></a> | <a href="'+domain+'/picante/" target="_top"><span class="PIEFOOT">Picante</span></a> | <a href="'+domain+'/curiosidades/" target="_top"><span class="PIEFOOT">Curiosidades</span></a> | <a href="'+domain+'/especiales/" target="_top"><span class="PIEFOOT">Especiales</span></a> | <a href="'+domain+'/club/" target="_top"><span class="PIEFOOT">Club</span></a> | <a href="'+domain+'/comunidad.shtml" target="_top"><span class="PIEFOOT">Comunidad</span></a><br><a href="'+domain+'/copyright.shtml" target="_top"><span class="PIEFOOT">© Portalmix 2000-2007 · Reservados todos los derechos ·</span> <a href="'+domain+'/contacto.shtml"><span class="PIEFOOT">Contacta</span></a> · <a href="/contacto.shtml#publicidad"><span class="PIEFOOT">Publicidad</span></a> · <a href='+domain+'/prensa/ target="_top"><span class="PIEFOOT">Notas de Prensa</span></a> · <a href='+domain+'/ayuda.shtml target="_top"><span class="PIEFOOT">Ayuda</span></a> · <a href='+domain+'/mapaweb/ target="_top"><span class="PIEFOOT">Mapa Web</span></a></td></tr></table><div id="pie"><span style="background-color:#fff00a"><scr'+'ipt language="JavaScr'+'ipt" src="http://www.terra.es/nav/pie/pie_100nsimple.js"></scr'+'ipt></span></div>');
	
	document.writeln('<STYLE>.PIEFOOT {color:White; font-family:Verdana;font-size:10px;font-weight:normal;}A.PIEFOOT:link{color:White; font-family:Verdana;font-size:10px;font-weight: normal;text-decoration:none;}A.PIEFOOT:visited{color:White;font-family:Verdana;font-size:10px;font-weight:normal;text-decoration:none;}A.PIEFOOT:hover{color:White;font-family:Verdana;font-size:10px;font-weight:normal;text-decoration:underline;}</STYLE><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1" height="35" bgcolor=#000000><img src="/img/tb.gif" width=1 height=35 border=0 alt=""></td><td ALIGN=center class="PIEFOOT" bgcolor="Black"><a href="'+domain+'/" target="_top" class="PIEFOOT">Inicio</A> |  <a href="'+domain+'/humor.shtml" target="_top" class="PIEFOOT">Humor</a> | <a href="'+domain+'/juegos/" target="_top" class="PIEFOOT">Juegos</a> | <a href="'+domain+'/cine/" target="_top" class="PIEFOOT">Cine</a> | <a href="'+domain+'/musica/" target="_top" class="PIEFOOT">Música</a> | <a href="'+domain+'/moviles/" target="_top" class="PIEFOOT">Móviles</a> | <a href="'+domain+'/tv/" target="_top" class="PIEFOOT">TV</a> | <a href="'+domain+'/famosos/" target="_top" class="PIEFOOT">Famosos</a> | <a href="'+domain+'/picante/" target="_top" class="PIEFOOT">Picante</a> | <a href="'+domain+'/curiosidades/" target="_top" class="PIEFOOT">Curiosidades</a> | <a href="'+domain+'/especiales/" target="_top" class="PIEFOOT">Especiales</a> | <a href="'+domain+'/club/" target="_top" class="PIEFOOT">Club</a> | <a href="'+domain+'/comunidad.shtml" target="_top" class="PIEFOOT">Comunidad</a><br>© Portalmix 2000-2009 · <a href="'+domain+'/copyright.shtml" target="_top" class="PIEFOOT">Condiciones generales</a> · <a href="'+domain+'/contacto.shtml" class="PIEFOOT">Contacta</a> · <a href="/contacto.shtml#publicidad" class="PIEFOOT">Publicidad</a> · <a href='+domain+'/prensa/ target="_top" class="PIEFOOT">Notas de Prensa</a> · <a href='+domain+'/ayuda.shtml target="_top" class="PIEFOOT">Ayuda</a> · <a href='+domain+'/mapaweb/ target="_top" class="PIEFOOT">Mapa Web</a></td></tr></table>');

	document.writeln('<script type="text/javas'+'cript">');
	
	document.writeln('var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");');
	
	document.writeln('document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javasc"+"ript\'%3E%3C/scr"+"ipt%3E"));');
	
	document.writeln('</scri'+'pt>');
	
	document.writeln('<scri'+'pt type="text/javascr'+'ipt">');
	
	document.writeln('var pageTracker = _gat._getTracker("UA-3623573-8");');
	
	document.writeln('pageTracker._trackPageview();');
	
	document.writeln('</scr'+'ipt>');

	
}

function MM_jumpMenu(targ,selObj,restore){var selected = selObj.options[selObj.selectedIndex].value;if(selected=="http://portalmix.zzn.com/") {targ="parent.mid";parent.up.location="/top_home.html";}
if(selected.indexOf("http://tvmix.blogs.terra.es")==0){var date = new Date();var seconds = date.getSeconds();window.open('http://tvmix.blogs.terra.es',seconds);if (restore) selObj.selectedIndex=0;return 0;}
if(selected.indexOf("http://tienda.portalmix.com")==0){var date = new Date();var seconds = date.getSeconds();window.open('http://tienda.portalmix.com',seconds);if (restore) selObj.selectedIndex=0;return 0;}
if(selected.indexOf("http://pedigree-es.fullsix.com/index.asp?ref=destacadotoppmix ")==0){var date = new Date();var seconds = date.getSeconds();window.open('http://pedigree-es.fullsix.com/index.asp?ref=destacadotoppmix ',seconds);if (restore) selObj.selectedIndex=0;return 0;}
if(selected.indexOf("/mixplorer/")==0){var date = new Date();var seconds = date.getSeconds();window.open('http://www.portalmix.com'+selected,seconds);if (restore) selObj.selectedIndex=0;return 0;} 
if(selected.indexOf("http://www.quienseapunta.com")==0){var date = new Date();var seconds = date.getSeconds();window.open('http://www.quienseapunta.com',seconds);if (restore) selObj.selectedIndex=0;return 0;}
eval(targ+".location='"+selected+"'");  
if (restore) selObj.selectedIndex=0;}
if (typeof(comprueba_popups) == "undefined") var comprueba_popups = true;
if (comprueba_popups == true) checkPopUps();
/*
else {
	// si existeix la variable 'mostrar_interstital', se mostrara el interstitial
	if (typeof(mostrar_interstitial) != "undefined") {  
		Abrir_Interstitial();
	}
}
*/
