<!--                              ///
                                  ///
                                  ///
   /////// ///  ////  ///   ///////// 
  ///      //// ///// //// ///    ///                                
  ///      ///   ///   /// ///    ///         
  ///      ///   ///   /// ///    /// Copyright(c)2000,2005 set/2005                           
  ///      ///   ///   /// ///    /// todos os direitos reservados       
   /////// ///   ///   /// /////////  www.cmdnet.com.br                                    
    
// abre uma nova janela sem menu
function OpenWindow(name,left,top,width,height,scroll) {
	features = "left="+left+",top="+top+",width="+width+",height="+height+",toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no"+",scrollbars="+scroll;
	newWindow = window.open( name,null,features);
	newWindow.focus();
};

function OpenNewWindow(name,left,top,width,height,scroll,toolbar,menubar) {
	features = "left="+left+",top="+top+",width="+width+",height="+height+",toolbar="+toolbar+",location=no,directories=no,status=no,menubar="+menubar+",resizable=no"+",scrollbars="+scroll;
	newWindow = window.open( name,null,features);
	newWindow.focus();
};

function validar(formulario) { 
	pag = "email_ins.asp?email=" + formulario.email.value + "&status="+formulario.status.value; 
	newwindow = open(pag,'janela',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=320,height=200"); 
}; 

function cmd_libBrowser()
   // (cmd)09.09.05
   // dados sobr o browser do cliente
{
	d=document;
	this.agt=navigator.userAgent.toLowerCase(); // informações sobre o navegador
	this.major = parseInt(navigator.appVersion); // versão do navegador
	this.dom=(d.getElementById)?1:0; //
	this.name=(this.dom&&navigator.appName); // nome do navegador
	this.ns=(d.layers);
	this.nts=(this.dom&&navigator.appName=="Netscape"); // true se for netscape 
	this.mie=(this.dom&&navigator.appName=="Microsoft Internet Explorer"); // true se for Internet explorer
	this.opr=(window.opera?1:0);  // retorna 1 se o nav. for o opera se não 0
	this.ie=(d.all);
	this.ie4=(d.all&&!this.dom)?1:0; // 1 se a versão for a 4 se não 0
	this.ie4up=(this.ie && this.major>=4); // true se a versão do navegador for superior a 4
	this.ie5=(d.all&&this.dom);
	this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1)); // true para s.o. windows
	this.mac=(this.agt.indexOf("mac")!=-1); // true para s.o. mac
};

function cmd_showWarning(sPath,sMessage,sConfirm,sCancel){
   // (cmd)09.09.05
   // abre uma janela show modal, exibe uma mensagem e 
   // aguarda o pressionamento de uma das duas opções
   // retorna true ou false
   // a janela esta na pasta home "show_warning.htm"
   if (window.external.IYBrowserExtend) {
      if(!confirm(sMessage)) return false;
   }else {
      var oArguments = {
         Message : sMessage,           // mensagem a ser apresentada
         ConfirmButtonValue: sConfirm, // texto do botão confirmar
         CancelButtonValue: sCancel    // texto do botão cancelar
      };
      var oAction = window.showModalDialog(sPath,oArguments,"dialogHeight:150px;dialogWidth:450px;status:no;help:no;resizable:yes;scroll:no;");
      if(oAction){
        // retorna true se o botão confirm for pressionado se não false
        if(oAction.confirmed) return true
      }
      if(!oAction.confirmed) return false;
   } 
   return true;
};

function cmd_showMessage(sPath,sMessage,sButton){
   // (cmd)09.09.05
   // abre uma janela show modal, exibe uma mensagem e 
   // aguarda o pressionamento de de ok
   // retorna true se o botão ok for pressionado se não false
   // a janela esta na pasta home "show_message.htm"
   if (window.external.IYBrowserExtend) {
      if(!confirm(sMessage)) return false;
   }else {
      var oArguments = {
         Message : sMessage,
         OkButtonValue: sBotton
      };
      var oAction = window.showModalDialog(sPath,oArguments,"dialogHeight:150px;dialogWidth:450px;status:no;help:no;resizable:yes;scroll:no;");
      if(oAction){
         // retornou true (pressionou o botao)
        if(oAction.confirmed) return true
      }
      if(!oAction.confirmed) return false;
   } 
   return true;
};

function cmd_checkBoxAll(form,elements){
   // (cmd)09.09.05
   // marca todas as chekbox do form definidas em elements
	var i;
	var objs = document.getElementsByName(elements);
	for	(i=0; i < objs.length; i++)
	{
		objs[i].checked=form.cboxAll.checked;
	}
};
function cmd_goUrl(url){
   // (cmd)09.09.05
   // carrega a página definida em url
   if (url != "") { 
     location = url;
   }
};  
function cmd_reloadWin() {
   // (cmd)09.09.05
   // recarrega a página ativa
  window.location.reload(true);
};

function cmd_printForm() {
   // (cmd)19.09.05
   // envia o conteúdo para a impressora
   if (window.print ) {
		window.print();
	}
}
