function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function apriPopupSegnalazione(URLpagina, titolo, IDnodo, lingua) 
{
	var newWin;
	//alert(URLpagina)
	patt = /§/gi;
	newtitolo=titolo.replace(patt, "'");
	newWin=window.open("/includes/formSegnalazione.asp?lingua="+ lingua+"&URLpagina="+URLpagina+"&titolo="+newtitolo+"&IDnodo="+IDnodo,"","toolbar=no,menubar=no,scrollbars=yes,top=100,left=100,height=400,width=600");
	newWin.focus();
}

function faiNewWin(URLfoto, titolo, opzioni) 
{
	var newWin;
	//alert(URLpagina)
	newWin=window.open("/fai/popupZoom.asp?URLfoto="+URLfoto+"&titolo="+titolo,"","toolbar=no,menubar=no,scrollbars=yes,top=30,left=30,height=560,width=600");
	newWin.focus();
}

function cgweZoom(URLfoto, titolo, opzioni) 
{
	var newWin;
	//alert(URLpagina)
	newWin=window.open("/cgwe/popupZoom.asp?URLfoto="+URLfoto+"&titolo="+titolo,"","toolbar=no,menubar=no,scrollbars=yes,top=50,left=150,height=500,width=500");
	newWin.focus();
}

function iweZoom(URLfoto, titolo, opzioni) 
{
	var newWin;
	//alert(URLpagina)
	newWin=window.open("/iwe/popupZoom.asp?URLfoto="+URLfoto+"&titolo="+titolo,"","toolbar=no,menubar=no,scrollbars=yes,top=50,left=150,height=500,width=500");
	newWin.focus();
}

function apriPopupCommento(URLpagina, titolo, IDnodo, lingua) 
{
	var newWin;
	//alert(URLpagina)
	patt = /§/gi;
	newtitolo=titolo.replace(patt, "'");
	newWin=window.open("/includes/formCommento.asp?lingua="+ lingua+"&URLpagina="+URLpagina+"&titolo="+newtitolo+"&IDnodo="+IDnodo,"","toolbar=no,menubar=no,scrollbars=yes,top=100,left=100,height=400,width=600");
	newWin.focus();
}

function apriPopupGenerico(URLpopup) 
{

	if (popWin && popWin.open())	//esiste gią il popup
	{
		popWin.location=URLpopup
		popWin.focus()
	}
	else
	{
	var popWin;	popWin=window.open(URLpopup,"popWin","toolbar=no,menubar=no,scrollbars=yes,location=no,status=no,resizable=yes,top=40,left=40,height=520,width=720");
		popWin.focus();
	}
}

function apriPopupStrutturaMds(IDstruttura, lingua) 
{
	var winStrutturaMds;
	//alert(URLpagina)
	winStrutturaMds=window.open("/motorediscelta/popup_StrutturaMds.asp?lingua="+ lingua+"&IDstruttura="+IDstruttura,"winStrutturaMds","toolbar=no,menubar=no,scrollbars=yes,top=0,left=100,height=500,width=600");
	//winStrutturaMds=window.open("/motorediscelta/schedaStruttura.asp?lingua="+ lingua+"&IDstruttura="+IDstruttura,"winStrutturaMds","toolbar=yes,menubar=no,scrollbars=yes,resizable=yes,top=30,left=30,height=550,width=700");
	winStrutturaMds.focus();
}

function validEmailAddress(email) 
{
	var goodEmail = email.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.biz)|(\..{2,2}))$)\b/gi);
	if (!goodEmail)
	{
		return false
	}
	return true
}

function isIE()
{
    if(document.all)
       return true;
	else 
		return false;
}

function isNS4()
{
    if(document.layers)
       return true;
	else 
		return false;
}

function isNS6()
{
    if(!document.all && document.getElementById)
       return true;
	else 
		return false;
}

function reloadSponsor_it() 
{
	if (isIE()) 
	{
		if (document.all.ifrSeat1)
		{
			document.all.ifrSeat1.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=italia&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat2)
		{
			document.all.ifrSeat2.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=italia&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat3)
		{
	document.all.ifrSeat3.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=italia&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
	}
}

function reloadSponsor_en() 
{
	if (isIE()) 
	{
		if (document.all.ifrSeat1)
		{
			document.all.ifrSeat1.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=commer&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat2)
		{
			document.all.ifrSeat2.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=commer&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat3)
		{
	document.all.ifrSeat3.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=commer&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
	}
}

function reloadSponsor_de() 
{
	if (isIE()) 
	{
		if (document.all.ifrSeat1)
		{
			document.all.ifrSeat1.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=deutsch&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat2)
		{
			document.all.ifrSeat2.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=deutsch&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
		if (document.all.ifrSeat3)
		{
	document.all.ifrSeat3.src='http://ad-catgeo.paginegialle.it/html.ng/site=dita&size=120x60&subsite=deutsch&bogus='+Date();
			//document.all.frmSponsor3.src='/includes/sponsor3.asp?bogus='+Date();
		}
	}
}

function apriPopupOPODO() 
{
	if (winOpodo && winOpodo.open())	//esiste gią il popup
	{
		winOpodo.location="/includes/opodo/index.asp?lingua=de"
		winOpodo.focus()
	}
	else
	{
	var winOpodo;	winOpodo=window.open("/includes/opodo/index.asp?lingua=de","winOpodo","toolbar=yes,menubar=yes,scrollbars=yes,location=yes,status=yes,resizable=yes,top=20,left=20,height=430,width=750");
		winOpodo.focus();
	}
}


function apriPopupECard(lingua) 
{
	var ecardWin;
	ecardWin=window.open("/includes/ecards/index.asp?lingua="+ lingua,"ecardWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,top=50,left=50,height=550,width=620");
	ecardWin.focus();
}

function apriPopupVivere(lingua) 
{
	return;
}

function apriPopupDidael(lingua) 
{
	return;
}

function apriPopupAigo() 
{
	var newWin;
	newWin=window.open("/includes/AIGO/RhoneAlpes2003_popup.asp","","toolbar=no,menubar=no,resizable=yes,scrollbars=yes,top=0,left=0,height=550,width=750");
	newWin.focus();
}


function apriPopupB2B()
		{
			var W;
			W=window.open("/motorediscelta/motorediscelta.html","B2B","toolbar=no,menubar=no,scrollbars=yes,top=0,left=50,height=600,width=750");
			W.focus()
		}


// ***************************************************************************************
// Funzioni Adobe per risolvere problema Active Content in IE (attivazione oggetti Flash) 
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

// FINE Funzioni Adobe - Active Content