// JavaScript Document
function AgregarServicio(value, id, status){
	if(status == true){
		document.getElementById(id).value  = value;
		}
	}
	
function MostrarSuperficies(idCategoria){
	if( idCategoria == 11 ){
		//Seteamos el rango de superficie para Campos (Ha) 
		document.getElementById('superficieCampos').style.display  = 'block';
		document.getElementById('selectCampos').disabled = false;
		document.getElementById('superficieGral').style.display  = 'none';
		document.getElementById('selectSupGral').disabled = true;
		}
	else {
		//Seteamos el rango de superficie para Otras Categorias (M2) 
		document.getElementById('superficieGral').style.display  = 'block';
		document.getElementById('selectSupGral').disabled = false;
		document.getElementById('superficieCampos').style.display  = 'none';
		document.getElementById('selectCampos').disabled = true;
		}	
	}
	
function MostrarDivCalendario(idOperacion){
	if( idOperacion == 2 ){
		//Mostramos el calendario
		document.getElementById('divCalendario').style.display  = 'block';	
		document.getElementById('divCalendario2').style.display = 'block';
		}
	else {
		//No mostramos el calendario
		document.getElementById('divCalendario').style.display  = 'none';
		document.getElementById('divCalendario2').style.display = 'none';	
		MostrarFechaIn('');
		MostrarFechaOut('');
		}			
	if( idOperacion == 1 || idOperacion == 2){
		//Seteamos el rango de precios para Alquiler y Alquiler Temporario 
		document.getElementById('precioAlquileres').style.display  = 'block';
		document.getElementById('selectAlquileres').disabled = false;
		document.getElementById('precioGral').style.display  = 'none';
		document.getElementById('selectGral').disabled = true;
		document.getElementById('precioVenta').style.display  = 'none';
		document.getElementById('selectVenta').disabled = true;
		}
	else if( idOperacion == 3 || idOperacion == 4 ){
		document.getElementById('precioVenta').style.display  = 'block';
		document.getElementById('selectVenta').disabled = false;
		document.getElementById('precioGral').style.display  = 'none';
		document.getElementById('selectGral').disabled = true;
		document.getElementById('precioAlquileres').style.display  = 'none';
		document.getElementById('selectAlquileres').disabled = true;		
		}
	else {
		document.getElementById('precioVenta').style.display  = 'none';
		document.getElementById('selectVenta').disabled = true;
		document.getElementById('precioAlquileres').style.display  = 'none';
		document.getElementById('selectAlquileres').disabled = true;
		document.getElementById('precioGral').style.display  = 'block';
		document.getElementById('selectGral').disabled = false;
		}				
	}
	
function Calendario(InOut){
	urlFechaCalendario = 'calendario'+InOut+'.php';
	popup(urlFechaCalendario, 'Calendario', 235, 260);
	}
	
function MostrarFechaIn(fecha){
	document.getElementById('fechaIngreso').value = fecha;
	if( fecha != ''){
		document.getElementById('fechaIngreso').style.display = 'block';
		}
	else {
		document.getElementById('fechaIngreso').style.display = 'none';
		}		
	}
	
function MostrarFechaOut(fecha){
	document.getElementById('fechaEgreso').value = fecha;
	if( fecha != ''){
		document.getElementById('fechaEgreso').style.display = 'block';
		}
	else {
		document.getElementById('fechaEgreso').style.display = 'none';
		}		
	}
	
function TouryFoto(obj){
	if( obj.name == 'contour' ){
		if( obj.checked == true ){
			document.getElementById('PropCTour').value	=	1;
			}
		else {
			document.getElementById('PropCTour').value	=	0;
			}			
		}
	if( obj.name == 'confoto' ){
		if( obj.checked == true ){
			document.getElementById('PropCFoto').value	=	1;
			}
		else {
			document.getElementById('PropCFoto').value	=	0;
			}
		}	
	}
	
function BuscarPropiedad(accion){
	document.getElementById('accion').value = accion;
	document.frmProp.submit();
	}

function VerPropiedad(idDpto){
	URL = 'editproperty.php?idDpto='+idDpto;
	popup(URL, 'EdicionPropiedad', 573, 780);
	}

function popup(URL, name, Height, width){
	vars = 'height='+Height+',width='+width;
	newwindow=window.open(URL, name, vars);
	if (window.focus) {newwindow.focus()}
	return false;
	}
