function onContent(f){//(C)webreflection.blogspot.com
var a=onContent,b=navigator.userAgent,d=document,w=window,c="onContent",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='//:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,".",c,"()}'></scr","ipt>");
a[c]=(function(o){return function(){a[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)}})(a[c]);
if(d[e])d[e]("DOMContentLoaded",a[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))(function(){/loaded|complete/.test(d[r])?a[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};

function boldLabel(cbox, label)
{
	if (cbox.checked == true)
	{
		document.getElementById(label).style.fontWeight = 'bold';
	}
	else
	{
		document.getElementById(label).style.fontWeight = 'normal';
	}
}

function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}

function chkEstensioneImmagine(file)
{
	var ext = file.substring(file.length - 3, file.length);

	if (ext != "png" && ext != "jpg" && ext != "gif")
	{
		return false;
	}
	else
	{
		return true;
	}
}

function trim(stringa)
{
	while (stringa.substring(0,1) == ' ')
	{
		stringa = stringa.substring(1, stringa.length);
	}
	while (stringa.substring(stringa.length-1, stringa.length) == ' ')
	{
		stringa = stringa.substring(0,stringa.length-1);
	}

	return stringa;
}

function isset(variable_name)
{
	try
    {
        if (typeof(eval(variable_name)) != "undefined")
        if (eval(variable_name) != null)
        return true;
    }
    catch(e) { }
    return false;
}


function refreshIframe(e)
{
    if (e.rel == null)
    {
        e.rel = 'loaded';
        e.src = e.src;
    }
}
