function checksimplesearch(f) {
  return true;
}
//questa puo' sempre servire, per ora la lascio anche se non viene mai invocata
function resizeimages(){
  var max_width = 120;
  pix = document.getElementsByName('content_img');
  //pix = document.getElementById(whichId).getElementsByTagName('img')
  //pix = document.images;
  for (i=0; i<pix.length; i++) {
    while ( !pix[i].complete ){
      break;
    }
    w=pix[i].width;
    h=pix[i].height;
    if (w > max_width) {
      f=1-((w - max_width) / w);
      pix[i].width=w * f;
      pix[i].height=h * f;
    }
  }
}

//gestire eventuali errori nei parametri (da fare nel php)
function controllaricerca(f) {
	if (f.id_editore.selectedIndex==0) {
		alert("Seleziona un editore");
		return false;
	}
	return true;
}

function controllaricerca2(f) {
	return true;
}

function controllaricercaquick(f) {
	if (f.titolo_collana.value=="" && f.titolo_albo.value=="") {
		alert("E' obbligatorio impostare almeno uno tra titolo collana e titolo albo");
		f.titolo_collana.focus();
		return false;
	}
	return true;
}

/*
function apridettaglioart(cod) {
	properties = "width=500,height=300,scrollbars=1,resizable=0";
	url = "dettaglioart.php?cod=" + cod;
	det=window.open(url,"det",properties);
	det.focus();
}
*/
function apridettaglioart(id) {
	url = "dettaglioart.php?id=" + id;
	x = 800;
	y = 600;
  properties = "width=" + x +",height=" + y +",scrollbars=1,resizable=1";
	popup=window.open(url,"popup",properties);
	popup.focus();
	//location.href = url;
}

function apripopup(url,x,y) {
	properties = "width=" + x +",height=" + y +",scrollbars=1,resizable=1";
	popup=window.open(url,"popup",properties);
	popup.focus();
}

function indietro() {
	history.back();
	return false;
}

function stampa() {
	window.print();
	return false;
}

function stampacarrello() {
	properties = "width=700,height=700,scrollbars=1,resizable=1";
	url = "carrellostampa.php";
	carprint=window.open(url,"carprint",properties);
	carprint.focus();
}

