#include "switch.h"
//#include "menu.h"


void switch_now(int mode, int *integer, int second_mode)
{
     if(mode == 1)
     {
             
                   switch(sm)
{
                                  case 0 :
                                  SelectOption(1, 0, sb, sc, sd);
                                  sm = 1;
                                  break;
                                  case 1:
                                  SelectOption(1, 1, sb, sc, sd);
                                  sm = 2;
                                  break;
                                  case 2:
                                  SelectOption(1, 2, sb, sc, sd);
                                  sm = 3;
                                  break;
                                  case 3:
                                  SelectOption(1, 3, sb, sc, sd);
                                  sm = 4;
                                  break;
                                  case 4:
                                  SelectOption(1, 4, sb, sc, sd);
                                  sm = 5;
                                  break;
                                  case 5:
                                  SelectOption(1, 5, sb, sc, sd);
                                  sm = 6;
                                  break;
                                  case 6:
                                  SelectOption(1, 6, sb, sc, sd);
                                  sm = 7;
                                  break;
                                  case 7:
                                  SelectOption(1, 7, sb, sc, sd);
                                  sm = 8;
                                  break;
                                  case 8:
                                  SelectOption(1, 8, sb, sc, sd);
                                  sm = 9;
                                  break;
                                  case 9:
                                  SelectOption(1, 9, sb, sc, sd);
                                  sm = 0;
                                  break;
                                  }
                                  }
                                  
else if(mode == 2)
{
SelectOption(2, sa, integer, sc, sd);
     switch(sm)
{
                                  case 0 :
                                  SelectOption(2, sa, 0, sc, sd);
                                  sm = 1;
                                  break;
                                  case 1:
                                  SelectOption(2, sa, 1, sc, sd);
                                  sm = 2;
                                  break;
                                  case 2:
                                  SelectOption(2, sa, 2, sc, sd);
                                  sm = 3;
                                  break;
                                  case 3:
                                  SelectOption(2, sa, 3, sc, sd);
                                  sm = 4;
                                  break;
                                  case 4:
                                  SelectOption(2, sa, 4, sc, sd);
                                  sm = 5;
                                  break;
                                  case 5:
                                  SelectOption(2, sa, 5, sc, sd);
                                  sm = 6;
                                  break;
                                  case 6:
                                  SelectOption(2, sa, 6, sc, sd);
                                  sm = 7;
                                  break;
                                  case 7:
                                  SelectOption(2, sa, 7, sc, sd);
                                  sm = 8;
                                  break;
                                  case 8:
                                  SelectOption(2, sa, 8, sc, sd);
                                  sm = 9;
                                  break;
                                  case 9:
                                  SelectOption(2, sa, 9, sc, sd);
                                  sm = 0;
                                  break;
                                  }
                                  }
                                  
                                  
else if(mode == 3)
{
SelectOption(3, sa, sb, integer, sd);
     switch(sm)
{
                                  case 0 :
                                  SelectOption(3, sa, sb, 0, sd);
                                  sm = 1;
                                  break;
                                  case 1:
                                  SelectOption(3, sa, sb, 1, sd);
                                  sm = 2;
                                  break;
                                  case 2:
                                  SelectOption(3, sa, sb, 2, sd);
                                  sm = 3;
                                  break;
                                  case 3:
                                  SelectOption(3, sa, sb, 3, sd);
                                  sm = 4;
                                  break;
                                  case 4:
                                  SelectOption(3, sa, sb, 4, sd);
                                  sm = 5;
                                  break;
                                  case 5:
                                  SelectOption(3, sa, sb, 5, sd);
                                  sm = 6;
                                  break;
                                  case 6:
                                  SelectOption(3, sa, sb, 6, sd);
                                  sm = 7;
                                  break;
                                  case 7:
                                  SelectOption(3, sa, sb, 7, sd);
                                  sm = 8;
                                  break;
                                  case 8:
                                  SelectOption(3, sa, sb, 8, sd);
                                  sm = 9;
                                  break;
                                  case 9:
                                  SelectOption(3, sa, sb, 9, sd);
                                  sm = 0;
                                  break;
                                  }
                                  }                      
else if(mode == 4)
{
SelectOption(4, sa, sb, sc, integer);
     switch(sm)
{
                                  case 0 :
                                  SelectOption(4, sa, sb, sc, 0);
                                  sm = 1;
                                  break;
                                  case 1:
                                  SelectOption(4, sa, sb, sc, 1);
                                  sm = 2;
                                  break;
                                  case 2:
                                  SelectOption(4, sa, sb, sc, 2);
                                  sm = 3;
                                  break;
                                  case 3:
                                  SelectOption(4, sa, sb, sc, 3);
                                  sm = 4;
                                  break;
                                  case 4:
                                  SelectOption(4, sa, sb, sc, 4);
                                  sm = 5;
                                  break;
                                  case 5:
                                  SelectOption(4, sa, sb, sc, 5);
                                  sm = 6;
                                  break;
                                  case 6:
                                  SelectOption(4, sa, sb, sc, 6);
                                  sm = 7;
                                  break;
                                  case 7:
                                  SelectOption(4, sa, sb, sc, 7);
                                  sm = 8;
                                  break;
                                  case 8:
                                  SelectOption(4, sa, sb, sc, 8);
                                  sm = 9;
                                  break;
                                  case 9:
                                  SelectOption(4, sa, sb, sc, 9);
                                  sm = 0;
                                  break;
                                  }
                                  
                                  
}
                         
}
