var stile = "top=10, left=10, width=340, height=460, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=no";
var stile2 = "top=10, left=10, width=310, height=186, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=no";
var stile2b = "top=10, left=10, width=310, height=230, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=no";
var stile3 = "top=5, left=5, width=780, height=580, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=yes";
var stile4 = "top=18, left=18, width=700, height=505, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=yes";

function mostra_nascondi_pannello(elemento, imgTag) {
	if (window.navigator.userAgent.toLowerCase().match("gecko")){ // è un browser gecko (firefox ecc.)
 		document.poppedLayer = eval("document.getElementById(elemento)");
		oggIMG = eval("document.getElementById(imgTag)");
	}else if (document.all){ //è IE
 		document.poppedLayer = eval("document.getElementById(elemento)");
		oggIMG = eval("document.getElementById(imgTag)");
	}else{ // è altro da (firefox, IE, ecc.)
 		document.poppedLayer = eval("document.layers[elemento]");
		oggIMG = eval("document.layers[imgTag]");
	} 

	if (document.poppedLayer.style.display == "none"){
		imgTag.src = 'immagini/nascondi_marcatori.png';
		document.poppedLayer.style.display = "inline";
		
	}else{
		imgTag.src = 'immagini/mostra_marcatori.png';
		document.poppedLayer.style.display = "none";
	}
 
}

function cambia_piu_meno(imgTag) {
	if (imgTag.src == 'immagini/mostra_marcatori.png'){
		imgTag.src = 'immagini/nascondi_marcatori.png';
	}else{
		imgTag.src == 'immagini/mostra_marcatori.png'
	}
 
}

function AudioPopup(nf, t) {
    window.open('ascoltaintervento.asp?nomeFile=' + nf + '&titolo=' + t, "", stile2);
}

function AudioPopup2(nf, t) {
    window.open('ascoltaintervento2.asp?nomeFile=' + nf + '&titolo=' + t, "", stile2);
}

function AudioPopupSPOT(nf, t, s) {
    window.open('ascoltainterventospot.asp?nomeFile=' + nf + '&titolo=' + t + '&sito=' + s, "", stile2b);
}

function Popup(apri) {
    window.open(apri, "", stile);
}

function PopupCentrata() {
	var w = 400;
   	var h = 250;
   	var l = Math.floor((screen.width-w)/2);
   	var t = Math.floor((screen.height-h)/2);
    window.open("mioFile.htm","","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
}

function gestisciTabellini(codT) {
	window.open("tabellino.asp?codPartita=" + String(codT),"", stile3);
}

var stileSquadra = "top=5, left=5, width=790, height=630, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=yes";

function visualizzaSquadra(codT, t) {
	window.open("dettaglioSquadra.aspx?codSquadra=" + String(codT),"", stileSquadra);
}


function openMotivo(motivo){
	alert(motivo);
}

var stileGiocatore = "top=5, left=5, width=440, height=640, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=yes";
function apriGiocatore(idGiocatore){
    window.open("dettaglioGiocatore.aspx?codGiocatore=" + String(idGiocatore),"", stileGiocatore);
}

function gestisciTabelliniTesto(codT, tipo) {
	window.open("tabellino_testo.asp?codPartita=" + String(codT) + "&tipo=" + String(tipo),"", stile3);
}


var stilePopUpDirettaAudio = "top=10, left=10, width=410, height=400, status=no, statusbar=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=auto";

function PopupDirettaAudio(apri) {
	window.open(apri, "", stilePopUpDirettaAudio); 
}

function partitaInTempoReale(momentiSalienti, formazioni) {
	window.open("partitaInTempoReale/partita_in_tempo_reale.asp?idMomentiSalienti=" + String(momentiSalienti) + "&idFormazioni=" + String(formazioni),"", stile4);
}

function elezioniInTempoReale(momentiSalienti, formazioni) {
	window.open("elezioniInTempoReale/elezioni_in_tempo_reale.asp?idMomentiSalienti=" + String(momentiSalienti) + "&idFormazioni=" + String(formazioni),"", stile4);
}



