function setActiveCSSClassName(className)
{
	var contentAreaElement = document.getElementById('cnt_area');

	if (contentAreaElement) {
		contentAreaElement.className = className;
	}
}

var foto1;
function CaricaFoto(img) {
	foto1 = new Image();
	foto1.src = (img);
	Controlla(img);
}

function Controlla(img) {
	if ( (foto1.width != 0) && (foto1.height != 0) ) {
		viewFoto(img);
//		alert(foto1.width +"::"+ foto1.height)
	}
	else{
		funzione = "Controlla('" + img + "')";
		intervallo = setTimeout(funzione, 500);
	}
}

function viewFoto(img) {
	largh = foto1.width+20;
	altez = foto1.height+30;
	stringa = "width=" + largh + ",height=" + altez + ",status=0";
//	alert (stringa);
	finestra=window.open(img, "photo_wnd", stringa);
	if (finestra != null)
	{
		finestra.focus();
	}
	else
	{
		alert('Pop up blocker activated!\nTo view large image, please use \'ctl\' + click.');
	}	
		
	return false;
}