function clear_text(id)
{
	if(id==null)
		return

	id.value = "";
}

function printOrder(_url)
{/* version 1.4.0.00 */
	printWindow = window.open(_url,
		"printWindow","toolbar=0, location=0, status=1, resizable=1, menubar=1, "+
		"scrollbars=1, width=750, height=540");
	printWindow.focus();
} 

(function($){
  $.fn.equalBlocks = function() {
    var tallest = 0,
        rowStart = 0,
        items = [],
        $el,
        topPos = 0;
    
    $(this).each(function() {
      $el = $(this);
      topPos = $el.position().top;
      
      if (rowStart != topPos) {
        // we just came to a new row. Set all the heights on the completed row
        for (i = 0 ; i < items.length ; i++) {
          items[i].height(tallest);
        }
        
        // set the variables for the new row
        items.length = 0; // empty the array
        rowStart = topPos;
        tallest = $el.height();
        items.push($el);
      } else {
        // another item on the current row. Add it to the list and check if it's taller
        items.push($el);
        tallest = Math.max(tallest, $el.height());
      }
      
      // do the last row
      for (i = 0 ; i < items.length ; i++) {
        items[i].height(tallest);
      }
    });
  }
})(jQuery);

$(document).ready(function() {
	// brisanje tinymce praznog <p> </p>
	$('p:empty').remove();
	
	$("#hala_4, #hala_1, #hala_1a, #hala_2").mousemove(function(e){
		$("#tooltip_" + this.id).fadeIn();
		$("#tooltip_" + this.id).css({
			top: (e.pageY) + "px",
			left: (e.pageX + 50) + "px"
		});
	});
	
	$("#hala_4, #hala_1, #hala_1a, #hala_2").mouseout(function(e){
		$("#tooltip_" +  this.id).fadeOut();
	}); 
	
	$('ul.galCatList li').equalBlocks();
});

