function RefreshWindow() { 
	window.location.reload()
}
	
function apripopup(gloss)
{
	window.open('/www_include/fad_crpa/include/popup.cfm?gloss='+gloss,'mywin','left=20,top=20,width=440,height=350,toolbar=0,resizable=0,scrollbars=1');
}

function NewWindow(mypage,myname,w,h,scroll){

  if (w == "") w = 500 ;
	if (h == "") h = 300 ;
	if (myname == null) myname = 'mywin' ;
	
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+
	',resizable,status=yes,titlebar=yes,menubar=yes'
	
	win = window.open(mypage,myname,settings)
	if(win.window.focus){win.window.focus();}
}

function apripopupdoc(param,w,h,scroll,myname)
{
 	// L'offset necessario per visualizzare nella finestra anche
	// il pulsante "chiudi"
	var h_offset = 150;
	var w_offset = 50;

	if (w == null || w == "100%") w = 550 ;
	if (h == null || h == "100%") h = 500 ;
	
	var url = '/www_include/fad_crpa/include/popup_fad.cfm?'+param+'&w='+w+'&h='+h;
	
  NewWindow (url, myname, w+w_offset, h+h_offset, scroll);

}


function getEl(id)
{
    element = document.getElementById(id);

    return element;
}

function hideEl(id)
{
    var element = getEl(id);

    element.style.display = 'none';
}

function showEl(id)
{
    var element = getEl(id);

    element.style.display = '';
}

function ShowHide(sid)
{
    var el = 'info_' + sid;

    if(getEl(el).style.display == 'none') {

        showEl(el);
        showEl('meno_info_' + sid);
        hideEl('piu_info_' + sid);

    } else {

        hideEl(el);
        showEl('piu_info_' + sid);
        hideEl('meno_info_' + sid);

    }
}
