﻿// JScript File
//*******************************************************************************
function ShowImage(source, eventArgs){
    var source_id = source._id;
    var txtBx_id = source_id.replace('atx','txt');
	var element = $(txtBx_id);
	if(element){
	    element.style.backgroundImage = 'url("Images/loading.gif")';
	    //alert('img is shown now');
	    element.style.backgroundRepeat = 'no-repeat';
	}
}
//*******************************************************************************
function HideImage(source, eventArgs){
    if(typeof source._id != 'undefined'){
        var source_id = source._id;
        var txtBx_id = source_id.replace('atx','txt');
	    var element = $(txtBx_id);
	    if(element)	element.style.backgroundImage = 'none';
	}
}
//*******************************************************************************
function ItemSelected(source, eventArgs){
    var source_id = source._id;
    var hdn_id = source_id.replace('atx','hdn');
    var txtBx_id = source_id.replace('atx','txt');
	
	var element = $(hdn_id);
	var txtBox = $(txtBx_id);
	
	
	if(element)
	{
	    
	    element.value = eventArgs.get_value();
	    
	    txtBox.value = txtBox.value.split(',')[0];     
	    //alert(txtBox.value);
	    
	} 
	
}
function ItemSelected_AircraftCatalog(source, eventArgs){
    var source_id = source._id;
    var hdn_id = source_id.replace('atx','hdn');
    var txtBx_id = source_id.replace('atx','txt');
	var element = $(hdn_id);
	var txtBox = $(txtBx_id);
	
	if(element){	    
	    element.value = eventArgs.get_value();
	    
	    txtBox.value = txtBox.value.split(',')[0];     
	    //alert(txtBox.value);
	} 
	checkAirJet(txtBx_id,hdn_id);
}

