// JavaScript Document
window.onload = function() {
	MM_preloadImages('../images/bton_adjudica_act.gif','images/ver_bton_act.gif');
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function oculta_mensaje(){
	document.getElementById('msg').style.display="none";
}

function validate (forma){
	sw=0; 
	if (document.getElementById('PROVEEDOR').value==''){ 
		document.getElementById('id_login').innerHTML = '(*) Requerido';
		sw=1; 
	} 
	else{ 
		document.getElementById('id_login').innerHTML = '';
	}
	if (sw==0){
		forma.submit();
	}
	else { 
		document.getElementById('PROVEEDOR').focus();	
	}
}
	
function abrir(nombre,nro,ancho,alto,x,y) {
	varpass = y;
	varlogin = x;	
	//alert(varpass);
	//alert(varlogin);	
	url=nombre+'?login='+varlogin+'&pass='+varpass;			
	//window.open(url,'ventana','width='+alto+', height='+ancho+', toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, left=0,top=0');
};

function valida () {

	if (document.forma.login.value == "") {
		alert("Por Favor Ingresar su login");
		document.forma.login.focus();
		return false;
	}
	if (document.forma.pass.value == "") {
		alert("Por Favor Ingresar su palabra clave");
		document.forma.pass.focus();
		return false;
	}
	/*document.forma.submit();*/
}

function impuesto_transacciones(){
	MostrarOcultar('liquidacion_impuesto')
}

function MostrarOcultar(objetoVisualizar) {
	if (document.all[objetoVisualizar].style.display=='none') {
		document.all[objetoVisualizar].style.display='block';
	} else {
		document.all[objetoVisualizar].style.display='none';
	}
}

function opciones_liquidacion(){
	MostrarOcultar('opciones_liquidacion')
}

function popup_modal_pago_en_linea_loging(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=190,height=420,');");
}

var WindowObjectReference;
function popup_modal3(nombre,nro,ancho,alto,x,y) {
			
varpass = y;
varlogin = x;	


//alert(varpass);
//alert(varlogin);

	url=nombre+'?login='+varlogin+'&pass='+varpass;
	dat = 'width=' + ancho + ',height=' + alto + ',left=50,top=50,scrollbars=yes,resizable=YES,modal=No,dialog=No,minimizable=Yes,toolbar=No';
	
	if (WindowObjectReference == null || WindowObjectReference.closed) {
		WindowObjectReference = window.open(url,'',dat);
	}
	else if(!WindowObjectReference.closed) {
		WindowObjectReference.focus();
	}
};

function popup_modal(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=Yes,width=650,height=400');");
}
   
   function popup_modal_regprocontra(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=625,height=730,');");
}
   
/*   function popup_modal_entidades(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=No,width=744,height=474,');");
}*/

   function popup_modal_entidades(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=yes,fullscreen=yes,');");
}

   function cerrar_ventana_regprov(){
ventana_proveedores.close();
}   	


   function popup_modal_ordenamiento(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=763,height=630,');");
}

   function popup_modal_directorio(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=Yes,width=600,height=650,');");
}

   function popup_modal_impuestoinmuebles(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,location=no,menubar=0,resizable=No,width=744,height=650,');");
}

   function popup_modal_licitaciones(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=640,height=470,');");
}

   function popup_modal_demopagos(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=1024,height=768,');");
}

function popup_modal_graficas(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=No,width=860,height=540,');");
}
/*var WindowObjectReference ;
		
		function popup_modal(nombre,nro,ancho,alto) {
			url=nombre+'?nro='+nro;
			dat = 'width=' + ancho + ',height=' + alto + ',left=0,top=0,scrollbars=yes,resize=no,modal=yes,dialog=yes,minimizable=no';
			
			if (WindowObjectReference == null || WindowObjectReference.closed) {
				WindowObjectReference = window.open(url,'',dat);
			}
			else if(!WindowObjectReference.closed) {
				WindowObjectReference.focus();
			};
		}


function posicion(){
moveTo(0, 0);
}*/
/* --------------------------------------------------------------
*  SUBMENU
   -------------------------------------------------------------*/
	function submenu(id,opcion,nro){
		if ($(''+opcion+nro+'').style.visibility=='hidden') {
			var i=0;
			while (i<nro) {
				i++;
				//$(''+id+'').class='submenu_activo';
				$(''+id+'').hasClassName(''+id+'','submenu_activo');
				$(''+opcion+i+'').style.visibility='visible';
				$(''+opcion+i+'').style.display='block';
			}
		}
		else {
			var i=0;
			while (i<nro) {
				i++;
				$(''+opcion+i+'').style.visibility='hidden';
				$(''+opcion+i+'').style.display='none';
			}
		}
	}
	
/* --------------------------------------------------------------
*  MENU
   -------------------------------------------------------------*/   
	function menu(url) {
		var updater = new Ajax.Updater('contenido',url,{
			asynchronous:true, 
			evalScripts:true});
	}
/* --------------------------------------------------------------
*  CENTRAR VENTANA POP-UP
   -------------------------------------------------------------*/   
	
function centrar() {
	iz=(screen.width-document.body.clientWidth) / 2;
	de=(screen.height-document.body.clientHeight) / 2;
	moveTo(iz,de);
}