/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

  function CallDialog (dialogWidth, dialogHeight,modal,divid){
      var id = "#"+divid;
      document.getElementById(divid).style.width= dialogWidth+'px';
      document.getElementById(divid).style.height= dialogHeight+'px';
      //$(id).css("", dialogWidth);
      //$(id).css("", dialogHeight);
      ShowDialog(modal,id);
  }

   function ShowDialog(modal,id)
   {
       
      $("#overlay").show();
      $(id).fadeIn(300);

      if (modal)
      {
         $("#overlay").unbind("click");
      }
      else
      {
	
         $("#overlay").click(function (e)
         {
	     
            HideDialog(id);
         });
      }
   }

   function HideDialog(id)
   {
      $("#overlay").hide();
      $(id).fadeOut(300);
      var allTDs = document.getElementsByTagName('TD');
      for (i=0; i<allTDs.length; i++) {
	  if (allTDs[i].id && allTDs[i].id.split('_')[1]=='Error') {
	      allTDs[i].innerHTML = '';
	  }
      }
   }

   function DisableBackground () {
       $("#overlay2").show();
   }
   
   function ActiveBackgroud () {
	$("#overlay2").hide();
   }
