void GetDescription(char d[])
{
  strcpy(d,"2x2 Picture Preview");
 
}

int GetPriority()
{
  return 256;
}


int GetValueAfter(char str[])
{
  char val[100];
  char line[200];
  int i, l, k;
   
  GetLineByStr(str,line);
  
  l = strlen(str);
  for (i = 0, k= 0; i <= l; i++) 
  {  
    if (line[l+i] != ' ') val[k++] = line[l+i];
    else if (k) break;
  }  
  return atol(val);
}

void DeleteBlock(char block[])
{
   int val, i, num;
   val = GetValueAfter(block);
   num = GetLineNum(block);
   RemoveLineByNum(num);
   for (i = 0; i < val; i++) RemoveLineByNum(num);
}

int IsResMore176()
{
    int DigClockX;  
    DigClockX = GetValueAfter("1 574 ");
    return (DigClockX > 144);
}


void PatchSKI()
{   
   if (IsResMore176())
   {
      log("This script only for 176x220 phones.");
      return;
   }
   DeleteBlock("0 14 ");
   DeleteBlock("0 15 ");
   DeleteBlock("0 16 ");
   DeleteBlock("0 20 ");
   DeleteBlock("0 21 ");

   AddLine("0 14 4");
   AddLine("1 25 55 55 85");
   AddLine("1 110 55 140 85");
   AddLine("1 25 133 55 163");
   AddLine("1 110 133 140 163");

   AddLine("0 15 4");
   AddLine("1 0 38 80 98");
   AddLine("1 85 38 165 98");
   AddLine("1 0 118 80 178");
   AddLine("1 85 118 165 178");

   AddLine("0 16 4");
   AddLine("1 2 40 16 54");
   AddLine("1 87 40 101 54");
   AddLine("1 2 120 16 134");
   AddLine("1 87 120 101 134");

   AddLine("0 20 4");
   AddLine("1 0 98 80 118");
   AddLine("1 87 98 167 118");
   AddLine("1 0 178 80 198");
   AddLine("1 87 178 167 198");

   AddLine("0 21 4");
   AddLine("1 0 98 111 98");
   AddLine("1 87 98 198 98");
   AddLine("1 0 178 111 178");
   AddLine("1 87 178 198 178");
}

