// Funzioni gestione campo search
function emptyField(f){if(f.defaultValue==f.value){f.value='';}}
function fillField(f){if(f.value==''){f.value=f.defaultValue;}}

if (window.addEvent) {
    window.addEvent('domready', function(){
        // Cambio icone pdf, stampa, mail
        var tdIcons = $$('.buttonheading'); // td contenenti le icone
        tdIcons.each(function(el,index){
            var a = el.getFirst('a');
            var r = index % 3;
            if (a) {
                switch(r){
                    case 0: a.setStyle('backgroundImage','url("/templates/silix_dot_org/images/icons/pdf.png")'); break;
                    case 1: a.setStyle('backgroundImage','url("/templates/silix_dot_org/images/icons/print.png")'); break;
                    case 2: a.setStyle('backgroundImage','url("/templates/silix_dot_org/images/icons/mail.png")'); break;
                }
            }
        });
	
	// Assegno onclick a link in nuova finestra
	$$('.blank').each(function(el) {
		el.addEvent('click', function(event){
			event = new Event(event);
			event.stopPropagation;
			window.open(el.href);
			//return false;
		});
	});
    });
}
