function preparescreen


global ITEMS SIZES COLORS 

%screens
global window woff wblank centerx centery wsize wfix dotsize wlines



whichScreen = 0;
[window,Scrnsize] = Screen(whichScreen,'OpenWindow',[150,150,150]);
SCREEN(window,'TextSize',40);
SCREEN(window,'TextFont','Arial');

%create the stimuli panels

centerx = 21;
centery = 21;
wsize = 40;
dotsize = 20;
for(i = 1:size(ITEMS,1))
    for(j = 1:size(ITEMS,2))
        woff(i,j) = Screen(window,'OpenOffscreenWindow',[150,150,150],[1,1,wsize *2+1,wsize*2+1]);        
        oldFontSize=SCREEN(woff(i,j),'TextSize',SIZES(i));
        oldFontSize=SCREEN(woff(i,j),'TextFont','Arial');
%        oldFontSize=SCREEN(woff(i,j),'TextFont','Arial');
        s =   sprintf('%c',ITEMS(i,j));
        if(i==2)    %black box
            s= '#';
            TextWidth = SCREEN (woff, 'TextWidth', s');    
            SCREEN(woff(i,j),'DrawText',s,wsize-(TextWidth/2),wsize+wsize/1.5,COLORS(i,1:3));
            s= '@';
            TextWidth = SCREEN (woff, 'TextWidth', s');    
            SCREEN(woff(i,j),'DrawText',s,wsize-(TextWidth/2),wsize+wsize/1.5,COLORS(i,1:3));
  
        else    
            TextWidth = SCREEN (woff, 'TextWidth', s');
            SCREEN(woff(i,j),'DrawText',s,wsize-(TextWidth/2),wsize+wsize/1.5,COLORS(i,1:3));
        end
    end
end


for(lines = 1:20)
		
    wlines(lines) = Screen(window,'OpenOffscreenWindow',[150,150,150],[1,1,wsize *2+1,wsize*2+1]);
	radians = .5 +(lines-10)*.02;   %1/4 of a circle
	xcord = sin(radians)*.6;
	ycord = cos(radians)*.6;	
	rectx(1,1) = wsize-wsize*xcord; 
	rectx(1,2) = wsize+wsize*xcord; 
	recty(1,1) = wsize-wsize*ycord; 
	recty(1,2) = wsize+wsize*ycord; 

	Screen(wlines(lines),'DrawLine',[10,10,10],rectx(1,1),recty(1,1),rectx(1,2),recty(1,2),[8],[8])
end


%black and red dots
        woff(3,1) = Screen(window,'OpenOffscreenWindow',[255,255,255],[1,1,dotsize*2+1,dotsize*2+1]);        
        woff(3,2) = Screen(window,'OpenOffscreenWindow',[255,255,255],[1,1,dotsize*2+1,dotsize*2+1]);        
        SCREEN(woff(3,1),'FillOval',[255,0,0],[1,1,dotsize*2+1,dotsize*2+1]);
        SCREEN(woff(3,2),'FillOval',[0,0,0],[1,1,dotsize*2+1,dotsize*2+1]);

%blank
        wblank = Screen(window,'OpenOffscreenWindow',[150,150,150]);        
        SCREEN(wblank,'FrameRect',31);
%fixation cross
        wfix = Screen(window,'OpenOffscreenWindow',[150,150,150]);%[255,255,255],[1,1,wsize*2+1,wsize*2+1]);        
        SCREEN(wfix,'FrameRect',31);

        oldFontSize=SCREEN(wfix,'TextSize',70);
        oldFontSize=SCREEN(wfix,'TextFont','Arial');

        s = sprintf('%c','+');
        TextWidth = SCREEN (wfix, 'TextWidth', s');
        SCREEN(wfix,'DrawText',s,wsize-(TextWidth/2),wsize+wsize/2,[10,10,10]);
  
centerx = Scrnsize(3)/2;
centery = Scrnsize(4)/2;

        
