// JavaScript Document

/**
   * Called to close all quick reply boxes. Enables all reply buttons.
   */
  function FechaTodosFormsConsulta(texts_prefix){
  
    
      var max = 10;
    

    for (var i = 1; i <= max; i++) {
      var text = document.getElementById(texts_prefix + i);
      if(text == null)
        break;
      text.style.display = "none";
    }
    
    // toggles the reply result message.
    //var message = document.getElementById("quickReplyResult");
    //if (message) {
    //  message.style.display = "none";
    //}
  }
  
  /**
   * Called to open a particular Quick Reply box. Disables the respective button.
   */
  function FormConsulta(obj, boxprefix, textprefix, id) {

	// changes the requested box state
	var box = document.getElementById(boxprefix + id);    

// closes all
    if ( box.style.display == 'block' ) { FechaTodosFormsConsulta(boxprefix, "reply_link_"); }
	
	else {

		// shows the quick reply box
		box.style.display = 'block';
		
		// set focus on the textarea
		var text = document.getElementById(textprefix + id);
		text.value="";
		text.focus();
	
		// and disables the quick reply link
		//alert(obj.style.color);
		//obj.style.color="#000000";
	}
   }