// ## Variables Globales
var cssPath = "webctrl_client/themes/"		
var textCargaAutomotor = 'AutomotorInteriorCampo7';
var popupCargaAutomotor = 'popupContainer';
        
// ## Muestra/Oculta un popup		
function Appear(id)
{    
    // -- quitar cuando esten cargados los datos de 2011
    if (parseInt(document.getElementById('PeriodoFiscal1').value) == 2011)
    {
        alert('Valuaciones aun no disponibles.');    
        return false;
    }
    
	if (document.getElementById(id).style.display == 'none')
	{
		Mostrar(id)
		document.body.scrollTop = 0;
	}
	else
	{
		Ocultar(id);
	}
}


// ## Muestra un popup
function Mostrar(id)
{
    document.getElementById(id).style.display = '';
}


// ## Oculta un popup
function Ocultar(id)
{
    document.getElementById(id).style.display = 'none';
}


// ## Muestra el calendario en un popup
function Calendario(parentControl)
{
	var url = 'calendario.aspx?target=' + parentControl;
	var screenTop = (screen.width/4);
	var screenLeft = (screen.height-100);		
	var features = 'width=260,height=180,top=' + screenTop + ',left=' + screenLeft + ',directories=0,location=0,menubar=0,titlebar=0,toolbar=0,status=0';
    var calendario = window.open(url, '_popup', features);
	
}

// ## - Copia el valor de la valuacion desde el popup al campo de valuacion en el formulario web.
// ## - Limpia los combos y los items de valuacion
// ## - Luego cierra el popup.
function SetValuacion(valor)
{
	document.getElementById(textCargaAutomotor).value = valor.toString();	
	
	// -- Limpia todos los valores
	document.getElementById("ListMarca1").options.item(0).selected = true;
	ClearDropDownList(document.getElementById("ListVehiculo1"));
	ClearDropDownList(document.getElementById("ListModelo1"));
	document.getElementById("LabelResultado1").innerHTML = new String();
		
	Ocultar(popupCargaAutomotor);
}

// ## Confirmacion para salir de la aplicacion.	
function ConfirmSalir()
{
	return confirm('Esta seguro que desea salir?');	
}
