function apriEmail() {
		document.getElementById('contact').style.visibility='visible'; 
		completeAHAH.ahah('contatta.html', 'contact', '', 'GET', '', this);
}
function chiudiEmail() {
		document.getElementById('contact').style.visibility='hidden'; 
		completeAHAH.ahah('contatta.html', 'contact', '', 'GET', '', this);
}
function inviaEmail() {
		//document.getElementById('contact').style.visibility='hidden'; 
		completeAHAH.ahah('contatta.php', 'contact', '', 'GET', '', this);		
}

function showTab(name) {		completeAHAH.ahah('toptabmenu_'+name+'.php', 'topcontent', '', 'GET', '', this);
}

function openPopupDettagliTrasmissione2(anno,numero)
{
  WindowObjectReference = window.open("data/trasmissione/"+anno+"/"+numero+".html",
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
}
function openPopupDettagliTrasmissione(anno,numero)
{
		completeAHAH.ahah('data/trasmissione/'+anno+'/'+numero+'.html', 'archivio', '', 'GET', '', this);
}

function advShowCode(id)
{
		document.getElementById(id).style.visibility='visible';
		document.getElementById(id).rows='5';
		document.getElementById(id).cols='60';
}
function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
} 
function mostradettagli(object) {
		document.getElementById('dettagliWin').style.visibility='visible'; 
		//ahah('data/squadra/'+object+'.html', 'dettagli');
		//completeAHAH.ahah('data/squadra/'+object+'.html', 'dettagli', '', 'GET', '', this);
		
    $.ajaxSetup ({  
        cache: false  
    });  
    var ajax_load = "<img src='img/load.gif' alt='loading...' />";  
  
//  load() functions  
    var loadUrl = 'data/squadra/'+object+'.html';  
    alert(loadUrl);
    $("#load_basic").click(function(){  
        $("dettagli").html(ajax_load).load(loadUrl);  
    }); 
}

function showmenu(object) { 
		var smelement = document.getElementById("sm_"+object);
		var left = document.getElementById(object).offsetLeft;
		var width = document.getElementById(object).offsetWidth - 2;
		var top = document.getElementById(object).offsetTop + document.getElementById(object).offsetHeight;
		//alert('posleft:'+left);
		//alert('width:'+width);
		//alert('object:'+object);
		//alert('top:'+top);
		smelement.style.width=width+'px';
		smelement.style.left=left+'px';
		smelement.style.top=top+'px';
		smelement.style.visibility='visible';
		//document.getElementById(object).className='menuopen';
		//document.getElementById(object).style.border='1px solid white';
		//document.getElementById(object).style.borderBottom='0px';
		//document.getElementById(object).style.backgroundColor='#64B1FF';
		//document.getElementById(object).style.color='#000000';
		var homewidth = document.getElementById('homepage').offsetWidth - 2;
		document.getElementById('sidebar_left').style.width=homewidth+'px';
		
}
function hidemenu(object) {
		document.getElementById("sm_"+object).style.visibility='hidden';
		//document.getElementById(object).className='menuclosed';
		//document.getElementById(object).style.border='1px solid white';
}

function Button1_onclick() 
{
    //faccio la richiesta alla pagina a.asp che restituisce
    //<p>Ciao</p><_script language=\"javascript\">alert('pippo')</_script>
    //ajax("a.asp", onload);
    //showTab('photogalleryload');
    function onload()
    {
		//t contiene la risposta
		var t = this.request.responseText;
		
		//execJS esegue javascript contenuto in t e restituisce
		//t senza javascript
		t = execJS(t);
		
        //finalmente metto t 'pulito' dento il div
        $("div1").innerHTML = t;
        
    }
}

function share(site,url,title) {
  if (site == 'facebook'){
WindowObjectReference = window.open("http://www.facebook.com/sharer.php?u="+url+"&t="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");    } else if (site == 'digg'){
WindowObjectReference = window.open("http://digg.com/submit?phrase=2&url="+url+"&title="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");   
  } else if (site == 'delicious'){
WindowObjectReference = window.open("http://del.icio.us/post?url="+url+"&title="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no"); 
  } else if (site == 'myspace'){
WindowObjectReference = window.open("http://www.myspace.com/Modules/PostTo/Pages/?u="+url+"&t="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'live'){
WindowObjectReference = window.open("https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url="+url+"&title="+title+"&top=1",
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'google'){
WindowObjectReference = window.open("http://www.google.com/bookmarks/mark?op=edit&bkmk="+url+"&t="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'twitter'){
WindowObjectReference = window.open("http://twitter.com/timeline/home/?status=NapoliPassion%20"+url+"via+%40NapoliPassion",
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'oknotizie'){
WindowObjectReference = window.open("http://oknotizie.alice.it/post?url="+url+"&title="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'yahoo'){
WindowObjectReference = window.open("http://bookmarks.yahoo.com/toolbar/savebm?opener=tb&u="+url+"&t="+title,
        "DescriptiveWindowName",
        "width=670,height=550,resizable,scrollbars=yes,status=1,statusbar=no");
  } else if (site == 'more'){
        document.getElementById("sharemore-"+url).style.display='';
  } else {
    alert("Handler could not be removed");
    
  }
}

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}

