// JavaScript Document
var maxAds=10;
var imads_timer;
function counter_Views()
{
	clearInterval(imads_timer);
	var ads=AJAX_MM_findObj("ads");
	if(ads)
	{
		driver("VIEWS",ads.value);	
	}
}
function counter_Prints()
{
	clearInterval(imads_timer);	
	var ads;
	var code='';
	for(i=0;i<maxAds;i++)
	{
		ads=AJAX_MM_findObj("ads_"+i);
		if(ads)
		{
			if(i>0)
				code=code + "[]";
			code=code + ads.value;
			//driver("PRINTS",ads.value);
		}
	}
	driver("PRINTS",code);
}
function driver(type,ads)
{
	var drv=document.createElement('iframe');
	drv.height=1;
	drv.width=1;
	drv.src=UrlServer + "index.php?im_core=xmlAds&im_action=pv&ads="+ads+"&im_unico=1&type="+type;
	//drv.frameborder=1;
	drv.style.visibility="hidden";
	document.body.appendChild(drv); 
}
function driverStatistics(type)
{
	
	if(type=="VIEWS")
	{
		imads_timer=window.setTimeout('counter_Views()',1000);
	}
	else
	{
		imads_timer=window.setTimeout("counter_Prints()",50);
	}
}
function openmod(page)
{
	MOOdalBox.open(page,"","500 300");
}
