%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Investment Judgment Advisor
%%% Programed by Jhiin Joo specifically for MAC users
%%% March 3, 2009
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


function varargout = IJA(varargin)
% IJA M-file for IJA.fig
%      IJA, by itself, creates a new IJA or raises the existing
%      singleton*.
%
%      H = IJA returns the handle to a new IJA or the handle to
%      the existing singleton*.
%
%      IJA('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in IJA.M with the given input arguments.
%
%      IJA('Property','Value',...) creates a new IJA or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before IJA_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to IJA_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help IJA

% Last Modified by GUIDE v2.5 31-Oct-2008 10:40:26

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @IJA_OpeningFcn, ...
                   'gui_OutputFcn',  @IJA_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before IJA is made visible.
function IJA_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to IJA (see VARARGIN)

global ppmenu11 ppmenu12 ppmenu13 ppmenu14 ppmenu21 ppmenu22 ppmenu23 ppmenu24 
global ppmenu31 ppmenu32 ppmenu33 ppmenu34 ppmenu41 ppmenu42 ppmenu43 ppmenu44 
global ppmenu51 ppmenu52 ppmenu53 ppmenu54 ppmenu61 ppmenu62 ppmenu63 ppmenu64 
global counter popupmenu61 templet WhichInv


% Choose default command line output for IJA
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes IJA wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Executes on selection change in popupmenu11.
function popupmenu11_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu11 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu11


% --- Executes during object creation, after setting all properties.
function popupmenu11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER. 
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu11
set(hObject,'Value',ppmenu11);

% --- Executes on selection change in popupmenu21.
function popupmenu21_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu21 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu21 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu21


% --- Executes during object creation, after setting all properties.
function popupmenu21_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu21 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu21
set(hObject,'Value',ppmenu21);

% --- Executes on selection change in popupmenu31.
function popupmenu31_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu31 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu31 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu31


% --- Executes during object creation, after setting all properties.
function popupmenu31_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu31 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu31
set(hObject,'Value',ppmenu31);

% --- Executes on selection change in popupmenu41.
function popupmenu41_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu41 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu41 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu41


% --- Executes during object creation, after setting all properties.
function popupmenu41_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu41 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu41
set(hObject,'Value',ppmenu41);

% --- Executes on selection change in popupmenu51.
function popupmenu51_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu51 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu51 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu51


% --- Executes during object creation, after setting all properties.
function popupmenu51_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu51 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu51
set(hObject,'Value',ppmenu51);

% --- Executes on selection change in popupmenu12.
function popupmenu12_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu12 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu12


% --- Executes during object creation, after setting all properties.
function popupmenu12_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu12
set(hObject,'Value',ppmenu12);

% --- Executes on selection change in popupmenu22.
function popupmenu22_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu22 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu22 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu22


% --- Executes during object creation, after setting all properties.
function popupmenu22_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu22 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu22
set(hObject,'Value',ppmenu22);

% --- Executes on selection change in popupmenu32.
function popupmenu32_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu32 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu32 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu32


% --- Executes during object creation, after setting all properties.
function popupmenu32_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu32 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu32
set(hObject,'Value',ppmenu32);

% --- Executes on selection change in popupmenu42.
function popupmenu42_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu42 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu42 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu42


% --- Executes during object creation, after setting all properties.
function popupmenu42_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu42 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu42
set(hObject,'Value',ppmenu42);

% --- Executes on selection change in popupmenu52.
function popupmenu52_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu52 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu52 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu52


% --- Executes during object creation, after setting all properties.
function popupmenu52_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu52 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu52
set(hObject,'Value',ppmenu52);

% --- Executes on selection change in popupmenu13.
function popupmenu13_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu13 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu13


% --- Executes during object creation, after setting all properties.
function popupmenu13_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu13
set(hObject,'Value',ppmenu13);

% --- Executes on selection change in popupmenu23.
function popupmenu23_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu23 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu23 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu23


% --- Executes during object creation, after setting all properties.
function popupmenu23_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu23 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu23
set(hObject,'Value',ppmenu23);

% --- Executes on selection change in popupmenu33.
function popupmenu33_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu33 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu33 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu33


% --- Executes during object creation, after setting all properties.
function popupmenu33_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu33 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu33
set(hObject,'Value',ppmenu33);

% --- Executes on selection change in popupmenu43.
function popupmenu43_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu43 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu43 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu43


% --- Executes during object creation, after setting all properties.
function popupmenu43_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu43 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu43
set(hObject,'Value',ppmenu43);

% --- Executes on selection change in popupmenu53.
function popupmenu53_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu53 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu53 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu53


% --- Executes during object creation, after setting all properties.
function popupmenu53_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu53 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu53
set(hObject,'Value',ppmenu53);

% --- Executes on selection change in popupmenu14.
function popupmenu14_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu14 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu14


% --- Executes during object creation, after setting all properties.
function popupmenu14_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu14
set(hObject,'Value',ppmenu14);

% --- Executes on selection change in popupmenu44.
function popupmenu44_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu44 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu44 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu44


% --- Executes during object creation, after setting all properties.
function popupmenu44_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu44 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu44
set(hObject,'Value',ppmenu44);

% --- Executes on selection change in popupmenu24.
function popupmenu24_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu24 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu24 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu24


% --- Executes during object creation, after setting all properties.
function popupmenu24_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu24 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu24
set(hObject,'Value',ppmenu24);

% --- Executes on selection change in popupmenu34.
function popupmenu34_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu34 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu34 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu34


% --- Executes during object creation, after setting all properties.
function popupmenu34_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu34 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu34
set(hObject,'Value',ppmenu34);

% --- Executes on selection change in popupmenu54.
function popupmenu54_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu54 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu54 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu54


% --- Executes during object creation, after setting all properties.
function popupmenu54_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu54 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu54
set(hObject,'Value',ppmenu54);

% --- Executes on selection change in popupmenu61.
function popupmenu61_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu61 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu61 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu61


% --- Executes during object creation, after setting all properties.
function popupmenu61_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu61 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global counter ppmenu61
if counter==0
    ppmenu61=1;
end

set(hObject,'Value',ppmenu61);



% --- Executes on selection change in popupmenu62.
function popupmenu62_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu62 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu62 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu62


% --- Executes during object creation, after setting all properties.
function popupmenu62_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu62 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu62 counter 

if counter==0
    ppmenu62=1;
end

set(hObject,'Value',ppmenu62);



% --- Executes on selection change in popupmenu64.
function popupmenu64_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu64 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu64 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu64


% --- Executes during object creation, after setting all properties.
function popupmenu64_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu64 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu64 counter 

if counter==0
    ppmenu64=1;
end

set(hObject,'Value',ppmenu64);



% --- Executes on selection change in popupmenu63.
function popupmenu63_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu63 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu63 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu63


% --- Executes during object creation, after setting all properties.
function popupmenu63_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu63 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

global ppmenu63 counter 

if counter==0
    ppmenu63=1;
end

set(hObject,'Value',ppmenu63);

% --- Outputs from this function are returned to the command line.
function varargout = IJA_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;
set(handles.popupmenu11,'Visible','on');
    set(handles.popupmenu12,'Visible','on');
    set(handles.popupmenu13,'Visible','on');
    set(handles.popupmenu14,'Visible','on');
    set(handles.popupmenu21,'Visible','on');
    set(handles.popupmenu22,'Visible','on');
    set(handles.popupmenu23,'Visible','on');
    set(handles.popupmenu24,'Visible','on');
    set(handles.popupmenu31,'Visible','on');
    set(handles.popupmenu32,'Visible','on');
    set(handles.popupmenu33,'Visible','on');
    set(handles.popupmenu34,'Visible','on');
    set(handles.popupmenu41,'Visible','on');
    set(handles.popupmenu42,'Visible','on');
    set(handles.popupmenu43,'Visible','on');
    set(handles.popupmenu44,'Visible','on');
    set(handles.popupmenu51,'Visible','on');
    set(handles.popupmenu52,'Visible','on');
    set(handles.popupmenu53,'Visible','on');
    set(handles.popupmenu54,'Visible','on');
    set(handles.popupmenu61,'Visible','on');
    set(handles.popupmenu62,'Visible','on');
    set(handles.popupmenu63,'Visible','on');
    set(handles.popupmenu64,'Visible','on');


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global counter templet
global popupmenu61
global ppmenu11 ppmenu12 ppmenu13 ppmenu14 ppmenu21 ppmenu22 ppmenu23 ppmenu24 
global ppmenu31 ppmenu32 ppmenu33 ppmenu34 ppmenu41 ppmenu42 ppmenu43 ppmenu44 
global ppmenu51 ppmenu52 ppmenu53 ppmenu54 ppmenu61 ppmenu62 ppmenu63 ppmenu64 
global wordsf wordss words_w MFsf MFss MFs_w
global ppmenu11string ppmenu14string ppmenu61string  WhichInv
global Xs Ws Special

% disp('Please wait for a moment.........');
% disp('  ');
% disp('processing.....');
% disp('  ');



counter=counter+1;

msgbox('Please wait for a moment..... Thank you. :) ', 'PROCESSING','none');
%disp(['Trial Number: ' num2str(counter)]);

%msgbox('Please wait for a moment..... Thank you. :) ', 'PROCESSING','none');


prepareDataFLIA11; %% To get the FOUs from the words...

ppmenu11=get(handles.popupmenu11, 'Value'); ppmenu12=get(handles.popupmenu12, 'Value'); ppmenu13=get(handles.popupmenu13, 'Value');
ppmenu14=get(handles.popupmenu14, 'Value'); ppmenu21=get(handles.popupmenu21, 'Value'); ppmenu22=get(handles.popupmenu22, 'Value');
ppmenu23=get(handles.popupmenu23, 'Value'); ppmenu24=get(handles.popupmenu24, 'Value'); ppmenu31=get(handles.popupmenu31, 'Value');
ppmenu32=get(handles.popupmenu32, 'Value'); ppmenu33=get(handles.popupmenu33, 'Value'); ppmenu34=get(handles.popupmenu34, 'Value');
ppmenu41=get(handles.popupmenu41, 'Value'); ppmenu42=get(handles.popupmenu42, 'Value'); ppmenu43=get(handles.popupmenu43, 'Value');
ppmenu44=get(handles.popupmenu44, 'Value'); ppmenu51=get(handles.popupmenu51, 'Value'); ppmenu52=get(handles.popupmenu52, 'Value');
ppmenu53=get(handles.popupmenu53, 'Value'); ppmenu54=get(handles.popupmenu54, 'Value'); ppmenu61=get(handles.popupmenu61, 'Value');
ppmenu62=get(handles.popupmenu62, 'Value'); ppmenu63=get(handles.popupmenu63, 'Value'); ppmenu64=get(handles.popupmenu64, 'Value');



Xs=zeros(5,4); Ws=zeros(1,4);
Xs=[ppmenu11 ppmenu12 ppmenu13 ppmenu14; %% Xs corresponds to the linguistic words
    ppmenu21 ppmenu22 ppmenu23 ppmenu24;
    ppmenu31 ppmenu32 ppmenu33 ppmenu34;
    ppmenu41 ppmenu42 ppmenu43 ppmenu44;
    ppmenu51 ppmenu52 ppmenu53 ppmenu54]; 
Ws=[ppmenu61 ppmenu62 ppmenu63 ppmenu64]; %% Ws corresponds to the liguistic weights 
Xs;
Ws;


executeLWA_FLIA1;

%% 1st Set of Data
global XS1 WS1 XXS1 XXL1 XXR1 XXSM1 XXSL1 XXSR1 WhichInv
global ling1_11 ling1_12 ling1_13 ling1_14
global ling1_21 ling1_22 ling1_23 ling1_24
global ling1_31 ling1_32 ling1_33 ling1_34
global ling1_41 ling1_42 ling1_43 ling1_44
global ling1_51 ling1_52 ling1_53 ling1_54
global ling1_61 ling1_62 ling1_63 ling1_64
global rank1_1 rank1_2 rank1_3 rank1_4 rank1_5
global cen1_1 cen1_2 cen1_3 cen1_4 cen1_5
global sim1_11 sim1_12 sim1_13 sim1_14 sim1_15
global sim1_21 sim1_22 sim1_23 sim1_24 sim1_25
global sim1_31 sim1_32 sim1_33 sim1_34 sim1_35
global sim1_41 sim1_42 sim1_43 sim1_44 sim1_45
global sim1_51 sim1_52 sim1_53 sim1_54 sim1_55

%% 2nd Set of Data
global XS2 WS2 XXS2 XXL2 XXR2 XXSM2 XXSL2 XXSR2
global ling2_11 ling2_12 ling2_13 ling2_14
global ling2_21 ling2_22 ling2_23 ling2_24
global ling2_31 ling2_32 ling2_33 ling2_34
global ling2_41 ling2_42 ling2_43 ling2_44
global ling2_51 ling2_52 ling2_53 ling2_54
global ling2_61 ling2_62 ling2_63 ling2_64
global rank2_1 rank2_2 rank2_3 rank2_4 rank2_5
global cen2_1 cen2_2 cen2_3 cen2_4 cen2_5
global sim2_11 sim2_12 sim2_13 sim2_14 sim2_15
global sim2_21 sim2_22 sim2_23 sim2_24 sim2_25
global sim2_31 sim2_32 sim2_33 sim2_34 sim2_35
global sim2_41 sim2_42 sim2_43 sim2_44 sim2_45
global sim2_51 sim2_52 sim2_53 sim2_54 sim2_55

%% 3rd Set of Data
global XS3 WS3 XXS3 XXL3 XXR3 XXSM3 XXSL3 XXSR3
global ling3_11 ling3_12 ling3_13 ling3_14
global ling3_21 ling3_22 ling3_23 ling3_24
global ling3_31 ling3_32 ling3_33 ling3_34
global ling3_41 ling3_42 ling3_43 ling3_44
global ling3_51 ling3_52 ling3_53 ling3_54
global ling3_61 ling3_62 ling3_63 ling3_64
global rank3_1 rank3_2 rank3_3 rank3_4 rank3_5
global cen3_1 cen3_2 cen3_3 cen3_4 cen3_5
global sim3_11 sim3_12 sim3_13 sim3_14 sim3_15
global sim3_21 sim3_22 sim3_23 sim3_24 sim3_25
global sim3_31 sim3_32 sim3_33 sim3_34 sim3_35
global sim3_41 sim3_42 sim3_43 sim3_44 sim3_45
global sim3_51 sim3_52 sim3_53 sim3_54 sim3_55
global Special templet


Special;
if counter==1
    close all;
    ShowResults_First;
elseif counter==2
    close all;
    ShowResults_Second;
%     close(ShowResults_First);
elseif counter==3
    close all;
    ShowResults_Third;
elseif counter>3
    close all;
    ShowResults_Third;    
end




% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close(IJA);
close all
Blank;
IJA_demo;

