//abrir ventana a un tamaņo especifico
function ventanaSecundaria3 (URL){ 
window.open(URL,"ventanaadm","width=620, height=300, scrollbars=no, menubar=no, location=no, resizable=no"); 
} 
function ventanaSecundaria2 (URL){ 
window.open(URL,"ventanaadm","width=217, height=117, scrollbars=no, menubar=no, location=no, resizable=no"); 
} 
function ventanaSecundaria (URL){ 
window.open(URL,"Detalles","width=670, height=500, top=50, left=20, scrollbars=yes, menubar=no, location=no, resizable=yes"); 
} 
function ventanaClave (URL){ 
window.open(URL,"ventanaadm","width=220, height=150, scrollbars=no, menubar=no, location=no, resizable=no"); 
} 
function ampliaFoto(){
GP_AdvOpenWindow('ampliaFoto.asp?img='+foto,'form_ampli','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no',550,413,'center','ignoreLink','',0,'');return document.MM_returnValue
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = "";
}

function resetText(thefield){
if(thefield.value==""){
thefield.value=thefield.defaultValue;
}}
// -->
<!--GALERIA
function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
function cerrar() {
	close();
}
function puntitos(donde,caracter){
	pat = /[\*,\+,\(,\),\?,\,$,\[,\],\^]/
//	donde= this.form.txtInscripcionNew
	valor = donde.value
//	caracter=this.form.txtInscripcionNew.value.charAt(this.form.txtInscripcionNew.value.length-1)
	largo = valor.length
	crtr = true
	if(isNaN(caracter) || pat.test(caracter) == true){
		if (pat.test(caracter)==true){ 
			caracter = caracter
		}
		caracter = new RegExp(caracter,"g")
		valor = valor.replace(caracter,"")
		donde.value = valor
		crtr = false
	}
	else{
		var nums = new Array()
		cont = 0
		for(m=0;m<largo;m++){
			if(valor.charAt(m) == "." || valor.charAt(m) == " ")
				{continue;}
			else{
				nums[cont] = valor.charAt(m)
				cont++
			}
		}
	}
	var cad1="",cad2="",tres=0
	if(largo > 3 && crtr == true){
		for (k=nums.length-1;k>=0;k--){
			cad1 = nums[k]
			cad2 = cad1 + cad2
			tres++
			if((tres%3) == 0){
				if(k!=0){
					cad2 = "." + cad2
				}
			}
		}
		donde.value = cad2
	}
}
function marcar_tipo(tipo) {
  var valor
  if (tipo=="apartamentos") valor=1;
  if (tipo=="casas") valor=2;
  if (tipo=="habitaciones") valor=3;
  if (tipo=="oficinas") valor=4;
  if (tipo=="locales") valor=5;
  if (tipo=="terrenos") valor=6;
  if (tipo=="edificios") valor=7;
  if (tipo=="hoteles") valor=8;
  if (tipo=="resorts") valor=9;
  if (tipo=="negocios") valor=10;
  if (tipo=="galpones") valor=11;
  if (tipo=="haciendas") valor=12;
  this.formCambios.cbTipo.selectedIndex=valor;
}
function marcar_oper(oper) {
var valor
switch (oper) {
case "venta": valor=1; break;
case "alquiler": valor=2; break;
case "vacacional": valor=3; break;
}
this.formCambios.cbOperacion.selectedIndex=valor;
}
function marcar_cat(categ) {
var valor
switch (categ) {
case "Proyecto": valor=1; break;
case "Inmueble": valor=2; break;
case "Terreno": valor=3; break;
}
this.formCambios.RGCategoria.value=valor;
}
function marcar_moneda(moneda) {
switch (moneda) {
case "Bs": this.formCambios.cbMoneda.selectedIndex=1; break;
case "$": this.formCambios.cbMoneda.selectedIndex=2; break;
case "Euro": this.formCambios.cbMoneda.selectedIndex=3; break;
}
}
function cargar_pagina(enlace) {//mostrar los inmuebles
  if (this.formBusqueda.cambios.selectedIndex!=-1) {
    var operacion;
	operacion =enlace+this.formBusqueda.cambios.options[this.formBusqueda.cambios.selectedIndex].value;
	if (operacion) location.href = operacion;
  }
}
function cargar_pagina_detalles(enlace,ide,oper) {//mostrar los inmuebles
    var operacion;
	operacion =enlace+oper+'&ide='+ide;
	if (operacion) location.href = operacion;
}
function eliminar(enlace,codigo,accion) {
    borrar = window.confirm('Se eliminara el Inmueble seleccionado');
    if (borrar==true) {
      var operacion;
  	  operacion =enlace+codigo+'&accion='+accion;
	  if (operacion) location.href = operacion;
	}
	else 
	  return false;
}