//<!--
function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	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 ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name ) {
	
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// Detect Plugins
version=6;
pdf="";
var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	
	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer");
	pluginlist += detectIE("SWCtl.SWCtl.1","Shockwave Director");
	pluginlist += detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash"); 
	pluginlist += detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") ; 
	pluginlist += detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime");
	pluginlist += detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player");
	for(i=1;i<=version;i++) {
		pdf=detectIE("PDF.PdfCtrl." + i,"Acrobat Reader");
		if (pdf!="") { pluginlist += pdf; break; }
	}
}
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '")) \n</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
//End detect
	
function WebStatistiche(sessionid) {
	var strpath="http://stats.webservizi.biz";
	var file=strpath + "/dns.aspx?sessionid=" + sessionid;
	var ref="";

	b=navigator.appName;
	pag=escape(document.URL);
	if (b != 'Netscape') {c=screen.colorDepth;}
	else {c=screen.pixelDepth;}
	varinfo="&referer=" + escape(document.referrer);
	varinfo+="&pag=" + pag;
	varinfo+="&c=" + c;
	varinfo+="&w=" + screen.width;
	varinfo+="&h=" + screen.height;
	varinfo+="&cookies=";
	//varinfo+=(document.cookie)?1:0;
	Set_Cookie( 'test', 'none', '', '/', '', '' );
	if ( Get_Cookie( 'test' ) ){
		varinfo+="1";
		Delete_Cookie('test', '/', '');
	}
	else {
		varinfo+="0";
	}
	varinfo+="&java=";
	varinfo+=(navigator.javaEnabled())?1:0;
	varinfo+="&flash=";
	varinfo+=(pluginlist.indexOf("Flash")!=-1)?1:0;
	varinfo+="&plugin=" + escape(pluginlist);
	varinfo+="&useragent=" + escape(navigator.userAgent);
/*	if (sessionid=="PPFWDNCMRU") {
		top.location.href=file + varinfo;
	}
	else { */
		document.write('<a href="' + strpath + '/click.asp" target="_blank">');
		document.write('<img src="' + file + varinfo + '" border="0" alt="GECOStats - Le statistiche pił complete sul tuo sito!"></a>');
//	}
}
//-->