var currenty_open;
var oldHeight;
function show_printer_info(event, id) {
  
  if(typeof(event.pageY) == 'undefined'){event.pageY = event.y;}
  
  if (typeof(currently_open) !== 'undefined' && currently_open != null && currently_open.id != id) {
	  if(typeof(oldHeight) !== 'undefined' && oldHeight != null) {
		  document.getElementById('browse_frame').style.height = oldHeight + 'px';
		  oldHeight = null;
	  }
	  currently_open.style.display = "none";
  }

  if (document.getElementById(id).style.display == "none") {
	  document.getElementById(id).style.display = "block";
	  if(document.getElementById(id).offsetHeight + event.pageY > document.height) {
		  oldHeight = document.getElementById('browse_frame').offsetHeight;
		  document.getElementById('browse_frame').style.height = oldHeight + (30 + document.getElementById(id).offsetHeight + event.pageY - document.height) + "px";
	  }

	  currently_open = document.getElementById(id);
  }
  else {
	  if(typeof(oldHeight) !== 'undefined' && oldHeight != null) {
		  document.getElementById('browse_frame').style.height = oldHeight + 'px';
		  oldHeight = null;
	  }
	  document.getElementById(id).style.display = "none";
	  currently_open = null;
  }
}

function set_items_per_page(number) {
	document.getElementById('items_per_page').value = number;
	document.getElementById('product_sort_page_form').submit();
}
