function setActiveCSSClassName(className)
{
	var contentAreaElement = document.getElementById('cnt_area');

	if (contentAreaElement) {
		contentAreaElement.className = className;
	}
}

function IsEmpty(aTextField) {
   if ((aTextField.value.length==0) ||
   (aTextField.value==null)) {
      return true;
   }
   else { return false; }
}

function clearTXT(txtField , stdString)
{
	if(!IsEmpty(txtField) && txtField.value == stdString){
		txtField.value = '';
	}
}

function addTXT(txtField , stdString)
{
	if(IsEmpty(txtField)){
		txtField.value = stdString;
	}
}

function PrintWIN(zoom_URL)     {
		var centerWidth=(screen.width/2)-(250/2);
		var centerHeight=(screen.height/2)-(950/2);
        var content=window.open(zoom_URL, "printContent", "width=550,height=460,top="+centerHeight+",left="+centerWidth+",location=no,menubar=1,resizable=no,scrollbars=1,status=0,titlebar=no,toolbar=no,directories=no");
        content.focus();
		return false;
}

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;
}

function change_currencies(e, imot) {				
	document.getElementById(imot).innerHTML=e.value;
}