function imageview (imagepath,w,h,wtitle) {
	var wname =  "img" + ((new Date().getSeconds() * 31) + new Date().getDate());
	var wo = window.open(imagepath, wname , "directories=no,menubar=no,resizable=no,top=120,left=50,width=" + ( w ) + ",height=" + ( h ) , false);
	wo.document.write('<HEAD><script language="javascript"> function closeme() { self.close(); wo = null ; }<');
	wo.document.write("/script>");
	wo.document.write('<TITLE>' + wtitle + '</TITLE></HEAD>');
	wo.document.write('<body>');
	wo.document.write('<div style="position: absolute; left:0px; top:0px;">');
	wo.document.write('<a href="javascript:closeme();">');
	wo.document.write('<img src="' + imagepath + '" width="' + w + '" height="' + h + '" border="0" alt="Chiudi">');
	wo.document.write('</a>');
	wo.document.write('</div>');
	wo.document.write('</body>');
}

function openwin(filename,w,h) {	
	win = open(filename, 'dettagli', 'resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, width='+w+', height='+h+', left=200, top=100');	
	win.focus();	
}

function hideObject(id)	{	document.getElementById(id).style.visibility = "hidden";	}
function showObject(id)	{	document.getElementById(id).style.visibility = "visible";	}

/*Drop box scripts*/

var TimeLimit	= 600;
var TimeCount	= 0;
var DropBox	= 0;

document.onclick = CloseBox; 	// se il focus va altrove chiudo il box

function openmenu(id)	{	
	// creo il layer nascosto
	timeoutrestart();		// azzero il time counter
	DropBox = document.getElementById(id);
	DropBox.style.visibility = 'visible';	// imposto a visibile il box
	}
	
function CloseBox()	{	if(DropBox) DropBox.style.visibility = 'hidden';	}

function boxtimeout()	{	TimeCount = window.setTimeout(CloseBox, TimeLimit);	}

function timeoutrestart()	{
	// azzero il timeout counter
	if(TimeCount)	{	window.clearTimeout(TimeCount);	TimeCount = null;	}
} 

/* Tiscover script */
function openWFitness(idH, L) {	
window.open("http://www.fitness.trentino.to/pop_offerta/offerta.asp?idH="+ idH+"&L="+L,"Fitness","status=0,toolbar=0,resizable=0,scrollbars=1,width=550,height=600");
}
