<!-- begin hide here for non-Javascript-enabled browsers
/*
	Funzione per accendere/spegnere da 1 a n oggetti
	USO:			UB_showHideObject('IDobj1','flag1','IDobj2','flag2','IDobj3','flag3',.....,'IDobjN','flagN');
	VARIABILI:	'IDobj1','IDobj2','IDobj3',.....,'IDobjN' corrisponde all'ID dell'oggetto/i che si vuole accendere/spegnere
					'flag1','flag2','flag3',.....,'flagN' corrisponde allo stato relativo alla visualizzazione dell'oggetto/i; i possibili valori che esso puo' assumere sono: on|off | none|inline|block
					NB: per comodita' d'uso on='block' e off='none'
*/
function UB_showHideObject() { //v2.0
var i,p,v,obj,args=UB_showHideObject.arguments;
for (i=0; i<(args.length-1); i+=2) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+1];
if (obj.style) { obj=obj.style; v=(v=='off')?'none':(v=='on')?'block':v; }
obj.display=v; }
}
function DB_showHideObject(obj)
{
	document.getElementById(obj).style.display = document.getElementById(obj).style.display != 'block'?'block':'none';
}

function UB_showHideNode() { //v1.1
var i,v,obj,args=UB_showHideNode.arguments;
for (i=0; i<(args.length-1); i+=2) {obj=args[i];v=args[i+1];
if (obj.style) { obj=obj.style; v=(v=='off')?'none':(v=='on')?'block':v;}
obj.display=v;	}
}

/*
	Funzione per cambiare classe ad 1 --> n oggetti
	USO:			UB_changeClass('IDobj1','class1','IDobj2','class2','IDobj3','class3',.....,'IDobjn','classN');
	VARIABILI:	'IDobj1','IDobj2','IDobj3',.....,'IDobjN' corrisponde all'ID dell'oggetto/i a cui si vuole cambiare la classe
					'class1','class2','class3',.....,'classN' corrisponde al nome della classe che si vuole applicare all'oggetto/i
*/
function UB_changeClass() { //v1.0
	var i,myObj,myClass,args=UB_changeClass.arguments;
	for (i=0; i<(args.length-1); i+=2) {
		myObj=MM_findObj(args[i]);
		myObj.className=args[i+1];
	}
}

function UB_changeClassLibrary(id,firstClass,secondClass) { //v1.0
	
	var obj = MM_findObj(id);
	if(obj.className== firstClass)
	{
		obj.className=secondClass;
	}
	else
	{
		obj.className=firstClass;
	}
	
}

/*
	funzione generica per aprire popup centrate nello schermo di dimensioni variabili
	USO:			UB_genericPop('nomefile.xxx','nonePop',400,300);
	VARIABILI:	myUrl			URL del file che si vuole aprire in popup
					myWinName	nome assegnato alla popup (puo' anche non assumere alcun valore = '')
					myWidth		larghezza della popup espressa in pixel
					myHeight		altezza della finestra espressa in pixel
					myPars		parametri aggiuntivi; se omessa vengono settati di default i seguenti valori: "toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0"
*/
function UB_genericPop(myUrl,myWinName,myWidth,myHeight,myPars) { //v1.1
	var winLeft=(screen.availWidth-myWidth)/2;
	var winTop=(screen.availHeight-myHeight)/2;
	parameters=myPars+'';
	if(parameters=='') {parameters=',toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0'};
	newPop=window.open(myUrl,myWinName,'width='+ myWidth +',height='+ myHeight +',left='+ winLeft +',top='+ winTop + parameters);
	newPop.focus();
}


function ControlloValore(MyObj,MyText){
if(MyObj.value==MyText)MyObj.value='';
}

//funzione che apre il messenger
function openChatMessenger(receiver, sender, noresize) 
{
    var name = "messenger_" + receiver + "_" + sender;
    var url = "http://www.mtv.it/chat/messenger.aspx";
    var width=468;
    var height=430;
    url += "?receiver=" + receiver;
    url += "&sender=" + sender;
    name = name.replace(/[^\w\d]/, "_");
    name = name.replace(/undefined/, "_");
    
	var left = Math.round((screen.width - width) / 2);
	var top = Math.round((screen.height - height) / 2);
	var styleStr = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no";
	styleStr += ",resizable=" + (noresize ? "no" : "yes"); 
	styleStr += ",width=" + width	+ ",height=" + height; 
	styleStr += ",left=" + left + ",top=" + top;
	styleStr += ",screenX=" + left + ",screenY=" + top;
    
	window.open(url, name, styleStr);
}

// end hide -->

