function nuevoAjax() {  var xmlhttp=false;  try    {  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");  }   catch(e)  {  try  {   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }  catch(E) { xmlhttp=false; }  }  if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); }    return xmlhttp; } 

function crearcookie() { 	
	ajax=nuevoAjax();
	ajax.open("GET", "/foro/ads/partner_Ads.asp?partner=TM", true);  	
	ajax.onreadystatechange=function()	
	{  	
		if (ajax.readyState==1)
		{ 
			document.getElementById('ads').innerHTML="";
		} 
		if (ajax.readyState==4) 
		{
			document.getElementById('ads').innerHTML="";
			var today  = new Date();
			var strYear     = today.getYear()-100;
			strYear = (strYear < 10)? "0" + strYear : strYear;
			
			var iMonth      = today.getMonth() + 1; 
			var iQuarter    = Math.ceil((iMonth / 12) * 4);
			var iDay        = today.getDate();
			var strDateOut  = "";
			iMonth = (iMonth < 10)? "0" + iMonth : iMonth;
			iDay = (iDay < 10)? "0" + iDay : iDay;
			strDateOut = iDay+"-"+ iMonth +"-"+strYear + " ";
			SetCookie ('TMAds','TMAds:'+strDateOut,30  );
		} 
	
	 }
	 ajax.send(null);
}




function SetCookie( name, value, expires, path,domain,secure )
{
var today = new Date();
today.setTime( today.getTime() );

if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path !=null) ? ";path=" + path : "" ) +
( ( domain!=null ) ? ";domain=" + domain : "" ) +
( ( secure!=null ) ? ";secure" : "" );
}




function DisplayInfo() 
{
var expdate = new Date();
var visit;
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
if(!(visit = GetCookie("visit"))) 
visit = 0;
visit++;
SetCookie("visit", visit, expdate, "/", null, false);
var message;
if(visit == 1) message=" Bienvenido a la página de HTMLpoint";
if(visit == 2) message=" Ejemplo de Massimiliano Valente";
if(visit == 3) message=" Visita el sitio Web de HTMLpoint";
if(visit == 4) message=" Visita www.htmlpoint.com"; 
if(visit == 5) message=" Aquí puedes incluir un mensaje a tu gusto";
if(visit == 6) message=" Aquí puedes añadir otro mensaje";
alert("\n"+"Has visitado esta página\n"+""+visit+" "+"volte."+"\n"+"\n"+message);
}

function ResetCounts() 
{
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); 
visit = 0;
SetCookie("visit", visit, expdate , "/", null, false);
leapto();
}


