var _POPUP_FEATURES = 'resizable=yes,location=0,statusbar=0,menubar=0,width=800,height=500';

function raw_popup(url, target, features) {
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function isUndefined(v) {
    var undef;
    return v===undef;
}

//



//USATA PER SEARCH DI NOTIZIE

function mostraPer(tipo){

	var dispTesto = '';
	var dispFoto = '';

	if (tipo == 'titoli'){
		dispTesto = 'none';
		dispFoto = 'none';
	}else if (tipo == 'testi'){
		dispFoto = 'none';
		dispTesto = '';
	}

	for(i=0; i<document.images.length; i++){
		if (document.images[i].name=='img-notizia'){
			document.images[i].style.display = dispFoto;
		}
	}

	for(i=0; i<document.getElementsByTagName('DIV').length; i++){
		if (document.getElementsByTagName('DIV')[i].id=='testo-notizia'){
			document.getElementsByTagName('DIV')[i].style.display = dispTesto;
		}
	}

}


function o(url,name,options) {
	var wnd = window.open(url, name, options);
}
