function checkcontent2() 
{
	var find=0;
	var sNosub=document.search.ricerca.value;
	if (sNosub=="") 
		return (false); 
	else 
	{
		for (var loc=0; loc <= sNosub.length; loc++) 
		{
			if (find==0) 
			{
				if (sNosub.charAt(loc) == " ") 
					document.search.ricerca.value=sNosub.substring(loc+1, sNosub.length)
				else 
					find=1;
			}
		}
	} 
	if (document.search.ricerca.value=="") 
		return (false); 
	if (find== 1) 
		return (true);
	else return (false);
}

function roll(quale,over) {
	if (document.all){
		var obj
		if ((document.all) && (over)) {
			obj='document.all["rigo' + quale +'"].bgColor="#E7E7E7"'
			eval (obj);
			obj='document.all["testo' + quale +'"].style.color="#913741"'
			eval (obj);
		}
		if ((document.all) && (!over))  {
			obj='document.all["rigo' + quale +'"].bgColor="#FFFFFF"'
			eval (obj);
			obj='document.all["testo' + quale +'"].style.color="#000000"'
			eval (obj);
		}
	}
}

var iswindowopen = false;
var mw;
function popupFoto(theURL,winName,wSize,hSize)
{
        if (iswindowopen) {
                if (!mw.closed){
                  mw.close();
                 }
        }
        var xOffset = 20; yOffset = 20;
				if (window.screen.availHeight<720)
				{
        	if (navigator.appname != 'Netscape'){
        		mw = window.open(theURL,winName,'width='+wSize+',height='+hSize+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
        	}else{
        		mw = window.open(theURL,winName,'screenX='+wSize+',screenY='+hSize+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
        	}
				}
				else
				{
        	if (navigator.appname != 'Netscape'){
        		mw = window.open(theURL,winName,'width='+wSize+',height='+568+',scrollbars=no,resizable=no,top='+yOffset+',left='+xOffset+'');
        	}else{
        		mw = window.open(theURL,winName,'screenX='+wSize+',screenY='+568+',scrollbars=no,resizable=no,top='+yOffset+',left='+xOffset+'');
        	}
				}
        mw.focus();
        iswindowopen = true;
}

function popUpVideo(url)
{
window.open(url, 'videopopup', 'height=406,width=480,  left = 100, top = 50, location=0, toolbars=0, scrollbars=0, statusbars=0, menubars=0, resizable=0 ');
}

function popUpVideo2(url,nome)
{
window.open(url, nome, 'height=406,width=480,  left = 100, top = 50, location=0, toolbars=0, scrollbars=0, statusbars=0, menubars=0, resizable=0 ');
}

function popUpAudio(url)
{
window.open(url, 'audiopopup', 'height=326,width=480,  left = 100, top = 50, location=0, toolbars=0, scrollbars=0, statusbars=0, menubars=0, resizable=0 ');
}



var iswindowopen = false;
var mw;
function popupInfog(theURL,winName)
{
	var wSize=520;
	var hSize=538;
        if (iswindowopen) {
                if (!mw.closed){
                  mw.close();
                 }
        }
        var xOffset = 20; yOffset = 5;
       	if (navigator.appname != 'Netscape'){
       		mw = window.open(theURL,winName,'width='+wSize+',height='+hSize+',scrollbars=no,resizable=no,top='+yOffset+',left='+xOffset+'');
       	}else{
       		mw = window.open(theURL,winName,'screenX='+wSize+',screenY='+hSize+',scrollbars=no,resizable=no,top='+yOffset+',left='+xOffset+'');
       	}
        mw.focus();
        iswindowopen = true;
}

function createPopup(popupfile,w,h)
{
  var hwnd;
  hwnd = window.open (popupfile, 'popup', 'width='+w+',height='+h+',scrollbars=yes,toolbar=no,noresize,menubar=no,screenX=120,screenY=50,top=50,left=120');
  if(!hwnd.opener) hwnd.opener=self;
  if(hwnd.focus!=null) hwnd.focus();
  return false;
}

function createPopup2(popupfile,w,h)
{
  var hwnd;
  hwnd = window.open (popupfile, 'euroconv', 'width='+w+',height='+h+',scrollbars=no,toolbar=no,noresize,menubar=no,screenX=180,screenY=200,top=200,left=180');
  if(!hwnd.opener) hwnd.opener=self;
  if(hwnd.focus!=null) hwnd.focus();
}

function MM_openBrWindow2(theURL,winName,features) { //v2.0
  var hwnd;
  hwnd=window.open(theURL,winName,features);
  if(!hwnd.opener) hwnd.opener=self;
  if(hwnd.focus!=null) hwnd.focus();
  }

function createPopupAuthor(popupfile) {
  //alert("Creiamo il popup "+popupfile);
  var hwnd;
  hwnd = window.open (popupfile, 'popupauthor', 'width=520,height=460,scrollbars=no,toolbar=no,noresize,menubar=no,screenX=120,screenY=50,top=50,left=120');
  if(!hwnd.opener) hwnd.opener=self;
  if(hwnd.focus!=null) hwnd.focus();
  return false;
}

var iswindowopenNwsl = false;
var mwNwsl;
function popupNwsl(theURL,winName,wSize)
{
        if (iswindowopenNwsl) {
                if (!mwNwsl.closed){
                  mwNwsl.close();
                 }
        }
        var xOffset = 120; yOffset = 20;
	if (window.screen.availHeight<720)
	{
       	    if (navigator.appname != 'Netscape'){
        	mwNwsl = window.open(theURL,winName,'width='+wSize+',height='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
        	mwNwsl = window.open(theURL,winName,'screenX='+wSize+',screenY='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
	}
	else
	{
            if (navigator.appname != 'Netscape'){
        	mwNwsl = window.open(theURL,winName,'width='+wSize+',height='+680+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
        	mwNwsl = window.open(theURL,winName,'screenX='+wSize+',screenY='+680+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
	}
        mwNwsl.focus();
        iswindowopenNwsl = true;
}

var iswindowopenMM = false;
var mwMM;
function MM_openBrWindow(theURL,winName,wSize)
{
        if (iswindowopenMM) {
                if (!mwMM.closed){
                  mwMM.close();
                 }
        }
        var xOffset = 90; yOffset = 20;xOffsetH = 170;yOffsetH = 60;
	if (window.screen.availHeight<720)
	{
       	    if (navigator.appname != 'Netscape'){
        	mwMM = window.open(theURL,winName,'width='+wSize+',height='+540+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
        	mwMM = window.open(theURL,winName,'screenX='+wSize+',screenY='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
	}
	else
	{
            if (navigator.appname != 'Netscape'){
        	mwMM = window.open(theURL,winName,'width='+wSize+',height='+600+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }else{
        	mwMM = window.open(theURL,winName,'screenX='+wSize+',screenY='+580+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }
	}
        mwMM.focus();
        iswindowopenMM = true;
        return false;
}

function CreaParamVeloce() {
    if (document.RicVeloce.NOMERADIO[1].checked == true) {
    	// FONDI
      var miastringa='http://fondi.iol.it/cobranding/iol/?r=quickrank/?search=' + document.RicVeloce.STRING.value;
			var s = window.open(miastringa, 'QuickSearch', 'height=500,width=650,menubar,location,toolbar,scrollbars,resizable');
			s.focus();
    }
    else {
    	// AZIONI
		  var miastringa = document.RicVeloce.STRING.value;
			var url = 'http://mercati.iol.it/xplaneweb/iolf/XpIsapi.dll?page=RicercaRisultatoAzioni&SH_QUERY=F95000="Az.Milano"';
		  var myparam = '';
      if (miastringa != ''){ 
      	myparam = ' AND ("' + miastringa + '" is substring of F10011' + ' OR "' + miastringa + '" is substring of F10014)';
      }
			var param = url + escape(myparam) + '&STRING=&CHAIN_V=Az.Milano&CHAIN_Vdesc1=Az.Milano';
			//alert(param);
			var s = window.open(param, 'QuickSearch', 'height=500,width=650,menubar,location,toolbar,scrollbars,resizable');
			s.focus();	
    }
	return false;    	
}

function invioNews(tit)
{
  createPopup('/invio_news2.jhtml?url='+window.location+'&titolo='+tit,520,460);
  return false;
}

function stampaNews()
{
  createPopup('/stampa_news.jhtml?url='+window.location+'&tipo=news',630,460);
  return false;
}

function stampaNoi2000Mail()
{
  createPopup('/stampa_news.jhtml?url='+window.location+'&tipo=noi2000mail',630,460);
  return false;
}

function checkcerca() 
{
	var find=0;
	var sNosub=document.cerca.ricerca.value;
	if (sNosub=="") 
		return (false); 
	else 
	{
		for (var loc=0; loc <= sNosub.length; loc++) 
		{
			if (find==0) 
			{
				if (sNosub.charAt(loc) == " ") 
					document.cerca.ricerca.value=sNosub.substring(loc+1, sNosub.length)
				else 
					find=1;
			}
		}
	} 
	if (document.cerca.ricerca.value=="") 
		return (false); 
	if (find== 1) 
		return (true);
	else return (false);
}

function whatBrowser() {
        bAgt = navigator.userAgent.toLowerCase();
        if (bAgt.indexOf("mac") != -1) {
		window.location="help_personalizza.jhtml";
		return(false);
        }
	if (navigator.appName == 'Microsoft Internet Explorer') {
		var version = navigator.appVersion;
		var myVersion = version.substring(0,1);  //4);
		if (myVersion <= 3)
		window.location="help_personalizza.jhtml";
		return(false);
	} else {
		window.location="help_personalizza.jhtml";
		return(false);
	}
}

var iswindowopenMM = false;
var mwMM;
function MM_openBrWindow3(theURL,winName,wSize)
{
        if (iswindowopenMM) {
                if (!mwMM.closed){
                  mwMM.close();
                 }
        }
        var xOffset = 90; yOffset = 20;xOffsetH = 170;yOffsetH = 60;
	if (window.screen.availHeight<720)
	{
       	    if (navigator.appname != 'Netscape'){
        	mwMM = window.open(theURL,winName,'width='+wSize+',height='+540+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
        	mwMM = window.open(theURL,winName,'screenX='+wSize+',screenY='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
	}
	else
	{
            if (navigator.appname != 'Netscape'){
        	mwMM = window.open(theURL,winName,'width='+wSize+',height='+600+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }else{
        	mwMM = window.open(theURL,winName,'screenX='+wSize+',screenY='+580+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }
	}
        mwMM.focus();
        iswindowopenMM = true;
}

function checkSondaggio()
{
    bol= 0;
    for (i=0; i<= document.frmSondaggio.votazione.length-1; i++) {
      if (document.frmSondaggio.votazione[i].checked == 1) bol=1;
    }

    if (bol==0)
      {
        alert("Attenzione! Bisogna fare almeno una scelta");
        return (false)
      };

    if (bol==0) return true;
}

var iswindowopenWC = false;
var mwWC;
function WC_openWebcam(theURL,winName,wSize)
{
        if (iswindowopenWC) {
                if (!mwWC.closed){
                  mwWC.close();
                 }
        }
        var xOffset = 60; yOffset = 20;xOffsetH = 170;yOffsetH = 10;
	if (window.screen.availHeight<720)
	{
       	    if (navigator.appname != 'Netscape'){
        	mwWC = window.open(theURL,winName,'width='+wSize+',height='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
        	mwWC = window.open(theURL,winName,'screenX='+wSize+',screenY='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
	}
	else
	{
            if (navigator.appname != 'Netscape'){
        	mwWC = window.open(theURL,winName,'width='+wSize+',height='+690+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }else{
        	mwWC = window.open(theURL,winName,'screenX='+wSize+',screenY='+690+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }
	}
        mwWC.focus();
        iswindowopenWC = true;
        return false;
}

var iswindowopenFOTO = false;
var mwFOTO;
function popupFotoAnsa(theURL)
{
        winName='';
        wSize=620;
        if (iswindowopenFOTO) {
                if (!mwFOTO.closed){
                  mwFOTO.close();
                 }
        }
        var xOffset = 60; yOffset = 20;xOffsetH = 170;yOffsetH = 10;
        if (window.screen.availHeight<720)
        {
            if (navigator.appname != 'Netscape'){
                mwFOTO = window.open(theURL,winName,'width='+wSize+',height='+540+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }else{
                mwFOTO = window.open(theURL,winName,'screenX='+wSize+',screenY='+520+',scrollbars=yes,resizable=yes,top='+yOffset+',left='+xOffset+'');
            }
        }
        else
        {
            if (navigator.appname != 'Netscape'){
                mwFOTO = window.open(theURL,winName,'width='+wSize+',height='+600+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }else{
                mwFOTO = window.open(theURL,winName,'screenX='+wSize+',screenY='+590+',scrollbars=yes,resizable=yes,top='+yOffsetH+',left='+xOffsetH+'');
            }
        }
        mwFOTO.focus();
        iswindowopenFOTO = true;
}
