﻿
  var timeout;
	function openInfoDialog() {
		Dialog.info("",
				        {windowParameters: {className: "loading",width:250, height:100}, showProgress: true});
		timeout=3;
		setTimeout("infoTimeout()", 1000)
	}
	
	function infoTimeout() {
	  timeout--;
	  if (timeout >0) {
	    Dialog.setInfoMessage("Test of info panel, it will close <br>in " + timeout + "s ...")
  		setTimeout("infoTimeout()", 1000)
    }
	  else
	    Dialog.closeInfo()
	}

	function openPopUp(id, titulo, w, h, url){
		var xpos, ypos;
                        if(typeof this.parent.win != "undefined" ){
                                   parent.win.setURL(url);
                                   parent.win.setTitle(titulo);
                                   parent.win.setSize(w,h);  
									if (!document.all)
									{
										ypos = this.parent.scrollY;
										xpos = this.parent.scrollX;
									}
									else
									{
										xpos = parent.document.body.scrollLeft;
										ypos = parent.document.body.scrollTop;
									}
									parent.win.setLocation(ypos, xpos);
									parent.win.show(false);
                                   //parent.win.showCenter(false, py);     
								   //parent.win.focus();          

                        }else{
                                   parent.win = new Window(id, {className: "popups", title: titulo, width:w, height:h, 
								   closable: true, resizable: true , url: url, showEffectOptions: {duration:0.5}})
									if (!document.all)
									{
										ypos = this.parent.scrollY;
										xpos = this.parent.scrollX;
									}
									else
									{
										xpos = parent.document.body.scrollLeft;
										ypos = parent.document.body.scrollTop;
									}
									parent.win.setLocation(ypos, xpos);
									parent.win.show(false);
//                                	 parent.win.showCenter(false, py);      
								   //parent.win.focus();
                                   //parent.win.setDestroyOnClose();
                        }

	}
	function openConfirmDialog(mensaje, w, h, okLabel, cancelLabel) {
		Dialog.confirm(mensaje, 
				        {windowParameters: {width:w, height:h}, okLabel: okLabel, cancelLabel:cancelLabel, 
						    cancel:function(win) {
								//funcion con cancelacion
							},
						    ok:function(win) { 
								//funcion con ok
								return true}
						    });
	}
	
	function openAlertDialog(mensaje, w, h, okLabel) {
		Dialog.alert(mensaje, 
				        {windowParameters: {width:w, height:h}, okLabel: okLabel, 
						    ok:function(win) {
								//funcion ok
								return true}
						    });
	}
	function openPopUp1(id, titulo, w, h, url){
		var xpos, ypos;
	   if(typeof this.win1 != "undefined" ){
           win1.setURL(url);
           win1.setTitle(titulo);
           win1.setSize(w,h);            
			if (!document.all)
			{
				ypos = this.parent.scrollY;
				xpos = this.parent.scrollX;
			}
			else
			{
				xpos = parent.document.body.scrollLeft;
				ypos = parent.document.body.scrollTop;
			}
			win1.setLocation(ypos, xpos);
			win1.show(false);
           //win1.showCenter(false, py);      
      }else{
		var win1 = new Window("popG", {className: "popups", title: titulo, width:w, height:h, closable: true, resizable: true , url: url, showEffectOptions: {duration:0.5}})
        //win1.showCenter(false, py); 
		if (!document.all)
		{
			ypos = this.parent.scrollY;
			xpos = this.parent.scrollX;
		}
		else
		{
			xpos = parent.document.body.scrollLeft;
			ypos = parent.document.body.scrollTop;
		}
		win1.setLocation(ypos, xpos);
		win1.show(false);
		win1.setDestroyOnClose();
	}
}
function closePop1(){
	Windows.close("popG");
	//parent.win1.closeInfo();
}